Skip to content

BB-915: Release from the epic with no GitHub release - #2897

Closed
anurag4DSB wants to merge 1 commit into
epic/S3C-10971-bnaas-d1from
improvement/BB-915-epic-release-workflow
Closed

anurag4DSB wants to merge 1 commit into
epic/S3C-10971-bnaas-d1from
improvement/BB-915-epic-release-workflow

Conversation

@anurag4DSB

@anurag4DSB anurag4DSB commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Intent: why does this change exist?

The official release workflow does not run from an epic branch (cloudserverclient#31), so the D1 epic carries its own copy of it, and we release by running that copy from the epic. The copy differs from development only where the original creates a GitHub release. It is row 3.5 of the Tickets tab.

System impact: what's affected, including downstream?

Only .github/workflows/release.yaml on the backbeat epic. A run builds backbeat:, backbeat:-federation and the dashboards and policies as in development, and Federation pins the image it needs.

Preserved behavior: what explicitly stays the same?

Every other job and step stays as in development. Development keeps its own file, and the final merge drops this copy.

Intended change: what's different after this PR?

In the release job, the last step creates the git tag with the job token (gh api .../git/refs) instead of creating a GitHub release. A first check refuses a tag that is not X.Y.Z-bnaas.N, or that already exists, before any image is pushed, so neither a typo nor a rerun can overwrite a released image.

Verification: how do we know this worked, or how would we know if it didn't?

actionlint reports nothing new. After the merge and the version bump, one run from the epic with 9.6.0-bnaas.1 must push backbeat:9.6.0-bnaas.1-federation and create the tag, with no GitHub release.

run: |
if ! [[ "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+-bnaas\.[0-9]+$ ]]; then
echo "::error::$TAG is not an X.Y.Z-bnaas.N epic tag"
exit 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The check does not refuse a tag that already exists. Running 9.6.0-bnaas.1 twice overwrites the released backbeat:9.6.0-bnaas.1 and -federation images (and dashboards/policies) in build, and only then fails at tag creation. Also refuse an existing tag here, before any push.

Suggested change
exit 1
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.inputs.tag }}
run: |
if ! [[ "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+-bnaas\.[0-9]+$ ]]; then
echo "::error::$TAG is not an X.Y.Z-bnaas.N epic tag"
exit 1
fi
if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$TAG" > /dev/null 2>&1; then
echo "::error::tag $TAG already exists"
exit 1
fi

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.25%. Comparing base (5c48232) to head (6b158d4).

Additional details and impacted files

Impacted file tree graph
see 3 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 85.50% <ø> (ø)
Core Library 86.93% <ø> (+0.07%) ⬆️
Ingestion 83.38% <ø> (ø)
Lifecycle 86.17% <ø> (ø)
Oplog Populator 89.48% <ø> (ø)
Replication 68.67% <ø> (+0.02%) ⬆️
Bucket Scanner 89.37% <ø> (ø)
@@                     Coverage Diff                     @@
##           epic/S3C-10971-bnaas-d1    #2897      +/-   ##
===========================================================
+ Coverage                    81.21%   81.25%   +0.03%     
===========================================================
  Files                          209      209              
  Lines                        44236    44236              
===========================================================
+ Hits                         35928    35943      +15     
+ Misses                        8308     8293      -15     
Flag Coverage Δ
api:retry 14.59% <ø> (ø)
bucket-scanner 89.37% <ø> (ø)
ft_test:queuepopulator 18.11% <ø> (+0.72%) ⬆️
ingestion 20.57% <ø> (ø)
notification 1.90% <ø> (ø)
oplogPopulator 0.45% <ø> (ø)
replication 25.27% <ø> (ø)
unit 67.44% <ø> (ø)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The official release workflow does not run from an epic branch, so the
BNaaS D1 epic carries its own copy of it. The copy creates only the git
tag, with the job token, where the original creates a GitHub release. A
first check refuses a tag that is not X.Y.Z-bnaas.N, or that already
exists, before any image is pushed, so neither a typo nor a rerun can
overwrite a released image. Everything else stays as in development.

The copy exists only on the epic, and the final merge drops it.
@anurag4DSB
anurag4DSB force-pushed the improvement/BB-915-epic-release-workflow branch from 27e8b09 to 6b158d4 Compare October 22, 2026 16:40
fi
if gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$TAG" --silent 2>/dev/null; then
echo "::error::Tag $TAG already exists"
exit 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This check fails open: any gh api error (rate limit, 5xx, network) is read as "tag absent", so the build overwrites a released image. Treat only a 404 as absent and fail on any other error.

Suggested change
exit 1
if out=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/tags/$TAG" 2>&1); then
echo "::error::Tag $TAG already exists"
exit 1
elif ! grep -q 'HTTP 404' <<< "$out"; then
echo "::error::Cannot check tag $TAG: $out"
exit 1
fi

- name: Refuse a tag that is not an epic tag
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.inputs.tag }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing checks the dispatch ref. A ticket branch cut from the epic carries this file, so a run from it can publish a -bnaas.N image and tag from an unreviewed commit. Also refuse any ref other than the epic branch, e.g. [[ "$GITHUB_REF" == refs/heads/epic/*-bnaas-d1 ]] || { echo "::error::Release only from the epic branch"; exit 1; }.

@anurag4DSB

Copy link
Copy Markdown
Contributor Author

Closing: D1 will not release from the epic branches. Arsenal and cloudserverclient changes go through the development branches and ship in normal releases, and Federation pins the CI images of the epics by commit sha.

@anurag4DSB anurag4DSB closed this Oct 22, 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