Skip to content

feat(k8s): run one shared supervisor per node #3032

feat(k8s): run one shared supervisor per node

feat(k8s): run one shared supervisor per node #3032

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Maintainer Approval
on:
merge_group:
types: [checks_requested]
# Reviews supply the result for the current head. Until then, GitHub waits
# for the ruleset's required check without a separate push-triggered run.
pull_request_review:
types: [submitted, dismissed]
permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event.pull_request.head.sha || github.sha }}
cancel-in-progress: true
jobs:
maintainer-approval:
# This name is the required status check context. Changing it silently
# breaks the ruleset entry that gates merges on this job.
name: OpenShell / Maintainer Approval
# Merge-group checks do not need to repeat the PR approval evaluation.
if: >-
github.event.repository.fork == false &&
github.event_name != 'merge_group' &&
github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
# Check out the default branch, never the pull request head. Both the
# maintainer list and the decision helper must come from main: reading
# either from the pull request ref would let a contributor add themselves
# to the list, or rewrite the decision logic, and self-approve.
- name: Check out the maintainer list and helper
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
sparse-checkout: |
MAINTAINERS.md
tasks/scripts/check_maintainer_approval.py
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Verify maintainer or Gator approval
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
EVENT_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
shell: bash
run: |
set -euo pipefail
gh api --paginate --slurp "repos/$GH_REPO/pulls/$PR_NUMBER/reviews" \
| jq 'add // []' > reviews.json
pr_json=$(gh api "repos/$GH_REPO/pulls/$PR_NUMBER")
pr_author=$(jq -er '.user.login' <<< "$pr_json")
head_sha=$(jq -er '.head.sha' <<< "$pr_json")
if [[ "$head_sha" != "$EVENT_HEAD_SHA" ]]; then
echo "PR head changed while checking approval"
exit 1
fi
printf '[]\n' > commit-pages.json
if jq -e --arg head "$head_sha" \
'any(.[]; .state == "APPROVED" and .commit_id == $head and .user.type == "Bot")' \
reviews.json >/dev/null; then
# GraphQL exposes the signer and can page through the complete PR history.
if ! gh api graphql --paginate --slurp \
-f owner="${GH_REPO%/*}" -f repo="${GH_REPO#*/}" \
-F number="$PR_NUMBER" -f query='
query($owner: String!, $repo: String!, $number: Int!, $endCursor: String) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
headRefOid
baseRefOid
commits(first: 100, after: $endCursor) {
totalCount
pageInfo { hasNextPage endCursor }
nodes {
commit {
oid
author { user { login } }
committer { user { login databaseId } }
committedViaWeb
signature {
isValid
signer { databaseId }
wasSignedByGitHub
}
}
}
}
}
}
}' > commit-pages.json; then
echo "Could not verify PR commits for Gator approval"
printf '[]\n' > commit-pages.json
fi
fi
OPENSHELL_PR_AUTHOR="$pr_author" OPENSHELL_PR_HEAD_SHA="$head_sha" \
OPENSHELL_PR_COMMIT_PAGES=commit-pages.json \
python3 tasks/scripts/check_maintainer_approval.py \
--maintainers MAINTAINERS.md \
--reviews reviews.json