Skip to content

feat(ci): add an empty-diff reusable that fails a no-op pull request - #111

Merged
Jaro-c merged 1 commit into
mainfrom
feat/empty-diff-reusable
Aug 11, 2026
Merged

feat(ci): add an empty-diff reusable that fails a no-op pull request#111
Jaro-c merged 1 commit into
mainfrom
feat/empty-diff-reusable

Conversation

@Jaro-c

@Jaro-c Jaro-c commented Aug 11, 2026

Copy link
Copy Markdown
Member

Eight no-op PRs landed on Glyndor/homebrew-tap and Glyndor/scoop-bucket before any gate existed: the work was already in main via squash-merge, the branch was recreated as -v2, and the second merge landed as a commit with zero files changed. CI is happy with that — a commit with no diff is valid git and a green GitHub Actions run, and only git show --stat flags it.

I am adding a reusable in .github/workflows/empty-diff.yml that fails a pull request whose diff against its base ref is empty. The reusable detects the base ref from the pull_request event payload and needs fetch-depth: 0 on the checkout to see the base.

This PR lands as advisory only. A required status check whose emitted name does not match blocks every pull request of the consumer, which is the phantom-check failure mode that bit apt and klyradb before. The reusable should be added as a thin caller in each of the four repositories that opened the no-op PRs, watched for a few weeks of green, and only then promoted to required in each repository's ruleset.

Generated docs/reusables/empty-diff.md is committed alongside the workflow so docs-current stays green; the page is regenerated, not written, by scripts/render-reusable-docs.py.

Eight no-op PRs landed on Glyndor/homebrew-tap and Glyndor/scoop-bucket
before this gate existed: the work was already in main via squash-merge,
the branch was recreated as -v2, and the second merge landed as a commit
with zero files changed. CI is happy with that — a commit with no diff is
valid git and a green GitHub Actions run, and only git show --stat flags it.

The new reusable fails a pull request whose diff against its base ref is
empty. It detects the base ref from the pull_request event payload, and
needs fetch-depth: 0 on the checkout to see the base.

This lands as advisory only. A required status check whose emitted name
does not match blocks every pull request of the consumer, which is the
phantom-check failure mode that bit apt and klyradb before. The reusable
should be added as a thin caller in each of the four repositories that
opened the no-op PRs, watched for a few weeks of green, and only then
promoted to required in each repository's ruleset.

Generated docs/reusables/empty-diff.md is committed alongside the workflow
so docs-current stays green; the page is regenerated, not written, by
scripts/render-reusable-docs.py.

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
@Jaro-c Jaro-c added type:feature New feature or capability type:ci CI/CD and automation prio:P1 High priority effort:S Small area:ci labels Aug 11, 2026
@Jaro-c
Jaro-c merged commit 7eb2c69 into main Aug 11, 2026
6 checks passed
@Jaro-c
Jaro-c deleted the feat/empty-diff-reusable branch August 11, 2026 10:15
Jaro-c added a commit to Glyndor/apt that referenced this pull request Aug 11, 2026
Pin to the SHA of the merge commit (7eb2c69), before any vX.Y.Z tag of
.Glyndor/.github exists, so this consumer is the one that proves the
reusable. The check is advisory only for now: it runs on every pull
request and emits a red status if the diff against main is empty, but
the ruleset does not require it. Once the emitted name has stayed stable
across a few weeks of green here and on the other three consumers
(homebrew-tap, scoop-bucket, .github itself), I will promote it to a
required status check in each repository's ruleset.

The reusable itself was added in Glyndor/.github#111; the phantom-check
failure mode that bit apt and klyradb before is the reason this lands
advisory first rather than required.

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
Jaro-c added a commit to Glyndor/apt that referenced this pull request Aug 11, 2026
Pin to the SHA of the merge commit (7eb2c69), before any vX.Y.Z tag of
Glyndor/.github exists, so this consumer is the one that proves the
reusable. The check is advisory only for now: it runs on every pull
request and emits a red status if the diff against main is empty, but
the ruleset does not require it. Once the emitted name has stayed stable
across a few weeks of green here and on the other three consumers
(homebrew-tap, scoop-bucket, .github itself), I will promote it to a
required status check in each repository's ruleset.

The reusable itself was added in Glyndor/.github#111; the phantom-check
failure mode that bit apt and klyradb before is the reason this lands
advisory first rather than required.

Closes #88

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
Jaro-c added a commit to Glyndor/homebrew-tap that referenced this pull request Aug 11, 2026
Pinned to the SHA that is the v1.14.0 tag of Glyndor/.github. The check
is advisory only: it runs on every pull request and emits a red status
if the diff against main is empty, but the ruleset does not require it.

This tap is where the bug first showed up — eight no-op PRs landed here
before any gate existed. The reusable was added in Glyndor/.github#111
and proven on Glyndor/apt#89 (pinned at the same SHA, ran green) before
the tag was cut. Once the emitted check name has stayed stable across a
few weeks of green here, I will promote it to a required status check in
the ruleset. The phantom-check failure mode that bit apt and klyradb
before is the reason the promotion should be deliberate, not done at
first merge.

Closes #53

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
Jaro-c added a commit to Glyndor/scoop-bucket that referenced this pull request Aug 11, 2026
Pinned to the SHA that is the v1.14.0 tag of Glyndor/.github. The check
is advisory only: it runs on every pull request and emits a red status
if the diff against main is empty, but the ruleset does not require it.

The sibling tap (Glyndor/homebrew-tap) is where eight no-op PRs landed
before any gate existed. The same shape lives here, so the same gate
applies. The reusable was added in Glyndor/.github#111 and proven on
Glyndor/apt#89 (pinned at the same SHA, ran green) before the tag was
cut. Once the emitted check name has stayed stable across a few weeks of
green here, I will promote it to a required status check in the ruleset.
The phantom-check failure mode that bit apt and klyradb before is the
reason the promotion should be deliberate, not done at first merge.

Closes #45

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
Jaro-c added a commit that referenced this pull request Aug 11, 2026
Pinned to the SHA that is the v1.14.0 tag of this repository. The check
is advisory only: it runs on every pull request and emits a red status
if the diff against main is empty, but the ruleset does not require it.

This repository is the fourth and final consumer to adopt the gate that
catches no-op PRs — the same shape that bit Glyndor/homebrew-tap and
Glyndor/scoop-bucket before the reusable existed in #111. Proven on
Glyndor/apt#89, Glyndor/homebrew-tap#54 and Glyndor/scoop-bucket#46
(pinned at the same SHA, ran green) before the v1.14.0 tag was cut. Once
the emitted check name has stayed stable across a few weeks of green
here and across the other consumers, I will promote it to a required
status check in each repository's ruleset.

Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci effort:S Small prio:P1 High priority type:ci CI/CD and automation type:feature New feature or capability

Development

Successfully merging this pull request may close these issues.

1 participant