Repository navigation
fix(submit): stop a failed follow-up from flagging a live entry - #205
Conversation
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
left a comment
There was a problem hiding this comment.
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 acceptedfirst, then a singlegh issue commentwith 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.
|
Done in bc75414. The label goes on first in both places: |
jamesconwaydev
left a comment
There was a problem hiding this comment.
Perfect, label first and the comment sent once. Thanks.
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 theacceptedlabel 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 iscontinue-on-error. If it still fails,failure()stays false, so the step that addsneeds-reviewand 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
acceptedlabel 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 thebusycheck, so a merged branch that won't delete is still logged by_delete_branchand 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), andmainpassesload(), so the tests don't read the realentries.json.Permission change: the sweep token goes from
issues: readtoissues: write, so it can comment and close.Known limits, both costing only the thank-you comment, never a duplicate:
Closes #Nhas 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
python3 -m unittest discover -s scripts -t .passesnpm --prefix site testpasses (if you touchedsite/)npx prettier --check .passesdata/entries.jsonby hand (submissions go through the form)