Skip to content

Commit 6d761d5

Browse files
committed
Prevent race dispatch image publishing
1 parent 2fa1bc9 commit 6d761d5

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
name: Docker Build & Push (amd64)
7575
needs: build
7676
runs-on: ubuntu-latest
77-
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.build_amd64)) }}
77+
if: ${{ github.ref == 'refs/heads/main' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.build_amd64 && !inputs.run_race)) }}
7878
permissions:
7979
contents: read
8080
packages: write
@@ -115,7 +115,7 @@ jobs:
115115
name: Docker Build & Push (arm64)
116116
needs: build
117117
runs-on: ubuntu-latest
118-
if: ${{ github.event_name == 'workflow_dispatch' && inputs.build_arm64 }}
118+
if: ${{ github.event_name == 'workflow_dispatch' && inputs.build_arm64 && !inputs.run_race }}
119119
permissions:
120120
contents: read
121121
packages: write

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ DB-backed integration tests skip when no Postgres connection is configured. To r
2929

3030
The default required-looking CI job is `Build, Vet & Test`. Keep that job name stable unless repository branch protection is updated at the same time.
3131

32-
Default PR and push CI uses `CGO_ENABLED=0` for build, vet, and tests, matching the production binary. Race detector tests are available as a manual GitHub Actions run: start the `CI` workflow with `run_race=true`. Use this before merging changes that touch tenant management, scheduler goroutines, async AI generation, recompute coordination, Telegram webhook dispatch, or notification loops.
32+
Default PR and push CI uses `CGO_ENABLED=0` for build, vet, and tests, matching the production binary. Race detector tests are available as a manual GitHub Actions run: start the `CI` workflow with `run_race=true`. Race-only dispatches do not publish Docker images, even when the image build inputs are left at their defaults. Use this before merging changes that touch tenant management, scheduler goroutines, async AI generation, recompute coordination, Telegram webhook dispatch, or notification loops.
3333

3434
For local checks on a machine with a CGO toolchain:
3535

docs/ai-plans/2026-06-06-issue-152-ci-race-detector-branch-protection-policy.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ <h2>Implementation Result</h2>
133133
<li>Kept the default <code>Build, Vet &amp; Test</code> job name stable.</li>
134134
<li>Added a manual-only <code>Race Detector</code> job behind <code>workflow_dispatch</code> input <code>run_race=true</code>.</li>
135135
<li>Race detector job runs <code>CGO_ENABLED=1 go test -race ./...</code> and is not required on normal PR or push runs.</li>
136+
<li>Guarded Docker publish jobs so race-only dispatches do not push images when <code>run_race=true</code>.</li>
136137
<li>Documented local and CI race-detector guidance in <code>CONTRIBUTING.md</code>.</li>
137138
<li>Recorded current branch protection state: GitHub API returned <code>Branch not protected</code> for <code>main</code> on 2026-06-06.</li>
138139
</ul>
@@ -144,6 +145,7 @@ <h2>Verification Run</h2>
144145
<li><code>go test ./...</code></li>
145146
<li><code>go vet ./...</code></li>
146147
<li><code>CGO_ENABLED=1 go test -race ./...</code> on Windows was blocked before tests by missing <code>gcc</code> in <code>PATH</code>; the manual GitHub Actions job is the Ubuntu validation path.</li>
148+
<li>Manual GitHub Actions run <code>27062004434</code> passed with <code>run_race=true</code>, including the <code>Race Detector</code> job on Ubuntu.</li>
147149
<li><code>gh api repos/Dzarlax-AI/health_dashboard/branches/main/protection</code> returned <code>404 Branch not protected</code>.</li>
148150
</ul>
149151
</section>

0 commit comments

Comments
 (0)