Add support for validation jobs to sync.ts, and refactor#3541
Open
Add support for validation jobs to sync.ts, and refactor#3541
sync.ts, and refactor#3541Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors pr-checks/sync.ts to make workflow generation more modular, and introduces first-class support for generating additional “validation jobs” that run after the primary PR-check job.
Changes:
- Refactor workflow generation into helpers (matrix generation, shared setup-step generation, job generation).
- Add
validationJobssupport in check specifications to generate dependent post-check jobs. - Reorder generated workflow setup steps/inputs (notably alphabetizing setup steps), causing widespread regenerated workflow diffs.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pr-checks/sync.ts | Adds validation-job generation and refactors setup-step/matrix/job generation into reusable helpers. |
| .github/workflows/__with-checkout-path.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__upload-sarif.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__upload-ref-sha-input.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__unset-environment.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__swift-custom-build.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__split-workflow.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__remote-config.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__packaging-inputs-js.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__packaging-config-js.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__packaging-config-inputs-js.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__packaging-codescanning-config-inputs-js.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__multi-language-autodetect.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__local-bundle.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__go.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__go-custom-queries.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__export-file-baseline-information.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__config-input.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__build-mode-manual.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__analyze-ref-input.yml | Regenerated output reflecting reordered setup steps/inputs. |
| .github/workflows/__all-platform-bundle.yml | Regenerated output reflecting reordered setup steps/inputs. |
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.
The primary goal of this PR is to add support for additional, validation jobs to
sync.ts. My motivation for this is #3519 (review). To add a PR check which does that, the most sensible way of testing it would be to run a second job after the main one which verifies that the artifact was successfully uploaded.This PR doesn't yet add or modify a PR check which makes use of this new functionality. I will add that as part of #3519 once this PR is merged.
I have refactored a few things in the first commits to break up the horrible long
mainfunction that we had initially ported from the earliersync.pyscript as-is in #3526.The refactoring has introduced some minor changes to the generated workflow files because the order of the various
setup-*steps is now alphabetical, rather than effectively random. This should not have any impact on the behaviour of the workflows.Notes for reviewers
Best reviewed commit-by-commit. Since these changes do not affect the CodeQL Action itself, a relatively lightweight review which focuses on the following is acceptable:
I have locally verified that the changes here broadly work for what I have in mind for the new workflow for #3526. Any small adjustments that may be required to support the full workflow could be added in that PR.
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?
pr-checks).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?
N/A
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist