Repository navigation
Run Each .NET Leg over Only the Test Projects Declaring Its Line - #4621
Conversation
Skip and name a test project that does not declare the leg's netX.Y, and fail a leg where none does. Keep a timed-out uv export or property read from aborting the package consume checks before the summary. Part of #4609 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Trim and case-fold each declared framework, read both properties in tests, and list every tracked test project directly, since the workspace resolver now gives the same list. Annotate the property read timeout. Part of #4609 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The conditional that "that case" pointed to was removed, so the sentence now states the rule outright. Part of #4609 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🔵 Needs a closer look
The workflow depends on live dotnet msbuild JSON output and runner-installed jq across SDK lines, so its actual GitHub runner behavior still requires human or CI confirmation.
No open issues 🎉
What changed in this PR
Updates .NET validation to run each framework leg only against matching test projects, while improving package-consume timeout reporting.
Changes:
- Filters test projects by declared target frameworks.
- Handles PyPI export and NuGet property-read timeouts.
- Updates tests, workflow contracts, documentation, and generated guidance.
| File | Description |
|---|---|
| WORKFLOW.md | Documents the updated .NET testing and package-consumption guarantees. |
| tests/test_release_guards.py | Adds coverage for framework filtering and workflow behavior. |
| tests/test_package_consume_pypi.py | Tests PyPI dependency-export timeout handling. |
| tests/test_package_consume_nuget.py | Tests NuGet property-read timeout reporting. |
| docs/reusable-workflows.md | Documents per-framework .NET project selection. |
| .github/workflows/validate-task.yml | Updated as part of this pull request. |
| .github/skills/workflow-ci-contract/references/d-guarantees.md | Updates generated workflow guidance. |
| .github/actions/package-consume-pypi/package_consume_pypi.py | Reports export failures while continuing package checks. |
| .github/actions/package-consume-nuget/package_consume_nuget.py | Annotates NuGet property-read timeouts. |
| .claude-plugin/fleet-skills/skills/workflow-ci-contract/references/d-guarantees.md | Updates generated Claude workflow guidance. |
| .claude-plugin/fleet-skills/.source-digests/workflow-ci-contract | Refreshes the generated workflow guidance digest. |
| .agents/skills/workflow-ci-contract/references/d-guarantees.md | Updates canonical workflow guidance. |
Review effort: Lite
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4621 +/- ##
========================================
Coverage 78.45% 78.45%
========================================
Files 58 58
Lines 17857 17857
========================================
Hits 14010 14010
Misses 3847 3847
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@coderabbitai review |
|
/review |
Action not completed
|
|
Answering the headline in the Copilot round on aacbb8e (the workflow depends on live dotnet msbuild JSON and runner-installed jq): No change needed. The step's script was run locally against the real dotnet SDK's msbuild with two -getProperty flags, which always prints JSON, and the output for legs 11.0, 10.0 and 9.0 is in the PR body. jq is preinstalled on ubuntu-latest, the only runner the job uses, and tests/test_release_guards.py runs the whole step script against a stand-in dotnet for the trim, case, prefix, singular and empty-selection cases. The one residual risk, non-JSON output being read as no match, is listed in the PR body as deferred. |
…#4618) ## Promoted pull requests - #4612: Consume the built NuGet package per target framework before it publishes. A `plan` phase reads the declared target frameworks, and a `check` phase asserts the package shape and then restores, builds, and runs a throwaway consumer per framework against the exact `.nupkg`. - #4613: Consume the built PyPI package per Python line before it publishes, the Python counterpart of #4612. - #4616: Upload the PyPI default leaf's wheel and sdist as a release asset. - #4617: Run each .NET line as its own unit test leg. The `test-matrix` job builds the .NET matrix, reports whether a `*Tests*.csproj` exists, and resolves the Python directories, so each job skips cleanly when its kind is absent. - #4619: Name the optional `package-consume` hook in the build-release hook table (fixes the first finding below). - #4620: Neutralize workflow commands in the NuGet consume check's child output (fixes the Copilot finding below). - #4621: Run each .NET leg over only the test projects declaring its line, and keep a timed-out `uv export` or property read from aborting the consume checks (fixes the two CodeRabbit threads on this pull request). Every tracked `*Tests*.csproj` is now read and filtered per leg, so a root holding one solution runs test projects outside that solution too. Closes #4609 ## Promotion review findings A local `frontier` pass against `main` at head d7300a7 raised eight findings: - `docs/reusable-workflows.md:92` omitted the optional `package-consume` hook. Real, fixed by #4619. - `validate-task.yml:1097` forces `--framework net<line>` on every project, which fails a project not listing that framework. Declined: forcing `--framework` on every project and the solution-level form are the decided design of #4609, recorded in #4617's body. - `pypi-build-default/action.yml:145` uploads `release-asset-<branch>-pypi` for a caller whose `github-release` job does not delete it. Declined: `nuget-build-default/action.yml` uploads its release asset under the same condition, and both set `retention-days: 1`, which bounds what a caller skipping the download leaves behind. The same pattern is the decided shape of both leaves. - `package_consume_pypi.py:326` tests row can pass where a caller's own `conftest.py` re-adds `src/` to `sys.path`. Declined: the check controls the pytest configuration it hands the suite (importlib mode, `pythonpath` cleared) and cannot police code a caller's tests run themselves. The import-location probe is the check on the built form. - `build-release-task.yml:332`, `package_consume_nuget.py:151` and `package_consume_pypi.py:159` duplicate a validation step, the `global.json` parse, and the result and escape helpers. Declined: each action ships self-contained and each reusable workflow validates its inputs at entry, as #4612's body records. - `validate-task.yml:1072` repeats `hashFiles` and `python-any` conditions the job-level `if:` already decided. Class `introduced`, harmless and left as is, a dead-condition nit. Listed here, no behavior is wrong. A second local `frontier` pass at head d6e2b60 (after #4619 landed) raised one finding. Copilot's #4620 finding below is the opposite call, which is why #4620 added the same hardening to the NuGet twin rather than removing it from PyPI: - `package_consume_pypi.py:77`, `introduced`: `neutralize` and the nuget `escape_command` use rewrite a leading `::` in child output, which the pass reads as over-hardening, since that child code already runs in the job. Left as is, a value call on code #4613 wrote, with the maintainer's removal being a small separate change. It owes the maintainer's answer if they want it removed. Copilot raised two findings on head d6e2b60: - `package_consume_nuget.py:212` printed child output raw, unlike the PyPI runner. Real, fixed by #4620. - `package_consume_pypi_selftest.py:54` says the sdist keeps the excluded module. Declined with evidence: `uv build` builds the wheel from the sdist, so the wheel target's `exclude` applies to the sdist's consume too, and the `PyPI package consume self-test job` is green on this head with its required-FAIL assertion on every wheel and sdist leg. A third local `frontier` pass at head c79fb1a raised three findings, all declined: - `package_consume_nuget.py:421`: a `netstandard` row is consumed as the consumer line, so its own folder's assembly is not loaded. Declined: the nearest-folder resolution is the decided design, recorded in #4612's body. - `validate-task.yml:196`: a multi-targeting test project loses its other framework's leg where `dotnet-versions` is unset. Declined: forcing `--framework` per line is the decided design of #4609, recorded in #4617's body. - `package_consume_pypi.py:326`: the tests run with the working directory outside the project, so a fixture opened by a relative path fails. Declined: D1.8 in `WORKFLOW.md` states this requirement ("the caller's suite must not read a path relative to the project root") as the contract. A fourth local `frontier` pass against `main` at head 901c575 (after #4621 landed) raised six findings: - `package_consume_nuget.py:460`: a `netstandard` folder is never loaded where the package also has a `net` folder. Declined, the same call as the third pass: nearest-folder resolution is the decided design, recorded in #4612's body. - `validate-task.yml:1108`: where `dotnet-versions` is unset, the one leg runs `--framework` for the selected line only, so a project's lower framework is not run. Declined: `docs/reusable-workflows.md` states this ("Without the input, the one leg runs `--framework` for the selected line alone"), and it is the decided design of #4609 recorded in #4617's body. - `test-pull-request.yml:136`: the aggregator interpolates `${{ needs.*.result }}` into its run script. Class `pre-existing`, copying the existing validate and Windows lines. The value is a fixed set of result words, so nothing is injectable. Listed under `Pre-existing findings, not filed`, with no behavior wrong. - `test-pull-request.yml:107`: the self-test's `setup-uv` version is described as the PyPI leaf's pin with nothing tying the two together. Class `pre-existing`, listed under `Pre-existing findings, not filed`. - `package_consume_nuget.py:156`: `global_json_line` repeats the `dotnet-sdk` action's `global.json` parse. Declined: each action ships self-contained, as the first pass records. - `escape_command`, `neutralize`, `Report` and `run()` are duplicated between the two consume scripts. Declined for the same self-contained reason. ## Pre-existing findings, filed - `package_consume_pypi.py:119`, Copilot on head 901c575: a top-level data directory in a wheel is probed as an importable name and fails the import location row. Filed as #4622. ## Pre-existing findings, not filed - `test-pull-request.yml:136`, class `pre-existing`: result values interpolated into a run script. - `test-pull-request.yml:107`, class `pre-existing`: the self-test `setup-uv` pin is not tied to the PyPI leaf's. ## Dropped findings - Dead `hashFiles` and `python-any` step conditions in `validate-task.yml`, covered above. - `package_consume_nuget.py:156` and the duplicated helpers between the two consume scripts, declined above. ## Issues #4619, #4620 and #4621 are the fix pull requests this promotion picked up. #4609 is closed by this promotion. #4534 is already closed and is only cited in #4612 as the shape its check guards against. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Release workflows now verify built NuGet and PyPI packages by checking package contents and running relevant tests across configured .NET and Python versions. * .NET validation runs in a separate test job for each configured version, with framework-specific coverage reporting. * Default PyPI builds upload wheels and source distributions as release assets. Python versions for package checks can be configured. * **Documentation** * Updated workflow guidance and examples to describe package checks, release assets, and version-specific testing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Part of #4609
Summary
uv exportin the PyPI consume check now records a failedtest dependenciesrow naming the timeout. The install, version and import checks still run, the tests row for each target fails naming the missing dependencies, the summary is written, and the step fails.TimeoutExpired. Its one uncaught shape was thedotnet msbuildproperty read, which now prints an::error::annotation and exits 1..NET X.Yleg runsdotnet test --framework netX.Y --project Ponly for tracked*Tests*.csprojprojects whoseTargetFrameworkorTargetFrameworksdeclaresnetX.Y. Entries are trimmed and compared without case. Other projects are skipped with a log line naming them, and a leg where none declares its line fails with an::error::.dotnet-workspaceshop is dropped from the unit-test job, because withsolutionsfalse it listed the same*Tests*.csprojset the step now enumerates itself. A root holding one solution therefore now runs every tracked*Tests*.csproj, not only the projects inside that solution.dotnet-versionsinput description, WORKFLOW.md D1.6 and D1.9, and docs/reusable-workflows.md.Local filter evidence
Real
dotnet msbuildproperty reads,dotnet teststubbed, three constructed projects: ATests declaresnet10.0, BTests declaresnet10.0;net11.0, CTests declaresnet10.0-windows; NET11.0.Local review
Three recorded local strict passes. The first found eight issues and the second one, all fixed in this branch. The third found none.
Deferred, not blocking:
jq -ereads unparseabledotnet msbuildoutput the same as no match, so a project could be skipped with a misleading reason. No real source of non-JSON output was found.The
commentslabel is applied because the change adds why-comments.Closes nothing: the parent issue stays open for the promotion.
🤖 Generated with Claude Code