Skip to content

Upload the PyPI Default Leaf's Wheel and Sdist as a Release Asset - #4616

Merged
ptr727 merged 7 commits into
developfrom
feature/4609-pypi-release-asset
Dec 3, 2026
Merged

ptr727 merged 7 commits into
developfrom
feature/4609-pypi-release-asset

Conversation

@ptr727

@ptr727 ptr727 commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Part of #4609

What changes

  • The hub default PyPI leaf uploads release-asset-<branch>-pypi, the wheel and sdist unzipped, gated on smoke being false, with retention-days: 1.
  • The github-release job already downloads release-asset-<branch>-* with merge-multiple into ./Publish and attaches ./Publish/*, so the files land on the release directly.
  • WORKFLOW.md (D4.3, D6.1, section 3 seam text and diagram, section 6 pypi row), docs/reusable-workflows.md, the release-publish-mechanics reference, and the input comments in build-release-task.yml no longer say PyPI contributes no release asset.
  • A PyPI caller on the default leaf keeps expect_release_assets true.
  • tests/test_release_guards.py gains a test holding both default leaves to the name pattern, the smoke gate, and retention-days: 1.

Local review findings left open after the edit budget

  • pre-existing, not filed: the PyPI leaf cannot see expect_release_assets, and the fleet's one PyPI caller carries its own hook.
  • pre-existing, not filed: no test holds that the build-pypi and build-nuget jobs forward smoke to the leaf.
  • pre-existing, not filed: the develop .dev0 wheel keeps one filename across prereleases.
  • Not filed here: a spec/project-types.json assertion that a PyPI caller on the default leaf does not pass expect_release_assets: false.

Rollout note

A PyPI caller still passing expect_release_assets: false on the default leaf leaves an unconsumed artifact that retention reaps after a day.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • PyPI releases now include the built wheel and source distribution as downloadable assets in the corresponding GitHub release, alongside the existing PyPI publishing flow.
    • The default PyPI build skips both artifact uploads in smoke mode.
  • Documentation

    • Updated release workflow guidance to clarify when PyPI builds contribute release assets, including cases where custom publishing hooks do not upload them.

ptr727 and others added 3 commits December 3, 2026 06:44
The hub default PyPI leaf uploaded no release-asset artifact, so a PyPI caller needed its own build-pypi hook only to attach the package files to the GitHub release.
The leaf now uploads release-asset-<branch>-pypi unzipped, gated on smoke being false, which the github-release job already collects with merge-multiple.
The contract text no longer says PyPI contributes no release asset, and a test holds both default leaves to the name pattern, the smoke gate, and retention-days 1.

Part of #4609

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Draw the PyPI release-asset edge in the seam diagram, stop telling a PyPI caller to set expect_release_assets false, and read the new step's own keys in the test.

Part of #4609

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…te Test

Part of #4609

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Dec 3, 2026
Copilot AI lite review requested due to automatic review settings December 3, 2026 14:56
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The default PyPI build action now uploads dist/* as a smoke-gated, one-day GitHub release artifact alongside the PyPI build artifact. Release contracts, workflow guidance, and guard tests now describe and check the artifact behavior and the custom-hook no-asset case.

Changes: PyPI Release Asset

Layer / File(s) Summary
Upload and verify the PyPI release asset
.github/actions/pypi-build-default/action.yml, tests/test_release_guards.py
The PyPI action uploads dist/* as a branch-specific release asset when smoke mode is disabled. Guard tests check the upload settings, missing-file behavior, and release-task artifact download.
Document release artifact expectations
.agents/skills/branching-and-release-model/references/release-publish-mechanics.md, .agents/skills/workflow-ci-contract/references/*, .github/workflows/build-release-task.yml, WORKFLOW.md, docs/reusable-workflows.md
The release documentation distinguishes default PyPI leaves, which upload release assets, from custom hooks that may upload none. The workflow diagrams, guarantees, scenarios, and hook guidance reflect the artifact flow. The release-publishing reference also clarifies the .NET build hooks.

Estimated code review effort: 2 (Simple) | ~12 minutes

Merge Risk: Minimal · up to 0cae9 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: the PyPI default leaf now uploads its wheel and sdist as a release asset. The raw summary and PR objectives confirm this is the core change, which adds a release-asse…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: the PyPI default leaf now uploads its wheel and sdist as a release asset. The raw summary and PR objectives confirm this is the core change, which adds a release-asset-<branch>-pypi artifact, a smoke-gated upload step, and related docs and test updates.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1a8455a and 0cae985.

Files ignored due to path filters: 10

  • .claude-plugin/fleet-skills/.source-digests/branching-and-release-model is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/.source-digests/workflow-ci-contract is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/branching-and-release-model/references/release-publish-mechanics.md is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/workflow-ci-contract/references/architecture.md is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/workflow-ci-contract/references/d-guarantees.md is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/workflow-ci-contract/references/test-methodology.md is excluded by !.claude-plugin/fleet-skills/**
  • .github/skills/branching-and-release-model/references/release-publish-mechanics.md is excluded by !.github/skills/**
  • .github/skills/workflow-ci-contract/references/architecture.md is excluded by !.github/skills/**
  • .github/skills/workflow-ci-contract/references/d-guarantees.md is excluded by !.github/skills/**
  • .github/skills/workflow-ci-contract/references/test-methodology.md is excluded by !.github/skills/**
Files selected for processing: 9

  • .agents/skills/branching-and-release-model/references/release-publish-mechanics.md
  • .agents/skills/workflow-ci-contract/references/architecture.md
  • .agents/skills/workflow-ci-contract/references/d-guarantees.md
  • .agents/skills/workflow-ci-contract/references/test-methodology.md
  • .github/actions/pypi-build-default/action.yml
  • .github/workflows/build-release-task.yml
  • WORKFLOW.md
  • docs/reusable-workflows.md
  • tests/test_release_guards.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@ptr727

ptr727 commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 6f4ddede2450853c3dcb1e2671af2fa6db50a79c, the content this pull request carries at that commit against develop, and it recorded 5 findings.

… Download in a Test

Part of #4609

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Approval is blocked by active moderate and nit findings affecting caller scoping, release asset handling, documentation accuracy, and missing consumer-contract assertions.

5 open issues
What changed in this PR

Adds PyPI wheel and sdist release assets while updating workflow contracts, documentation, tests, and generated skill copies.

Changes:

  • Uploads PyPI release assets with smoke gating and one-day retention.
  • Updates release architecture and caller guidance.
  • Adds producer-side asset contract tests.
File Description
WORKFLOW.md Updates release and PyPI asset contracts.
tests/​test_release_guards.py Adds tests for PyPI release asset properties.
docs/​reusable-workflows.md Updates PyPI hook and caller guidance.
.github/​workflows/​build-release-task.yml Updates release asset input comments.
.github/​skills/​workflow-ci-contract/​references/​d-guarantees.md Updates workflow guarantee documentation.
.github/​skills/​workflow-ci-contract/​references/​architecture.md Updates release-seam architecture documentation.
.github/​skills/​branching-and-release-model/​references/​release-publish-mechanics.md Updates release publishing mechanics.
.github/​actions/​pypi-build-default/​action.yml Uploads PyPI wheel and sdist release assets.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​d-guarantees.md Updates the distributed workflow guarantee reference.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​architecture.md Updates the distributed architecture reference.
.claude-plugin/​fleet-skills/​skills/​branching-and-release-model/​references/​release-publish-mechanics.md Updates the distributed publishing mechanics reference.
.claude-plugin/​fleet-skills/​.source-digests/​workflow-ci-contract Refreshes the workflow skill source digest.
.claude-plugin/​fleet-skills/​.source-digests/​branching-and-release-model Refreshes the release skill source digest.
.agents/​skills/​workflow-ci-contract/​references/​d-guarantees.md Updates canonical workflow guarantee documentation.
.agents/​skills/​workflow-ci-contract/​references/​architecture.md Updates canonical release-seam architecture documentation.
.agents/​skills/​branching-and-release-model/​references/​release-publish-mechanics.md Updates canonical release publishing mechanics.

Review effort: Lite

Comment thread WORKFLOW.md Resolved
Comment thread tests/test_release_guards.py Resolved
ptr727 and others added 2 commits December 3, 2026 07:02
Part of #4609

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Part of #4609

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 10ea6fc4fef9fe9e066f6c87b76048bb581f8c78, the content this pull request carries at that commit against develop, and it recorded 2 findings.

Part of #4609

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 0cae985c874f8200e0ad5723fc22ea5a65984ffd, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.45%. Comparing base (b38e084) to head (0cae985).
⚠️ Report is 420 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4616      +/-   ##
===========================================
- Coverage    81.60%   78.45%   -3.16%     
===========================================
  Files           26       58      +32     
  Lines         9070    17857    +8787     
===========================================
+ Hits          7402    14010    +6608     
- Misses        1668     3847    +2179     
Flag Coverage Δ
python-3.13 78.45% <ø> (-3.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Dec 3, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit e8582dc into develop Dec 3, 2026
11 checks passed
@ptr727
ptr727 deleted the feature/4609-pypi-release-asset branch December 3, 2026 15:42
ptr727 added a commit that referenced this pull request Dec 3, 2026
…#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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants