Skip to content

Fetch Azure Role Assignments for the Access tab in managed projects#511

Open
tejhan wants to merge 1 commit intoAzure:mainfrom
tejhan:AKSProjectAccessTab
Open

Fetch Azure Role Assignments for the Access tab in managed projects#511
tejhan wants to merge 1 commit intoAzure:mainfrom
tejhan:AKSProjectAccessTab

Conversation

@tejhan
Copy link
Copy Markdown
Collaborator

@tejhan tejhan commented Mar 24, 2026

Description

This PR registers a custom AccesTab component on projects that are managed by ARM so that we can accurately fetch & display Azure Role Assignments to the user, specifically on AKSD projects that are managed, while preserving default k8s role access tab for non-managed AKSD projects.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • CI/CD changes
  • Other: **___**

Related Issues

Closes #[issue number]
Related to #[issue number]

Changes Made

  • Created listNamespaceRoleAssignments utility function
  • Created AccessTab with useAccessTab hook for population
  • Added access tab registration override in index.tsx
  • Added isArmManagedproject to distinguish between regular ASKD projects & managed ones.

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Performance tested (if applicable)
  • Accessibility tested (if applicable)

Test Cases

Describe the test cases that were run:

  1. Create both a managed & non-managed project
  2. Open the managed project.
  3. Observe the access tab fetch Azure roles
  4. Open the non-managed project
  5. Observe the default access tab

Screenshots/Videos

image

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Documentation Updates

  • README.md updated
  • API documentation updated
  • Code comments updated
  • User guide updated
  • No documentation updates needed

Reviewer Notes

Any specific areas you'd like reviewers to focus on or questions you have.

Copilot AI review requested due to automatic review settings March 24, 2026 13:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a custom Access tab experience for ARM-managed AKS Desktop projects, enabling the UI to fetch and display Azure Role Assignments for the project namespace, while leaving non-managed projects on the default Kubernetes access view.

Changes:

  • Adds ARM-managed project detection via a new isArmManagedProject helper.
  • Introduces an Azure CLI utility to list role assignments for a managed namespace.
  • Registers a custom Access tab and implements a hook-driven UI to fetch/cache/display assignments.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
plugins/aks-desktop/src/utils/shared/isAksProject.ts Adds ARM-managed project detection based on a namespace label.
plugins/aks-desktop/src/utils/azure/az-cli.ts Adds listNamespaceRoleAssignments() and a role-assignment shape for UI consumption.
plugins/aks-desktop/src/index.tsx Registers an Access tab override for ARM-managed projects.
plugins/aks-desktop/src/components/AccessTab/hooks/useAccessTab.ts New hook to fetch role assignments with a short TTL cache and refresh support.
plugins/aks-desktop/src/components/AccessTab/AccessTab.tsx New Access tab UI that renders role assignments, loading, and error states.
Comments suppressed due to low confidence (1)

plugins/aks-desktop/src/index.tsx:420

  • The comment says this delete button is for "ARM-managed projects only", but isEnabled is still isAksProject (managed-by: aks-desktop). Either update isEnabled to isArmManagedProject or adjust the comment so it matches the actual behavior.
// Register custom delete button for ARM-managed projects only
registerProjectDeleteButton({
  isEnabled: isAksProject,
  component: ({ project }) => <AKSProjectDeleteButton project={project} />,
});

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tejhan tejhan force-pushed the AKSProjectAccessTab branch from 4a99e97 to ac8a3c9 Compare March 25, 2026 18:24
Copilot AI review requested due to automatic review settings March 26, 2026 20:19
@tejhan tejhan force-pushed the AKSProjectAccessTab branch from ac8a3c9 to 9b489a6 Compare March 26, 2026 20:19
@tejhan tejhan force-pushed the AKSProjectAccessTab branch from 9b489a6 to d5bc6ec Compare March 26, 2026 20:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tejhan tejhan force-pushed the AKSProjectAccessTab branch from d5bc6ec to e0928f7 Compare March 26, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants