Skip to content

Conversation

@iamayushm
Copy link
Contributor

@iamayushm iamayushm commented Feb 9, 2023

Description

Fixing case where deletion get stuck, the argo app is not actually deleted but it is deleted at devtron side. This causes error when user tries to recreate the pipeline.
Fixes #2746

tech doc: https://docs.google.com/document/d/1XrOChkOvShkpk0oNr-BqXT4jerOizgSza1Xw6naSN9E/edit

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

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?


@iamayushm iamayushm changed the title Enhancement: Recreating deployment pipeline shows already exists error without proper information feat: Recreating deployment pipeline shows already exists error without proper information Feb 9, 2023
@iamayushm iamayushm changed the title feat: Recreating deployment pipeline shows already exists error without proper information feat: delete state handling for devtron apps deployed using gitOps. Feb 10, 2023
@iamayushm iamayushm self-assigned this Feb 15, 2023
handler.Logger.Infow("request payload, FetchAppDetailsForInstalledApp, app store", "installedAppId", installedAppId, "envId", envId)

err = handler.installedAppService.CheckAppExistsByInstalledAppId(installedAppId)
if err == pg.ErrNoRows {
Copy link
Contributor

Choose a reason for hiding this comment

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

avoid this check in rest handler, handle it in service layer.

//rback block ends here
if len(appDetail.AppName) > 0 && len(appDetail.EnvironmentName) > 0 {
handler.fetchResourceTree(w, r, &appDetail)
err = handler.fetchResourceTree(w, r, &appDetail)
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move this logic at service layer

common.WriteJsonResp(w, err, nil, http.StatusBadRequest)
return
}
pipelines, err := handler.pipelineRepository.FindActiveByAppIdAndEnvironmentId(appId, envId)
Copy link
Contributor

Choose a reason for hiding this comment

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

we have to move this logic in service

vikramdevtron
vikramdevtron previously approved these changes Feb 20, 2023
@iamayushm iamayushm changed the title feat: delete state handling for devtron apps deployed using gitOps. feat: deployment pipeline partially delete. Feb 20, 2023
# Conflicts:
#	api/restHandler/AppListingRestHandler.go
#	internal/sql/repository/pipelineConfig/PipelineRepository.go
#	pkg/app/AppService.go
#	pkg/bean/app.go
#	pkg/pipeline/GitopsOrHelmOption_test.go
#	pkg/pipeline/PipelineBuilder.go
#	wire_gen.go
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 17 Code Smells

No Coverage information No Coverage information
7.9% 7.9% Duplication

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.

Enhancement: Recreating deployment pipeline shows already exists error without proper information

3 participants