Skip to content

fix(ci): the docs gate re-evaluates when eligibility changes without a push - #1874

Merged
Ikalus1988 merged 1 commit into
mainfrom
fix/docs-gate-reevaluates
Sep 19, 2026
Merged

Ikalus1988 merged 1 commit into
mainfrom
fix/docs-gate-reevaluates

Conversation

@Ikalus1988

@Ikalus1988 Ikalus1988 commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

User description

Testing the channel on real PRs today exposed two ways a PR becomes — or stops being — eligible with no
new commit
, and the gate only listened for commits and labels.

edited — retargeting the base

#1801 was opened against a stale feature branch (agent/issue-1196-intake-背景-2026-08-212). A
pull_request/pull_request_target run evaluates the base branch's workflow file, so retargeting it
to main changed which definition the PR was even running. The gate did not look again until a human
re-applied the label — which is exactly what I had to do by hand today.

unlabeled — a refusal withdrawn

A maintainer removing needs-human-review (or lessons-only) is a decision that the PR may proceed.
Without this event the gate only ever saw the refusal, never its withdrawal, so "a person looked and
says it is fine" was indistinguishable from "nobody has looked".

Change

types: [opened, synchronize, ready_for_review, labeled, unlabeled, edited]

The test now asserts all three transitions instead of just labeled: the property is "the gate decides
on the current state of the PR"
, not "the gate runs when a label appears".

Verification

Today's two real runs are the baseline this extends — the same pull_request_target job that produced
Enable auto-merge success for #1842 and Docs-only: false for #1801. This PR only widens when it is
asked to decide.

  • Retargeted/reopened PRs are re-evaluated
  • Withdrawing a refusal label re-evaluates
  • Pinned by the trigger test

PR Type

Bug fix, tests


Description

  • Add unlabeled and edited events to docs gate workflow triggers

  • Update tests to assert all three eligibility transitions (labeled, unlabeled, edited)

  • Cover base-branch retargeting and refusal-label withdrawal cases


Diagram Walkthrough

flowchart LR
  A["PR opened / synchronized"] --> G["Gate evaluates"]
  B["Label added (labeled)"] --> G
  C["Label removed (unlabeled)"] --> G
  D["Base branch retargeted (edited)"] --> G
  G --> E{"Eligible?"}
  E -->|Yes| F["Auto-merge / proceed"]
  E -->|No| H["Hold / refuse"]
Loading

File Walkthrough

Relevant files
Bug fix
auto-merge-docs.yml
Extend docs gate triggers for unlabeled and edited events

.github/workflows/auto-merge-docs.yml

  • Added unlabeled and edited to pull_request_target trigger types
  • Documented why each new event is load-bearing (base retarget, refusal
    withdrawn)
+8/-1     
Tests
test_auto_merge_docs.py
Assert all three eligibility transition events in gate test

tests/test_auto_merge_docs.py

  • Replaced single labeled assertion with a loop over labeled, unlabeled,
    edited
  • Each failure message explains the real-world case the event covers
+7/-4     

…a push

Testing the channel on real PRs today exposed two ways a PR becomes (or stops being) eligible with no
new commit, and the gate only listened for commits and labels:

* **`edited`** — retargeting the base branch. #1801 was opened against a stale feature branch
  (`agent/issue-1196-…`), and a `pull_request`/`pull_request_target` run evaluates the *base* branch's
  workflow file, so retargeting it to `main` changed which definition the PR ran. The gate would not
  look again until a human re-applied the label by hand — which is what I had to do.
* **`unlabeled`** — a maintainer removing `needs-human-review` (or `lessons-only`) is a decision that
  the PR may proceed. Without this event the gate only ever saw the refusal, never its withdrawal, so
  "a person has looked and says it is fine" was indistinguishable from "nobody has looked".

Both are one line in `types:`, and the test now asserts all three (added, removed, retargeted) rather
than just `labeled` — the property is "the gate decides on the current state of the PR", not "the gate
runs when a label appears".

Signed-off-by: Ikalus1988 <136884451+Ikalus1988@users.noreply.github.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
misakanet-web ee8fdfd Commit Preview URL

Branch Preview URL
Sep 19 2026, 01:52 PM

@github-actions

Copy link
Copy Markdown
Contributor

PR Genius Analysis

  • Risk Level: medium_risk
  • PR Size: +15/-5 (20 lines, small)
  • Impact: 2 files changed (.github, tests)
  • Rules: 8 core + 5 repo-specific

Checklist

  • ci_passing (PENDING) — checks are still running
  • dco_signoff (PASS) — all commits signed
  • tests_updated (PASS) — 1 test file(s) changed
  • issue_reference (PASS) — linked issue found

Anti-Patterns Detected

  • workflow_change (medium)

Suggestions

  • Verify workflow syntax with act or push to a test branch.

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1801 - Partially compliant

Compliant requirements:

Non-compliant requirements:

  • N/A

Requires further human verification:

  • N/A

1842 - Partially compliant

Compliant requirements:

Non-compliant requirements:

  • N/A

Requires further human verification:

  • N/A
⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found in the successfully analyzed chunks.

⚠️ Suggestion coverage: 1 of 1 analysis chunks failed; no suggestions were found in the successful chunks; failed chunks could not be analyzed.

@Ikalus1988

Copy link
Copy Markdown
Owner Author

🧾 Audit Report — PR #1874 (ee8fdfd)

📊 Quality Score

⚠️ Quality score unavailable; continuing with hard gates.

🔏 DCO Audit

✅ All commits signed-off.

📏 PR Size

Metric Value
Files Changed 2
Lines Added 15

🔐 Secret Scan

✅ No hardcoded secrets detected.

📦 Dependency Audit

⏭️ Skipped; no Python/JS dependency files changed.

🧪 Test Suite

✅ PASS — 54% coverage

📋 Lesson Schema

✅ All lessons valid.

⚖️ Verdict

✅ All gates passed. Ready for merge.


Scope: full | Triggered by ee8fdfd | View run

@Ikalus1988
Ikalus1988 merged commit 0113787 into main Sep 19, 2026
29 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Merged — Thank you!

Your contribution has been merged into main.

PR: #1874 — fix(ci): the docs gate re-evaluates when eligibility changes without a push

What's next:

  • Your code is now part of MisakaNet's failure-lesson corpus (now 393 lessons)
  • Feel free to pick up another issue labeled good first issue or status: competition
  • Questions? Ask in this thread or open a Discussion

Welcome to the MisakaNet contributor community! 🧠

@github-actions

Copy link
Copy Markdown
Contributor

✅ Merged! Thanks again, @Ikalus1988.

fix(ci): the docs gate re-evaluates when eligibility changes without a push (+15 lines, 2 files)

Quick question — did any MisakaNet lesson help you this time?
→ Share feedback

No need to reply if nothing comes to mind. ⚡

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.

1 participant