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: custom chart download #3801

Merged
merged 20 commits into from
Sep 5, 2023
Merged

feat: custom chart download #3801

merged 20 commits into from
Sep 5, 2023

Conversation

Ash-exp
Copy link
Contributor

@Ash-exp Ash-exp commented Aug 21, 2023

Description

Problem Statement:
Inability to Download Uploaded Helm Charts on Devtron Hinders Chart Modifications and Re-uploads.

Solution:

  1. An option to download listed custom charts.
  2. Display all devtron default charts in that list.

Fixes #3840

Invalid Chart Name: lower(Reserved_Names) has prefix

Reserved_Names_Examples

Rollout Deployment/  Rollout_Deployment/ Rollout.Deployment/ Rollout-Deployment/rollout deployment/ rollout_deployment/ rollout.deployment/ rollout-deployment/ Reference Chart/ Reference_Chart/ Reference.Chart/ Reference-Chart/reference.chart/ reference-chart
Deployment/ deployment/ Deployment Chart/Deployment_Chart/Deployment.Chart/Deployment-Chart/deployment.chart/ deployment-chart
Knative/ knative/ Knative Chart/ Knative_Chart/ Knative.Chart/ Knative-Chartknative.chart/ knative-chart
Job & CronJob/ job & cronjob/job_&_cronjob/Cronjob Chart/Cronjob_Chart/Cronjob.Chart/ Cronjob-Chartcronjob.chart/ cronjob-chart
StatefulSet/ statefulset/ statefulset.chart/ statefulset-chart

How Has This Been Tested?

  • Upload existing Chart and Version
  • Upload existing Chart with different version
  • Upload new Chart
  • Upload Devtron Reference Charts with reserved name
  • Upload Devtron Reference Charts with new name
  • Upload Chart with editing the description
  • Use the Custom Chart in Devtron App

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?


@Ash-exp Ash-exp added the enhancement New feature or request label Aug 21, 2023
@Ash-exp Ash-exp self-assigned this Aug 21, 2023
@gitguardian
Copy link

gitguardian bot commented Aug 21, 2023

⚠️ GitGuardian has uncovered 2 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 Secret Commit Filename
7786970 Generic High Entropy Secret 7af7645 api/appStore/deployment/AppStoreDeploymentRestHandler.go View secret
7786970 Generic High Entropy Secret 3ada5a2 api/appStore/deployment/AppStoreDeploymentRestHandler.go 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.

Our GitHub checks need improvements? Share your feedbacks!

// common.WriteJsonResp(w, err, nil, http.StatusInternalServerError)
// return
//}
ctx = context.WithValue(r.Context(), "token", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2OTIzNTM3MDYsImp0aSI6IjcwNDIzOTRjLTQwNDktNDVjMi05MWE0LTkxZDViYjEwNDJmNCIsImlhdCI6MTY5MjI2NzMwNiwiaXNzIjoiYXJnb2NkIiwibmJmIjoxNjkyMjY3MzA2LCJzdWIiOiJhZG1pbiJ9.gSWm-GbKY4I1Svg5xOGsrVRGSAAvdBC7S8iIlomfL9I")
Copy link
Contributor

Choose a reason for hiding this comment

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

revert this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed 👍


token := r.Header.Get("token")
if ok := handler.enforcer.Enforce(token, casbin.ResourceGlobal, casbin.ActionDelete, "*"); !ok {
common.WriteJsonResp(w, errors.New("unauthorized"), nil, http.StatusForbidden)
Copy link
Contributor

Choose a reason for hiding this comment

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

correct rbac action

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have used ActionUpdate

common.WriteJsonResp(w, fmt.Errorf("error in parsing chartRefId : %s must be integer", chartRefId), nil, http.StatusBadRequest)
return
}
chartRef, err := handler.chartService.FetchChartInfoByChartRefId(chartRefId)
Copy link
Contributor

Choose a reason for hiding this comment

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

we should move this logic of fetching chart and converting it into bytes in a separate function in chart service

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed 👍

@sonarcloud
Copy link

sonarcloud bot commented Sep 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@Ash-exp Ash-exp removed the request for review from vikramdevtron September 5, 2023 17:02
@Ash-exp Ash-exp merged commit 6f3b96a into main Sep 5, 2023
6 of 8 checks passed
@Ash-exp Ash-exp deleted the feat-custom-chart-download branch September 5, 2023 17:12
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: Download Custom Charts
3 participants