Repository navigation
The Changes job fails open, misses renames, and does not list tools/Shared or .config/dotnet-tools.json #70
Description
Problem
The changes job in dotnet.yml (added in 44b3ef0) decides whether a PR runs Pack and Consumer smoke test, two required checks. It can answer "nothing to pack" when the PR does change a package, and nothing reports that. There are three ways.
1. It fails open. The workflow comment says a failed git diff "fails the job rather than answering false, so a broken diff can never skip the pack". The opposite happens:
Changesis not a required check.- When it fails,
PackandConsumerare skipped because a job they need failed. - GitHub reports a skipped job as Success on a required check ("A job that is skipped will report its status as "Success". It will not prevent a pull request from merging, even if it is a required check").
So Test (ubuntu-latest) and Labels and issue link decide the merge alone. This follows from GitHub's documented rule; it has not been reproduced on a live PR.
2. It cannot see a rename's source. git diff --name-only without --no-renames lists only the new path of a renamed file. Moving a file from src/ to spikes/ or docs/ reports just the new path, so the job answers product=false. Checked locally with git 2.54: git mv src/A.cs docs/A.cs lists docs/A.cs alone, while --no-renames lists both paths.
3. Two inputs are missing from its list.
tools/Shared/*.csis compiled into the smoke test tool throughtools/Directory.Build.props(<Compile Include="$(MSBuildThisFileDirectory)Shared/*.cs" />), but onlytools/ConsumerSmokeTest/*is listed..config/dotnet-tools.jsonpins the CycloneDX that Pack's SBOM step runs, and it is not listed either.
A change to either skips Pack and Consumer on the PR. The first run of the changed code is the push to the release branch.
Change
git diff --name-only --no-renames -z.- The deciding list comes from the project graph: the smoke tool's and the shipping projects' MSBuild inputs, including linked and imported files, plus
.config/dotnet-tools.json. Any path the list does not recognise selects the pack, rather than skipping it. - A job that always runs requires
Changesto have succeeded (CI: a gate job over every job, and which legs it requires #71). Until then, makeChangesa required check. - Seeds, each shown to fail:
- a rename out of
src/ - an edit to
tools/Shared/SharedFile.cs - an edit to
.config/dotnet-tools.json Changesexiting 1 on a PR
- a rename out of
Done when
All four seeds fail the PR's required checks, rather than skipping Pack and Consumer.
Activity