* Fix Hide Previous Plan Comments
* Update GitLab client tests
* Update GitLab client test
* Update github client test
* Add nolint: errcheck to test
* format github_client.go
By fixing nil pointer reference in 3428 we unveiled yet another bug now that the code is able to run further:
When an MR with no HeadPipeline exists its commits are set to skipped by default and thus create some mess when running "PullMergeable" (rendering the MR useless)
The bug was caught by the tests, however, in an attempt to make the build pass and unblock we create a patch to ignore that test.
In order to prevent further problems, this MR:
* Updates the test stack to run all plan/apply commands in the context
of "HeadLess" Pipelines
* Fixes the default of skipped pipeline to false (as it is better to
assume it is NOT skipped since that prevents the merge in most cases)
* Make all integratiion tests pass
References:
* Original MR: https://github.com/runatlantis/atlantis/pull/3428
* Tests Patch MR : https://github.com/runatlantis/atlantis/pull/3653
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
* feat: Basic implementation of github reactions on PRs
Adds eyes whenever it detects an `atlantis` command.
* feat: Make the emoji reaction configurable
* tests: Add a mocked test for EmojiReaction being called in github
* ci: Disable revive linter for stubs
* Modify the automere commit message to include the PR number [DEVOPS-674]
* Update server/events/vcs/common/common.go
Co-authored-by: Ken Kaizu <k.kaizu38@gmail.com>
* added test for PR message func [DEVOPS-674]
---------
Co-authored-by: Ken Kaizu <k.kaizu38@gmail.com>
* feat: customize atlantis.yaml file name in server side config
* Update server/events/vcs/bitbucketcloud/client.go
* Update server/events/vcs/bitbucketserver/client.go
* Update server/events/vcs/not_configured_vcs_client.go
* Update server/events/vcs/azuredevops_client.go
* docs: repo_config_file multiple atlantis servers usecase example
* docs: multiple atlantis server usage which show how to call one atlantis server
* Update runatlantis.io/docs/server-side-repo-config.md
* Apply suggestions from code review
* Update runatlantis.io/docs/server-side-repo-config.md
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
* fix: update commit status check logic to match the commit status name
* Update server/events/vcs/gitlab_client.go
chore: simplify ignored statuses logic
Co-authored-by: Emil 'Skeen' Madsen <sovende@gmail.com>
* feat(gitlab_client_test): add PullIsMergeable test case
Co-authored-by: Emil 'Skeen' Madsen <sovende@gmail.com>
* Moved CommandContext and CommandResult to models (#193)
* Moved CommandContext and CommandResult to models
* move from models to command
rename CommandContext -> Context
rename CommandResult -> Result
* moved command related helpers into command package
* move ProjectCommandContext and ProjectResult to command/project package
* move project command context and project result
* revert unrelated code
* move tests
* fix left over
* fix linting
* fix tests
* remove unused import
* fix project context dependencies
* fix depenedecies
* fix typo