-
Notifications
You must be signed in to change notification settings - Fork 0
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 a class for manipulating repo data #20
base: main
Are you sure you want to change the base?
Conversation
4d1d55e
to
5c95154
Compare
🐛 BUG Parent dependencies: these are all null in the latest dataset. Suspect this is because we send the "this is an indirect dependency" examples straight to finding a lockfile version, which will generally be successful and find the govuk-frontend dependency at top level, rather than digging in the sub-levels. Probably makes sense to just fold the parent dependency in with this data, to be honest, rather than have a special path just for "indirect" dependencies. SOLVED: 47fec86 |
0871587
to
7aeda71
Compare
7aeda71
to
bf1524b
Compare
cde51fb
to
7e03cd7
Compare
7e03cd7
to
15c58a8
Compare
e6009c5
to
11c43e4
Compare
standardjs is having some governance problems. Neostandard is a fork which is compatible with eslint 9. At least some contributors at standardjs have indicated they want to fold the changes back in when the governance issue is sorted.
- strict equality - use 'with' instead of 'assert' for import assertions - No more dangling commas
11c43e4
to
cea129c
Compare
8b04217
to
81d9fe7
Compare
Adds helpers/octokit.mjs for queries to the GitHub API. getRepo() gets some basic repo data getTree() gets the repo file tree getFileContent() gets the text content of a file getRemainingRateLimit() gets the remaining REST API rate limit
Rather hastily done, and we're not testing the Octokit class just yet, but probably better than nothing
Creates a dated unprocessedItems.json file with any repos that weren't processed.
Adds coverage to tests
Adds the originating branch name to the PR branch name so we can differentiate by originating PRs.
Stores and emits the result. Could be used for validation and normalisation of result data.
81d9fe7
to
93bb0e0
Compare
Resolves #13, resolves #12, resolves #10, resolves #9
Example action: https://github.com/alphagov/design-system-github-stats/actions/runs/12678615737
And PR: #23
Changes
Adds vitest for testing
Abstracts Octokit
Adds a RepoData class
Adds a Result class
Updates the script behaviour and return data
directDependencies
indirectDependencies
Dead ends
I did a lot of thinking about how to reduce the script time and API calls. The free GraphQL request for created at, pushed at and latest commit I've implemented is the biggest enhancement, and batch writing to files reduces I/O a lot. But there were some dead ends:
govuk-frontend
dependencies in relevant files, but the rate limit is severely restrictive (10 calls per minute for code search). Could potentially be more useable if we're doing caching, but probably not a goer.