Skip to content

ci: make DPU releases transactional - #215

Merged
nia-sg-bot merged 2 commits into
mainfrom
nia/release-integrity-recovery
Aug 4, 2026
Merged

nia-sg-bot merged 2 commits into
mainfrom
nia/release-integrity-recovery

Conversation

@nia-sg-bot

@nia-sg-bot nia-sg-bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Why

The post-merge automation for #213 published tag/release 2.2.1 before packaging completed. cargo deb then failed because vibi-dpu/Cargo.toml resolved README.md inside the crate while the file is at repository root. The result is an immutable tag pointing at source that still declares 2.2.0, an open unchecked bump PR (#214), and a public release with no assets.

This PR makes release publication fail closed: a normal merge may only propose a reviewed version change; only an explicit vMAJOR.MINOR.PATCH tag on a commit already contained in main can package and publish a release.

Changes

  • fix the package README path used by cargo-deb;
  • update both Cargo.toml and Cargo.lock in the version proposal script, skipping versions already present as either legacy or v tags;
  • replace merge-triggered publication with a single updateable version-bump PR;
  • require tag/manifest/lockfile/source ancestry consistency before release packaging;
  • pin the Debian build environment and cargo-deb version;
  • build, inspect, and checksum the .deb before creating a draft release, then publish only after assets upload successfully;
  • pin checkout actions and apply least-privilege workflow permissions;
  • run release-script tests and locked Cargo metadata/build/test gates in CI.

Recovery boundary

  • Existing tag/release 2.2.1 is intentionally untouched and should be treated as incomplete/superseded.
  • Do not merge Update Cargo.toml #214 as-is. It changes only Cargo.toml, has no checks, and cannot repair the already-published 2.2.1 release.
  • After this PR is reviewed and merged, create/review the generated synchronized 2.2.2 version PR. Only after that exact commit is on main should a deliberate v2.2.2 tag be created. The new tag workflow will build and publish the validated .deb plus checksum.
  • No tag, release, package visibility, GHCR visibility, or production state is changed by this PR.

Verification

  • python3 -m unittest scripts/test_update.py scripts/test_verify_release.py — 8 passed
  • cargo metadata --manifest-path vibi-dpu/Cargo.toml --locked --no-deps --format-version 1 — passed
  • cargo test --manifest-path vibi-dpu/Cargo.toml --locked — 1 passed; 96 pre-existing warnings
  • cargo build --manifest-path vibi-dpu/Cargo.toml --release --locked — passed; same pre-existing warnings
  • cargo package --manifest-path vibi-dpu/Cargo.toml --locked --allow-dirty --no-verify --list — passed
  • cargo deb --manifest-path vibi-dpu/Cargo.toml --locked with cargo-deb 3.7.0 — produced and inspected vibi-dpu_2.2.0-1_amd64.deb; payload contains /usr/bin/vibi-dpu
  • all workflow YAML parsed successfully; git diff --check passed

The independent multi-architecture GHCR run for merge commit 3950199 completed successfully; its immutable image remains separate from semantic release 2.2.2.

Summary by CodeRabbit

  • New Features

    • Releases are now published from verified semantic version tags.
    • Release packages include Debian artifacts and checksums.
    • Merged changes can automatically prepare the next patch-version update.
  • Bug Fixes

    • Added validation to prevent releases with mismatched versions, lockfiles, invalid tags, or duplicate versions.
    • Improved build and test reliability through locked, reproducible checks.
  • Chores

    • Updated package metadata to reference the repository README.

Separate reviewed version proposals from tag-driven publication so failed packaging cannot leave a public release without assets. Validate manifest, lockfile, tag ancestry, Debian metadata, and checksums before publishing, and fix the package README path exposed by 2.2.1.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@nia-sg-bot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2cb81b8d-1442-4731-b69b-f04073386ea4

📥 Commits

Reviewing files that changed from the base of the PR and between ce7441e and 3a5acde.

📒 Files selected for processing (3)
  • .github/workflows/release.yml
  • .github/workflows/rust.yml
  • .github/workflows/version-bump.yml

Walkthrough

The PR replaces pull-request release creation with validated semantic-tag releases. It adds synchronized version-bump automation, release verification, Debian package validation, checksum generation, pinned workflow actions, locked Cargo commands, and expanded script tests.

Changes

Release automation

Layer / File(s) Summary
Version update implementation and tests
scripts/update.py, scripts/test_update.py
The updater validates stable semantic versions, selects untagged patch versions, updates matching manifest and lockfile entries, and validates both files before writing. Tests cover synchronization, mismatches, tags, and prereleases.
Release verification contract and tests
scripts/verify_release.py, scripts/test_verify_release.py
Release tags must match the manifest version and exactly one matching vibi-dpu lockfile entry. Tests cover valid tags and invalid tag, manifest, and lockfile data.
Merged-pull-request version bump workflow
.github/workflows/version-bump.yml
Merged pull requests to main trigger version updates, validation, an automation branch, and creation or update of a version-bump pull request.
Validated tag release workflow
.github/workflows/release.yml, vibi-dpu/Cargo.toml
Semantic version tags trigger commit, ancestry, release, metadata, build, Debian package, checksum, and asset validation before release publication. The package README path now references the repository README.
Rust workflow validation
.github/workflows/rust.yml
The Rust workflow uses pinned checkout, read-only permissions, release automation tests, locked Cargo metadata, and locked verbose build and test commands.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MergedPR
  participant VersionBumpWorkflow
  participant update.py
  participant VersionBumpPR
  participant ReleaseWorkflow
  participant verify_release.py
  participant cargo_deb
  participant GitHubRelease

  MergedPR->>VersionBumpWorkflow: merge into main
  VersionBumpWorkflow->>update.py: update manifest and lockfile
  VersionBumpWorkflow->>VersionBumpPR: create or update automation pull request
  VersionBumpPR->>ReleaseWorkflow: merged version bump creates semantic tag
  ReleaseWorkflow->>verify_release.py: verify tag and package versions
  ReleaseWorkflow->>cargo_deb: build and validate Debian package
  ReleaseWorkflow->>GitHubRelease: publish package and checksum assets
Loading

Possibly related PRs

  • vibinex/vibi-dpu#213: Restructures version updates and expands validation in the same scripts and Rust workflow areas.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: making DPU releases transactional.
Description check ✅ Passed The description explains the changes, verification results, tests, packaging checks, and recovery steps in sufficient detail.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nia/release-integrity-recovery

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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/release.yml:
- Around line 41-42: Pin Python 3.11 or newer with an actions/setup-python step
before Python usage in .github/workflows/release.yml (lines 41-42) and
.github/workflows/rust.yml (lines 20-21), ensuring the release validation and
script tests invoke the configured interpreter instead of unversioned python3.
- Around line 37-40: Update the release-existence check around gh release view
"$TAG" to distinguish draft releases from published releases. Allow a retry to
reuse or cleanly complete an existing draft before attempting publication, while
continuing to fail when a published release already exists.

In @.github/workflows/version-bump.yml:
- Around line 17-20: Update the workflow condition guarding the version-bump job
to require the merged pull request’s head repository to match github.repository,
preventing fork PRs from triggering it. In the gh pr list filtering logic,
additionally require headRepository.nameWithOwner to equal github.repository
before selecting or editing the automation/version-bump PR.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 489a885e-492c-4381-b87f-2e4f3ef6fab1

📥 Commits

Reviewing files that changed from the base of the PR and between 3950199 and ce7441e.

📒 Files selected for processing (8)
  • .github/workflows/release.yml
  • .github/workflows/rust.yml
  • .github/workflows/version-bump.yml
  • scripts/test_update.py
  • scripts/test_verify_release.py
  • scripts/update.py
  • scripts/verify_release.py
  • vibi-dpu/Cargo.toml

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/version-bump.yml
Pin Python 3.11 for tomllib-based validation, resume interrupted draft releases without accepting published duplicates, and restrict version-bump automation to same-repository pull requests and bot branches.
@nia-sg-bot
nia-sg-bot merged commit 6b06afa into main Aug 4, 2026
3 checks passed
@nia-sg-bot
nia-sg-bot deleted the nia/release-integrity-recovery branch August 4, 2026 21:45
@nia-sg-bot nia-sg-bot mentioned this pull request Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant