ci.yml: narrow push to main, move the e2e gate onto the pull request #80

Closed
opened 2026-09-22 15:46:34 +01:00 by cruelacid · 1 comment
Owner

Part of #77. Blocked by branch protection being decided.

Why

Two problems, one fix.

The gate runs after the merge, not before. e2e and promote are both
if: github.ref == 'refs/heads/main'. The comment in ci.yml gives the
reasoning — "the two minutes of real Obsidian are spent on what is about to be
promoted." Under pull requests the merge is what is about to be promoted, so
the same reasoning moves the gate onto the PR. A failure then means "do not
merge" instead of "main is already broken and the deploy has been stopped
after the fact."

Every PR runs CI twice. push and pull_request both fire on the same sha
— confirmed on eight distinct shas in action_run. The repo has 317 push runs
against 15 pull_request runs.

What to do

on:
  push:
    branches: [main]     # was: every branch, which is why PRs double-ran
  pull_request:
  • e2e: run on pull_request and on main.
  • promote: stays main only. :stable must still move only after a green
    gate on the commit that is actually deployed.
  • Note the deliberate consequence: a branch with no PR gets no CI. Opening a
    PR becomes how you ask for it, and exploratory branches stop paying.

Cost, measured not guessed

e2e moves from once per push to main to once per PR. With 41 commits landing
in a single day, consolidating those into one PR is a reduction in
real-Obsidian runs, not an increase.

Keep the comment block explaining why on: is shaped this way — the current one
records that CI previously triggered on main only and therefore never ran,
and that history is worth keeping.

Part of #77. Blocked by branch protection being decided. ## Why Two problems, one fix. **The gate runs after the merge, not before.** `e2e` and `promote` are both `if: github.ref == 'refs/heads/main'`. The comment in `ci.yml` gives the reasoning — "the two minutes of real Obsidian are spent on what is about to be promoted." Under pull requests *the merge* is what is about to be promoted, so the same reasoning moves the gate onto the PR. A failure then means "do not merge" instead of "`main` is already broken and the deploy has been stopped after the fact." **Every PR runs CI twice.** `push` and `pull_request` both fire on the same sha — confirmed on eight distinct shas in `action_run`. The repo has 317 `push` runs against 15 `pull_request` runs. ## What to do ```yaml on: push: branches: [main] # was: every branch, which is why PRs double-ran pull_request: ``` - `e2e`: run on `pull_request` **and** on `main`. - `promote`: stays `main` only. `:stable` must still move only after a green gate on the commit that is actually deployed. - Note the deliberate consequence: **a branch with no PR gets no CI.** Opening a PR becomes how you ask for it, and exploratory branches stop paying. ## Cost, measured not guessed `e2e` moves from once per push to `main` to once per PR. With 41 commits landing in a single day, consolidating those into one PR is a **reduction** in real-Obsidian runs, not an increase. Keep the comment block explaining why `on:` is shaped this way — the current one records that CI previously triggered on `main` only and therefore never ran, and that history is worth keeping.
Author
Owner

Landed via PR #112, which was fast-forward merged as 796d617. It is the first pull request ever merged onto main here.

  • The branch push started no run, and the PR started pull_request run 482. The double run is gone.
  • On the PR, e2e ran against real Obsidian and passed. promote was skipped.
  • On main, run 489 passed build, e2e and promote. eu1.nectenda.com/api/health reports 796d617.
  • Status contexts for #79: CI / build (pull_request), CI / e2e (pull_request), Release note / release-note (pull_request).

One thing this did not cover: tag pushes run the workflows as they are at the tagged commit. Pushing seven release tags onto old history queued 14 runs, which were cancelled. A paths:-only push filter also fires on tags, and e2e.yml is fixed for that in the #84 branch.

Landed via PR #112, which was fast-forward merged as `796d617`. It is the first pull request ever merged onto `main` here. - The branch push started **no** run, and the PR started `pull_request` run 482. The double run is gone. - On the PR, `e2e` ran against real Obsidian and passed. `promote` was skipped. - On `main`, run 489 passed build, e2e and promote. `eu1.nectenda.com/api/health` reports `796d617`. - Status contexts for #79: `CI / build (pull_request)`, `CI / e2e (pull_request)`, `Release note / release-note (pull_request)`. One thing this did not cover: tag pushes run the workflows **as they are at the tagged commit**. Pushing seven release tags onto old history queued 14 runs, which were cancelled. A `paths:`-only push filter also fires on tags, and `e2e.yml` is fixed for that in the #84 branch.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Nectenda/nectenda#80
No description provided.