Skip to content

Add a Build-Release-Asset Hook for File Targets the Release Task Ships No Leaf For - #2295

Merged
ptr727 merged 4 commits into
developfrom
feature/release-asset-hook
Oct 3, 2026
Merged

ptr727 merged 4 commits into
developfrom
feature/release-asset-hook

Conversation

@ptr727

@ptr727 ptr727 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Summary

An eda or homeassistant repository ships a data or integration zip on its GitHub release. None of build-release-task.yml's leaves can build that zip, and the audit retires the repository's own copy of the task, so these repositories had no conformant route. KiCadLibrary is the first to need one, and homeassistant-purpleair has the same shape.

  • A new enable_release_asset input (default false, so no existing caller changes) runs a build-release-asset job. The job calls the caller's required .github/actions/build-release-asset hook, which writes the target's files into an output-directory, on a smoke run too.
  • The task owns the seam. It requires at least one top-level regular file, refuses a subdirectory, a symlink, or a dot-prefixed name, and uploads release-asset-<branch>-build-release-asset itself. The upload is skipped on smoke (D1.3) and keeps retention-days: 1 (D5.4). github-release and build-docker take the job in needs:.
  • The contract names the route. That covers WORKFLOW.md "Two Layers", "Output Seam by Destination", D6.1 (what fills <target>), and the section 6 library, homeassistant, and eda rows. In docs/reusable-workflows.md it covers the Hook Contract, the Hook Catalog, Stage 4, and two adoption checkboxes. The generated skill references are regenerated.
  • A release guard pins the job's gate, its upload gate and retention, its output checks, its needs: edges, and its default. Each was proven by mutation. An existing test's job slice is generalized so that inserting a job after build-pypi no longer breaks it.

The PR carries the comments label for the three new workflow comments.

Local review

The local strict review took four passes. It raised 4, 4, 1, and 2 findings, and the first nine were fixed. Of the last two:

  • Declined: a hook file name containing a character upload-artifact rejects, such as :. A smoke run passes it, and the real publish then fails loudly at the upload step with no release cut. Nothing is dropped silently, which was the reason for refusing dotfiles.
  • Deferred: "Adopting the Release Chain" has no caller-stub variant for a file-target repository yet. It will be written from KiCadLibrary's release-chain adoption, which is the first such stub.

Verification

All of these pass locally:

  • python3 -m unittest discover -s tests (2004 tests)
  • spec/validate.py
  • scripts/build_dist.py --check
  • ruff and mypy
  • scripts/repo_gate.py
  • all seven scripts/docker_lint.py linters
  • scripts/prose_lint.py --diff origin/develop, apart from the labelled comment-added lines

A probe ran the output check against constructed directories, and only the regular-files case passes.

The job itself runs for the first time on KiCadLibrary's adoption pull request, since the hub carries no hook of its own for it.

🤖 Generated with Claude Code

ptr727 and others added 4 commits October 2, 2026 19:11
…s No Leaf For

An eda or homeassistant repo ships a data or integration zip on its GitHub
release, which none of build-release-task.yml's leaves can build, while the
audit retires the repo's own copy of the task. The new enable_release_asset
input runs a build-release-asset job that calls the caller's required
.github/actions/build-release-asset hook, checks it wrote at least one file,
and uploads release-asset-<branch>-build-release-asset itself, so the smoke
gate and the one-day retention hold for every caller. The input defaults
false, since the hook has no hub default, so no existing caller changes.

WORKFLOW.md's library, homeassistant, and eda rows and the reusable-workflows
hook catalog name the hook, and a release guard pins its upload gate, its
retention, its needs edges, and its default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ntract

A subdirectory never reaches the release and a dot-prefixed file is never
uploaded, so the output check now refuses both rather than letting the
release ship short. The hook contract says the files are written on a smoke
run too, which the output check already required, and the Output Seam names
the hook route beside the one-leaf-per-output one. The retired release-assets
hook sentence is dropped, since this hook is that hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D6.1 now says a file target built through the build-release-asset hook
fills <target> with build-release-asset, so the documented route is not the
differently-named artifact the homeassistant row calls a defect. The hook
contract and the refusal message name symlinks and every other non-regular
entry, the presence-gate header names the one input that defaults false, and
the release guard now fails if the job loses its enable_release_asset gate or
its output checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A symlink to a regular file would upload its target, so the release would not
drop it, and the contract and the error message now state what the task
accepts instead of a reason that is false for that case.

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

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4a8e6fe-d036-4d76-9f71-eb06edfa232e
  • Autopilot · 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

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.22%. Comparing base (cce212f) to head (8c00742).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2295   +/-   ##
========================================
  Coverage    58.22%   58.22%           
========================================
  Files           16       16           
  Lines         7821     7821           
========================================
  Hits          4554     4554           
  Misses        3267     3267           
Flag Coverage Δ
python-3.13 58.22% <ø> (ø)

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.

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.

Copilot review overview

🟡 Changes recommended

The hook must receive the declared ref, and the output-contract guard lacks executable regression coverage.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds a reusable build-release-asset hook for file-based release assets, including validation, uploads, documentation, tests, and regenerated references.

Changes:

  • Adds the release-asset workflow job and input.
  • Documents the hook contract and adoption path.
  • Adds regression guards and updates skill references.
File Summary
WORKFLOW.md Documents the file-target hook contract.
tests/​test_release_guards.py Adds workflow behavior guards.
docs/​reusable-workflows.md Documents hook usage and adoption.
.github/​workflows/​build-release-task.yml Implements the release-asset job.
.github/​skills/​workflow-ci-contract/​references/​d-guarantees.md Regenerated guarantee reference.
.github/​skills/​workflow-ci-contract/​references/​architecture.md Regenerated architecture reference.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​d-guarantees.md Regenerated guarantee reference.
.claude-plugin/​fleet-skills/​skills/​workflow-ci-contract/​references/​architecture.md Regenerated architecture reference.
.claude-plugin/​fleet-skills/​.source-digests/​workflow-ci-contract Updates the source digest.
.agents/​skills/​workflow-ci-contract/​references/​d-guarantees.md Updates the canonical guarantee reference.
.agents/​skills/​workflow-ci-contract/​references/​architecture.md Updates the canonical architecture reference.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/build-release-task.yml
@ptr727
ptr727 merged commit fc8fc7c into develop Oct 3, 2026
11 checks passed
ptr727 added a commit that referenced this pull request Oct 3, 2026
…2298)

## Summary

Promotes develop to main with the pull request below, which was already
reviewed and merged into develop.

- [#2295](#2295):
`build-release-task.yml` gains an `enable_release_asset` input, default
`false`, and a `build-release-asset` job.
- **What it is for:** a file target the task ships no leaf for, such as
an `eda` data zip or a `homeassistant` integration zip.
- **The hook:** the job calls the caller's required
`.github/actions/build-release-asset` hook, which writes the files.
- **Checks:** the task accepts only top-level regular files with no
dot-prefixed name.
- **Upload:** the task uploads
`release-asset-<branch>-build-release-asset` itself. The upload is
skipped on smoke and kept for one day.
- **Docs:** WORKFLOW.md (D6.1 and the `library`, `homeassistant`, and
`eda` rows) and `docs/reusable-workflows.md` name the route.

No existing caller changes, since the input defaults false. The release
this promotion unblocks gives KiCadLibrary a pinnable hub commit for its
release-chain adoption.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@ptr727
ptr727 deleted the feature/release-asset-hook branch October 3, 2026 14:19
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