Skip to content

fix: debounce failed backports, based on marker in failure comment - #232

Merged
lampajr merged 1 commit into
kiegroup:mainfrom
BtbN:failure_debounce
Sep 16, 2026
Merged

lampajr merged 1 commit into
kiegroup:mainfrom
BtbN:failure_debounce

Conversation

@BtbN

@BtbN BtbN commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Description

This is the other part to the previous PR #231.
If the backport fails, but then something triggers a re-run of the backport action, like additional lables being added or removed, it could get incredibly spammy, since naturally the backport will fail every time.

This adds a small commented out tag to each failure comment, and then scans the existing comments for that tag before even trying to do the same backport again.
For a retry the comment has to be deleted or the tag edited out of it.

How Has This Been Tested?

This has also been actively in use on the FFmpeg Forgejo instance, and done a couple dozen of successfull backport PRs.

Checklist

  • Tests added if applicable.
  • Documentation updated if applicable.

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements
88.05% (-1.67% 🔻)
641/728
🟢 Branches
83.02% (-3.28% 🔻)
308/371
🟢 Functions
85.31% (-2.57% 🔻)
151/177
🟢 Lines
88.16% (-1.35% 🔻)
618/701
Show files with reduced coverage 🔻
St.❔
File Statements Branches Functions Lines
🟢 runner/runner.ts
88.82% (+0.41% 🔼)
92.45% (+0.62% 🔼)
82.35% (-0.98% 🔻)
88.74% (+0.34% 🔼)
🟢
... / github-client.ts
83.49% (-6.76% 🔻)
72.58% (-15.51% 🔻)
68% (-5.68% 🔻)
84.62% (-5.26% 🔻)
🟢
... / gitlab-client.ts
80.2% (-5.07% 🔻)
65.52% (-10.48% 🔻)
81.48% (-6.52% 🔻)
80.21% (-4.41% 🔻)

Test suite run success

230 tests passing in 19 suites.

Report generated by 🧪jest coverage report action from 4826977

@lampajr lampajr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey again @BtbN 👋🏻

Overall looks good and, even though the last comment might not be the one posted by the failure, I think that's a good tradeoff.

Could you please add some small section about this behavior in the README? This might be subtle if not properly documented.

I merged the other PR, do you mind rebasing and resolving conflicts?

@BtbN

BtbN commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

It's not the last comment, but the last "page", as per the pagination of the API, of comments.
So if it does end up retrying, it won't be right away where it'd be super spammy.
Though thinking about it, I think I overlooked that the last page there might only be a singular comment, given the page-rollover happens every N, usually 100, comments, hm.
Maybe looking at the last two pages would be a bit better?

Could also add a line like "Delete this comment to allow retries.".
And of course document it in the README.

Rebased as-is for now.

@BtbN
BtbN force-pushed the failure_debounce branch 2 times, most recently from 0d36224 to cdb8088 Compare September 13, 2026 16:38
@lampajr

lampajr commented Sep 13, 2026

Copy link
Copy Markdown
Member

Oh I missed it is the last page, I believe that's a fair tradeoff for now - I don't think there will be many cases where this won't work. Either way we can improve it later.

Could also add a line like "Delete this comment to allow retries.".
And of course document it in the README.

Yeah these would be great, or something like "Subsequent backports are blocked. Delete this comment to unblock retries"

@BtbN

BtbN commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

I've extended it a bit so it's the last two pages. Since on GitHub, the last page can be just one singular comment.
Readme and message are updated accordingly.

@lampajr lampajr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@lampajr

lampajr commented Sep 16, 2026

Copy link
Copy Markdown
Member

Thanks a lot @BtbN 🙏

@lampajr
lampajr merged commit 6a0d383 into kiegroup:main Sep 16, 2026
5 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