Skip to content

feat: Argo flux permission - #3145

Open
shivani170 wants to merge 10 commits into
developfrom
feat-argo-flux-permission
Open

feat: Argo flux permission#3145
shivani170 wants to merge 10 commits into
developfrom
feat-argo-flux-permission

Conversation

@shivani170

Copy link
Copy Markdown
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

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)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

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.

🟡 Changes recommended

Unresolved environment selection, loading-state, stale-value, and validation issues block approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds Argo CD and Flux CD permission management and enables authorized users to access corresponding application views.

Changes:

  • Adds permission tabs, APIs, validation, and environment-scoped selectors.
  • Propagates Argo/Flux access controls through navigation, lists, and details.
  • Updates shared UI dependencies and development proxy configuration.
File summaries
File Review summary
yarn.lock Locks the updated shared dependency.
vite.config.mts Changes the default proxy to staging; retain the existing default and use VITE_TARGET_URL instead.
src/Pages/GlobalConfigurations/Authorization/utils.ts Adds projectless validation, but “All applications” can bypass mandatory environment validation.
src/Pages/GlobalConfigurations/Authorization/types.ts Adds Argo/Flux permission and resource types.
src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/utils.ts Adds Argo/Flux tabs, helpers, and cluster IDs.
src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/types.ts Extends supported permission types.
src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/EnvironmentSelector.tsx Reuses environment selection, but drops clusterId, preventing application requests.
src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/DirectPermission.tsx Hides project selection for projectless applications.
src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/constants.ts Adds empty Argo/Flux permission rows.
src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/AppPermissions.component.tsx Integrates permission workflows, but retains stale applications when environments change.
src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/AppPermissionDetail.tsx Updates projectless permission headers and layouts.
src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/AppOrJobSelector.tsx Loads environment-scoped applications, but clearing environments can leave loading stuck.
src/Pages/GlobalConfigurations/Authorization/constants.ts Adds Argo/Flux validation state.
src/Pages/GlobalConfigurations/Authorization/authorization.service.ts Adds Argo/Flux resource APIs.
src/Pages/GlobalConfigurations/Authorization/authorization.scss Adds projectless permission-row styling.
src/Pages/App/Details/ExternalFlux/ExternalFluxAppDetails.tsx Allows permitted users to view Flux details.
src/components/common/navigation/NavigationRoutes.tsx Publishes Argo/Flux access flags through context.
src/components/app/list-new/GenericAppList.tsx Enforces application-type access.
src/components/app/list-new/AppList.tsx Shows authorized Argo/Flux tabs.
package.json Updates the shared UI library.
Review details

Suppressed comments (2)

src/Pages/GlobalConfigurations/Authorization/Shared/components/AppPermissions/AppOrJobSelector.tsx:167

  • Projectless rows use a truthy placeholder team, so this condition enables the application picker before any environment is selected. Users can select “All applications” and save, but validation treats the row as untouched because its environment list is empty and silently drops it. Require an environment first for Argo/Flux.
            isDisabled={
                !permission.team || (projectId && listForAccessType.get(projectId)?.loading) || isLoadingArgoFluxApps
            }

vite.config.mts:33

  • This feature change also redirects the default local-development proxy from preview to staging, so unrelated local API calls now hit a different shared environment. The PR does not require that operational change; keep the existing default and use VITE_TARGET_URL when staging is needed.
const TARGET_URL = 'https://staging.devtron.info/'
  • Files reviewed: 19/20 changed files
  • Comments generated: 4
  • Review effort level: Balanced

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

Comment thread src/Pages/GlobalConfigurations/Authorization/utils.ts Outdated
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@github-actions github-actions Bot added the PR:Issue-verification-failed PR:Issue-verification-failed label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@shivani170 shivani170 changed the title Feat argo flux permission feat: Argo flux permission Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

export type ProjectsListType = Record<ACCESS_TYPE_MAP, Teams[]>
export type EnvironmentsListType = Record<ACCESS_TYPE_MAP.DEVTRON_APPS | ACCESS_TYPE_MAP.JOBS, EnvListMinDTO[]>

type PermissionTabAccessType =

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.

Should we export this 1 level up. So that it can be reused in other places as well

environment?: string
action: string
accessType?: ACCESS_TYPE_MAP.DEVTRON_APPS | ACCESS_TYPE_MAP.HELM_APPS | ACCESS_TYPE_MAP.JOBS
accessType?:

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.

We should use 'PermissionTabAccessType'

export interface DirectPermissionsRoleFilter extends RoleFilter, PermissionStatusAndTimeout {
entity: EntityTypes.DIRECT | EntityTypes.JOB
accessType: ACCESS_TYPE_MAP.DEVTRON_APPS | ACCESS_TYPE_MAP.HELM_APPS | ACCESS_TYPE_MAP.JOBS
accessType:

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.

we should use 'PermissionTabAccessType'

extends Partial<Pick<K8sResourceListPayloadType, 'clusterId' | 'k8sRequest'>> {
entity: EntityTypes
accessType?: ACCESS_TYPE_MAP.DEVTRON_APPS | ACCESS_TYPE_MAP.HELM_APPS
accessType?:

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.

Same here


const isArgoCDAppList = appType === InfrastructureManagementAppListType.ARGO_CD
const isFluxCDAppList = appType === InfrastructureManagementAppListType.FLUX_CD
const hasAppTypeAccess = isSuperAdmin || (isArgoCDAppList ? hasArgoAppAccess : hasFluxAppAccess)

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.

Should we also check 'isFluxCDAppList'?

@github-actions

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@github-actions

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@github-actions

Copy link
Copy Markdown

Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR:Issue-verification-failed PR:Issue-verification-failed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants