Skip to content

Commit 9ea07e4

Browse files
committed
fix(ci): gate e2e/release-smoke per-job so docs-only PRs are mergeable
The `kamaji-datastore`, `smoke (helm)` and `smoke (manifest)` contexts are required by branch protection, but their workflows filtered themselves out at the `on:` trigger via path filters. A workflow skipped at the trigger never reports its check, so the required contexts stayed in "Expected" and blocked any PR that touched none of the filtered paths (docs-only PRs in particular). enforce_admins is on, so there was no admin bypass either. Move the path filtering off the trigger and into a cheap `changes` job (dorny/paths-filter, no checkout): the workflows now always start, and the expensive jobs are skipped via a job-level `if:` when nothing relevant changed. A job skipped via `if:` still reports its check as "skipped", which branch protection treats as passing — so docs-only PRs are mergeable while the ~30-45 min e2e and the kind smokes still skip (zero compute) on them. The smoke matrix is kept intact so the required context names are unchanged. Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
1 parent 7d20b1a commit 9ea07e4

2 files changed

Lines changed: 70 additions & 17 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ on:
66
# a branch PRs never target (this said `master`, which does not exist) means
77
# the workflow never runs at all.
88
#
9-
# paths-ignore: a kind+cert-manager+Kamaji provisioning run costs ~30-45
10-
# minutes; skip it for PRs that touch nothing the suite exercises
11-
# (docs-only changes). Everything else — Go code, manifests, the harness,
12-
# the workflows themselves — still gates.
9+
# No paths filter on the trigger either: `kamaji-datastore` is a *required*
10+
# status check, and a workflow skipped at the trigger never reports its
11+
# check, leaving the required context stuck in "Expected" — which blocks the
12+
# PR forever (e.g. docs-only PRs). Path filtering instead lives in the
13+
# `changes` job below; a job skipped via `if:` still reports its check as
14+
# "skipped", which branch protection treats as passing.
1315
pull_request:
14-
paths-ignore:
15-
- '**.md'
16-
- 'docs/**'
1716
push:
1817
tags: [ "v*" ]
1918
workflow_dispatch:
@@ -23,7 +22,34 @@ concurrency:
2322
cancel-in-progress: true
2423

2524
jobs:
25+
changes:
26+
# Cheap (~seconds, no checkout — dorny uses the PR API) gate that decides
27+
# whether the expensive job below needs to run. PR-only: tag pushes and
28+
# manual dispatch always run the suite unconditionally (see the `if` on
29+
# kamaji-datastore).
30+
if: github.event_name == 'pull_request'
31+
runs-on: ubuntu-latest
32+
outputs:
33+
code: ${{ steps.filter.outputs.code }}
34+
steps:
35+
- uses: dorny/paths-filter@v3
36+
id: filter
37+
with:
38+
# `code` is true when the PR touches anything the e2e suite
39+
# exercises. Only-negated patterns get an implicit `**`, so this
40+
# reads as "all files except Markdown and docs/**" — i.e. docs-only
41+
# PRs leave `code` false and the ~30-45 min run below is skipped.
42+
filters: |
43+
code:
44+
- '!**/*.md'
45+
- '!docs/**'
46+
2647
kamaji-datastore:
48+
needs: changes
49+
# Always run for tag pushes / manual dispatch; for PRs, run only when
50+
# non-docs files changed. When skipped on a docs-only PR the check still
51+
# reports (as "skipped" = passing), so the PR is not blocked.
52+
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.code == 'true' }}
2753
runs-on: ubuntu-latest
2854
timeout-minutes: 45
2955
steps:

.github/workflows/release-smoke.yml

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,52 @@ name: Release install smoke
1010
# introduces them, not on the first real tag. The image is loaded into kind,
1111
# never pushed — no registry credentials.
1212
on:
13+
# No paths filter on the trigger: `smoke (helm)` and `smoke (manifest)` are
14+
# *required* status checks, and a workflow skipped at the trigger never
15+
# reports them, leaving the required contexts stuck in "Expected" and
16+
# blocking the PR forever (e.g. docs-only PRs). Path filtering lives in the
17+
# `changes` job below instead; the matrix job is skipped via `if:` when
18+
# nothing release-relevant changed, and a skipped check counts as passing.
1319
pull_request:
14-
paths:
15-
- '.github/workflows/release-smoke.yml'
16-
- '.github/workflows/docker-publish.yml'
17-
- '.github/workflows/release-assets.yml'
18-
- '.github/workflows/helm-publish.yml'
19-
- 'hack/release-smoke.sh'
20-
- 'charts/**'
21-
- 'Makefile'
22-
- 'Dockerfile'
23-
- 'api/**'
2420
workflow_dispatch:
2521

2622
concurrency:
2723
group: release-smoke-${{ github.ref }}
2824
cancel-in-progress: true
2925

3026
jobs:
27+
changes:
28+
# Cheap (~seconds, no checkout) gate. PR-only: manual dispatch always runs
29+
# the smoke matrix unconditionally (see the `if` on smoke).
30+
if: github.event_name == 'pull_request'
31+
runs-on: ubuntu-latest
32+
outputs:
33+
release: ${{ steps.filter.outputs.release }}
34+
steps:
35+
- uses: dorny/paths-filter@v3
36+
id: filter
37+
with:
38+
# True when the PR touches the tag-release machinery or anything it
39+
# ships. Matches the paths this workflow used to filter on at the
40+
# trigger; PRs that touch none of these skip the two kind smokes.
41+
filters: |
42+
release:
43+
- '.github/workflows/release-smoke.yml'
44+
- '.github/workflows/docker-publish.yml'
45+
- '.github/workflows/release-assets.yml'
46+
- '.github/workflows/helm-publish.yml'
47+
- 'hack/release-smoke.sh'
48+
- 'charts/**'
49+
- 'Makefile'
50+
- 'Dockerfile'
51+
- 'api/**'
52+
3153
smoke:
54+
needs: changes
55+
# Always run on manual dispatch; for PRs, run only when release-relevant
56+
# files changed. When skipped, each matrix leg's required check still
57+
# reports as "skipped" (= passing), so the PR is not blocked.
58+
if: ${{ github.event_name != 'pull_request' || needs.changes.outputs.release == 'true' }}
3259
runs-on: ubuntu-latest
3360
timeout-minutes: 30
3461
permissions:

0 commit comments

Comments
 (0)