Skip to content

Commit 97f6350

Browse files
Add explicit codeowners line for who can approve extension publishing (#9155)
Prep for adding in Foundry developers so they can also approve their own registry update PRs, subject to the checks in the `ext-registry-check` workflow. (There's some github changes I need to do before I can add Foundry into CODEOWNERS, but this is very close!) (small changes) * Bring myself back as an azd reviewer. * Adding myself to the global codeowners slot since everyone else is on that. (these are those workflows, and it's js file): - https://github.com/Azure/azure-dev/blob/main/.github/scripts/src/ext-registry-check.js - https://github.com/Azure/azure-dev/blob/main/.github/workflows/ext-registry-check.yml The way this works, with regards to registry PRs: - Simple registry updates (new version for an existing extension, no provider or capability updates) can be approved by anyone in CODEOWNERS (azd team, foundry devs, currently). - Complex updates (ie, any of those things mentioned above, change), you get a PR workflow fail for the "ext-registry-check" workflow run: <img width="1324" height="113" alt="image" src="https://github.com/user-attachments/assets/f444dcb1-a1b3-452f-b72f-577e76902980" /> If you click it ([link](https://github.com/Azure/azure-dev/actions/runs/29439680201/job/87435127264?pr=9100)) it'll tell you the specific item that's requires approval. So then: 1. The user needs to find an azd core team member, and provided it's "okay" (@tg-msft is working on docs) then they'll approve it and the release can happen (the 'super approvers' list is just hardcoded in the JS at this moment: (https://github.com/Azure/azure-dev/blob/cc1f941a9a27098facdd95db0f4f47fc5241a3b6/.github/scripts/src/ext-registry-check.js#L143)) 2. Re-run that failed workflow step - now it will pass. Part of the fix for #8997
1 parent 8eb1a10 commit 97f6350

3 files changed

Lines changed: 33 additions & 5 deletions

File tree

.github/CODEOWNERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
# everything else not listed below -- no need for a separate /cli/ rule.
66

77
# ── Default (core team) ──────────────────────────────────────────────────────
8-
/** @vhvb1989 @hemarina @JeffreyCA @tg-msft @RickWinter
8+
/** @vhvb1989 @hemarina @JeffreyCA @tg-msft @RickWinter @richardpark-msft
99

1010
# ── CLI installer ─────────────────────────────────────────────────────────────
1111
/cli/installer/ @danieljurek @vhvb1989 @tg-msft @RickWinter
1212

13+
# ── CLI extensions registry - anyone added to this can approve extension publishing, provided they pass the `ext-registry-check` workflow.
14+
/cli/azd/extensions/registry.json @vhvb1989 @hemarina @JeffreyCA @tg-msft @RickWinter @richardpark-msft
15+
1316
# ── CLI extensions (AI) ──────────────────────────────────────────────────────
1417
/cli/azd/extensions/azure.ai.agents/ @JeffreyCA @glharper @trangevi @trrwilson @therealjohn @huimiu @hund030
1518
/cli/azd/test/functional/ai_agents/ @JeffreyCA @glharper @trangevi @trrwilson @therealjohn @huimiu @hund030

.github/scripts/src/ext-registry-check.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ function getCoreReviewers({ core }) {
145145
'hemarina',
146146
'JeffreyCA',
147147
'RickWinter',
148-
// TODO: bring me back from the dead!
149-
// 'richardpark-msft',
148+
// TODO: bring me back after we get this all working in production
149+
//'richardpark-msft',
150150
'tg-msft',
151151
'vhvb1989',
152152
];

.github/workflows/ext-registry-check.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
name: ext-registry-check
22

3+
# NOTE: We're using pull_request_target here, because the PR is untrusted and the entire point of this workflow is to judge
4+
# if "untrusted registry.json update is safe", so we need to make sure the workflow is coming from our 'protected'
5+
# main branch, not from the user's PR branch.
6+
#
7+
# Currently, check-enforcer doesn't have the same support for `pull_request_target` as `pull_request` so we need to have a
8+
# discussion about what's going on there. I filed an issue, so potentially we can revisit this:
9+
# - https://github.com/Azure/azure-sdk-tools/issues/16366
10+
#
11+
# This means we, instead, need to be set in GitHub as a "required to pass" workflow check. That means our workflow
12+
# needs to run on _every_ PR because required workflows still need to report a status on each PR. We no-op quickly,
13+
# but we still need to run and report a status, regardless.
314
on:
415
pull_request_target:
5-
paths:
6-
- "cli/azd/extensions/registry.json"
716
branches: [main]
817
types: [opened, edited, synchronize, labeled, unlabeled, reopened, ready_for_review]
918

@@ -26,12 +35,28 @@ jobs:
2635
runs-on: ubuntu-latest
2736
timeout-minutes: 5
2837
steps:
38+
- name: Check if registry.json changed
39+
id: changed
40+
uses: actions/github-script@v9
41+
with:
42+
script: |
43+
const files = await github.paginate(github.rest.pulls.listFiles, {
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
pull_number: context.payload.pull_request.number,
47+
});
48+
const changed = files.some((f) => f.filename === 'cli/azd/extensions/registry.json');
49+
core.info(`registry.json changed: ${changed}`);
50+
core.setOutput('registry_json_changed', changed);
51+
2952
- name: Checkout
53+
if: steps.changed.outputs.registry_json_changed == 'true'
3054
uses: actions/checkout@v6
3155
with:
3256
ref: ${{ github.event.pull_request.base.sha }}
3357

3458
- name: Check extension registry update
59+
if: steps.changed.outputs.registry_json_changed == 'true'
3560
uses: actions/github-script@v9
3661
with:
3762
script: |

0 commit comments

Comments
 (0)