Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

Implement contributor tracking #94

Merged
merged 4 commits into from
Jul 20, 2020
Merged

Implement contributor tracking #94

merged 4 commits into from
Jul 20, 2020

Conversation

skilly-lily
Copy link
Contributor

Basic outline:

  • If upload analysis has been successful (meaning we successfully called the API, not that we didn't receive any errors), try to upload contributor tracking data.
  • Data takes the shape of {"<authorEmail>": "<latest contribution date: YYYY-MM-DD>", ...}
  • Once contributor tracking phase is started, we do not fail the analysis or process for any reason within our control, including errors.
  • Errors are reported as debug messages, but otherwise ignored. This includes all three instances of IO:
    • Retrieving the current date
    • Invoking and reading the git log ... output
    • Uploading the contribution data to the core endpoint
  • Malformed output lines from git log ... are ignored, since git should be taking care of that. We can add protection here later if needed.
  • No response is needed from the API, but we may want to check for an error message. We can add this once the core endpoint has been implemented.

@skilly-lily skilly-lily requested a review from cnr July 7, 2020 18:14
src/App/Fossa/Analyze.hs Outdated Show resolved Hide resolved
. M.map (T.pack . iso8601Show)
. M.fromListWith max
. mapMaybe readLine
$ T.lines textContrib
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line got too long for me. ormolu suggested this style, so I went with it.

@skilly-lily skilly-lily requested a review from cnr July 7, 2020 19:58
Copy link
Contributor

@cnr cnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

uploadContributors baseUrl apiKey locator contributors


fetchGitContributors ::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] can we move this to another module? (along with gitLogCmd, of course)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a name/existing module in mind?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be okay with a new module named VCS.Git or similar

@skilly-lily skilly-lily force-pushed the git-contrib-count-v2 branch from 8073b27 to 620c04e Compare July 20, 2020 19:23
@skilly-lily skilly-lily requested a review from cnr July 20, 2020 19:28
@skilly-lily
Copy link
Contributor Author

@cnr would you mind rechecking? I fixed some merge conflicts and I'd like another set of eyes making sure I didn't miss something obvious.

Copy link
Contributor

@cnr cnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still LGTM 👍

@skilly-lily skilly-lily merged commit d92909d into master Jul 20, 2020
@skilly-lily skilly-lily deleted the git-contrib-count-v2 branch July 20, 2020 22:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants