Repository navigation
Adopting codejson-core 0.3.0 - #176
Merged
Merged
Conversation
sachin-panayil
requested review from
DinneK,
decause-gov and
natalialuzuriaga
October 13, 2026 16:29
sachin-panayil
marked this pull request as draft
October 13, 2026 18:27
sachin-panayil
marked this pull request as ready for review
October 13, 2026 18:36
DinneK
approved these changes
Oct 14, 2026
DinneK
left a comment
There was a problem hiding this comment.
OK! I reviewed codejson.ts, create-deps.ts, main.ts, helper.ts, and enrich.ts. I ran the full test suite locally everything passed and I manually verified the fail-fast behavior on a bad AGENCY value.
This is really great work! LGTM!
This was referenced Oct 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopting codejson-core 0.3.0
Problem
The action had two limitations. The first was how it merged an existing code.json with new values. That work was split between this action and codejson-core, and core only did a shallow merge. Nested objects got replaced as a whole and detected values always won, so manual edits like a custom name or description could be overwritten from GitHub on the next run.
The second was that the action only knew how to produce the CMS version of code.json. Every repository got CMS only fields, the CMS organization name, a CC0 license by default, and a pull request sent on behalf of the CMS Source Code Stewardship Taskforce. Other agencies couldn't use the action without ending up with a CMS file. With SHARE IT Act work ramping up, this is a problem.
Solution
This bumps codejson-core to 0.3.0, which now handles the full merge. Manual values are kept, values that change over time like labor hours and the repository URL are refreshed on every run, and tags and reused code are combined from both sides. Because core owns this now, the action just reports what it detected and the old merging code has been removed.
It also adds a new AGENCY input that accepts
cmsorneutral, with cms as the default for this specific repo. The SHARE IT Org version might be better suited to haveneutralas its default. The selected agency is read once when the action starts and that profile is used everywhere after like building the file, validating it, and checking it on pull requests. This way a file is always checked against the same schema it was generated with. If someone enters an agency that doesn't exist, the action fails right away with a clear message listing the valid options.A few CMS specific pieces now follow the selected agency. AI enrichment only asks the model for fields the schema actually has, so on neutral it only suggests tags and skips the long description entirely. Pull requests for neutral repositories leave out the Taskforce and Slack wording. The README explains the new input and what changes between the two agencies.
AI Usage
Result
Current CMS users don't need to change anything. Without AGENCY set they get the same CMS file as before, except their manual edits now stick across runs.
Other agencies can set AGENCY to neutral and get a code.json with only the shared fields, a blank organization for them to fill in, no default license, tag suggestions from the AI, and pull request text that doesn't mention CMS. Supporting another agency later only needs a new codejson-core release and a version bump here.
One thing to note is that switching an existing repository from cms to neutral will remove its CMS-only fields on the next run. The README calls this out.
Test Plan
All unit tests, lint and the package build pass. New tests cover picking each agency and rejecting an unknown one, a neutral run producing no CMS-only fields, pull request validation using the selected agency, neutral AI enrichment asking only for tags, and neutral pull request text leaving out the CMS wording.
To check it end to end, run the action on DSACMS/testing-repository without AGENCY set and confirm an existing code.json only changes its metadataLastUpdated date. Then run it on a test repository with AGENCY set to neutral and confirm the pull request has no CMS fields or CMS wording. Finally, run it with an invalid agency and confirm the job fails with the "Unknown AGENCY" message.