Skip to content
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

feat(ui): Add sourceNamespaces field to projects UI (#15196) #16249

Conversation

jdvgh
Copy link
Contributor

@jdvgh jdvgh commented Nov 6, 2023

Closes #15196

  • This PR adds the field sourceNamespaces which is already defined in the AppProject CRD to the ProjectDetails UI

image

  • it is defined as follows (see manifests/crds/appproject-crd.yaml):
              sourceNamespaces:
                description: SourceNamespaces defines the namespaces application resources
                  are allowed to be created in
                items:
                  type: string
                type: array
  • From what I figured there is no test for the AppProject UI yet so I'd have to write one from scratch which would rely not only on my change but on the whole AppProject UI - maybe this would be a whole other issue/feature.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

@jdvgh jdvgh force-pushed the feat/add-sourcenamespaces-field-to-projects-ui branch from 548a384 to 7f4bd38 Compare November 6, 2023 14:09
@jdvgh jdvgh changed the title feat(ui): Add sourceNamespaces field to projects UI feat(ui): Add sourceNamespaces field to projects UI (#15196) Nov 6, 2023
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (19fa5b9) 49.50% compared to head (001cd10) 49.50%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #16249   +/-   ##
=======================================
  Coverage   49.50%   49.50%           
=======================================
  Files         269      269           
  Lines       47430    47430           
=======================================
  Hits        23479    23479           
  Misses      21645    21645           
  Partials     2306     2306           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jdvgh jdvgh marked this pull request as ready for review November 7, 2023 08:22
@jdvgh jdvgh requested a review from a team as a code owner November 7, 2023 08:22
@crenshaw-dev
Copy link
Member

Thanks for the PR, @jdvgh!

Could we make it so that this panel only appears if the apps-in-any-namespace feature is enabled?

@crenshaw-dev crenshaw-dev added the component:ui User interfaces bugs and enhancements label Nov 14, 2023
@jdvgh
Copy link
Contributor Author

jdvgh commented Nov 14, 2023

Copying from the issue:

@crenshaw-dev Could you give me a pointer on how I'd check whether apps-in-any-namespace is enabled?
I noticed application-tiles.tsx uses useAuthSettingsCtx?.appsInAnyNamespaceEnabled
where
const useAuthSettingsCtx = React.useContext(AuthSettingsCtx); however I'm not that deep into TypeScript and React to know whether this could and should be re-used in settings/components/project-details/project-details.tsx

@crenshaw-dev
Copy link
Member

@jdvgh I think it's safe to reuse here. Checking w/ a colleague...

@crenshaw-dev
Copy link
Member

Checked w/ Ashutosh Singh, you should be good to go using that Ctx.

@jdvgh jdvgh force-pushed the feat/add-sourcenamespaces-field-to-projects-ui branch from fd27864 to 1678ec0 Compare November 16, 2023 23:04
…sInAnyNamespaceEnabled flag is set

Signed-off-by: Eilers, Jonas <133217951+jdvgh@users.noreply.github.com>
@jdvgh jdvgh force-pushed the feat/add-sourcenamespaces-field-to-projects-ui branch from 1678ec0 to ce7be1f Compare November 16, 2023 23:04
@jdvgh
Copy link
Contributor Author

jdvgh commented Nov 16, 2023

@crenshaw-dev added it to be specific to appsInAnyNamespaceEnabled. Tested it by (un)setting:

data:
  application.namespaces: test-*

in argocd-cmd-params-cm.

@crenshaw-dev
Copy link
Member

crenshaw-dev commented Nov 20, 2023

I've assigned Ashutosh to review this in my team's next sprint (starting tomorrow). You can expect a review in the next two weeks!

@ashutosh16
Copy link
Contributor

ashutosh16 commented Nov 30, 2023

UI seems good to me.

Screenshot 2023-11-30 at 9 38 18 AM Screenshot 2023-11-30 at 9 38 00 AM

Copy link
Contributor

@ashutosh16 ashutosh16 left a comment

Choose a reason for hiding this comment

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

LGTM

@jdvgh
Copy link
Contributor Author

jdvgh commented Dec 1, 2023

@ashutosh16 @crenshaw-dev thanks for the Review 🥂 - do I need to do anything more now? For me it still says:

Merging is blocked
Merging can be performed automatically with 1 approving review.

Copy link
Member

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

Thanks, @jdvgh!

@crenshaw-dev crenshaw-dev merged commit 017b08a into argoproj:master Dec 1, 2023
25 checks passed
@jdvgh jdvgh deleted the feat/add-sourcenamespaces-field-to-projects-ui branch December 4, 2023 16:37
vladfr pushed a commit to vladfr/argo-cd that referenced this pull request Dec 13, 2023
…sInAnyNamespaceEnabled flag is set (argoproj#16249)

Signed-off-by: Eilers, Jonas <133217951+jdvgh@users.noreply.github.com>
tesla59 pushed a commit to tesla59/argo-cd that referenced this pull request Dec 16, 2023
…sInAnyNamespaceEnabled flag is set (argoproj#16249)

Signed-off-by: Eilers, Jonas <133217951+jdvgh@users.noreply.github.com>
JulienFuix pushed a commit to JulienFuix/argo-cd that referenced this pull request Feb 6, 2024
…sInAnyNamespaceEnabled flag is set (argoproj#16249)

Signed-off-by: Eilers, Jonas <133217951+jdvgh@users.noreply.github.com>
lyda pushed a commit to lyda/argo-cd that referenced this pull request Mar 28, 2024
…sInAnyNamespaceEnabled flag is set (argoproj#16249)

Signed-off-by: Eilers, Jonas <133217951+jdvgh@users.noreply.github.com>
Signed-off-by: Kevin Lyda <kevin@lyda.ie>
Hariharasuthan99 pushed a commit to AmadeusITGroup/argo-cd that referenced this pull request Jun 16, 2024
…sInAnyNamespaceEnabled flag is set (argoproj#16249)

Signed-off-by: Eilers, Jonas <133217951+jdvgh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:ui User interfaces bugs and enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sourceNamespaces field to the Projects UI
3 participants