Skip to content

Stop running the documentation workflow twice per push - #508

Merged
chrismattmann merged 1 commit into
masterfrom
stop-running-the-docs-workflow-twice
Nov 10, 2026
Merged

chrismattmann merged 1 commit into
masterfrom
stop-running-the-docs-workflow-twice

Conversation

@chrismattmann

Copy link
Copy Markdown
Owner

The Documentation badge reads failing after almost every merge to master, and the docs are fine.

Two runs start on every push and fight over the same concurrency group:

CI             push  success    2026-11-09T22:00:27Z
Documentation  push  cancelled  2026-11-09T22:00:27Z
Documentation  push  cancelled  2026-11-09T21:59:51Z
CI             push  success    2026-11-09T21:59:51Z

Identical timestamps. ci.yml had a docs: job calling documentation.yml via workflow_call, and documentation.yml triggers on push to master itself. Both hold concurrency: group: "pages", so one gets cancelled — and GitHub renders a cancelled run as a failing badge, on exactly the workflow the README badge points at.

It wasn't only cosmetic

Under workflow_call from a push, github.event_name is still 'push' — so the deploy job's if was true in the called run as well. Both runs were deploying the same commit to GitHub Pages, and only the concurrency group stopped them doing it simultaneously.

The change

  • ci.yml no longer calls it. That job's real value was building docs on pull requests, so documentation.yml now takes pull_request directly. Deployment stays gated on a push to master, so a PR builds the docs without publishing them. One run per event.
  • The concurrency group moves from the workflow to the deploy job. At workflow level it could cancel a queued build, which is how two merges 36 seconds apart produced a red badge over documentation that had built perfectly. Deployments still serialise — which is what Pages requires — and an in-progress deployment still finishes.

Before changing job names

master has no branch protection and no required status checks, so dropping docs / Build documentation with Sphinx from the CI run breaks no gate. The same check now arrives from the Documentation workflow instead.

Residual case

Three or more pushes to master inside a single deploy still leaves a superseded deployment cancelled. That outcome is correct — skipping a docs deploy for a commit that's already two commits stale is what you want — it just means the badge can still go red in that narrow case. Worth knowing rather than discovering again.

This PR exercises the change: documentation.yml should appear once on it, building but not deploying.

The Documentation badge reads failing after almost every merge to master, and
the docs are fine. Two runs start on every push and compete for the same
concurrency group:

  CI             push  success    2026-11-09T22:00:27Z
  Documentation  push  cancelled  2026-11-09T22:00:27Z
  Documentation  push  cancelled  2026-11-09T21:59:51Z
  CI             push  success    2026-11-09T21:59:51Z

Same timestamps. ci.yml had a `docs` job calling documentation.yml via
workflow_call, and documentation.yml also triggers on push to master. Both
hold `concurrency: group: "pages"`, so one is cancelled -- and GitHub renders
a cancelled run as a failing badge, on the workflow the README badge points
at.

It is worse than a cosmetic problem. Under workflow_call from a push,
github.event_name is still 'push', so the deploy job's `if` was true in the
called run as well: both runs were deploying the same commit to Pages, and
only the concurrency group kept them from doing it at once.

So ci.yml no longer calls it, and documentation.yml takes `pull_request`
instead -- which is what the ci.yml job was really providing, a docs build on
pull requests. Deployment is still gated on a push to master, so a pull
request builds the docs without publishing them. One run per event now.

The concurrency group moves from the workflow to the deploy job. At workflow
level it could cancel a queued *build*, which is how an ordinary pair of
merges 36 seconds apart produced a failing badge over documentation that had
built perfectly well. Deployments still serialise, which is what Pages needs,
and an in-progress deployment is still allowed to finish.

Checked before changing the job names: master has no branch protection and no
required status checks, so dropping `docs / Build documentation with Sphinx`
from the CI run breaks no gate. The same check now arrives from the
Documentation workflow.

Residual case, much narrower: three or more pushes to master inside a single
deploy still leaves a superseded deployment cancelled. Skipping the docs
deployment for a commit that is already two commits stale is the right
outcome; it just means the badge can still go red in that case.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 70.13%. remained the same — stop-running-the-docs-workflow-twice into master

@chrismattmann chrismattmann self-assigned this Nov 10, 2026
@chrismattmann chrismattmann added this to the tika-next milestone Nov 10, 2026
@chrismattmann
chrismattmann merged commit 4ca0ee5 into master Nov 10, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants