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: Flux app detail #5331

Open
wants to merge 46 commits into
base: main
Choose a base branch
from
Open

feat: Flux app detail #5331

wants to merge 46 commits into from

Conversation

RajeevRanjan27
Copy link
Contributor

@RajeevRanjan27 RajeevRanjan27 commented Jun 18, 2024

Description

Fixes #5332

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires 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.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


Copy link

gitguardian bot commented Jun 18, 2024

⚠️ GitGuardian has uncovered 5 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
141558 Triggered Generic High Entropy Secret 134e08c scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/env-values.yaml View secret
1040826 Triggered Generic Password 7d71b8c manifests/installation-script View secret
2763127 Triggered Generic High Entropy Secret 134e08c scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/secrets-test-values.yaml View secret
10220829 Triggered Generic High Entropy Secret 7d71b8c charts/devtron/values.yaml View secret
10220829 Triggered Generic High Entropy Secret 7d71b8c charts/devtron/devtron-bom.yaml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@prakash100198 prakash100198 restored the flux-app-detail branch June 19, 2024 06:22
@prakash100198 prakash100198 reopened this Jun 19, 2024

//handling when the clusterIds string is empty ,it will not support the
if len(clusterIdString) == 0 {
handler.logger.Errorw("error in getting cluster ids", "error", err, "clusterIds", clusterIds)
Copy link
Contributor

@prakash100198 prakash100198 Jun 19, 2024

Choose a reason for hiding this comment

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

make this error "error in getting cluster ids" constant since used multiple times , also the comment above if check is incomplete

We can use util.ApiError with a proper http status code 404 not found error , and this error string can go in UserMessage as well as Internal message

If there are more such known error strings make them constant and leverage util.ApiError to send error resp with proper https status code

@RajeevRanjan27 RajeevRanjan27 changed the title feat: Flux app detail resource tree support feat: Flux app detail Jul 1, 2024
api/fluxApplication/FluxApplicationRestHandler.go Outdated Show resolved Hide resolved
pkg/fluxApplication/helper.go Outdated Show resolved Hide resolved
Comment on lines +71 to +72
if appIdentifier.IsKustomizeApp == true && appIdentifier.Name == "flux-system" && appIdentifier.Namespace == "flux-system" {

Copy link
Contributor

Choose a reason for hiding this comment

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

make "flux-system" constant

Comment on lines 84 to 85
res, err := handler.fluxApplicationService.GetFluxAppDetail(context.Background(), appIdentifier)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

context.Background() -> r.Context()

appList.Errored = &deployedApps.Errored
appList.ErrorMsg = &deployedApps.ErrorMsg
} else {
fluxApps := make([]bean.FluxApplication, 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

make([]bean.FluxApplication, 0) -> make([]bean.FluxApplication, 0,len(deployedApps.FluxApplication))

nishant-d
nishant-d previously approved these changes Jul 4, 2024
Copy link

sonarcloud bot commented Jul 5, 2024

impl.logger.Errorw("error in fetching cluster detail", "err", err)
return nil, err
}
impl.logger.Debugw("successfully fetched the cluster details", "clusterIds", clusters)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

Sensitive data returned by an access to Password
flows to a logging call.
Sensitive data returned by an access to PPassword
flows to a logging call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR:Ready-to-Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Flux Cd App Details
3 participants