Skip to content

fix(submit): stop a failed follow-up from flagging a live entry - #205

Merged
jamesconwaydev merged 2 commits into
devstreamhq:mainfrom
foothillsdigital:fix/post-merge-loose-ends
Nov 6, 2026
Merged

jamesconwaydev merged 2 commits into
devstreamhq:mainfrom
foothillsdigital:fix/post-merge-loose-ends

Conversation

@foothillsdigital

@foothillsdigital foothillsdigital commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Closes #51.

A failed post-merge comment no longer flags the entry. In submit.yml, the step that posts the accepted comment and adds the accepted label adds the label first, retrying it up to three times (10s, then 20s apart), then posts the comment once with no retry, since it's a create. The step is continue-on-error. If it still fails, failure() stays false, so the step that adds needs-review and the "something went wrong" comment doesn't run on an entry that's already live.

The sweeper finishes what that step didn't. Any open submission whose entry is on the list gets the accepted label and then the comment (only if the label was missing) and is closed as completed. It only touches entries submitted more than 30 minutes ago (BRANCH_AGE, longer than the 15-minute merge wait), so it can't race the run that's still adding it. This check runs before the busy check, so a merged branch that won't delete is still logged by _delete_branch and no longer keeps its issue open. Before, that issue stayed busy forever. Without the busy flag, a re-dispatch would have rejected it as a duplicate of its own entry.

sweep() takes the entries as an argument (default empty), and main passes load(), so the tests don't read the real entries.json.

Permission change: the sweep token goes from issues: read to issues: write, so it can comment and close.

Known limits, both costing only the thank-you comment, never a duplicate:

  • If the label lands and the comment fails, nobody is thanked: the label marks the comment as already tried.
  • If the PR's Closes #N has already closed the issue and the comment failed, the sweeper never sees it, since it only lists open issues.

The new sweep tests fail on main, including one where the comment fails and the next sweep only closes. actionlint is clean on both workflows.

Checks

  • The PR title follows Conventional Commits
  • python3 -m unittest discover -s scripts -t . passes
  • npm --prefix site test passes (if you touched site/)
  • npx prettier --check . passes
  • This doesn't edit data/entries.json by hand (submissions go through the form)

After the merge, the accepted comment and label now retry three times
and the step is continue-on-error, so a failure there no longer runs
the step that parks the issue as needs-review.

The sweeper now finishes any open submission whose entry is already on
the list (and older than the longest run): it posts the accepted
comment and label if they are missing and closes the issue as
completed. This runs before the busy check, so a merged branch that
won't delete is logged and its issue still closes. Before, that issue
stayed busy forever, or a re-dispatch could reject it as a duplicate
of itself.

The sweep token needs issues: write for this.

@jamesconwaydev jamesconwaydev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the busy-forever issue, and running the sweeper check before the busy check is the right fix. One thing to change:

Don't retry the comment. gh issue comment is a POST. If the first try times out after GitHub has already saved it, the retry posts the thank-you twice. Our rule across the bots is that creation calls are sent once and never retried. Adding a label is safe to repeat, so please flip the order in both places:

  • submit.yml: retry gh issue edit "$ISSUE" --add-label accepted first, then a single gh issue comment with no retry.
  • _finish_listed: add the label first, then post the comment.

With the label going on first, the sweeper's "no accepted label" check can only find an issue where the comment wasn't attempted yet, so it never posts a second one. The cost is the other direction: if the label lands and the comment fails, nobody gets thanked. Note that in the known-limits paragraph, which already has the same trade-off for closed issues.

The issues: write bump on the sweep token is fine. The sweeper never reads issue bodies.

@foothillsdigital

Copy link
Copy Markdown
Collaborator Author

Done in bc75414. The label goes on first in both places: submit.yml retries the label, then sends the comment once, and _finish_listed adds the label before the comment. New test: the comment fails, and the next sweep only closes the issue with no second comment. The known-limits paragraph now covers the "label landed, comment failed" case.

@jamesconwaydev jamesconwaydev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, label first and the comment sent once. Thanks.

@jamesconwaydev
jamesconwaydev merged commit e0806d5 into devstreamhq:main Nov 6, 2026
8 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.

Stop a failing cleanup from keeping a submission open

2 participants