Skip to content

feat:show notes for gitops app #3045

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

Closed
wants to merge 12 commits into from
Closed

Conversation

adi6859
Copy link
Contributor

@adi6859 adi6859 commented Feb 27, 2023

Description

This feature will show notes.txt file on helm apps that id deployed via gitops.

Fixes AB2880

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
1.I have tested this via image deployment on vm.
2. I have checked for all cases that I have mentioned in unit test case in kubelink.

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?



response, err := impl.helmAppClient.GetNotes(ctx, request)
if err != nil {
impl.logger.Errorw("error in fetching chart", "err", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

add request in logging

prakash100198
prakash100198 previously approved these changes Feb 28, 2023
},
},
}
notes, err := impl.helmAppService.GetNotes(context.Background(), installReleaseRequest)
Copy link
Contributor

Choose a reason for hiding this comment

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

handle error here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

prakash100198
prakash100198 previously approved these changes Mar 1, 2023
@vikramdevtron vikramdevtron self-requested a review March 1, 2023 05:26
vikramdevtron
vikramdevtron previously approved these changes Mar 1, 2023
@adi6859 adi6859 dismissed stale reviews from vikramdevtron and prakash100198 via e12ebcf March 2, 2023 15:07
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 6, 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 7 Code Smells

No Coverage information No Coverage information
2.1% 2.1% Duplication

@@ -767,7 +768,6 @@ func (impl *InstalledAppServiceImpl) FindAppDetailsForAppstoreApplication(instal
Deprecated: installedAppVerison.AppStoreApplicationVersion.Deprecated,
ClusterId: installedAppVerison.InstalledApp.Environment.ClusterId,
DeploymentAppType: installedAppVerison.InstalledApp.DeploymentAppType,
DeploymentAppDeleteRequest: installedAppVerison.InstalledApp.DeploymentAppDeleteRequest,
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you remove this? what's the logic behind this?

installedAppVerison, err := impl.installedAppRepository.GetInstalledAppVersionByInstalledAppIdAndEnvId(installedAppId, envId)
var notes string
appName := installedAppVerison.InstalledApp.App.AppName
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.

handle the error just after line 784. if there is an error while getting installedAppVersion then installedAppVersion will come as nil and code will break since you are fetching AppName from it, return empty strings while returning.

@@ -889,7 +932,7 @@ func (impl InstalledAppServiceImpl) GetInstalledAppVersionHistoryValues(installe
values.ValuesYaml = versionHistory.ValuesYamlRaw
return values, err
}
func (impl InstalledAppServiceImpl) FetchResourceTree(rctx context.Context, cn http.CloseNotifier, appDetail *bean2.AppDetailContainer) (bean2.AppDetailContainer, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you remove the error returning, logic behind it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not done by me

return *appDetail, nil
}

func (impl InstalledAppServiceImpl) MarkGitOpsInstalledAppsDeletedIfArgoAppIsDeleted(installedAppId int, envId int) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

deleted the whole func, why, logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not done by me

@@ -123,6 +123,9 @@ type AppDetailContainer struct {
LinkOuts []LinkOuts `json:"linkOuts,omitempty"`
ResourceTree map[string]interface{} `json:"resourceTree,omitempty"`
}
type Notes struct {
Notes string `json:"gitOpsNotes,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you create new struct for only notes, wasn't there any notes field in the response object?

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.

Feature: Show NOTES.txt for helm apps deployed through Devtron with gitops
4 participants