Skip to content

[CI] mqttv5 ADR namespace repair: reuse role assignments inherited from the resource group - #412

Merged
Ewerton Scaboro da Silva (ewertons) merged 1 commit into
mainfrom
ci/mqttv5-adr-inherited-grants
Oct 11, 2026
Merged

Ewerton Scaboro da Silva (ewertons) merged 1 commit into
mainfrom
ci/mqttv5-adr-inherited-grants

Conversation

@ewertons

Copy link
Copy Markdown
Contributor

Role assignments scoped to the ADR namespace are deleted with it; the repair job then needs role-assignment write to recreate them, which the CI identity may not be allowed to have.

  • c/eng/e2e-mqttv5-adr-namespace.ps1: before granting, look up assignments of the role to the principal at the target scope or any parent; skip if present. A missing grant that cannot be created (AuthorizationFailed) fails at once with a message to grant it on the resource group.
  • Workflow header and end-to-end-tests.md: the identity needs Contributor on the resource group; role assignment write only if the link's grants are not on the resource group (or the namespace identity changes).

Validation: script run with a stubbed az (all grants inherited: no creates; one missing and denied: fails with that message); scope match checked against sibling/parent scopes; actionlint and zizmor clean.

…om the resource group

Role assignments scoped to the namespace are removed with it; assignments on
the resource group survive. Skip a grant when an assignment of the same role
to the same principal exists at the target scope or above, so the job needs
only Contributor when the grants are made once on the resource group. A grant
that is missing and cannot be created fails with a message saying so.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The lookup correctly includes ancestor assignments and filters out unrelated descendant scopes.

0 open findings

What changed in this PR

Updates ADR namespace repair to reuse inherited role assignments, reducing required CI permissions.

Changes:

  • Detects applicable role assignments at target or ancestor scopes.
  • Fails immediately with actionable guidance when assignment creation is unauthorized.
  • Documents revised OIDC permission requirements.
File Description
c/​eng/​e2e-mqttv5-adr-namespace.ps1 Reuses inherited assignments and improves authorization failure handling.
c/​docs/​eng/​end-to-end-tests.md Documents resource-group grants and CI permissions.
.github/​workflows/​ci-c-e2e-mqttv5-adr-namespace.yml Updates workflow permission guidance.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ewertons
Ewerton Scaboro da Silva (ewertons) merged commit 6cf6199 into main Oct 11, 2026
54 checks passed
@ewertons
Ewerton Scaboro da Silva (ewertons) deleted the ci/mqttv5-adr-inherited-grants branch October 11, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants