Skip to content

Commit caa7208

Browse files
committed
Merge main into dev: refresh the committed spec to 1.5.3 from core, not by hand
main and dev diverged: main was 3 commits ahead (the v0.2.3 openapi.json refresh to busbar 1.5.3, defining admin-tokens under identity-providers as 1.5.3 requires, and a release fix so a partial build cannot publish a release missing platforms), dev 5. Releases are cut from main, so nothing shipped was at risk. The hazard was the next dev -> main pull request silently reverting main's fixes. One conflict, openapi.json, seventeen hunks. Not hand-merged. This file is a committed COPY of core's admin spec, which ci.yml checks against crates/busbar/src/admin/v1/json/openapi.json in the paired core checkout, so the resolution is to take it from the generator rather than to reconcile hunks. main's copy is v1.5.3 and compares structurally identical to that file in busbar 1.5.3 (c8780349cf66d09b891478d50766b89dc1ff224c); dev's was still v1.5.2. Took main's, then re-verified the committed result against the core 1.5.3 spec directly. scripts/integration.sh merged without conflict and is worth naming, because the result is dev's and that is the right outcome: dev's version probes the engine for which admin-auth grammar it accepts instead of assuming one, carrying main's 1.5.3 identity-providers form verbatim as the modern branch and falling back to the legacy inline form only on the exact "unknown field identity-providers" rejection. dev's CI runs this against a released engine as well as the paired one, which main's single-grammar version could not survive. main's fix is preserved, not dropped. Confirmed after resolving that release.yml, Cargo.toml, Cargo.lock and openapi.json all match main exactly. Gate: cargo fmt --all --check, cargo clippy --all-targets -D warnings and cargo check --tests all pass. The integration script itself needs a real gateway and was not executed here. Noted, not changed, as it is main's pre-existing state and outside this merge: README.md still describes the committed contract as busbar 1.5.2 in two places, though openapi.json is now 1.5.3 on both main and here.
2 parents aab28ad + 01f958c commit caa7208

5 files changed

Lines changed: 235 additions & 166 deletions

File tree

.github/workflows/release.yml

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
name: Release
22

3-
# Builds release binaries for macOS + Linux on a v* tag and uploads them to the
4-
# GitHub release. NOTE: untested without a real tag push — treat as a starting point.
3+
# Builds release binaries for macOS + Linux on a v* tag and uploads them to the GitHub release.
4+
#
5+
# The Release is created as a DRAFT and is promoted to published-and-latest only after the build
6+
# matrix has finished AND the expected number of assets is provably attached. This is the same
7+
# shape every first-party plugin repo uses, and it is here for the same reason: this workflow used
8+
# to have each matrix leg independently create-or-update a PUBLISHED release via
9+
# softprops/action-gh-release, so a leg that failed after a sibling had already uploaded left a
10+
# published release carrying fewer assets than it should, with `latest` pointing at it. A user
11+
# on the missing platform gets a 404 from a release that looks complete. Nothing in the old
12+
# workflow could detect that: every gate it had was about whether the build compiled.
13+
#
14+
# A draft is invisible to users and to `releases/latest`, so the failure mode is now "the release
15+
# does not appear" rather than "the release appears and is wrong".
516

617
on:
718
push:
@@ -10,9 +21,38 @@ on:
1021
permissions:
1122
contents: write
1223

24+
env:
25+
# Every target in the build matrix must land an asset before the release is promoted. Keep this
26+
# in step with the matrix below; the gate compares against it rather than against "more than
27+
# zero", so a silent drop from three platforms to one fails too.
28+
EXPECTED_ASSETS: "3"
29+
1330
jobs:
31+
# Created first so the parallel matrix legs have something to attach to (uploading from a matrix
32+
# with no pre-existing release races and fails with "release not found"). Draft from the start:
33+
# the promotion below is the only thing that ever publishes it.
34+
create-release:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- name: Create draft Release
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: |
42+
gh release create "${GITHUB_REF_NAME}" \
43+
--repo "${GITHUB_REPOSITORY}" \
44+
--title "${GITHUB_REF_NAME}" \
45+
--draft \
46+
--verify-tag --generate-notes \
47+
|| gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}"
48+
1449
build:
50+
needs: create-release
1551
strategy:
52+
# Let every leg run and report. With fail-fast the first failure cancels its siblings, which
53+
# hides how many platforms are actually broken; the draft gate below is what keeps a partial
54+
# result from reaching users, so there is nothing to protect by stopping early.
55+
fail-fast: false
1656
matrix:
1757
include:
1858
- target: x86_64-unknown-linux-gnu
@@ -34,6 +74,32 @@ jobs:
3474
tar -C target/${{ matrix.target }}/release -czf \
3575
busbar-admin-${{ github.ref_name }}-${{ matrix.target }}.tar.gz busbar-admin
3676
- name: upload
37-
uses: softprops/action-gh-release@v2
38-
with:
39-
files: busbar-admin-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
run: |
80+
gh release upload "${GITHUB_REF_NAME}" \
81+
"busbar-admin-${GITHUB_REF_NAME}-${{ matrix.target }}.tar.gz" \
82+
--repo "${GITHUB_REPOSITORY}" --clobber
83+
84+
# The only step that ever publishes. `needs: build` means a total build failure never reaches it
85+
# at all and the release stays an invisible draft; a partial failure reaches it and is refused
86+
# here on the count.
87+
verify-assets:
88+
needs: build
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: Require the full asset set, then promote
92+
env:
93+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
run: |
95+
set -euo pipefail
96+
count="$(gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" \
97+
--json assets --jq '.assets | length')"
98+
echo "attached assets: ${count} (expected ${EXPECTED_ASSETS})"
99+
gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" \
100+
--json assets --jq '.assets[].name'
101+
if [ "${count}" -ne "${EXPECTED_ASSETS}" ]; then
102+
echo "::error::PARTIAL RELEASE PREVENTED: ${GITHUB_REF_NAME} has ${count} assets, expected ${EXPECTED_ASSETS}. Leaving it as a DRAFT so no user can download an incomplete release." >&2
103+
exit 1
104+
fi
105+
gh release edit "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" --draft=false --latest

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "busbar-admin"
3-
version = "0.2.1"
3+
version = "0.2.3"
44
edition = "2021"
55
license = "Apache-2.0"
66
description = "A human-facing CLI for the busbar gateway's admin API (/api/v1/admin)."

0 commit comments

Comments
 (0)