-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Improve contributor docs refs count script #17
Conversation
Note that there are no tests for this repo — I'll work on adding this later — so you will need to test this manually in the meantime. You can do this by following this section in the README on creating an access token and then running:
|
The script to count the number of references to the contributor-docs throughout comments in MetaMask repositories has never provided accurate counts. Upon reviewing this script, I noticed that while comments posted directly to pull requests were included in the count, comments posted as a part of reviews, which are separate types in the GitHub GraphQL API, were excluded. This resulted in a smaller count than expected. In addition, the cutoff for data that the script used — 5000 maximum comments per repo — hasn't been particularly useful. We need to define _some_ kind of cutoff because it would be impractical to pull all comments from all time, but since we use this script to gauge progress toward OKRs, it helps us better to define a fixed target, in this case 4/1/2023, the start of the first quarter where the Shared Libraries team began working on the contributor docs. In addition, the output of this script now breaks down the counts per quarter instead of giving a lump sum. Here is an example: ``` About to retrieve data. Please be patient, this could take a while: ✔ Retrieving data for core since 2023-04-01T00:00:00.000Z ✔ Retrieving data for design-tokens since 2023-04-01T00:00:00.000Z ✔ Retrieving data for metamask-extension since 2023-04-01T00:00:00.000Z ✔ Retrieving data for metamask-mobile since 2023-04-01T00:00:00.000Z ✔ Retrieving data for snaps since 2023-04-01T00:00:00.000Z ---------------------- Number of references to contributor-docs by repository: - core - Q2-2023: 0 - Q3-2023: 0 - Q4-2023: 2 - Q1-2024: 1 - design-tokens - Q2-2023: 0 - Q3-2023: 0 - Q4-2023: 0 - Q1-2024: 0 - metamask-extension - Q2-2023: 0 - Q3-2023: 0 - Q4-2023: 0 - Q1-2024: 2 - metamask-mobile - Q2-2023: 0 - Q3-2023: 0 - Q4-2023: 0 - Q1-2024: 4 - snaps - Q2-2023: 0 - Q3-2023: 0 - Q4-2023: 0 - Q1-2024: 0 Total number of references: 9 ```
7ad4d64
to
eaa5575
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I manually tested it with these results:
----------------------
Number of references to contributor-docs by repository:
- core
- Q2-2023: 0
- Q3-2023: 0
- Q4-2023: 2
- Q1-2024: 2
- design-tokens
- Q2-2023: 0
- Q3-2023: 0
- Q4-2023: 0
- Q1-2024: 0
- metamask-extension
- Q2-2023: 0
- Q3-2023: 0
- Q4-2023: 0
- Q1-2024: 2
- metamask-mobile
- Q2-2023: 0
- Q3-2023: 0
- Q4-2023: 0
- Q1-2024: 4
- snaps
- Q2-2023: 0
- Q3-2023: 0
- Q4-2023: 0
- Q1-2024: 0
Total number of references: 10
I just left a comment regarding some logs that don't seem informative
The script to count the number of references to the contributor-docs throughout comments in MetaMask repositories has never provided accurate counts. Upon reviewing this script, I noticed that while comments posted directly to pull requests were included in the count, comments posted as a part of reviews, which are separate types in the GitHub GraphQL API, were excluded. This resulted in a smaller count than expected.
In addition, the script was looking for instances of the
contributor-docs
repo in comments. We don't need to do this — we can simply look for the words "contributor docs" or "contributor-docs". This should give us a higher count in the future.Finally, the cutoff for data that the script used — 5000 maximum comments per repo — hasn't been particularly useful. We need to define some kind of cutoff because it would be impractical to pull all comments from all time, but since we use this script to gauge progress toward OKRs, it helps us better to define a fixed target, in this case 4/1/2023, the start of the first quarter where the Shared Libraries team began working on the contributor docs. In addition, the output of this script now breaks down the counts per quarter instead of giving a lump sum. Here is an example:
Fixes #16.