Skip to content

fix(ci): run the suite before tagging a release - #162

Merged
mogita merged 2 commits into
mainfrom
fix/release-gate-on-tests
Sep 15, 2026
Merged

mogita merged 2 commits into
mainfrom
fix/release-gate-on-tests

Conversation

@mogita

@mogita mogita commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Ticket

CHA-2963

Problem

The release job tags, creates the GitHub Release and publishes on every push to main with no test gate in front of it, so a red suite still ships a tag. For Go that is permanent: proxy.golang.org caches a tag forever.

Its pending-release lookup also reads one page of closed PRs and filters the label client-side, then takes .[0]. A release that has slipped past that page reads as "nothing to release", and the job exits 0 without tagging.

Solution

  • run_tests.yml: the test-and-build matrix, moved out of ci.yml unchanged (the job body is byte-identical) and exposed as workflow_call.
  • ci.yml: calls it on pull_request. The push: main trigger is dropped, because otherwise a release push would run the integration leg twice at once against the shared d2sj6pudbhz7 app, which is what made php and net flake.
  • release.yml: detect finds the pending release and verifies the go.mod major, tests runs the suite, release tags only after both. The label query now filters server-side and by base branch, matching the other five SDKs.

Workflow-level permissions drops to contents: read, with per-job grants.

How to verify

  1. This PR's own checks: the six matrix legs report as ci / 👷 Test & Build … and are the same six that ran before.
  2. On the next release, Release runs Detect pending releaseTests🚀 Tag and release. A failing suite leaves the tag uncreated.
  3. On a normal push, detect prints "No pending release" and only Release PR runs.

Review instructions

Run the branch-protection PATCH before merging, not after. A reusable-workflow call reports as <caller job id> / <called job name>, and the six required contexts are currently the bare names, so this PR's own checks already report under the new names and its mergeable_state is blocked until the contexts move. Sending checks rather than contexts[] keeps the app_id: 15368 pinning the branch has today:

gh api -X PATCH repos/GetStream/getstream-go/branches/main/protection/required_status_checks \
  --input - <<'JSON'
{
  "strict": true,
  "checks": [
    {"context": "ci / 👷 Test & Build 1.19 & Integration", "app_id": 15368},
    {"context": "ci / 👷 Test & Build 1.20", "app_id": 15368},
    {"context": "ci / 👷 Test & Build 1.21", "app_id": 15368},
    {"context": "ci / 👷 Test & Build 1.22", "app_id": 15368},
    {"context": "ci / 👷 Test & Build 1.23", "app_id": 15368},
    {"context": "ci / 👷 Test & Build 1.24", "app_id": 15368},
    {"context": "👮 Conventional PR title", "app_id": 15368}
  ]
}
JSON

Every other open PR here stalls until it is rebased. #161, #127, #126, #105, #104, #73, #68 and #59 all run the old ci.yml on their heads, so they report the bare names and block on the new ones. strict=true already requires those rebases, but this turns a per-PR rebase into a fleet-wide one.

One trade-off worth knowing: with push: main gone, Codecov stops getting a report on every main commit and gets one per release commit instead. PR coverage still uploads on every run.

The release job tagged, released and published on every push to main with no test gate in front of it, and its pending-release lookup filtered the label client-side over one page of closed PRs, so a release past that page read as nothing to release and passed silently.

Splits the matrix into a reusable run_tests.yml that both ci.yml and the release flow call, and brings release.yml to the detect/tests/release shape the other five SDKs use.
@mogita
mogita requested a review from tbarbugli as a code owner September 15, 2026 14:42
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 14:42 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 14:42 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 14:42 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 14:42 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 14:42 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 14:42 — with GitHub Actions Active

@mogita mogita left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Two substantial findings, inline.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/ci.yml
The workflow concurrency group already covers it: a push during a release run goes pending rather than running, and starts only once the tag exists and the label has flipped, so its own detect reports no pending release and release-pr runs.
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 15:23 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 15:23 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 15:23 — with GitHub Actions Active
@mogita
mogita had a problem deploying to feeds-enabled-shard September 15, 2026 15:23 — with GitHub Actions Failure
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 15:23 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 15:23 — with GitHub Actions Active
@mogita
mogita deployed to feeds-enabled-shard September 15, 2026 15:29 — with GitHub Actions Active
@mogita
mogita merged commit 3594ac9 into main Sep 15, 2026
18 of 19 checks passed
@mogita
mogita deleted the fix/release-gate-on-tests branch September 15, 2026 17:09

This branch was successfully deployed

1 active deployment
feeds-enabled-shard fbaf2f00 Deployed Sep 15, 2026 by mogita via ci / 👷 Test & Build 1.19 & Integration #535
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