In this particular example `mr.HeadPipeline.SHA` panics on a nil pointer dereference because HeadPipeline is empty.
This seems to be caused by the lack of permission to update the commit status.
```go
runtime.gopanic
runtime/panic.go:1038
runtime.panicmem
runtime/panic.go:221
runtime.sigpanic
runtime/signal_unix.go:735
github.com/runatlantis/atlantis/server/events/vcs.(*GitlabClient).PullIsMergeable
github.com/runatlantis/atlantis/server/events/vcs/gitlab_client.go:208
github.com/runatlantis/atlantis/server/events/vcs.(*ClientProxy).PullIsMergeable
github.com/runatlantis/atlantis/server/events/vcs/proxy.go:72
github.com/runatlantis/atlantis/server/events/vcs.(*pullReqStatusFetcher).FetchPullStatus
github.com/runatlantis/atlantis/server/events/vcs/pull_status_fetcher.go:28
github.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run
github.com/runatlantis/atlantis/server/events/apply_command_runner.go:105
github.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand
github.com/runatlantis/atlantis/server/events/command_runner.go:252
```
The least invasive solution is to simply use the commit-hash from pull and guess that the pipeline was "skipped" unless the HeadPipeline is there.
The outcome is:
When mr.HeadPipeline is present:
- use the commit hash and status from the HeadPipeline
When mr.HeadPipeline is NOT present:
- use the commit hash from pull request struct
- assume the pipeline was "skipped"
In cases where GitLab is configured to require a pipeline to pass, this results on a message saying the MR is not mergeable.
More info:
- https://github.com/runatlantis/atlantis/issues/1852
* Bump to atlantis-base:2022.11.13
* Use cimg/go back image
* Use correct path of cimg/go binary dir
* e2e: use /usr/bin
* e2e: add set -e
* circleci: use testing-env:2022.11.13
* e2e: use /home/circleci/go/bin
* e2e: revert to testing-env:2021.08.31 image
* Adding docker image and release scripts
* Using circleci version 2
* now building dumb-init and gosu from source
* trying to fix e2e tests
* fixing working directory for circleci version 2
* start atlantis server and ngrok in the background
* Adding terraform to path and removing old decryption method for circleci
* adding terraform binary to the correct path
* ATLANTIS_URL is now being exported
* using circleci version 2 syntax to export variable
* using circleci version 2 syntax to export variable
* ngrok isnt working now
* Updating CHANGELOG
* Fixes after review and updated README.md