Repository navigation
fix(ci): stop a green pack-validation proof failing the step - #152
Merged
Merged
Conversation
The rule proof passed all 29 validations and the step still reported exit 1. Every validation run has to fail, so $LASTEXITCODE was non-zero when the script fell through, and GitHub's pwsh shell appends `exit $LASTEXITCODE` to every step. The script now states exit 0, and the tool restore it depends on is fatal instead of piped to Out-Null: an ignored failure there leaves a stale purview-build proving rules this repository no longer has. The proof moves out of packed-consumers into its own job. It needs nothing the Native AOT and WebAssembly gates do, and as the last step of that job it could only fail after seven minutes of them. packed-consumers states its own exit code explicitly for the same reason. Drops the TELEMETRY_PRERELEASE_FEED variable. It was never set, and the shared build workflow already registers the organisation's GitHub Packages source when a pinned Purview.SourceGeneratorFramework or Purview.BuildSdk version is not on nuget.org. `-PrereleaseFeed` and LOCAL_NUGET_FEED_PATH remain, for local runs against a feed that holds an unpublished version. just pipeline-pack-validate now ends with the proof, so packing locally proves the rules without a second command. ReleaseGateTests fails when a gate script stops stating its exit code, when the proof sits behind the consumer gate, or when a failed tool restore is not raised.
…ores
A cold `dotnet tool restore` fails whenever dotnet-inspect is in the manifest,
on a hosted runner and on a clean machine alike:
The command "purview-build" specified in the tool manifest file is not
contained in the package with Package Id purview.build. The commands
contained in the package are dotnet-inspect.
dotnet-inspect 0.26.0 is a RID-specific tool (DotNetCliTool Version="2" with
RuntimeIdentifierPackages, laid out under tools/any/any). Installing it beside
another tool leaves NuGet validating the wrong package's commands. Reversing the
manifest order changes nothing and --disable-parallel does not help, so it is not
a race: it is every cold restore.
Nothing here ever ran the tool. It was added in 75bf81e and is referenced
nowhere.
Three cold-cache manifests prove the trigger: purview.build alone restores,
csharpier plus purview.build restores, and all three fail. Without the entry the
repository's own manifest restores cold in 7s - which is what every hosted run
and every fresh clone does.
This is why the gate in the parent commit could not pass: the shared build's
LintModule hits the same failure and retries past it.
Contributor
Author
|
The second commit finds the root cause of the
Reproduced on three cold manifests (fresh
|
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.
Why
The
packed-consumersjob was red on #151 while the gate it ran passed every check:Two independent faults, plus one latent one:
pwshshell appendsif ((Test-Path -LiteralPath variable:\LASTEXITCODE)) { exit $LASTEXITCODE }to every step script, andscripts/test-pack-validation-rules.ps1deliberately runs 29dotnet purview-buildinvocations that must exitnon-zero. It ended on a
Write-Host, so a green proof exited 1.just verify-pack-rulesruns the same scriptthrough
pwsh -File, which exits 0, so it never showed locally.dotnet tool restorefailed withThe command "purview-build" ... is not contained in the package with Package Id purview.build. The commands contained in the package are dotnet-inspect.A transient NuGettool-restore race: the shared build's LintModule hit it too, in the same run, and retried past it two seconds
later. The published
purview.build0.8.0 declarespurview-buildcorrectly.dotnet tool restorewas| Out-Null. A failed restorewould leave the runs using whatever
purview-buildthe tool store already held — it only worked in that runbecause 0.8.0 happened to be there. A stale tool would report rules this repository no longer has.
What
scripts/test-pack-validation-rules.ps1— ends with an explicitexit 0; the tool restore is fatal and its outputis part of the message.
scripts/test-packed-consumers.ps1— same explicitexit 0, so neither gate inherits$LASTEXITCODE..github/workflows/pr.yml— the rule proof moves from the last step ofpacked-consumersto its ownpack-validationjob. It packs the generator and proves the rules, in parallel with the Native AOT / WebAssemblyAOT gate rather than after its seven minutes. Its
dotnet tool restoreraises instead of leaving$LASTEXITCODE..github/workflows/pr.yml— dropsTELEMETRY_PRERELEASE_FEED, which was never set. The sharedbuildworkflowalready registers the organisation's GitHub Packages source when a pinned version is not on nuget.org.
Justfile—just pipeline-pack-validatenow ends with the proof, so packing locally proves the rules.ReleaseGateTests— fails when a gate script stops stating its exit code, when the proof sits behind the consumergate, or when a failed tool restore is not raised. Each new guard was checked by breaking it.
AGENTS.md,docs/wiki/Release-Flow.md— gate wiring and the prerelease-feed story.No version bump: this changes the gates, not the package.
Verification
(
$ErrorActionPreference = 'stop'plus a trailingexit $LASTEXITCODE) exits 0; before the fix it exited 1.exit 0failsGateScript_GivenCommandsThatFailByDesign_EndsWithAnExplicitExit; restoring it is green.just verify-pack-rules— 29 runs, 27/27 rules rejected, exit 0.PackValidation: Valid packages: 1/1.Repository.UnitTests51/51,SourceGenerator.IntegrationTestsnet10.0 567 passed / 0 failed,just build0 warnings,
dotnet csharpier check .clean.