Skip to content

Conversation

prakash100198
Copy link
Contributor

Description

Provide description for charts for all the chart type in the base deployment template (Cronjob and Job, Rollout Deployment, Knative and Deployment) within the same API call that fetches the chart types metadata when we click Base Deployment Template. So I introduced another field called 'chartMetadata' to that API response to avoid any data duplication where I will send the chart description metadata of only those charts which are currently provided by us with the same API call.
This is a new feature that will help frontend team build a new dashboard that will show chart type with chart description so that any user can select chart type according to their need.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Deployed my code changes in the remote cluster and verified the response from the frontend via the API:- orchestrator/chartref/autocomplete/{app_id}

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?


-- Table Definition
CREATE TABLE "public"."chart_ref_metadata" (
"chart_name" varchar(100) NOT NULL,
"chart_description" varchar(500) NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

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

change type to text

DROP TABLE "public"."chart_ref_metadata" CASCADE;

----Rows Deletion---
DELETE FROM "public"."chart_ref_metadata" WHERE ("chart_name"= 'Rollout Deployment')
Copy link
Contributor

@manish-agrawal-ai manish-agrawal-ai Nov 5, 2022

Choose a reason for hiding this comment

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

remove delete statements. as this will throw error as you have dropped the table just above.
which means you didn't test this sql scripts :)

@@ -997,12 +1005,24 @@ func (impl ChartServiceImpl) ChartRefAutocomplete() ([]chartRef, error) {
func (impl ChartServiceImpl) ChartRefAutocompleteForAppOrEnv(appId int, envId int) (*chartRefResponse, error) {
chartRefResponse := &chartRefResponse{}
var chartRefs []chartRef
var chartRefMetadata chartRefMetaData
Copy link
Contributor

Choose a reason for hiding this comment

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

needs refactoring

@manish-agrawal-ai manish-agrawal-ai merged commit 1b395a1 into main Nov 7, 2022
@manish-agrawal-ai manish-agrawal-ai deleted the provide-desc-for-charts branch November 7, 2022 07:34
pawan-59 added a commit that referenced this pull request Nov 9, 2022
* fixed migration query in 90th migration (#2586)

* updated wiring for TelemetryEventClientExtended.go (#2588)

* feat: Provide description for Chart Types (#2585)

* chart description provided with the api call

* added code to provide chart description with the api call

* refined the code for poviding chart description

* mitigated nil pointer exception in ChartService

* refactoring

* changes in sql files

Co-authored-by: Manish Agrawal <[email protected]>

* sql script semicolon fix (#2590)

* Ci Build config API backward compatibilty (#2598)

* docker build config added as backward compatible changes

* dependency injection fix

Co-authored-by: kartik-579 <[email protected]>
Co-authored-by: Prakash Kumar <[email protected]>
Co-authored-by: Manish Agrawal <[email protected]>
Co-authored-by: kripanshdevtron <[email protected]>
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.

2 participants