-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Atlantis - Gitlab integration failing when updating MR with new commits on version v0.29.0 #4950
Comments
@joaoluchetti Hello there! I'm here to assist you with any bugs, questions, or contributions while we wait for a human maintainer. The issue you're encountering with the Atlantis Gitlab integration on version v0.29.0, where the pipeline status is stuck on "Checking pipeline status" after adding new commits to a Merge Request, is likely due to the Here's the relevant part of the code: func (g GitlabClient) GetAtlantisStatus(ctx context.Context, branchName string) (string, error) {
pipelineInfos, _, err := g.client.MergeRequests.ListMergeRequestPipelines(g.projectId, g.branchToMR[branchName])
if (err != nil) {
return "", err
}
if len(pipelineInfos) != 1 {
return "", fmt.Errorf("unexpected pipelines: %d", len(pipelineInfos))
}
pipelineInfo := pipelineInfos[0]
pipeline, _, err := g.client.Pipelines.GetPipeline(g.projectId, pipelineInfo.ID)
if err != nil) {
return "", err
}
return pipeline.Status, nil
} Additionally, the Here is the relevant code: func (p *ProjectOutputWrapper) updateProjectPRStatus(commandName command.Name, ctx command.ProjectContext, execute func(ctx command.ProjectContext) command.ProjectResult) command.ProjectResult {
if err := p.JobURLSetter.SetJobURLWithStatus(ctx, commandName, models.PendingCommitStatus, nil); err != nil {
ctx.Log.Err("updating project PR status", err)
}
result := execute(ctx)
if result.Error != nil || result.Failure != "" {
if err := p.JobURLSetter.SetJobURLWithStatus(ctx, commandName, models.FailedCommitStatus, &result); err != nil {
ctx.Log.Err("updating project PR status", err)
}
return result
}
if err := p.JobURLSetter.SetJobURLWithStatus(ctx, commandName, models.SuccessCommitStatus, &result); err != nil {
ctx.Log.Err("updating project PR status", err)
}
return result
} The type DirNotExistErr struct {
RepoRelDir string
}
func (d DirNotExistErr) Error() string {
return fmt.Sprintf("dir %q does not exist", d.RepoRelDir)
} For more details, you can refer to the related issue here [1][2][3]. |
+1 |
same here with the v0.29.0 version! |
I just wanted to chime in and say that the problem is still present in v0.30.0. The error I had was {"level":"warn","ts":"2024-10-03T12:44:17.887Z","caller":"events/pre_workflow_hooks_command_runner.go:144","msg":"unable to update pre workflow hook status: 404 Not Found","json":{"repo":"myorg/myrepo","pull":"519"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*DefaultPreWorkflowHooksCommandRunner).runHooks\n\tgit.luolix.top/runatlantis/atlantis/server/events/pre_workflow_hooks_command_runner.go:144\ngit.luolix.top/runatlantis/atlantis/server/events.(*DefaultPreWorkflowHooksCommandRunner).RunPreHooks\n\tgit.luolix.top/runatlantis/atlantis/server/events/pre_workflow_hooks_command_runner.go:84\ngit.luolix.top/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\tgit.luolix.top/runatlantis/atlantis/server/events/command_runner.go:361"} ...and then of course several others while also trying to make the thing work again. 0.28.5 works fine. |
can reproduce |
Hi All,
After updating to atlantis v0.29.0 we are having issues when updating Gitlab Merge Requests with new commits.
When the MR is opened the atlantis pipeline runs without any issue, although when we add another commit to the MR the status of pipeline is stuck on "Checking pipeline status", the atlantis plan and apply run without any issues but we can't merge the MR as the pipeline is not identified as succeded.
Looking at the logs we found the following exception:
2024-09-25 14:17:19.087 {"level":"error","ts":"2024-09-25T17:17:19.087Z","caller":"events/project_command_runner.go:195","msg":"updating project PR status%!(EXTRA *errors.errorString=404 Not Found)","json":{"repo":"myorg/myrepo","pull":"133"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*ProjectOutputWrapper).updateProjectPRStatus\n\tgit.luolix.top/runatlantis/atlantis/server/events/project_command_runner.go:195\ngit.luolix.top/runatlantis/atlantis/server/events.(*ProjectOutputWrapper).Plan\n\tgit.luolix.top/runatlantis/atlantis/server/events/project_command_runner.go:164\ngit.luolix.top/runatlantis/atlantis/server/events.RunAndEmitStats\n\tgit.luolix.top/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:74\ngit.luolix.top/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandRunner).Plan\n\tgit.luolix.top/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:38\ngit.luolix.top/runatlantis/atlantis/server/events.runProjectCmds\n\tgit.luolix.top/runatlantis/atlantis/server/events/project_command_pool_executor.go:48\ngit.luolix.top/runatlantis/atlantis/server/events.(*PlanCommandRunner).runAutoplan\n\tgit.luolix.top/runatlantis/atlantis/server/events/plan_command_runner.go:136\ngit.luolix.top/runatlantis/atlantis/server/events.(*PlanCommandRunner).Run\n\tgit.luolix.top/runatlantis/atlantis/server/events/plan_command_runner.go:305\ngit.luolix.top/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunAutoplanCommand\n\tgit.luolix.top/runatlantis/atlantis/server/events/command_runner.go:223"}
We can confirm that this behavior does not happen on version v0.28.x.
The text was updated successfully, but these errors were encountered: