Skip to content

[Backport release-24.11] Reapply "workflows/labels: manage stale & merge conflict labels"#419802

Merged
wolfgangwalther merged 8 commits intorelease-24.11from
backport-419654-to-release-24.11
Jun 25, 2025
Merged

[Backport release-24.11] Reapply "workflows/labels: manage stale & merge conflict labels"#419802
wolfgangwalther merged 8 commits intorelease-24.11from
backport-419654-to-release-24.11

Conversation

@nixpkgs-ci
Copy link
Contributor

@nixpkgs-ci nixpkgs-ci bot commented Jun 25, 2025

Bot-based backport to release-24.11, triggered by a label in #419654.

  • Before merging, ensure that this backport is acceptable for the release.
    • Even as a non-committer, if you find that it is not acceptable, leave a comment.

To set the stale label properly, we need to consider the right timeline
events only - and their respective relevant timestamps.

(cherry picked from commit d5072dd)
When running in a pull_request context, the labels job is part of the
currently running workflow - which will never have succeeded, yet.
Apparently it could be failed already, so in this case we take *any*
workflow run, no matter its state.

(cherry picked from commit ed1fc4c)
Explained very well by the code comment.

(cherry picked from commit 39dc87d)
This should make sure that the timer is cleaned up, no matter what. This
didn't seem to be the case before, where it would still be stuck
sometimes, when throwing an error somewhere.

(cherry picked from commit ddf3480)
…l requests

It's necessary to use a combination of different endpoints here, because
the /search endpoint only allows fetching the first 1000 items and will
fail with a higher page number (11+). On the flip side, the /pulls
endpoint doesn't allow counting the total number of results, so we can't
calculate the required page number with its response.

Putting both together should work, though.

(cherry picked from commit 579bfd4)
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 4.workflow: backport This targets a stable branch 6.topic: policy discussion Discuss policies to work in and around Nixpkgs labels Jun 25, 2025
The previous implementation had two problems:
- When switching from /search to /pulls, we disabled the additional GET
on each single pull request - which causes no test merge commit creation
for all PRs. This means, merge conflicts will not actually be detected.
- By using `item` in the pull-request triggered case, this goes back to
`context.payload.pull_request`, which is the state *at the beginning* of
the workflow run. But this renders our "let's wait 3 minutes before
checking merge_commit_sha" logic void. While we wait for 3 minutes, we
still use the *old* value afterwards...

Just making the extra request every time simplifies the logic and solves
both problems.

(cherry picked from commit 59ac947)
@wolfgangwalther wolfgangwalther merged commit 58cd238 into release-24.11 Jun 25, 2025
43 of 46 checks passed
@wolfgangwalther wolfgangwalther deleted the backport-419654-to-release-24.11 branch June 25, 2025 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.workflow: backport This targets a stable branch 6.topic: continuous integration Affects continuous integration (CI) in Nixpkgs, including Ofborg and GitHub Actions 6.topic: policy discussion Discuss policies to work in and around Nixpkgs 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant