Repository navigation
ci: retry the Gallery dependency resolution in a step of its own - #64
Merged
Merged
Conversation
A transient refusal of the PowerShell Gallery failed the Package Module job of run 38637411323 before any repository code ran. The build job now resolves its dependencies in a step of its own, ./build.ps1 -ResolveDependency -Tasks noop, up to three times, 15 and then 45 seconds apart, each attempt in a new pwsh with $ErrorActionPreference = 'Stop', warns about each failed attempt with its number, and fails the job when the third attempt fails too. Build & Package Module then runs pack once, without resolving; the tests and the release take their modules from the build artifact and run once. tests/Workflows.Tests.ps1 binds every build.ps1 call of the workflows with PowerShell's own parameter binder, so -bootstrap and abbreviations count, and runs the resolution step's script as the runner does, against a fake build.ps1. Co-authored-by: AI Assistant <ai@example.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix the eight Nits of the review of b017fee, R15-01 to R15-08. - Each retry removes output/RequiredModules first, so it starts without what a failed attempt saved; the first attempt keeps the folder. - The Resolve Dependencies step times out after 15 minutes. Three cold resolutions and the minute of pauses fit, and a Gallery that hangs, which no retry catches, fails the job instead of holding it for up to six hours. - New tests: neither the step nor its job sets continue-on-error; the timeout lies between 5 and 30 minutes; each retried attempt is a ::warning:: annotation with its number; each retry finds output/RequiredModules empty, and the modules of the attempt that succeeded stay for the build. - The tests accept harmless rewrites: a comment beside a build.ps1 call, a log line that names one, any argument order, and the -bootstrap alias. The fake build.ps1 takes the real parameter block and records what it binds, and only a string that pwsh runs with -Command, or a script it runs with -File, counts as a child call. - The CHANGELOG entry says that the retry covers a refusal that is over within about a minute, that the third failure fails the job with an error, and that 15 minutes bound the step. "Before any build task ran" replaces a phrase that named the wrong code, in ci.yml, the test, and the entry. Co-authored-by: AI Assistant <ai@example.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix the two Nits of the check of a97b766, R15-09 and R15-10. - The fake build.ps1 leaves a module that holds a hidden dot-file, as a signed module holds .signature.p7s, so a cleanup without -Force fails the retry cases on every system, as it would end the step on Linux. - A mention of build.ps1 outside every call the tests read, and outside a Write-* log line, comes back unbound. A call whose script path is computed, such as & "$env:GITHUB_WORKSPACE/build.ps1", fails "Should run every other task of build.ps1 once" again, and so does one inside an Invoke-Expression string. A comment, a log line, reordered arguments, and the -bootstrap alias still pass. Co-authored-by: AI Assistant <ai@example.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Brief 15 is done on ai/ci-gallery-bootstrap-retry, stacked on brief 14, not pushed: the Package Module job resolves its dependencies in a step of its own, retried up to three times in a new pwsh each, from an empty output/RequiredModules, within 15 minutes. Gate on a97b766 6,073 passed, 0 failed, 91.61 %. Next is brief 18, its design ruled as option 1 plus 2', then the publish step, which reads the step's log in the pull request's CI. The oldest focus and milestone are curated. Co-authored-by: AI Assistant <ai@example.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Brief 15: the
Package Modulejob resolves its dependencies in a stepof its own,
Resolve Dependencies. The step runs./build.ps1 -ResolveDependency -Tasks noopup to three times, 15 andthen 45 seconds apart, each attempt in a new
pwshwith$ErrorActionPreference = 'Stop', and each retry without theoutput/RequiredModulesa failed attempt left. A retried attempt is a::warning::annotation; the third failure, or a step that runslonger than 15 minutes, fails the job.
Build & Package Modulethenruns
./build.ps1 -Tasks packonce, without resolving. The test legsand the release take their modules from the build artifact, so nothing
else reaches the Gallery for dependencies, and nothing else is retried.
Validation: every new test red first; every regression mutant on
copies caught, and the four harmless rewrites the review named pass.
The full gate before the test-only round and the Memory Bank commit
passed 6,073 tests, 0 failed, 145 skipped, coverage 91.61 %; after
that round the Workflows and CiAdmission suites 36 passed. Review:
Approve with eight Nits, then Approve with two; all fixed.
An early read of the whole stack (run 43695341208) was the first real
run of
Resolve Dependenciesand ofpackin a new process: oneattempt, no warning, and
packwithout resolving. It shows thesuccess path only, because a real Gallery refusal cannot be provoked.
The retry covers a refusal that is over within about a minute, and
also retries a failure that is not transient.
Rebased onto main unchanged: the tree is the brief's recorded tip
plus brief 12's test fix (b69cb23), which main already holds.
Co-authored-by: AI Assistant ai@example.com
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com