Harden CI dependency validation and merge gate - #1866
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c3145b3-010c-4400-a149-96f04988b9d2
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent dependency regressions from merging ahead of CI completion by hardening CI validation and introducing a stable merge gate, while also correcting the Angular sample’s TypeScript version to a supported range.
Changes:
- Downgrades the Angular sample TypeScript dependency to
~6.0.3and updates the lockfile accordingly. - Adds a repository-wide JavaScript validation script to restore Aspire AppHosts and run
npm ci/npm run buildacross committed lockfiles. - Updates the CI workflow to run on PRs, add explicit concurrency/permissions/timeouts, publish diagnostics consistently, and introduce a
CI Gatejob; temporarily disables policy-driven auto-merge and prevents Dependabot TypeScript major updates for the Angular sample.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| samples/aspire-with-javascript/AspireJavaScript.Angular/package.json | Pins TypeScript back to ~6.0.3 for Angular compatibility. |
| samples/aspire-with-javascript/AspireJavaScript.Angular/package-lock.json | Aligns the lockfile with the TypeScript downgrade. |
| build/validate-javascript.sh | New script to validate all committed JS lockfiles and build scripts in samples. |
| .github/workflows/ci.yml | Hardens CI triggers/behavior and adds an explicit CI Gate job. |
| .github/policies/auto-merge.yml | Temporarily disables the auto-merge policy. |
| .github/dependabot.yml | Prevents Dependabot from opening TypeScript major-update PRs for the Angular sample. |
Files not reviewed (1)
- samples/aspire-with-javascript/AspireJavaScript.Angular/package-lock.json: Generated file
Suppressed comments (2)
.github/workflows/ci.yml:63
apt-get installis run without-y, which will typically prompt for confirmation and fail in a non-interactive GitHub Actions runner. Add-y(or setDEBIAN_FRONTEND=noninteractive) so the step is deterministic.
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install azure-functions-core-tools-4
.github/workflows/ci.yml:194
- The
ci-gatejob has the same indentation issue asbuild: thesteps:list items are aligned withsteps:instead of being indented beneath it, which will make the workflow YAML invalid.
timeout-minutes: 5
steps:
- name: Verify required jobs succeeded
shell: bash
env:
BUILD_RESULT: ${{ needs.build.result }}
run: |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c3145b3-010c-4400-a149-96f04988b9d2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c3145b3-010c-4400-a149-96f04988b9d2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9c3145b3-010c-4400-a149-96f04988b9d2
412061f to
bfda518
Compare
Adam Ratzman (adamint)
left a comment
There was a problem hiding this comment.
Reviewed bfda518. I don’t see a new must-fix issue. I verified the two-leg matrix rolls up to the exact CI Gate context; run 30952149550 proves the gate fails closed, and run 31427008700 passes all three jobs while validating 27 lockfiles and 11 AppHosts. One proof gap: the branch-protection API returns 404 for my token, so I couldn’t verify the policy’s live post-merge materialization.
Adam Ratzman (adamint)
left a comment
There was a problem hiding this comment.
The existing thread is resolved and outdated, the pinned head is unchanged, and all required checks are green. Approved.
Why
mainis not flaky: deterministic dependency regressions were merging before CI could finish. In the sampled history, all 49 auto-merged dependency PRs merged before validation completed, and 34 later failed. The active repository ruleset requires no status checks, so native auto-merge had nothing to wait for.CI also restored only TypeScript AppHost roots even though the repository contains 27 committed npm lockfiles, leaving nested frontends and APIs unvalidated until integration tests or not validating them directly at all.
What changed
mainbranch protection requiringCI Gateand strict latest-mainvalidation~6.0.3and prevents another unsupported TypeScript major updateCI GateValidation
CI Gate, GitOps branch-policy/schema validation, and CLA checks passedCI Gateto fail; retrying the same SHA succeeded only after Windows completedMerge behavior
The GitOps policy continues to call GitHub's native
enableAutoMerge. The new repository-owned branch-protection policy requires the GitHub ActionsCI Gatecontext andrequiresStrictStatusChecks: true, so failed, cancelled, skipped, abandoned, or stale validation cannot merge. Removing theauto-mergelabel still cancels auto-merge.