Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 Add authors and contributors to Practice Exercises #1519

Conversation

ErikSchierboom
Copy link
Member

@ErikSchierboom ErikSchierboom commented Mar 24, 2021

If you got tagged in this PR, it is because you are being credited for work you've done in the past on Exercism here, and we want to ensure you don't miss out on the recognition you deserve 🙂


With v3, we've introduced the idea of exercise authors and contributors. This information is stored in the exercises' .meta/config.json files (see the docs).

Concept Exercises, which are all new, already contain authors and contributors. Practice Exercises though are missing this information. In this PR, we attempt to populate the authors and contributors of Practice Exercises based on their commit history.

Maintainer TODO list

These are the things you, the maintainers, should do:

  • Check the authors and contributors, adding/removing users where the data is missing or incorrect
  • Double-check any renamed Practice Exercises
  • Check for Practice Exercises with missing authors, which are most likely due to the author not being on GitHub anymore
  • Add additional authors if you know that a Practice Exercise has actually been created by more than one author

For clarity, authors should be the people who originally created the exercise on this track. Contributors should be people who have substantially contributed to that exercise. PRs for typos or multiple-exercise PRs do not automatically mean someone should be considered a contributor to that exercise. Those non-exercise-specific contributions will get recognition through Exercism's reputation system in v3.

If you find something needs updating, just push a new commit to this PR.

Automatic Merging

We will automatically merge this PR before we launch v3, but will give the maximum time we can to maintainers to review it first.


The rest of this issue explains how this PR has been generated. You do not need to read it.

Algorithm

We start out by looking at the current Practice Exercises. For each Practice Exercise, we'll look at the commit history of its files to see which commits touched that Practice Exercise. How renames are handled is discussed in the "Renames" section later in this document.

Any commit that we can associate with a Practice Exercise is used to determine authorship/contributorship. Here is how we assign authorship/contributorship:

Authors

  1. Find the Git commit author of the oldest commit linked to that Practice Exercise.
  2. Find the GitHub username for the Git commit author of that commit
  3. Add the GitHub username of the Git commit author to the authors key in the .meta/config.json file

Contributors

  1. Find the Git commit authors and any co-authors of all but the oldest commit linked to that Practice Exercise. If there is only one commit, there won't be any contributors.
  2. Exclude the Git commit author and any co-authors of the oldest commit from the list of Git commit authors (an author is not also a contributor)
  3. Find the GitHub usernames for the Git commit authors and any co-authors of those commits
  4. Add the GitHub usernames of the Git commit authors and any co-authors to the contributor key in the .meta/config.json file

We're using the GitHub GraphQL API to find the username of a commit author and any co-authors. In some cases though, a username cannot be found for a commit (e.g. due to the user account no longer existing), in which case we'll skip the commit.

Renames

There are a small number of Practice Exercises that might have been renamed at some point. You can ask Git to "follow" a file over its renames using git log --follow <file>, which will also return commits made before renames. Unfortunately, Git does not store renames, it just stores the contents of the renamed files and tries to guess if a file was renamed by looking at its contents. This can (and will) lead to false positives, where Git will think a file has been renamed whereas it hasn't. As we don't want to have incorrect authors/contributors for exercises, we're ignoring renames. The only exception to this are known exercise renames:

  • bracket-push was renamed to matching-brackets
  • retree was renamed to satellite
  • resistor-colors was renamed to resistor-color-duo
  • kindergarden-garden was renamed to kindergarten-garden

If you know of a rename of a Practice Exercise, please check to see if its authors and contributors are correctly set.

Exclusions

There are some commits that we skip over, which thus don't influence the authors/contributors list:

  • Commits authored by dependabot[bot], dependabot-preview[bot] or github-actions[bot]
  • Bulk update PRs made by ErikSchierboom or kytrinx to update the track

Tracking

exercism/v3-launch#24


cc @abecerramatias, @aes421, @AndrewYHuang, @artiom, @austinlyons, @avjgit, @B1tF8er, @balazsbotond, @bcwood, @bjorkqvist, @bmeverett, @bressain, @ChrisPritchard, @cmccandless, @davidelettieri, @delve, @deniscapeto, @dmahnkopf, @duffn, @ErikSchierboom, @felix91gr, @FizzBuzz791, @FridaTveit, @GKotfis, @haus, @inkahootz, @irrationalRock, @j2jensen, @jdehaan, @jenlouie, @jmbradnan, @joostas, @jpreese, @jwood803, @kytrinyx, @MahrWe, @martinfreedman, @mattcbaker, @mikecoop, @morrme, @mrtank, @NextNebula, @nicolastarzia, @PatrickMcSweeny, @petertseng, @pjangam, @pminten, @robkeim, @RoelofWobben, @rpottsoh, @rprouse, @ruanha, @ryanrobidou, @ShamilS, @sjakobi, @sjwarner, @sjwarner-bp, @SleeplessByte, @Thorocaine, @tomschluter, @tushartyagi, @valentin-p, @vamcs, @vgrigoriu, @wolf99, @yvincent, @Zureka as you are referenced in this PR

For each Practice Exercise, we've looked at the commit history of its files to see which commits touched that Practice Exercise.

Each commit that we could associate with a Practice Exercise was used to determine authorship/contributorship.

### Authors

1. Find the Git commit author of the oldest commit linked to that Practice Exercise
2. Find the GitHub username for the Git commit author of that commit
3. Add the GitHub username of the Git commit author to the `authors` key in the `.meta/config.json` file

### Contributors

1. Find the Git commit authors and any co-authors of all but the oldest commit linked to that Practice Exercise. If there is only one commit, there won't be any contributors.
1. Exclude the Git commit author and any co-authors of the oldest commit from the list of Git commit authors (an author is _not_ also a contributor)
2. Find the GitHub usernames for the Git commit authors and any co-authors of those commits
3. Add the GitHub usernames of the Git commit authors and any co-authors to the `contributor` key in the `.meta/config.json` file

We used the GitHub GraphQL API to find the username of a commit author or any co-authors. In some cases though, a username cannot be found for a commit (e.g. due to the user account no longer existing), in which case the commit was skipped.

## Renames

There are a small number of Practice Exercises that might have been renamed at some point. You can ask Git to "follow" a file over its renames using `git log --follow <file>`, which will also return commits made before renames. Unfortunately, Git does not store renames, it just stores the contents of the renamed files and tries to guess if a file was renamed by looking at its contents. This _can_ (and will) lead to false positives, where Git will think a file has been renamed whereas it hasn't. As we don't want to have incorrect authors/contributors for exercises, we're ignoring renames. The only exception to this are known exercise renames:

- `bracket-push` was renamed to `matching-brackets`
- `retree` was renamed to `satellite`
- `resistor-colors` was renamed to `resistor-color-duo`
- `kindergarden-garden` was renamed to `kindergarten-garden`

## Exclusions

There are some commits that we skipped over, and which thus didn't influence the authors/contributors list:

- Commits authored by `dependabot[bot]`, `dependabot-preview[bot]` or `github-actions[bot]`
- Bulk update PRs made by `ErikSchierboom` or `kytrinx` to update the track
@iHiD
Copy link
Member

iHiD commented Mar 24, 2021

@ErikSchierboom
Copy link
Member Author

This is mostly looking good as far as I can tell. The main thing that we should probably focus on is removing contributors that were added for cross-exercise commits. Some examples:

Of course, the above users should still be attributed for actual contributions that were made. One helpful tool that we can use is to check the commits for a specific authors within GitHub (e.g. https://github.com/exercism/csharp/commits?author=j2jensen)

@@ -1,6 +1,18 @@
{
"blurb": "Bob is a lackadaisical teenager. In conversation, his responses are very limited.",
"authors": [],
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -1,6 +1,16 @@
{
"blurb": "Given a word and a list of possible anagrams, select the correct sublist.",
"authors": [],
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -1,6 +1,16 @@
{
"blurb": "Calculate the Hamming difference between two DNA strands.",
"authors": [],
Copy link
Contributor

Choose a reason for hiding this comment

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

author not on github

23b6b43

@@ -1,6 +1,17 @@
{
"blurb": "Given a phrase, count the occurrences of each word in that phrase.",
"authors": [],
Copy link
Contributor

Choose a reason for hiding this comment

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

@ErikSchierboom
Copy link
Member Author

Thanks @valentin-p! I'll work on creating a script to remove the cross-exercise commits.

@ErikSchierboom
Copy link
Member Author

I've looked at removing the cross-exercise commits, but that will be very hard to do as there are so many cross-exercise commits.

Commit Message Users # Affected Exercises
6850035 Merge pull request #1314 from robkeim/update-canonical-data ErikSchierboom 2
05ccfd3 Update canonical data to latest version robkeim 2
b9d75e9 Improved long data type support (#1311) ErikSchierboom 2
5971e83 Merge pull request #1302 from robkeim/update-canonical-data ErikSchierboom 2
5100deb Update canonical data to latest version robkeim 2
9c2b193 Merge pull request #768 from robkeim/triangle-exception ErikSchierboom 2
b2c3816 Merge pull request #730 from exercism/update-docs-on-windows ErikSchierboom 2
c4b7565 exercises: update README to latest version ErikSchierboom 2
e8de0a2 README updates from problem-specifications repo (#702) Zureka 2
add34c9 docs: Update README ErikSchierboom 2
e9c5858 exercises: Update to latest canonical data (#609) ErikSchierboom 2
ac90944 Update canonical data for All Your Base and Reverse String (#495) robkeim 2
47db68b Update exercises (#492) ErikSchierboom 2
62522c3 Simplify canonical data types (#430) ErikSchierboom 2
dfa33d5 Use exceptions everywhere instead of null (#371) robkeim 2
ca148a7 Add book-store exercise (#308) ErikSchierboom 2
fd763f5 Add food-chain generator (#267) ErikSchierboom 2
aa7d89b Default file work ErikSchierboom 2
f99afa6 Add zipper exercise (#179) ErikSchierboom 2
548d87e Add matrix exercise ErikSchierboom 2
12be43b Merge pull request #51 from ErikSchierboom/fake-build jwood803 2
ef27504 Add Fake build script ErikSchierboom 2
e0210da Merge pull request #20 from mikecoop/master kytrinyx 2
dfccca3 Added two exercises mikecoop 2
1fee6da binary and trinary exercises didn't have tests verifying if values were valid or not bressain 2
807258d Added sieve exercise Missed test ignores on rna-transcription bressain 2
1e23467 Merge pull request #5 from dinkelburt/nucleotide-count kytrinyx 2
af9981b 734 use decimal for money (#737) AndrewYHuang 3
54d2c17 Add test generator for rna transcription exercise (#353) robkeim 3
10dc4da Move enumerations to outer scope ErikSchierboom 3
ad885d3 Fix tests suffix ErikSchierboom 4
e3656d0 update READMEs using configlet (#714) sjwarner 4
4f6c0f7 exercises: Update song exercises ErikSchierboom 4
3784df0 Merge pull request #503 from exercism/kytrinyx/missing-deprecated ErikSchierboom 4
99d6ad0 Merge pull request #53 from ErikSchierboom/new-exercises jwood803 4
09f524f Add four new exercises ErikSchierboom 4
23e6a86 Merge pull request #501 from robkeim/armstrong-number ErikSchierboom 5
1e7f951 Explicitly add used namespaces ErikSchierboom 5
b52a761 Merge pull request #215 from tushartyagi/dotnet-core ErikSchierboom 5
e839e27 Added static keyword to static classes and the examples tushartyagi 5
5849e3b Added static keyword to static classes tushartyagi 5
c840475 Add all-your-base exercise ErikSchierboom 5
596c45d Merge pull request #56 from ErikSchierboom/new-exercises bressain 5
c7d2cfa Add 5 new exercises ErikSchierboom 5
a8ddabe Merge pull request #6 from dinkelburt/more-exercises kytrinyx 5
5854b9b Simplify generators (#302) ErikSchierboom 6
0bd0462 Update test suites (#763) ErikSchierboom 7
831902b Update README's (#762) ErikSchierboom 7
63ed0c1 Updates the README files for various exercises (#696) Zureka 7
3229cc1 docs: Convert function word in README's to method ErikSchierboom 10
9d45fe9 Make exercise APIs more C#-like bressain 10
6228bfd Making things more idiomatic for C#. Underscores in tests are becoming more popular in .Net so made the call to prefer that to pascal casing. bressain 10
4b8b881 Ignoring all but first test so that people can red/green/refactor bressain 10
88361d5 Merge pull request #1292 from robkeim/update-canonical-data ErikSchierboom 11
9049510 Update canonical data to latest version robkeim 11
0b94594 Merge pull request #751 from vgrigoriu/update-tests ErikSchierboom 11
1377511 Update tests from latest canonical data vgrigoriu 11
94680b2 Build improvements (#78) ErikSchierboom 11
d3019f1 generators: Simplify parsing ErikSchierboom 12
b27879a Merge pull request #487 from robkeim/update-exercises ErikSchierboom 13
0ca68d6 exercises: update to latest version ErikSchierboom 15
8e04ee6 Add version of canonical data to generated test file (#301) robkeim 15
9ea9e6e Rename Hints.md files to HINTS.md (#241) ErikSchierboom 18
34ca4e6 Let the OCD flow and normalized test attributes bressain 18
93a53b4 Format documentation files ErikSchierboom 33
24dcec7 Merge pull request #515 from exercism/kytrinyx/hints ErikSchierboom 34
b5b223e Merge pull request #49 from ErikSchierboom/exercises-folder jwood803 44
72700a5 Move exercises into folder. Closes #46 ErikSchierboom 44
d4aefc5 Merge pull request #50 from ErikSchierboom/nunit3 jwood803 44
1b387f8 Upgrade to NUnit 3 ErikSchierboom 44
e3142cb Generators refactoring (#601) ErikSchierboom 55
3fa323d generators: Use updated canonical data parsing ErikSchierboom 62
4cedc41 Update dependencies (#1241) ErikSchierboom 102
8a60e34 Use RTM version of Microsoft.NET.Test.Sdk package ErikSchierboom 104
49b9b4f Update package references ErikSchierboom 104
4300f5c Ignore Example.cs in project ErikSchierboom 104
f0cc2f5 Enable CI support for .NET Core ErikSchierboom 104
10c9164 Add .NET CLI support ErikSchierboom 104
76fb465 Replace NUnit with xUnit ErikSchierboom 104
7d46b58 Merge pull request #319 from exercism/generate-readme ErikSchierboom 105
ea42fca Update xUnit packages to version 2.3.0 (#467) ErikSchierboom 109
c5724af Update package versions (#494) ErikSchierboom 111
188cbe4 docs: Remove submit path section from README's (#520) ErikSchierboom 116
152c8ca Merge pull request #519 from exercism/kytrinyx/inline-insert ErikSchierboom 116
df7f6fb projects: Update package references ErikSchierboom 117
ed1baa1 Upgrade to .NET Core 2.1 (#617) ErikSchierboom 118
ae18b13 Update documentation (#615) ErikSchierboom 118
cf0a2ea Rename test classes to ClassNameTests (plural) instead of ClassNameTest (singular) robkeim 120
dff703b Merge pull request #1242 from exercism/dependabot/nuget/exercises/Microsoft.NET.Test.Sdk-16.0.0 ErikSchierboom 120
cb19cd5 Remind learners to remove Skip properties from tests (in Leap) (#726) j2jensen 121
85d9453 Improve Skip string (#1383) wolf99 122
5b5a4e7 Remove unneeded excluding of example file ErikSchierboom 123
43a51b0 Update to .NET Core 3.0 (#1337) ErikSchierboom 124
492bf7f styling: only apply .editorconfig settings to implementation file ErikSchierboom 124
ddfe600 styling: don't show prefer var rule as suggestion (#1260) ErikSchierboom 124
08a325c general: add .editorconfig file to exercises ErikSchierboom 124
6308514 docs: remove submitting incomplete solutions from README (#1245) ErikSchierboom 124
fbb11de projects: bump target framework to net5.0 (#1490) ErikSchierboom 126

Maybe we need additional rules?

@ErikSchierboom ErikSchierboom merged commit ea4596d into exercism:main Apr 2, 2021
@ErikSchierboom
Copy link
Member Author

I've decided that it won't reasonably be possible to determine which commit should be considered for counting towards being an author/contributor. I feel that it is better to err on the side of being generous here. We can be more strict from now on.

@ErikSchierboom ErikSchierboom added the x:size/tiny Tiny amount of work label Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:size/tiny Tiny amount of work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants