Skip to content

ci: retry the Gallery dependency resolution in a step of its own - #64

Merged
raandree merged 4 commits into
mainfrom
ai/ci-gallery-bootstrap-retry
Nov 16, 2026
Merged

raandree merged 4 commits into
mainfrom
ai/ci-gallery-bootstrap-retry

Conversation

@raandree

Copy link
Copy Markdown
Owner

Brief 15: the Package Module job resolves its dependencies in a step
of its own, Resolve Dependencies. The step runs
./build.ps1 -ResolveDependency -Tasks noop up to three times, 15 and
then 45 seconds apart, each attempt in a new pwsh with
$ErrorActionPreference = 'Stop', and each retry without the
output/RequiredModules a failed attempt left. A retried attempt is a
::warning:: annotation; the third failure, or a step that runs
longer than 15 minutes, fails the job. Build & Package Module then
runs ./build.ps1 -Tasks pack once, without resolving. The test legs
and 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 Dependencies and of pack in a new process: one
attempt, no warning, and pack without resolving. It shows the
success 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

raandree and others added 4 commits November 16, 2026 14:43
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>
@raandree
raandree merged commit 5edc716 into main Nov 16, 2026
10 checks passed
@raandree
raandree deleted the ai/ci-gallery-bootstrap-retry branch November 16, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant