Compare commits

...

2 Commits

Author SHA1 Message Date
Superset Dev
ccb8ad3db1 fix(ci): action is already ASF-allowlisted; also tidy permissions/concurrency
apache/infrastructure-actions' approved_patterns.yml (the actual org
allowlist source of truth) lists eps1lon/actions-label-merge-conflict@*
- a wildcard covering any version/SHA - so no Infra ticket is needed
here at all, contrary to what the removed comment said.

While touching the file, also addressed zizmor's pedantic-persona
findings: scoped permissions to the job instead of the workflow, added
a concurrency group (queue rather than cancel, so an in-progress
paginated PR sweep always finishes), and commented the permission
grant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 22:48:07 -07:00
Superset Dev
71365b2572 feat(ci): auto-label PRs with merge conflicts via eps1lon/actions-label-merge-conflict
Adds a scheduled job that applies the existing requires:rebase label
(already defined, previously unused by any automation) to open PRs
GitHub reports as CONFLICTING, and removes it once a rebase makes the
PR mergeable again. Also strips need:merge if present, since a
conflicting PR isn't actually ready to merge.

Runs on a 2-hour schedule (plus workflow_dispatch) rather than the
upstream README's suggested push + pull_request_target: [synchronize]
trigger. The action always re-checks *every* open PR via GraphQL
regardless of what triggered it (verified in its source), so the
recommended trigger would re-sweep the entire open-PR backlog on every
push to master and every push to any open PR - many times an hour on a
repo this size. A schedule bounds that to a small, fixed number of
sweeps a day instead.

No commentOnDirty/commentOnClean: the label alone is the intended
signal (matches the label's existing description), and posting a
comment on every currently-conflicting PR the first time this runs
would be a lot of one-time notification noise across the backlog.

Pinned to eps1lon/actions-label-merge-conflict v3.1.0
(0273be72a0bbd58fcd71d0d6c02c209b50d1e5e1). Per the ASF Infra
allowlist process this repo already follows for other actions, this
will need an Infra ticket before the job can actually run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 22:10:24 -07:00

View File

@@ -0,0 +1,54 @@
name: Label Merge Conflicts
# Sweeps every open PR and labels the ones GitHub reports as CONFLICTING with
# `requires:rebase` (removing it once a rebase makes the PR mergeable again),
# so the label can be used to filter the PR backlog for the ones that need a
# rebase before they can be reviewed/merged.
#
# The action itself always re-checks *every* open PR via GraphQL on each run
# regardless of what triggered it (see eps1lon/actions-label-merge-conflict's
# sources/main.ts) - there's no way to scope it to "just this PR". The
# project's own README suggests triggering on `push` (to the default branch)
# plus `pull_request_target: [synchronize]`, but on a repo with Superset's PR
# volume that combination would re-sweep the entire open-PR list on every
# merge to master *and* every push to *any* open PR - many times an hour.
# A schedule bounds that to a fixed, predictable cadence instead; adjust it
# if 2 hours turns out to be too slow or too chatty in practice.
on:
schedule:
- cron: "0 */2 * * *"
workflow_dispatch:
# Avoid two full backlog sweeps racing (a manual workflow_dispatch landing
# mid-schedule-tick, say); queue rather than cancel so an in-progress
# paginated sweep always runs to completion.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions: {}
jobs:
label-merge-conflicts:
# Scheduled/dispatch workflows still run on forks that carry this file;
# skip anywhere but the canonical repo.
if: github.repository == 'apache/superset'
name: Label Merge Conflicts
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # to add/remove requires:rebase and need:merge
steps:
# ASF Infra allowlists this whole action via a wildcard
# (eps1lon/actions-label-merge-conflict@*), so any pinned SHA/version
# is already fine here - no Infra ticket needed for future bumps.
- uses: eps1lon/actions-label-merge-conflict@0273be72a0bbd58fcd71d0d6c02c209b50d1e5e1 # v3.1.0
with:
dirtyLabel: "requires:rebase"
# A conflicting PR isn't actually ready to merge; strip that signal
# if it was previously set so reviewers don't act on a stale one.
removeOnDirtyLabel: "need:merge"
repoToken: ${{ secrets.GITHUB_TOKEN }}
# Intentionally no commentOnDirty/commentOnClean: the label alone is
# the signal (matches the label's existing description, and avoids
# a one-time comment storm across the whole backlog on first run).