Skip to content

Add sanity checks for correct release channel to the build workflow - #4771

Merged
sairon merged 2 commits into
devfrom
build-check-release-channel
Jun 15, 2026
Merged

sairon merged 2 commits into
devfrom
build-check-release-channel

Conversation

@sairon

@sairon sairon commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

There's currently nothing preventing us from publishing RC build to the stable channel if the GH release is configured incorrectly. Since we have the meta file which dictates where the deployment should go, use this as a sanity check and reject the workflow if the expected configuration doesn't match.

Summary by CodeRabbit

  • Chores
    • Enhanced the build workflow with channel-aware pre-publish validation, ensuring deployment settings and version formats match the intended release channel. The process now stops the publish with clear error messages when configuration or version patterns are incorrect, improving release safety.

There's currently nothing preventing us from publishing RC build to the
stable channel if the GH release is configured incorrectly. Since we
have the meta file which dictates where the deployment should go, use
this as a sanity check and reject the workflow if the expected
configuration doesn't match.
@sairon
sairon requested a review from agners June 15, 2026 08:52
@sairon sairon added the build Build and CI related issues label Jun 15, 2026
@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6c41e8a5-0ffb-40a1-93b0-e8eebf19a41a

📥 Commits

Reviewing files that changed from the base of the PR and between 3026bb8 and 436820b.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml

📝 Walkthrough

Walkthrough

Adds a new validation step in the prepare job of .github/workflows/build.yaml. The step runs only when publish_build is true, reads DEPLOYMENT and VERSION_FULL from buildroot-external/meta, maps the GitHub-computed channel (dev/beta/stable) to expected DEPLOYMENT values (development/staging/production), validates VERSION_FULL against per-channel regex patterns, and fails the workflow with ::error:: annotations if DEPLOYMENT is unknown, mismatched, or if the version format does not match the channel-specific pattern.

Changes

Publish pre-flight validation

Layer / File(s) Summary
Deployment-to-channel validation and version format check
.github/workflows/build.yaml
Inserts a conditional shell step that reads DEPLOYMENT and VERSION_FULL from buildroot-external/meta, maps them to an expected release channel, and aborts with ::error:: workflow annotations if DEPLOYMENT is unknown, does not match the GitHub-computed channel output, or if VERSION_FULL does not conform to the channel-specific version format regex.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 Hippity-hop, the channels align,
A mismatch in deployment? That's a sign!
development maps dev, staging goes beta,
production means stable — the version's correcta.
The rabbit checks twice before the build takes flight,
No wrong channel slips through on my watch tonight! 🌙

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change—adding sanity checks for the release channel to the build workflow, which aligns with the changeset that adds deployment channel validation logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch build-check-release-channel

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 and usage tips.

@agners agners 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.

Nice! Yeah checking the deployment makes sense!

That said, I think while at it I'd also check the versioning. Maybe we can keep it simple and only do that on stable (check that it's a simple major.minor version).

@sairon

sairon commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

That said, I think while at it I'd also check the versioning. Maybe we can keep it simple and only do that on stable (check that it's a simple major.minor version).

We already do that:

- name: Validate version
id: version_check
if: ${{ github.event_name == 'release' }}
run: |
if [ "${{ steps.version.outputs.version_full }}" != "${{ github.event.release.tag_name }}" ]; then
echo "Version number in Buildroot metadata does not match tag (${{ steps.version.outputs.version_full }} vs ${{ github.event.release.tag_name }})."
exit 1
fi

@agners

agners commented Jun 15, 2026

Copy link
Copy Markdown
Member

That said, I think while at it I'd also check the versioning. Maybe we can keep it simple and only do that on stable (check that it's a simple major.minor version).

We already do that:

Right, that checks tag against metadata, and certainly make sense!

But it doesn't prevent a stable release with rc or dev in it's name 😅 . Checking DEPLOYMENT in the same file doesn't necessarily mean the version was correctly set. We could set a second variable, based on DEPLOYMENT, version_re=

Maybe reverse the whole logic, so it becomes "channel mandates certain meta rules" (make the case be about channel).

@agners agners 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.

LGTM!

@sairon
sairon merged commit b4977ed into dev Jun 15, 2026
1 check passed
@sairon
sairon deleted the build-check-release-channel branch June 15, 2026 13:28
@sairon sairon mentioned this pull request Jun 18, 2026
pull Bot pushed a commit to josbu/operating-system that referenced this pull request Jun 18, 2026
…ome-assistant#4771)

* Add sanity checks for correct release channel to the build workflow

There's currently nothing preventing us from publishing RC build to the
stable channel if the GH release is configured incorrectly. Since we
have the meta file which dictates where the deployment should go, use
this as a sanity check and reject the workflow if the expected
configuration doesn't match.

* Improve the check to validate version string as well

(cherry picked from commit b4977ed)
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

build Build and CI related issues cla-signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants