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: Add ability to hide certain annotations on secret resources #18216

Merged
merged 10 commits into from
Oct 30, 2024

Conversation

svghadi
Copy link
Contributor

@svghadi svghadi commented May 14, 2024

Closes #15693
Implements hide-annotations.md proposal.
Depends on argoproj/gitops-engine#577

This PR adds ability to define a list of annotations to mask on secret resources. A new resource.sensitive.mask.annotations key (updated based on feedback on PR) is introduced in argocd-cm configmap which can be used to configure a list of annotation keys to mask on secret resources.

mask-annotations.mov

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.
  • 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.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@svghadi svghadi changed the title feat: Add option to hide certain annotations on secret resources in the Argo CD Web UI feat: Add option to hide certain annotations on secret resources May 14, 2024
@svghadi svghadi changed the title feat: Add option to hide certain annotations on secret resources feat: Add ability to hide certain annotations on secret resources May 14, 2024
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 69.23077% with 8 lines in your changes missing coverage. Please review.

Project coverage is 55.12%. Comparing base (bb1e75f) to head (977960e).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
server/application/application.go 42.85% 4 Missing ⚠️
util/settings/settings.go 77.77% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18216      +/-   ##
==========================================
- Coverage   55.20%   55.12%   -0.08%     
==========================================
  Files         324      324              
  Lines       55116    55134      +18     
==========================================
- Hits        30428    30394      -34     
- Misses      22077    22121      +44     
- Partials     2611     2619       +8     

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

@pasha-codefresh
Copy link
Member

@CodiumAI-Agent /review

@CodiumAI-Agent
Copy link

CodiumAI-Agent commented Jun 30, 2024

PR Reviewer Guide 🔍

(Review updated until commit 1bc8297)

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Key issues to review

Code Quality
The method GetHideSecretAnnotations in util/settings/settings.go uses regular expressions to process annotation keys. This could be simplified or better documented to improve maintainability.

Error Handling
In controller/appcontroller.go, the error from HideSecretData is checked, but there's no handling for potential nil objects which might be returned in case of errors. This could lead to runtime panics.

@danielstankw
Copy link

What is the update on this feature? - we need it

@CodiumAI-Agent
Copy link

Persistent review updated to latest commit 1bc8297

@svghadi
Copy link
Contributor Author

svghadi commented Sep 16, 2024

Hi @danielstankw, it is awaiting review on dependent PR argoproj/gitops-engine#577.

@svghadi svghadi marked this pull request as ready for review September 16, 2024 09:22
@svghadi svghadi requested review from a team as code owners September 16, 2024 09:22
util/settings/settings.go Outdated Show resolved Hide resolved
docs/operator-manual/argocd-cm.yaml Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
util/settings/settings.go Outdated Show resolved Hide resolved
@svghadi
Copy link
Contributor Author

svghadi commented Sep 24, 2024

Hi @jsoref , @agaudreault,
Thanks for the inputs. I have incorporated your feedback. Please take a look whenever you get time. I am working on updating doc and adding an e2e test.

@svghadi
Copy link
Contributor Author

svghadi commented Sep 26, 2024

I have updated docs and add an e2e test. The PR is ready for review. Thanks.

Copy link
Member

@agaudreault agaudreault left a comment

Choose a reason for hiding this comment

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

LGTM

@pasha-codefresh
Copy link
Member

LGTM, @svghadi could you please resolve conflicts?

@svghadi
Copy link
Contributor Author

svghadi commented Oct 29, 2024

Seems like CI is flaky. Ran few of the failing tests locally, didn't encounter any failures.

Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
Signed-off-by: Siddhesh Ghadi <sghadi1203@gmail.com>
@svghadi
Copy link
Contributor Author

svghadi commented Oct 30, 2024

CI is green now ✅.
@pasha-codefresh - PR is ready of final review and merge. Thanks.

@agaudreault agaudreault merged commit eb10b70 into argoproj:master Oct 30, 2024
27 checks passed
@svghadi svghadi deleted the hide-secret-annots branch October 30, 2024 18:49
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.

Provide ability to hide defined annotations in ArgoCD web UI
6 participants