Repository navigation
ci: self-heal empty oclif command tree before NUTs @W-24530265@ - #514
Open
nico-pappagianis wants to merge 1 commit into
Open
nico-pappagianis wants to merge 1 commit into
nico-pappagianis wants to merge 1 commit into
Conversation
On CI the shared nut.yml workflow runs `yarn compile` + `yarn oclif manifest` once, before a retry block that only re-runs the NUT command. `yarn compile` is wireit-cached and restores `lib/` from the GitHub Actions cache rather than running tsc; when that restore is incomplete, `lib/commands` is empty at manifest time and `oclif manifest` silently writes a zero-command manifest. Every `agent:*` NUT then fails `command ... not found` (exit 2), and since the retry block never rebuilds, all attempts fail identically. Add scripts/verify-commands.mjs and run it (as `nuts:preflight`) at the front of each `test:nuts:*` script, inside the retried command. Healthy case: a sub-second no-op, so the fast cached build is preserved. Empty command tree: force an un-cached `WIREIT_CACHE=none yarn compile`, regenerate the manifest, and re-verify, so the next retry attempt runs against a correct lib/ — turning a silent 404 into either a heal or a loud build failure.
Contributor
|
This PR lacks any commits of the 'fix' or 'feat' type, and therefore will not trigger a release. To silence all further warnings, react to this warning comment (or any other) with the 👀 emoji. NOTE: If your repo uses squash commits, make sure to add the appropriate conventional commit prefix (e.g., 'fix:', 'feat:', 'chore:', etc) in the squash commit message. |
nico-pappagianis
marked this pull request as ready for review
November 6, 2026 23:52
setu4993
approved these changes
Nov 9, 2026
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.
Problem
The `tests` workflow NUTs on ubuntu intermittently fail with every `agent:*` subcommand reporting `command ... not found` (oclif exit 2), cascading into secondary assertion errors. It reproduces across all 3 retry attempts and is not caused by the PR under test — it's a build/cache flake.
Root cause: the shared reusable workflow (`salesforcecli/github-workflows/.github/workflows/nut.yml`) runs `yarn compile` then `yarn oclif manifest` once, before a `nick-fields/retry` block that re-runs only the NUT command. `yarn compile` is wireit-cached and, on the Actions runner, restores `lib/` from the GitHub Actions cache instead of running tsc. When that per-job restore is incomplete, `lib/commands` is empty at manifest time, so `oclif manifest` silently writes a zero-command manifest (it still prints "wrote manifest", no error). Every `agent:*` NUT then 404s at command-resolution time — and because the retry block never rebuilds, all attempts fail identically.
Fix
Add `scripts/verify-commands.mjs` and run it (as `nuts:preflight`) at the front of each `test:nuts:*` script — i.e. inside the retried command, which is the only thing plugin-agent controls in the retry loop.
This lives entirely in plugin-agent (no change to the shared `github-workflows` repo) and keeps the cache speedup for the ~95% of jobs that restore correctly.
Validation (local)
Notes / follow-ups