argoproj / gitops-engine

Democratizing GitOps
https://pkg.go.dev/github.com/argoproj/gitops-engine?tab=subdirectories
Apache License 2.0
1.67k stars 251 forks source link

feat: Add ability to hide certain annotations on secret resources #577

Open svghadi opened 3 months ago

svghadi commented 3 months ago

Related to https://github.com/argoproj/argo-cd/issues/15693.

This PR implements core logic from argoproj/argo-cd#hide-annotations.md proposal to hide annotations on secret resources.

This change will be integrated with Argo CD via https://github.com/argoproj/argo-cd/pull/18216.

Integration results:

https://github.com/argoproj/gitops-engine/assets/61187612/fdedc78c-1926-4582-aa9f-e1fefedf0f28

sonarcloud[bot] commented 3 months ago

Quality Gate Passed Quality Gate passed

Issues
5 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
3.4% Duplication on New Code

See analysis details on SonarCloud

pasha-codefresh commented 2 months ago

@CodiumAI-Agent /review

CodiumAI-Agent commented 2 months ago

PR Reviewer Guide 🔍

⏱️ Estimated effort to review [1-5] 3
🧪 Relevant tests Yes
🔒 Security concerns No
⚡ Key issues to review Possible Bug:
The function HideSecretData now accepts an optional hideAnnots parameter which is used to specify which annotations should be hidden. However, there is no check to ensure that the annotations specified actually exist in the object, which could lead to unnecessary processing or errors if non-existent annotations are specified.
Performance Concern:
The method of hiding annotations involves iterating over each annotation for each object (target, live, orig) which could be inefficient, especially with a large number of annotations or secrets. Consider optimizing this process.
svghadi commented 1 month ago

Hi @pasha-codefresh, sorry for the nudge :point_right: :sweat_smile:. Did you get a chance to review it again?

pasha-codefresh commented 1 month ago

@svghadi sorry, had urgent work to do, i will review it tomorrow

isaccavalcante commented 2 weeks ago

Hey @pasha-codefresh, were you able to review it again by any chance? thanks in advance.