Skip to content
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

chore: change CI backend infra #4251

Merged
merged 71 commits into from
Nov 30, 2023
Merged

chore: change CI backend infra #4251

merged 71 commits into from
Nov 30, 2023

Conversation

subhashish-devtron
Copy link
Contributor

@subhashish-devtron subhashish-devtron commented Nov 17, 2023

Description

code changes for setting infra in backend for change CI feature

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?


pkg/pipeline/BuildPipelineConfigService.go Outdated Show resolved Hide resolved
Comment on lines 1323 to 1324
// find any builds running on old ci_pipeline, if yes block this conversion with proper message.
inProgressWorkflows, err := impl.ciWorkflowRepository.FindRunningWorkflowCount(switchFromCiPipelineId)
Copy link
Contributor

Choose a reason for hiding this comment

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

we should check for recent one's only, there might be a possibility that we would find some old Running workflows


return nil
}
func (impl *CiPipelineConfigServiceImpl) deleteCiPipeline(tx *pg.Tx, ciPipeline *pipelineConfig.CiPipeline, externalCiPipelineId int, userId int32) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

func name should convey the the logic. renaming is required

}

if request.IsSwitchCiPipelineRequest() {
impl.logger.Debugw("handling switch ci pipeline")
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve logging here.

Copy link
Member

Choose a reason for hiding this comment

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

done

return impl.handleSwitchCiPipeline(request, ciConfig)
}

impl.logger.Debugw("create patch request")
Copy link
Contributor

Choose a reason for hiding this comment

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

improve logging here.

Copy link
Member

Choose a reason for hiding this comment

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

deleted this log

return nil, err
}

impl.logger.Debugw("create patch request for ci switch")
Copy link
Contributor

Choose a reason for hiding this comment

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

Improve logging here

Copy link
Member

Choose a reason for hiding this comment

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

removed it

@@ -1267,6 +1279,321 @@ func (impl *CiPipelineConfigServiceImpl) UpdateCiTemplate(updateRequest *bean.Ci
return originalCiConf, nil
}

func (impl *CiPipelineConfigServiceImpl) validateCiPipelineSwitch(switchFromCiPipelineId int, switchFromExternalCiPipelineId int, switchToType, switchFromType bean.PipelineType) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can make PipelineSwitchHandler and move switch logic to that place.
CC: @subhashish-devtron

Copy link

sonarcloud bot commented Nov 30, 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
0.1% 0.1% Duplication

@subhashish-devtron subhashish-devtron changed the title feat: merge sync refactor feat: change ci and refactorings Nov 30, 2023
@subhashish-devtron subhashish-devtron changed the title feat: change ci and refactorings chore: refactorings to support upcoming features Nov 30, 2023
@subhashish-devtron subhashish-devtron changed the title chore: refactorings to support upcoming features chore: change CI backend infra Nov 30, 2023
@subhashish-devtron subhashish-devtron merged commit bf56c9b into main Nov 30, 2023
7 of 11 checks passed
@subhashish-devtron subhashish-devtron deleted the linked-cd-refactor branch November 30, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants