-
Notifications
You must be signed in to change notification settings - Fork 515
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:store notes.txt in db and fetch from db #3183
Conversation
@@ -411,31 +411,26 @@ func (handler *InstalledAppRestHandlerImpl) FetchNotesForArgoInstalledApp(w http | |||
return | |||
} | |||
handler.Logger.Infow("request payload, FetchNotesForArgoInstalledApp, app store", "installedAppId", installedAppId, "envId", envId) | |||
|
|||
notes, appName, err := handler.installedAppService.FindNotesForArgoApplication(installedAppId, envId) | |||
notes, err := handler.installedAppService.FetchNotesFromdb(installedAppId, envId, token, handler.checkNotesAuth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the function name, fetchChartNotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -189,6 +190,13 @@ func (impl InstalledAppRepositoryImpl) UpdateInstalledAppVersion(model *Installe | |||
} | |||
return model, nil | |||
} | |||
func (impl InstalledAppRepositoryImpl) FetchNotesFromdb(installedAppId int) (*InstalledApps, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FetchNotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -280,6 +281,33 @@ func (impl AppStoreDeploymentServiceImpl) GetGitOpsRepoName(appName string) stri | |||
return repoName | |||
} | |||
|
|||
func (impl AppStoreDeploymentServiceImpl) AppStoreDeployOperationNotesUpdate(installAppId int, notes string) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UpdateNotesForInstalledApp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
return "", nil | ||
} | ||
|
||
if installedApp.Notes == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
isValidAuth := checkNotesAuth(token, appName, envId) | ||
if !isValidAuth { | ||
impl.logger.Errorw("unauthorized user", "isValidAuth", isValidAuth) | ||
return "", nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
impl.logger.Errorw("error fetching installed app version in installed app service", "err", err) | ||
return "", err | ||
} | ||
appStoreAppVersion, err := impl.appStoreApplicationVersionRepository.FindById(installedAppVerison.AppStoreApplicationVersion.Id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are already getting appStoreAppVersion by installedAppVerison, err := impl.installedAppRepository.GetInstalledAppVersionByInstalledAppIdAndEnvId(installedAppId, envId) , no need to fetch it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok,changes done
Kudos, SonarCloud Quality Gate passed!
|
Description
In this PR I have to store notes.txt in db for helm charts deployed via gitOps and fetch from db if present .
Fixes Ab2484
How Has This Been Tested?
a. when notes is not present in db.
b. when notes is present in db.
c.for all these test test cases , I have checked for timing and it is working fine , if fetching from db it is taking less time and when fetching from kubelink it is taking more time.
3.I have also done testing by putting multiple breakpoints.
Checklist: