Compare commits

..

2 Commits

Author SHA1 Message Date
Superset Dev
4c396a60a2 docs(ci): confirm this SHA is already on the ASF action allowlist
Checked apache/infrastructure-actions' approved_patterns.yml directly:
dependabot/fetch-metadata@25dd0e34... (the exact SHA pinned here) is
already present, so this workflow doesn't need an Infra ticket to run.
Tightens the comment to say so instead of the more hedged "will need a
ticket" framing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 22:48:41 -07:00
Superset Dev
05f66c1031 feat(ci): auto-approve Dependabot patch-level bumps
Posts an approving review (via dependabot/fetch-metadata's update-type
output) on Dependabot PRs that only bump a patch version. Scoped to
patch only, per the original ask; minor/major bumps get no automated
review and go through normal human review as before.

This does NOT enable auto-merge. Checked before building anything:
- allow_auto_merge is false at the repo level (confirmed via API) -
  GitHub's native auto-merge feature is off repo-wide, and flipping
  that is a separate, consequential, repo-wide settings decision, not
  something this workflow does on its own.
- Branch protection (.asf.yaml) requires require_code_owner_reviews
  plus 1 approving review. Checked .github/CODEOWNERS against every
  path Dependabot actually opens PRs against (superset-frontend/,
  docs/, superset-websocket/ x2, pip at /) - none match any CODEOWNERS
  pattern, so a bot-posted approval satisfies the plain 1-approval
  requirement for those, same as GitHub's own documented
  fetch-metadata + `gh pr review --approve` recipe for repos with
  required reviews. One exception: the npm ecosystem scoped to
  .github/actions matches the /.github/ CODEOWNERS entry, so those
  PRs still need a human owner's approval regardless - this workflow
  posts a review there too, but it won't satisfy the code-owner
  requirement alone.

Trigger/guard convention copied directly from the existing
sync-requirements-for-python-dep-upgrade-pr.yml (plain `pull_request`,
not `pull_request_target`): confirmed empirically via that workflow's
own run history that a plain `pull_request` trigger gets a working,
write-capable GITHUB_TOKEN for genuine Dependabot-authored PRs on this
repo (Dependabot pushes branches directly to apache/superset, not a
fork), rather than assuming pull_request_target was required.

Pinned to dependabot/fetch-metadata v3.1.0
(25dd0e34f4fe68f24cc83900b1fe3fe149efef98); needs the same ASF Infra
allowlist ticket as the other recent action additions before it can
run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 22:28:22 -07:00
5 changed files with 75 additions and 24 deletions

View File

@@ -5,6 +5,10 @@ inputs:
description: 'Python version to set up. Accepts a version number, "current", or "next".'
required: true
default: 'current'
cache:
description: 'Cache dependencies. Options: pip'
required: false
default: 'pip'
requirements-type:
description: 'Type of requirements to install. Options: base, development, default'
required: false
@@ -39,24 +43,17 @@ runs:
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ steps.set-python-version.outputs.python-version }}
- name: Install uv
if: inputs.install-superset == 'true'
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: ${{ steps.set-python-version.outputs.python-version }}
enable-cache: true
- name: Install apt packages
if: inputs.install-superset == 'true'
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
with:
packages: libldap2-dev libsasl2-dev
version: 1.0
cache: ${{ inputs.cache }}
- name: Install dependencies
env:
INPUT_INSTALL_SUPERSET: ${{ inputs.install-superset }}
INPUT_REQUIREMENTS_TYPE: ${{ inputs.requirements-type }}
run: |
if [ "$INPUT_INSTALL_SUPERSET" = "true" ]; then
sudo apt-get update && sudo apt-get -y install libldap2-dev libsasl2-dev
pip install --upgrade pip setuptools wheel uv
if [ "$INPUT_REQUIREMENTS_TYPE" = "dev" ]; then
uv pip install --system -r requirements/development.txt
elif [ "$INPUT_REQUIREMENTS_TYPE" = "base" ]; then

View File

@@ -45,10 +45,7 @@ jobs:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
python-version: "3.11"
enable-cache: true
run: pip install uv
- name: supersetbot bump-python -p "${{ github.event.inputs.package }}"
env:

View File

@@ -0,0 +1,63 @@
name: Auto-approve Dependabot patch bumps
# Posts an approving review on Dependabot PRs that only bump a patch
# version, using the same trigger/guard convention already proven to work
# for Dependabot PRs in sync-requirements-for-python-dep-upgrade-pr.yml
# (plain `pull_request` gets a working, write-capable GITHUB_TOKEN here
# because Dependabot pushes branches directly to this repo, not a fork).
#
# This does NOT auto-merge anything - repo-wide auto-merge is disabled
# (Settings > General > Pull Requests > "Allow auto-merge" is off), and
# flipping that is a separate, repo-wide decision this workflow doesn't
# make on its own. Branch protection also still requires 1 approving
# review; this just means that review can already exist by the time a
# human looks at the PR, for the (large majority of) ecosystems whose
# files aren't matched by any CODEOWNERS pattern. One ecosystem - the npm
# bump under .github/actions - matches the /.github/ CODEOWNERS entry, so
# those PRs will still need a human owner's approval regardless of this
# workflow; it posts a review there too, but that alone won't satisfy the
# code-owner requirement.
on:
pull_request:
types: [opened, synchronize]
# Cancel a superseded run if Dependabot pushes to the same PR again before
# the previous run finished (matches the pattern used elsewhere in
# superset-docs-verify.yml).
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions: {}
jobs:
approve-patch-bump:
name: Approve patch-level bump
# Mirrors the guard in sync-requirements-for-python-dep-upgrade-pr.yml:
# limited to (1) PRs authored by Dependabot and (2) the upstream repo,
# since forked PRs don't get a write-capable token here anyway.
if: >
github.repository == 'apache/superset' &&
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
permissions:
pull-requests: write # to post the approving review via `gh pr review`
steps:
- name: Fetch Dependabot metadata
id: metadata
# This exact SHA is on ASF Infra's action allowlist
# (apache/infrastructure-actions approved_patterns.yml) as of this
# writing. Do not bump without opening an Infra ticket to allow
# the new SHA first!
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
- name: Approve patch-level bump
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
DEPENDENCY_NAMES: ${{ steps.metadata.outputs.dependency-names }}
run: |
gh pr review --approve "$PR_URL" \
--body "Auto-approved: patch-level bump only ($DEPENDENCY_NAMES)."

View File

@@ -76,10 +76,7 @@ jobs:
distribution: "zulu"
java-version: "21"
- name: Install Graphviz
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
with:
packages: graphviz
version: 1.0
run: sudo apt-get install -y graphviz
- name: Compute Entity Relationship diagram (ERD)
env:
SUPERSET_SECRET_KEY: not-a-secret

View File

@@ -78,10 +78,7 @@ jobs:
- name: Install gettext tools
if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true'
uses: awalsh128/cache-apt-pkgs-action@553a35bb8ebd9fcabcb1c9451aa4c98e1b4ca8a9 # v1.6.3
with:
packages: gettext
version: 1.0
run: sudo apt-get update && sudo apt-get install -y gettext
# Fetch the base ref so we can compare PR-introduced regressions
# against a fair baseline (also runs babel_update against the base