Skip to content

fix(ci): a used-by submission reaches its pull request regardless of how it was filed - #530

Merged
superuser404notfound merged 2 commits into
mainfrom
fix/used-by-label-race
Sep 11, 2026
Merged

fix(ci): a used-by submission reaches its pull request regardless of how it was filed#530
superuser404notfound merged 2 commits into
mainfrom
fix/used-by-label-race

Conversation

@superuser404notfound

@superuser404notfound superuser404notfound commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Approved submissions were ending without a pull request, and no run ever went red.

Why the label was missing

The used-by-submission label from the issue form only lands when the issue is really filed through the web form. Measured across the 256 issues opened by other people in this tracker:

  • 114 carry a template label at all (45%). The other 55% reach the tracker past the templates, through the API, gh, a mobile client, or a body pasted from somewhere else. blank_issues_enabled: false does not stop any of those.
  • The correlation is clean: issues with a template label have the form's ### headings, issues without one mostly have no headings at all.

Two of the nine used-by submissions (#484, #525) arrived that way and had to be labelled by hand.

What was wrong

1. The label order decided whether anything ran. The job required approved to be the label that arrived. When the maintainer adds the missing used-by-submission afterwards, that event does not match, so nothing runs. The only escape was removing and re-applying approved by hand.

Timeline of #525, the whole trap in three events:

time event run
13:13:44 approved added (issue had no used-by-submission) skipped
13:14:15 used-by-submission added no run, wrong label name
13:14:31 approved removed and re-applied by hand ran

2. The parser returns {} when the body has no blank line after a heading. github-issue-parser splits a section into key and value on /\r?\n\r?\n/. Without the blank line the whole section becomes the key, the value is undefined, and JSON.stringify drops undefined keys. #525 arrived in exactly that shape; its log shows ISSUE_JSON: {} then "Missing a required field".

3. A failed parse was indistinguishable from a success. It exited 0, so the run went green with no PR and no notification. #525 has two green runs and no PR.

What changed

used-by-add.yml

  • The condition accepts either label as the one arriving last, so adding the missing label after approved starts the run.
  • The body is normalised (a blank line re-inserted after each ### heading, code fences respected) before it reaches the parser. Fixes the broken shape, leaves the web-form shape untouched.
  • An unreadable submission now fails with exit 1 and names the missing fields in the step summary.
  • Three further silent no-ops closed: missing README markers, an insert that changed nothing, and a PR step that produced no PR.
  • add-paths: README.md so no runner file can ride along in the commit.

used-by-label.yml (new)

  • Recognises a submission by its shape (a [Used by] title, or the form's headings in the body) and applies used-by-submission itself, so the label no longer depends on how the issue was filed.
  • Only ever adds that one label. approved stays a maintainer action and remains the thing that opens a pull request.

Verification

The workflow's own run: steps replayed against the real issue bodies:

case before after
#525 Vivid (no blank lines) {}, green, no PR parses, inserts - [Vivid](https://github.com/blurbery/vivid): open-source media app for iPhone, iPad and Apple TV.
#497 Moonfin (web form) parses parses, unchanged
free text, no form green, no PR exit 1, missing fields named
duplicate URL skip, exit 0 skip, exit 0, now in the summary

The labelling condition evaluated against every issue in the tracker: 9 of 9 used-by submissions matched, 0 false positives across 256 issues, 0 missed.

Workflow events run from the default branch, so this only takes effect once merged. After merging, re-applying either label on #525 opens the Vivid PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VDKAJrLjLXVsCvJVNdJEPw

Vincent Herbst and others added 2 commits September 11, 2026 15:28
…hout blank lines

Three faults made approved submissions end without a pull request, and none of
them left a red run.

The job keyed on the "approved" label arriving last. A submission that reaches
the tracker outside the web form carries no template label, so the maintainer
adds "used-by-submission" after "approved" is already on; that event failed
`github.event.label.name == 'approved'` and no run started. The only way out was
to remove and re-apply "approved" by hand, which is what happened on #525 and
#484. The condition now accepts either label as the one that arrives last.

The parser splits a section into key and value on the blank line the web form
writes after each "### " heading. A body without it collapses the section into
the key, leaves the value undefined, and JSON.stringify drops undefined, so the
whole form returns {}. #525 arrived that way: two runs went green, read every
field as missing, and opened nothing. The body is now normalised before parsing,
which fixes that shape and leaves the web-form shape untouched.

An unreadable submission exited 0, so a failed parse was indistinguishable from
success: green run, no PR, no notification. It now fails loudly and names the
missing fields. Two further silent no-ops are closed with it, a missing pair of
README markers and an insert that changed nothing, plus a check that the PR step
actually produced a PR.

Verified by replaying the real #525 and #497 bodies through the workflow's own
steps: #525 now parses and inserts, #497 is unchanged, free text fails with
exit 1, and a duplicate still skips at exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDKAJrLjLXVsCvJVNdJEPw
…orm's label

The "used-by-submission" label from the issue form only lands when the issue is
really filed through the web form, and most submissions are not. Measured across
the 256 issues opened by other people, 114 carry a template label at all, so 55%
reach the tracker past the templates, through the API, gh, a mobile client or a
body pasted from somewhere else. Two of the nine used-by submissions came in that
way and had to be labelled by hand before anything could run.

Recognise the submission by its shape instead: a "[Used by]" title, or a body
carrying the form's own headings. Checked against every issue in the tracker, the
condition matches all nine used-by submissions and nothing else.

This only ever adds "used-by-submission". "approved" stays a maintainer action and
remains the thing that opens a pull request. A label set with GITHUB_TOKEN starts
no further workflow run, which is the order we want anyway: the label lands at
submission time, the later human "approved" is the event that starts the run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDKAJrLjLXVsCvJVNdJEPw
@superuser404notfound superuser404notfound changed the title fix(ci): a used-by submission survives the label order and a body without blank lines fix(ci): a used-by submission reaches its pull request regardless of how it was filed Sep 11, 2026
@superuser404notfound
superuser404notfound merged commit e4384e3 into main Sep 11, 2026
5 checks passed
@superuser404notfound
superuser404notfound deleted the fix/used-by-label-race branch September 11, 2026 13:43
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.

1 participant