Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a TypeScript implementation of the sync_back utility used by PR checks tooling, and updates the rebuild workflow to use the new TS script when syncing Dependabot action-version updates back into the pr-checks sources.
Changes:
- Add
pr-checks/sync_back.tsto scan generated workflows and sync action versions back intopr-checks/sync.tsandpr-checks/checks/*.yml. - Add
pr-checks/sync_back.test.tswith Node test coverage for the new TS implementation. - Update
.github/workflows/rebuild.ymlto run the newsync_back.tsviatsxduring Dependabot rebuilds.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pr-checks/sync_back.ts | New TS sync-back implementation that updates template/action version references based on generated workflows. |
| pr-checks/sync_back.test.ts | New Node tests for the TS sync-back implementation. |
| .github/workflows/rebuild.yml | Switch rebuild workflow sync-back step from Python to npx tsx sync_back.ts. |
esbena
left a comment
There was a problem hiding this comment.
Despite this being a migration of existing code, I do want a somewhat significant change. Could we take the various regular expression based parsing we have and move that into its own module? A file-internal dictionary is fine.
My main motivations for requesting this are:
- I worry about redundant patterns currently.
- I worry about too-specific patterns, where it is hard to see that they're wrong because they are placed in a very specific coding context.
- They are general parsings that deserve their own very detailed JSDoc descriptions.
|
|
||
| // Find all action uses in the file, including potential comments | ||
| // This pattern captures: action_name@version_with_possible_comment | ||
| const pattern = /uses:\s+([^/\s]+\/[^@\s]+)@([^@\n]+)/g; |
There was a problem hiding this comment.
Please see the general comments about regex parsing, but as an example of that, this is one of three regex that uses the uses: prefix...
Follow-up (and based on) #3526.
This PR converts
sync_back.pyandtest_sync_back.pyto TypeScript equivalents.Risk assessment
For internal use only. Please select the risk level of this change:
Which use cases does this change impact?
Environments:
How did/will you validate this change?
If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist