-
Notifications
You must be signed in to change notification settings - Fork 468
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
Conversation
…ne except externalwebhook
// find any builds running on old ci_pipeline, if yes block this conversion with proper message. | ||
inProgressWorkflows, err := impl.ciWorkflowRepository.FindRunningWorkflowCount(switchFromCiPipelineId) |
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 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 { |
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.
func name should convey the the logic. renaming is required
} | ||
|
||
if request.IsSwitchCiPipelineRequest() { | ||
impl.logger.Debugw("handling switch ci pipeline") |
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.
Improve logging here.
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 impl.handleSwitchCiPipeline(request, ciConfig) | ||
} | ||
|
||
impl.logger.Debugw("create patch request") |
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.
improve logging here.
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.
deleted this log
return nil, err | ||
} | ||
|
||
impl.logger.Debugw("create patch request for ci switch") |
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.
Improve logging here
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.
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 { |
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 can make PipelineSwitchHandler
and move switch logic to that place.
CC: @subhashish-devtron
# Conflicts: # wire_gen.go
Kudos, SonarCloud Quality Gate passed!
|
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:
Does this PR introduce a user-facing change?