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
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/bean/AppView.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ type AppDetailContainer struct {
Environments []Environment `json:"otherEnvironment,omitempty"`
LinkOuts []LinkOuts `json:"linkOuts,omitempty"`
ResourceTree map[string]interface{} `json:"resourceTree,omitempty"`
Notes string `json:"gitOpsNotes,omitempty"`
}

type Environment struct {
Expand Down
20 changes: 20 additions & 0 deletions api/helm-app/HelmAppService.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type HelmAppService interface {
GetDevtronHelmAppIdentifier() *AppIdentifier
UpdateApplicationWithChartInfoWithExtraValues(ctx context.Context, appIdentifier *AppIdentifier, chartRepository *ChartRepository, extraValues map[string]interface{}, extraValuesYamlUrl string, useLatestChartVersion bool) (*openapi.UpdateReleaseResponse, error)
TemplateChart(ctx context.Context, templateChartRequest *openapi2.TemplateChartRequest) (*openapi2.TemplateChartResponse, error)
GetNotes(ctx context.Context, request *InstallReleaseRequest) (string, error)
}

type HelmAppServiceImpl struct {
Expand Down Expand Up @@ -727,6 +728,25 @@ func (impl *HelmAppServiceImpl) TemplateChart(ctx context.Context, templateChart

return response, nil
}
func (impl *HelmAppServiceImpl) GetNotes(ctx context.Context, request *InstallReleaseRequest) (string, error) {
clusterId := int(request.ReleaseIdentifier.ClusterConfig.ClusterId)
config, err := impl.GetClusterConf(clusterId)
var notesTxt string
if err != nil {
impl.logger.Errorw("error in fetching cluster detail", "clusterId", clusterId, "err", err)
return notesTxt, err
}

request.ReleaseIdentifier.ClusterConfig = config

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

return notesTxt, err
}
notesTxt = response.Notes
return notesTxt, err
}

type AppIdentifier struct {
ClusterId int `json:"clusterId"`
Expand Down
15 changes: 15 additions & 0 deletions api/helm-app/applicationClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type HelmAppClient interface {
RollbackRelease(ctx context.Context, in *RollbackReleaseRequest) (*BooleanResponse, error)
TemplateChart(ctx context.Context, in *InstallReleaseRequest) (*TemplateChartResponse, error)
InstallReleaseWithCustomChart(ctx context.Context, in *HelmInstallCustomRequest) (*HelmInstallCustomResponse, error)
GetNotes(ctx context.Context, request *InstallReleaseRequest) (*ChartNotesResponse, error)
}

type HelmAppClientImpl struct {
Expand Down Expand Up @@ -290,3 +291,17 @@ func (impl *HelmAppClientImpl) InstallReleaseWithCustomChart(ctx context.Context
}
return response, nil
}

func (impl *HelmAppClientImpl) GetNotes(ctx context.Context, in *InstallReleaseRequest) (*ChartNotesResponse, error) {
applicationClient, err := impl.getApplicationClient()
if err != nil {
return nil, err
}
response, err := applicationClient.GetNotes(ctx, in)

if err != nil {
return nil, err
}
return response, nil

}
Loading