Skip to content

fix(release): accept SHA-256-only digest sets - #2212

Open
Anurag-S1ngh wants to merge 2 commits into
apache:mainfrom
Anurag-S1ngh:fix/2173-sha256-only-releases
Open

Anurag-S1ngh wants to merge 2 commits into
apache:mainfrom
Anurag-S1ngh:fix/2173-sha256-only-releases

Conversation

@Anurag-S1ngh

@Anurag-S1ngh Anurag-S1ngh commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • ASF policy allows SHA-256 and/or SHA-512, but rc-cut preflight blocked any digest set without sha512 and verify-rc always required a .sha512 file, so a compliant SHA-256-only project could not use the release family.
  • Preflight now requires at least one of sha256 and sha512; verify-rc requires the first digest in the Digest set, which stays sha512 by default.
  • Updated the rc-cut and verify-rc skills, the release-build.md template, both tool READMEs, and the Step 3 eval spec.

Type of change

  • Python package (tools/*/ with pyproject.toml)
  • Documentation (docs/, README.md, CONTRIBUTING.md)

Test plan

  • uv run pytest in tools/release-management, tools/release-config and tools/release-verify: all pass.
  • New preflight test: digest_set with only sha256 passes; a set with neither sha256 nor sha512 is blocked; md5 and sha1 are still refused.
  • New checksum tests: --digest sha256 passes a SHA-256-only directory, a missing .sha256 is MISSING-DIGEST, and the default still requires .sha512.
  • New _digests() tests: a sha256-only set emits --digest sha256 alone in commands.checksums and commands.all; a set listing sha512 keeps it required; an empty set falls back to sha512.
  • New inventory test: a SHA-256-only digest set reports no unexpected files, and a digest file outside the set is reported unexpected.
  • ruff check, ruff format --check and mypy on both changed packages.
  • check-family-plugins.py --fix regenerates the plugin mirror with no remaining diff.
  • skill-token-count --write and skill-surface-hash.py --fix after the skill edits.
  • prek run on the changed files passes, including the workspace pytest, ruff and mypy hooks.

RFC-AI-0004 compliance

No principle touched: the existing gates stay; only which digest satisfies the required slot changes.

Linked issues

Closes #2173

Refs #2172

Notes for reviewers

The default digest stays sha512, so existing projects see no change. A project that wants SHA-256 only lists only sha256 in release-build.md; verify-rc then passes --digest sha256 alone. md5 and sha1 remain refused by preflight, and .md5 remains a warning in Step 3.

Generative AI disclosure: written with help from OpenCode (DeepSeek V4.1 Flash 1017). I have read every line of the diff and run the checks.

@github-actions github-actions Bot added family:setup setup-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:triage Sweep + classify + propose disposition capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement family:release-management release-* skills substrate:release Tool substrate: release-artefact helpers (reproducible archive build, lint, comparison) labels Nov 20, 2026

@KatalKavya96 KatalKavya96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Anurag-S1ngh, thanks for the PR.
Keeping sha512 as the default means existing projects see no change, and still refusing md5 and sha1 in preflight keeps the gate where it was.
The checksum tests cover both sides of the new rule: a SHA-256-only directory passes, a missing .sha256 is MISSING-DIGEST, and the default still requires .sha512.
The docs, the template and the Step 3 eval spec all move together, so nothing still says sha512 is the only option.

Should change

  • One inline comment: verify-rc's commands.checksums comes from _digests() in tools/release-management/.../verify_rc/args.py, which always puts --digest sha512 first. For a digest set of ["sha256"] it still emits --digest sha512 --digest sha256, so Step 3 still requires .sha512 and a SHA-256-only RC still fails. Could _digests() add sha512 only when the set has it (or is empty), with a test on that path?

Smaller points (non-blocking)

  • inventory() now always treats .sha256 and .sha512 as companions, whatever the Digest set says, so a stray .sha256 next to a sha512-only release is no longer reported as unexpected. Was that intended? The --digest list already covers both in a SHA-256-only run.
  • With _digests() changed as above, a SHA-256-only project only needs sha256 in its Digest set, so the template's "make sha256 the first entry" could become "list only sha256".

Thanks again for following this up.


This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. After you've
addressed the points above and pushed an update, an Apache Magpie
maintainer — a real person — will take the next look
at the PR. The findings cite the project's review criteria;
if you think one of them is mis-applied, please reply on the
PR and a maintainer will weigh in.

More on how Apache Magpie handles maintainer review:
Contributing guide.

@Anurag-S1ngh

Copy link
Copy Markdown
Contributor Author

Both points are handled in 40707ec.

_digests() now prepends sha512 only when the Digest set lists it or is empty. A ["sha256"] set emits --digest sha256 alone, so Step 3 gates on .sha256; ["sha256", "sha512"] still emits --digest sha512 --digest sha256, and an empty set falls back to sha512. Tests cover all three cases, including commands.checksums and commands.all, and the plugin mirror is regenerated.

inventory() now derives its digest companions from the Digest set, falling back to sha512 when the set is empty, so a digest file outside the set is reported unexpected again. There is a test for .sha512 files beside a SHA-256-only set.

The template now says to list only sha256 for a SHA-256-only release, and the Step 3 wording says sha512 is required whenever the set lists it.

@KatalKavya96 KatalKavya96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Anurag-S1ngh, thanks for the PR.
40707ec covers the points from my last review: _digests() adds sha512 only when the Digest set lists it or is empty, so a ["sha256"] set now produces --digest sha256 alone in both commands.checksums and commands.all, with tests for all three cases; inventory() takes its companions from the Digest set again, with a test for .sha512 files beside a SHA-256-only set; and the template now says to list only sha256.

Thanks again for the quick follow-up.


This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.

More on how Apache Magpie handles maintainer review:
Contributing guide.

ASF policy allows SHA-256 and/or SHA-512, but rc-cut preflight blocked
any digest set without sha512 and release-verify always required a
`.sha512` file. A compliant SHA-256-only project could not use the
release family.

Require at least one of sha256 and sha512 in preflight, and make the
first digest in the Digest set the required one in verify-rc. The
default stays sha512, so existing projects see no change.

Generated-by: OpenCode 2.3.2 (DeepSeek V4.1 Flash 1017)
verify-rc still passed `--digest sha512` first for every config, so a
SHA-256-only project generated `--digest sha512 --digest sha256` and
Step 3 kept requiring `.sha512`.

Add sha512 only when the Digest set lists it, or when the set is empty,
so a SHA-256-only project passes `--digest sha256` alone. inventory()
now takes its digest companions from the same set, so a digest file
outside the set is reported unexpected again.

Restamped measured_tokens after the rebase onto main.

Generated-by: OpenCode 2.3.2 (DeepSeek V4.1 Flash 1017)
@Anurag-S1ngh
Anurag-S1ngh force-pushed the fix/2173-sha256-only-releases branch from 40707ec to 060b77f Compare November 22, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:resolve Close-out: invalidate, dedupe, CVE allocate, announcement capability:triage Sweep + classify + propose disposition family:docs Docs, MISSION.md, READMEs family:release-management release-* skills family:setup setup-* skills family:tools tools/* substrate:release Tool substrate: release-artefact helpers (reproducible archive build, lint, comparison)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release-management: a SHA-256-only release fails preflight and verify-rc although ASF policy allows it

2 participants