Skip to content

feat(pr-management-triage): add docs/spellcheck to static_check + optimistic-lock approve-workflow#116

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:improve/static-check-spellcheck-and-approve-workflow-relock
May 11, 2026
Merged

feat(pr-management-triage): add docs/spellcheck to static_check + optimistic-lock approve-workflow#116
potiuk merged 1 commit into
apache:mainfrom
potiuk:improve/static-check-spellcheck-and-approve-workflow-relock

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented May 11, 2026

Summary

Two unrelated-but-small classifier-accuracy improvements, both prompted by misclassifications hit during the same apache/airflow triage sweep:

  1. Add spellcheck, spelling, build documentation, build docs, build-docs to the static_check substring list. A docs-build / spellcheck failure is symmetric with the other static checks — the contributor introduced text the checker doesn't accept (a misspelled word, a missing sphinx reference, a broken include) and the fix is a code change. Without these patterns, row 13 (rerun) fires on a single docs-build failure and the bot sends a useless rerun request that fails identically.

  2. Apply the Golden Rule 1b optimistic-lock pattern to approve-workflow too. Currently only mark-ready and mark-ready-with-ping re-verify state immediately before mutating. approve-workflow builds its run-ID list at fetch time, then mutates at action time — but maintainers spend minutes inspecting the diff between fetch and action, and another maintainer (or auto-approval) can land an approval in that window. The mutation then has nothing to approve and silently exits with empty output, leaving no signal about whether the desired state is in place. Re-listing pending runs at action time and exiting cleanly with a one-line note when the list is empty matches what mark-ready already does.

Empirical evidence

  • #66509 (@IamJasonBian): single failing check CI image checks / Build documentation (--spellcheck-only). Classifier picked rerun (row 13). The author added a word not in the wordlist; rerunning will fail identically. Manual override required to send a static-check-style comment with remediation.
  • #66065 (@petercheon, page 11) and #66686 (@kimjune01, page 12): both classified approve-workflow from a fetch-time action_required cache hit, but at action time the pending-runs list was empty (#66065 — runs already approved by someone else between fetch and act) or non-empty (#66686 — clean approval, the more common case). The empty case in #66065 surfaced as exit=0, out= with no guidance — the optimistic-lock check now produces an explicit no-op message.

Changes

classify-and-act.md:

  • static_check precondition glossary entry: append spellcheck, spelling, build documentation, build docs, build-docs to the substring list. Add a short paragraph explaining the symmetry with the other static checks (a docs-build failure is a code-fix problem, not a flakiness problem).

actions.md:

  • approve-workflow recipe: re-list pending runs at action time using the same select(.conclusion == "action_required") post-filter. If the list is empty, exit cleanly with a one-line note ("already approved by someone else") so the maintainer sees the no-op explicitly. Cross-references the Golden Rule 1b pattern in SKILL.md for symmetry with mark-ready.

Test plan

  • Re-classified #66509 with the new static_check entry — now correctly routes to row 12 (comment) instead of row 13 (rerun).
  • Walked through the recipe by hand against #66065's situation: empty ids → clean exit with the no-op note, vs. previous behavior of empty stdin to the while loop with no status message.
  • prek run --files passes (markdownlint, skill-validate, typos, etc.).
  • No new GraphQL fields or REST endpoints required.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

…imistic-lock approve-workflow

Two unrelated-but-small classifier-accuracy improvements, both
prompted by misclassifications hit during a triage sweep on
apache/airflow:

1. classify-and-act.md: append `spellcheck`, `spelling`,
   `build documentation`, `build docs`, `build-docs` to the
   `static_check` substring list. A docs-build / spellcheck
   failure is symmetric with the other static checks — the
   contributor introduced text the checker doesn't accept and
   the fix is a code change. Without these patterns, row 13
   (`rerun`) fires on a single docs-build failure and the bot
   sends a useless rerun request that fails identically.

2. actions.md: apply the Golden Rule 1b optimistic-lock pattern
   to `approve-workflow`. Re-list pending runs at action time;
   exit cleanly with a one-line note if empty (already approved
   between fetch and act). Matches what `mark-ready` and
   `mark-ready-with-ping` already do.
@potiuk potiuk merged commit 1a89b79 into apache:main May 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants