-
Notifications
You must be signed in to change notification settings - Fork 729
ci: enforce PMC vote on format-spec changes via CI gate #7399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: CI scripts | ||
|
|
||
| # Tests for helper scripts under ci/ that aren't covered by the language test | ||
| # suites (e.g. the format-spec vote gate logic). | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - release/** | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - release/** | ||
| paths: | ||
| - ci/format_vote_gate.py | ||
| - ci/test_format_vote_gate.py | ||
| - .github/workflows/format-vote-gate.yml | ||
| - .github/workflows/ci-scripts.yml | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| format-vote-gate: | ||
| name: Format vote gate unit tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install pytest | ||
| run: pip install pytest | ||
| - name: Run tests | ||
| run: pytest ci/test_format_vote_gate.py |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: Format spec vote gate | ||
|
|
||
| # Structurally enforces the PMC vote required for Lance format-specification | ||
| # changes (see https://lance.org/community/voting/). The path labeler | ||
| # (.github/labeler-area.yml) applies the `format-change` label to PRs that touch | ||
| # the format spec (`protos/**/*.proto`, `docs/src/format/**`); this gate reads | ||
| # that label and blocks merging until the PR has 3 binding +1 votes from PMC | ||
| # members (PR approvals, excluding the author), has no outstanding veto (a PMC | ||
| # "Request changes" review), and the 1-week voting period has elapsed. | ||
| # | ||
| # The gate publishes its verdict as the `format-spec-vote` commit status on the | ||
| # PR head. To make it a merge blocker, an org admin must add `format-spec-vote` | ||
| # as a required status check in the branch protection rules for `main` (and any | ||
| # release branches). The status is posted on *every* PR — success immediately | ||
| # for non-format PRs — so a required check is never left pending forever. | ||
| # | ||
| # A PMC member may waive a trivial edit (typo, wording, formatting) by applying | ||
| # the `format-waived` label. | ||
| # | ||
| # Uses pull_request_target so the token can post statuses/comments on fork-based | ||
| # PRs. It never checks out or executes PR code: it reads the trusted base | ||
| # checkout (for the PMC roster and this script) and queries the API only. | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened, synchronize, labeled, unlabeled] | ||
| pull_request_review: | ||
| types: [submitted, edited, dismissed] | ||
| schedule: | ||
| # Re-evaluate open format-change PRs so the voting-period clock is re-checked | ||
| # even when no PR event fires (e.g. the 1-week period elapses days after the | ||
| # third approval lands). | ||
| - cron: "0 */8 * * *" | ||
|
Comment on lines
+29
to
+33
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue(blocking): how does this trigger find which PRs to look at? IIRC this trigger isn't PR specific, but runs on a schedule globally for the whole repo, am I wrong?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right — the |
||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write | ||
| statuses: write | ||
|
|
||
| jobs: | ||
| gate: | ||
| name: Evaluate format spec vote | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout base | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install dependencies | ||
| run: pip install PyGithub PyYAML | ||
| - name: Evaluate vote | ||
| run: python ci/format_vote_gate.py | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue(blocking): do we not filter just for PRs that have no
format-changelabel? I think we should leave those PRs alone.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. The gate now keys off the
format-changelabel only. Labeling moved to the existing path labeler (.github/labeler-area.yml), and the gate leaves unlabeled PRs alone — for non-format PRs it posts just a passingformat-spec-votestatus and nothing else (needed so the required check never blocks them). Trivial edits are now waived by a PMC applying aformat-waivedlabel, rather than removingformat-change(the path labeler would otherwise re-add it on the next push).