Skip to content

[Backport release-25.05] workflows/labels: manage stale & merge conflict labels#419565

Closed
nixpkgs-ci[bot] wants to merge 8 commits intorelease-25.05from
backport-419481-to-release-25.05
Closed

[Backport release-25.05] workflows/labels: manage stale & merge conflict labels#419565
nixpkgs-ci[bot] wants to merge 8 commits intorelease-25.05from
backport-419481-to-release-25.05

Conversation

@nixpkgs-ci
Copy link
Contributor

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

Bot-based backport to release-25.05, triggered by a label in #419481.

  • 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.

Separate commit for better diff.

(cherry picked from commit 042a2fd)
…ntext

We previously ran another list request in this case, but don't need to
anymore - we already have the `pull_request` context available.

(cherry picked from commit 8b51015)
This doesn't provide much value in itself, yet, but is much more
flexible in the next step, when also looking at much older PRs.

(cherry picked from commit d9d97fd)
This replaces the manual dispatch trigger with a batched run through all
pull requests every day. This has the small benefit of not having to
worry about backfilling labeling after fixing bugs - and the much bigger
one in being able to handle merge-conflict and stale labels properly
later. For those, it's inevitable to eventually scan through all PRs.

At this stage, the vast majority of PRs will still be skipped, because
there won't be an eval run with artifact available. This will be
improved in the next step.

Technically, the workflow_dispatch trigger is kept to allow easily
testing this in forks, where the scheduled jobs are disabled. The
triggered job will behave similar to the scheduled job, though, and have
no special inputs.

(cherry picked from commit e55128a)
We keep working through the PR, even though we don't have any eval
results. This will allow actually managing labels for much older PRs as
well. Most importantly, it will allow merge-conflict and stale-labeling
next.

(cherry picked from commit 63b9355)
This manages the `2. status: stale` label for pull requests only (not
issues, yet) with the following conditions:
- The last event on the timeline of the Pull Request counts.
- Labeling and unlabeling of any kind are ignored.
- Older than 180 days are stale.
- Security labeled PRs are never stale.

To handle this label correctly, it's important to go through all pull
requests. Any approach to limit the list of PRs via search are not going
to work:
- Filtering by `updated` is not going to work, because it includes the
last time that *a label was set* on the PR. To actually find out whether
a PR is stale or not, the timeline of events needs to be looked at.
- Filtering by an existing stale label is not going to work either,
because such a label might have been added manually and thus breaking
the rules we set up here. Thus any existing label needs to be confirmed
as well.

(cherry picked from commit 58dd963)
The code comments describe much better what we do then a commit message
could ever do.

(cherry picked from commit 36e9fe9)
@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 24, 2025
@wolfgangwalther
Copy link
Contributor

Revert for now in #419574.

@wolfgangwalther wolfgangwalther deleted the backport-419481-to-release-25.05 branch June 24, 2025 14:07
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