Repository navigation
chore: manage ANS teams and repository settings #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9024b60
chore: configure ANS organization management
csnitker-godaddy 3383765
docs: simplify organization management guide
csnitker-godaddy f6ac831
fix: preserve CI bindings and avoid empty reviewer teams
csnitker-godaddy bcab367
chore: manage ANS teams with Peribolos
csnitker-godaddy e417642
chore: seed team configuration from native Peribolos export
csnitker-godaddy c055ee1
chore: configure merge requirements across ANS repositories
csnitker-godaddy ebf3278
chore: retire legacy teams from the desired configuration
csnitker-godaddy e177f64
fix: read existing App identifiers from repository secrets
csnitker-godaddy 2f932ec
chore: defer package protections and enable TSC reviews
csnitker-godaddy 8db9373
chore: add repository reviewer teams
csnitker-godaddy edbbcb1
fix: preserve reviewer teams during repository enrollment
csnitker-godaddy c7db85c
fix: address governance automation review
csnitker-godaddy 52a3938
fix: allow maintainer-authorized ANS merge queue entry
csnitker-godaddy 294e579
fix: retain PR-only Maintainer merge restrictions
csnitker-godaddy ccf4641
chore: update ANS specification repository name
csnitker-godaddy c786b09
fix: require checks from the DCO App
csnitker-godaddy 59ca8ae
fix: use strict checks for Maintainer-controlled PR merges
csnitker-godaddy 3b0b194
ci: retire merge queue workflow paths
csnitker-godaddy 5df8aa1
fix: allow normal merges for authorized teams
csnitker-godaddy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # GitHub requires explicit Write permission for CODEOWNERS teams. | ||
| * @agentnameservice/tsc-owners |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Bug report | ||
| description: Report a reproducible problem. Use private vulnerability reporting for security issues. | ||
| body: | ||
| - type: textarea | ||
| id: problem | ||
| attributes: | ||
| label: What happened? | ||
| description: Include the affected version and the behavior you expected. | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: reproduce | ||
| attributes: | ||
| label: How can we reproduce it? | ||
| description: Provide a minimal example with credentials and personal information removed. | ||
| validations: | ||
| required: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: Change request | ||
| description: Discuss a change before opening a pull request. | ||
| body: | ||
| - type: textarea | ||
| id: problem | ||
| attributes: | ||
| label: What problem should this solve? | ||
| validations: | ||
| required: true | ||
| - type: textarea | ||
| id: proposal | ||
| attributes: | ||
| label: What change do you suggest? | ||
| description: Describe the behavior and any alternatives. Formal proposals follow the governance repository's proposal process. | ||
| validations: | ||
| required: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| open-pull-requests-limit: 5 | ||
| - package-ecosystem: npm | ||
| directory: / | ||
| schedule: | ||
| interval: weekly | ||
| open-pull-requests-limit: 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| name: Check contribution metadata | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize, reopened, labeled, unlabeled, ready_for_review] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| contribution: | ||
| uses: ./.github/workflows/contribution-policy.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| name: Contribution policy | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| specification: | ||
| description: Require exactly one of editorial or normative on specification PRs | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| metadata: | ||
| name: Contribution policy | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| # No checkout and no interpolation of contributor-controlled text into shell code. | ||
| - name: Check PR metadata | ||
| env: | ||
| SPECIFICATION_REPOSITORY: ${{ inputs.specification }} | ||
| run: | | ||
| python3 - <<'PY' | ||
| import json, os, re, sys | ||
| with open(os.environ['GITHUB_EVENT_PATH']) as handle: | ||
| event = json.load(handle) | ||
| pr = event.get('pull_request') | ||
| if pr is None: | ||
| raise SystemExit('This workflow requires a pull request.') | ||
| errors = [] | ||
| if not re.match(r'^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|spec)(\([^\r\n()]+\))?!?: \S', pr['title']): | ||
| errors.append('Use a Conventional Commit PR title, such as docs: explain the setup.') | ||
| body = re.sub(r'<!--[\s\S]*?-->', '', pr.get('body') or '') | ||
| if not re.search(r'\b(?:fix(?:es|ed)?|close[sd]?|resolve[sd]?)\s+(?:#\d+|[\w.-]+/[\w.-]+#\d+|https://github\.com/[\w.-]+/[\w.-]+/issues/\d+)\b', body, re.I): | ||
| errors.append('Link a real issue using Fixes, Closes, or Resolves.') | ||
| if os.environ['SPECIFICATION_REPOSITORY'] == 'true': | ||
| labels = {label['name'] for label in pr.get('labels', [])} | ||
| if len(labels & {'editorial', 'normative'}) != 1: | ||
| errors.append('Apply exactly one specification label: editorial or normative.') | ||
| for error in errors: | ||
| print(error) | ||
| sys.exit(bool(errors)) | ||
| PY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| name: Manage repository | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| operation: | ||
| description: Inspect settings, prepare a configuration PR, or pause management | ||
| type: choice | ||
| options: [Inspect repository, Enroll or update, Pause management] | ||
| default: Inspect repository | ||
| repository: | ||
| description: Repository name within agentnameservice | ||
| type: string | ||
| required: true | ||
| required_checks: | ||
| description: Optional CI check names separated by semicolons; blank keeps/imports existing requirements | ||
| type: string | ||
| bootstrap_access: | ||
| description: Keep tsc-owners approval and merge access during setup; new repositories start enabled | ||
| type: choice | ||
| options: [Keep current, Enable, Remove] | ||
| default: Keep current | ||
| issue: | ||
| description: Issue number in .github for this change (not needed for Inspect) | ||
| type: string | ||
| signoff: | ||
| description: Your own Full Name <email>, published in the commit (not needed for Inspect) | ||
| type: string | ||
| certify_dco: | ||
| description: I certify the DCO and authorize my supplied sign-off on this configuration change | ||
| type: boolean | ||
| default: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: repository-request-${{ inputs.repository }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| request: | ||
| if: >- | ||
| github.repository == 'agentnameservice/.github' && | ||
| github.ref == 'refs/heads/main' && | ||
| vars.ORG_MANAGEMENT_ENABLED == 'true' | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| environment: org-management | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | ||
| with: | ||
| node-version: '24' | ||
| - run: npm ci --ignore-scripts --no-audit --no-fund | ||
| - uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 | ||
| id: read | ||
| with: | ||
| client-id: ${{ secrets.ORG_APP_CLIENT_ID }} | ||
| private-key: ${{ secrets.ORG_APP_PRIVATE_KEY }} | ||
| owner: agentnameservice | ||
| permission-administration: read | ||
| permission-contents: read | ||
| permission-members: read | ||
| permission-checks: read | ||
| permission-statuses: read | ||
| permission-pull-requests: read | ||
| permission-issues: read | ||
| - name: Inspect and prepare the request | ||
| id: prepare | ||
| env: | ||
| GH_TOKEN: ${{ steps.read.outputs.token }} | ||
| REQUESTER: ${{ github.triggering_actor }} | ||
| run: node scripts/manage-repository.mjs | ||
| - name: Validate generated configuration | ||
| if: steps.prepare.outputs.changed == 'true' | ||
| run: npm run validate | ||
| - name: Create a token limited to configuration PRs | ||
| if: steps.prepare.outputs.changed == 'true' | ||
| uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 | ||
| id: write | ||
| with: | ||
| client-id: ${{ secrets.ORG_APP_CLIENT_ID }} | ||
| private-key: ${{ secrets.ORG_APP_PRIVATE_KEY }} | ||
| owner: agentnameservice | ||
| repositories: .github | ||
| permission-contents: write | ||
| permission-pull-requests: write | ||
| - name: Open or update the configuration PR | ||
| if: steps.prepare.outputs.changed == 'true' | ||
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | ||
| with: | ||
| token: ${{ steps.write.outputs.token }} | ||
| base: main | ||
| branch: ${{ steps.prepare.outputs.branch }} | ||
| title: ${{ steps.prepare.outputs.title }} | ||
| body-path: reports/request.md | ||
| author: ${{ steps.prepare.outputs.author }} | ||
| commit-message: ${{ steps.prepare.outputs.commit_message }} | ||
| signoff: false | ||
| add-paths: | | ||
| safe-settings/ | ||
| peribolos.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| name: Organization management | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| mode: | ||
| description: Preview changes or apply the reviewed configuration | ||
| type: choice | ||
| options: [preview, apply] | ||
| default: preview | ||
| push: | ||
| branches: [main] | ||
| schedule: | ||
| - cron: '23 */6 * * *' | ||
|
|
||
| env: | ||
| PERIBOLOS_IMAGE: us-docker.pkg.dev/k8s-infra-prow/images/peribolos@sha256:b8dfdf7af7dc16d1a4b0f3efb760e6468f098f7e5f0fdd6f8271a07f17cba6d2 # v20261028-c06373a3e | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: organization-management | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| synchronize: | ||
| if: >- | ||
| github.repository == 'agentnameservice/.github' && | ||
| github.ref == 'refs/heads/main' && | ||
| vars.ORG_MANAGEMENT_ENABLED == 'true' | ||
| environment: org-management | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| env: | ||
| APPLY: ${{ (github.event_name == 'workflow_dispatch' && inputs.mode == 'apply') || (github.event_name != 'workflow_dispatch' && vars.ORG_AUTO_APPLY == 'true') }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | ||
| with: | ||
| node-version: '24' | ||
| - run: npm ci --ignore-scripts --no-audit --no-fund | ||
| - run: npm run validate | ||
| - uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 | ||
| id: token | ||
| with: | ||
| client-id: ${{ secrets.ORG_APP_CLIENT_ID }} | ||
| private-key: ${{ secrets.ORG_APP_PRIVATE_KEY }} | ||
| owner: agentnameservice | ||
| permission-members: read | ||
| permission-contents: read | ||
| - name: Verify manual apply requester | ||
| if: github.event_name == 'workflow_dispatch' && env.APPLY == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ steps.token.outputs.token }} | ||
| REQUESTER: ${{ github.triggering_actor }} | ||
| run: node --input-type=module -e "import {github,owner} from './scripts/github.mjs'; await owner(github(),process.env.REQUESTER)" | ||
| - name: Prepare the App key for Peribolos | ||
| env: | ||
| APP_KEY: ${{ secrets.ORG_APP_PRIVATE_KEY }} | ||
| run: | | ||
| umask 077 | ||
| printf '%s\n' "$APP_KEY" > "$RUNNER_TEMP/org-app.pem" | ||
| - name: Reconcile teams and membership | ||
| env: | ||
| APP_ID: ${{ secrets.ORG_APP_ID }} | ||
| run: | | ||
| args=(--config-path=/workspace/peribolos.yml --github-app-id="$APP_ID" --github-app-private-key-path=/key.pem --fix-teams --fix-team-members --maximum-removal-delta=0) | ||
| if [ "$APPLY" = true ]; then args+=(--confirm); fi | ||
| docker run --rm --user "$(id -u):$(id -g)" -v "$GITHUB_WORKSPACE:/workspace:ro" -v "$RUNNER_TEMP/org-app.pem:/key.pem:ro" "$PERIBOLOS_IMAGE" "${args[@]}" | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| repository: github-community-projects/safe-settings | ||
| ref: a9a1f366ad6a738b55682d346d94f8d6c4893b09 # 3.0.0 | ||
| path: .safe-settings | ||
| persist-credentials: false | ||
| - run: npm ci --ignore-scripts --omit=dev --no-audit --no-fund | ||
| working-directory: .safe-settings | ||
| - name: Run the documented Safe Settings synchronizer | ||
| id: settings | ||
| working-directory: .safe-settings | ||
| env: | ||
| GH_ORG: agentnameservice | ||
| ADMIN_REPO: .github | ||
| CONFIG_PATH: safe-settings | ||
| DEPLOYMENT_CONFIG_FILE: ${{ github.workspace }}/safe-settings/deployment-settings.yml | ||
| APP_ID: ${{ secrets.ORG_APP_ID }} | ||
| PRIVATE_KEY: ${{ secrets.ORG_APP_PRIVATE_KEY }} | ||
| FULL_SYNC_NOP: ${{ env.APPLY != 'true' }} | ||
| CREATE_PR_COMMENT: 'false' | ||
| CREATE_ERROR_ISSUE: 'false' | ||
| run: npm run full-sync | ||
| - name: Reconcile team repository access after protections succeed | ||
| env: | ||
| APP_ID: ${{ secrets.ORG_APP_ID }} | ||
| run: | | ||
| args=(--config-path=/workspace/peribolos.yml --github-app-id="$APP_ID" --github-app-private-key-path=/key.pem --fix-teams --fix-team-repos --maximum-removal-delta=0) | ||
| if [ "$APPLY" = true ]; then args+=(--confirm); fi | ||
| docker run --rm --user "$(id -u):$(id -g)" -v "$GITHUB_WORKSPACE:/workspace:ro" -v "$RUNNER_TEMP/org-app.pem:/key.pem:ro" "$PERIBOLOS_IMAGE" "${args[@]}" | ||
| - name: Remove temporary App key | ||
| if: always() | ||
| run: rm -f "$RUNNER_TEMP/org-app.pem" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| name: Validate organization configuration | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
| permissions: | ||
| contents: read | ||
| jobs: | ||
| validate: | ||
| name: Validate organization configuration | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | ||
| with: | ||
| node-version: '24' | ||
| - run: npm ci --ignore-scripts --no-audit --no-fund | ||
| - run: npm run validate | ||
| - run: npm test | ||
| - run: python3 -m unittest discover -s tests -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| __pycache__/ | ||
| *.pyc | ||
| reports/ | ||
| .safe-settings/ | ||
| .venv/ | ||
| .DS_Store | ||
| node_modules/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Code of conduct | ||
|
|
||
| ANS follows the [LF Projects Code of Conduct](https://lfprojects.org/policies/code-of-conduct/). | ||
| It applies to participation in the project's repositories and community spaces. | ||
|
|
||
| Report conduct concerns confidentially to the Manager of LF Projects at | ||
| [manager@lfprojects.org](mailto:manager@lfprojects.org). Include what happened, | ||
| when and where, and relevant supporting information. Do not publish sensitive | ||
| reports in a GitHub issue. The linked policy describes the reporting process. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.