Commit Graph

2825 Commits

Author SHA1 Message Date
MB
bcd917ffba fix(gitlab): Prevent considering non-head pipelines skipped by default (#3695)
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
2023-08-23 17:07:38 -04:00
renovate[bot]
823d62f557 fix(deps): update module github.com/moby/patternmatcher to v0.6.0 in go.mod (#3696)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-23 02:25:27 +00:00
smstone
b8bb6df40a feat: Slack notifications matched on base branch name (#3644)
* Add ability to send slack notification matched on base branch name

* Update BranchRegex usage doc

* Add test with invalid branch and workspace regex
2023-08-22 15:13:00 +00:00
renovate[bot]
2777ad04bb fix(deps): update module github.com/google/uuid to v1.3.1 in go.mod (#3694)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-22 01:17:38 +00:00
renovate[bot]
b43f3adf68 fix(deps): update module github.com/redis/go-redis/v9 to v9.1.0 in go.mod (#3685)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 16:11:08 +00:00
renovate[bot]
d054e522a4 fix(deps): update module github.com/go-playground/validator/v10 to v10.15.1 in go.mod (#3683)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 16:09:07 +00:00
Finn Arne Gangstad
760190629e fix: complete the upgrade to github v54 to unbreak tests (#3691) 2023-08-21 11:38:17 -04:00
renovate[bot]
233273fa8c chore(deps): lock file maintenance in server/events/testdata/test-repos/workspace-configured/main.tf (#3689)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-21 00:56:53 +00:00
renovate[bot]
5e7af0d812 chore(deps): update redis docker tag to v7.2 in docker-compose.yml (#3677)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-17 03:25:11 +00:00
renovate[bot]
55e24fbbf5 fix(deps): update module github.com/google/go-github/v53 to v54 in go.mod (#3676)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-17 00:41:13 +00:00
Artur Rodrigues
049c146b2c fix(github): prevent null pointer dereferencing when using AllowMergeableBypassApply with no required checks on branch protection (#3672)
* Implement test for allow mergeable bypass apply with no branch protection checks

* Report true combined status if no branch protection required status checks

* Remove warning on feature flag utilization
2023-08-15 10:11:37 -07:00
renovate[bot]
cec25e51dc chore(deps): lock file maintenance in server/events/testdata/test-repos/workspace-configured/main.tf (#3668)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-14 01:16:47 +00:00
renovate[bot]
a12823e057 fix(deps): update module github.com/alicebob/miniredis/v2 to v2.30.5 in go.mod (#3662)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
v0.25.0
2023-08-10 02:37:21 +00:00
Rui Chen
135bc3876e chore: update to use go1.21 (#3657)
* chore: update to use go1.21

Signed-off-by: Rui Chen <rui@chenrui.dev>

* update go base image to 1.21.0

---------

Signed-off-by: Rui Chen <rui@chenrui.dev>
2023-08-10 02:11:41 +00:00
renovate[bot]
8df77c661b chore(deps): update dependency node to v18.17.1 in .node-version (#3661)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-10 01:52:30 +00:00
renovate[bot]
7060ed573c chore(deps): update dependency hashicorp/terraform to v1.5.5 in .circleci/config.yml (#3660)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-10 00:45:47 +00:00
renovate[bot]
c096f10a5b fix(deps): update module github.com/hashicorp/golang-lru/v2 to v2.0.5 in go.mod (#3659)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 19:21:04 +00:00
renovate[bot]
9426fd93af fix(deps): update module golang.org/x/text to v0.12.0 in go.mod (#3652)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 19:17:00 +00:00
renovate[bot]
9e4702c431 fix(deps): update module github.com/xanzy/go-gitlab to v0.90.0 in go.mod (#3647)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 18:00:55 +00:00
renovate[bot]
b1118e565c fix(deps): update module github.com/go-playground/validator/v10 to v10.15.0 in go.mod (#3654)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 17:59:13 +00:00
renovate[bot]
d511eb743e fix(deps): update module golang.org/x/term to v0.11.0 in go.mod (#3650)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 17:58:13 +00:00
renovate[bot]
81aba38676 fix(deps): update github.com/hashicorp/terraform-config-inspect digest to f15f31b in go.mod (#3658)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-09 17:55:42 +00:00
Ghais Zaher
25c6b43a63 fix: gitlab client failing test (#3653)
* fix: gitlab client failing test

* change HeadCommit to `67cb91d3f6198189f433c045154a885784ba6977`

* remove test case for now
2023-08-09 13:31:36 -04:00
Simon Heather
9789aff2cb chore: Fix golangci-lint Configuration (#3645)
* Fix golang-ci

* Update lint workflows

* Removed required checks
2023-08-08 13:42:28 -04:00
renovate[bot]
e138a0743c chore(deps): update alpine docker tag to v3.18.3 in dockerfile (#3656)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-08 01:46:47 +00:00
renovate[bot]
6e988ea1fa chore(deps): lock file maintenance in server/events/testdata/test-repos/workspace-configured/main.tf (#3655)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-07 03:53:13 +00:00
Simon Heather
ec77a951b0 chore: Fix Go Static Check Errors (#3637)
* Fix Go Static Checks

* Fix working dir tests
2023-08-05 16:41:54 -04:00
MB
89a028ffd2 fix(gitlab): Prevent nil pointer dereference when HeadPipeline is empty (#3428)
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
2023-08-04 13:00:47 -04:00
chroju
fbb12fe3b9 feat: set atlantis/apply check to successful if all plans are No Changes (#3378)
* mod: rename updateCommitStatus func

* feat: add PlannedNoChangesPlanStatus

* Add skipApplyNoChanges option to PlanCommandRunner

* Add skipApplyNoChanges option to ApplyCommandRunner

* Add --skip-apply-no-changes flag

* Fix typo

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>

* Rename --skip-apply-no-changes flag

* Refactor updateCommitStatus functions

* chore(docs): add detailed use case for the flag

* test: add plan_command_runner set apply status

* feat: set apply status to successful by default when result is 'No Changes'

---------

Co-authored-by: chroju <chroju@users.noreply.github.com>
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2023-08-03 11:15:13 -04:00
renovate[bot]
d6ba8f5076 fix(deps): update module go.uber.org/zap to v1.25.0 in go.mod (#3643)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-03 04:00:30 +00:00
renovate[bot]
d218686830 chore(deps): update golang docker tag to v1.20.7 in testing/dockerfile (#3642)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-08-02 00:10:03 +00:00
Torben Tretau
62271955de fix(github): Mergeable requirement for fork PRs (#3620)
While using a PR from a fork and the "Github allow mergeable bypass apply" flag, the mergeable checks were run with the wrong owner in the request, leading to 404. By choosing the owner from the head repo data it should work both, for fork PRs and in-repo PRs.

Co-authored-by: Dylan Page <dylan.page@autodesk.com>
2023-08-01 02:25:31 +00:00
Simon Heather
b024cef470 chore: Update server/events/working_dir Logging Configuration (#3636)
* Update server/events/working_dir logging

* Add e2e FileWorkspace logger

* Fix github app working dir test logger

* Update working_dir_test

---------

Co-authored-by: Dylan Page <dylan.page@autodesk.com>
2023-07-31 22:10:03 -04:00
Shouichi Kamiya
2bd778b01e fix: auto plan when .terraform.lock.hcl changed (#3473)
Problem

When `projects` are specified and `when_modified` is not specified via
the config file, changing `.terraform.lock.hcl` file won't trigger auto
plan. This is because the default `raw.WhenModified` does not include
`.terraform.lock.hcl`.

Note that when projects are auto detected, changing
`.terraform.lock.hcl` triggers auto plan. This is because the
`cmd.DefaultAutoplanFileList` includes `.terraform.lock.hcl`.

Solution

Include `.terraform.lock.hcl` to the default `raw.WhenModified`.
2023-07-31 11:29:33 -04:00
Luke Massa
cbb86c248e feat: Allow for negations in repo allowlist (#3414)
* feat: Omit repos from allowlist

* Add quote in comment

* Better comment

* Remove test
2023-07-31 13:46:11 +00:00
renovate[bot]
72a763b283 fix(deps): update module github.com/xanzy/go-gitlab to v0.89.0 in go.mod (#3640)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-31 00:42:03 +00:00
William Richard
3ca5d82ebf fix: Include information about imports in PlanSuccessStats (#3621)
* Include information about imports in PlanSuccessStats

Terraform 1.5 introduced a feature to import existing resources into
state via code.

https://developer.hashicorp.com/terraform/language/import

When you run `terraform plan` with imports, the output includes information
about the imported resources, which breaks the current regex for parsing
plan changes.

This PR updates the regex to include the, optional, import information.

* Use the ?

Co-authored-by: Benjamin Ullian <5695343+bnu0@users.noreply.github.com>

---------

Co-authored-by: Will Richard <wrichard@seatgeek.com>
Co-authored-by: Benjamin Ullian <5695343+bnu0@users.noreply.github.com>
Co-authored-by: Dylan Page <dylan.page@autodesk.com>
2023-07-30 20:04:29 +00:00
Simon Heather
75b4b069e7 Fix Simple Logger Log Function (#3631) 2023-07-30 15:33:30 -04:00
renovate[bot]
383ea9a19b chore(deps): update dependency git-lfs/git-lfs to v3.4.0 in dockerfile (#3635)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-29 01:36:29 +00:00
renovate[bot]
719a81a7d8 chore(deps): update debian docker tag to v12.1 in dockerfile (#3630)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-28 20:16:42 +00:00
Simon Heather
9aae60f1d3 Conftest Log Fix (#3632) 2023-07-28 19:49:38 +00:00
renovate[bot]
8e75571f11 chore(deps): update dependency hashicorp/terraform to v1.5.4 in .circleci/config.yml (#3628)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-28 19:31:48 +00:00
Dylan Page
99c3a01db4 fix(ci): link_check required (#3633) 2023-07-28 12:27:00 -07:00
renovate[bot]
162739802c fix(deps): update module github.com/microcosm-cc/bluemonday to v1.0.25 in go.mod (#3613)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-25 13:11:14 +00:00
renovate[bot]
7db3c7c57a fix(deps): update module github.com/xanzy/go-gitlab to v0.88.0 in go.mod (#3616)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-25 07:23:45 +00:00
renovate[bot]
90650415e5 fix(deps): update module github.com/cactus/go-statsd-client/v5 to v5.1.0 in go.mod (#3615)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-25 05:12:19 +00:00
Dylan Page
689a6bee8b fix: alpine package versions bump (#3622) 2023-07-25 04:48:13 +00:00
Dylan Page
3d9813f199 fix(website-test): missing backslash for muffet (#3623)
Missing backslash.

https://github.com/runatlantis/atlantis/actions/runs/5652166425/job/15311381309
2023-07-24 21:18:25 -07:00
Dylan Page
70e561948e fix(website): vuepress-next breaking change (#3611)
* fix: vuepress-next breaking change

See https://github.com/vuepress/vuepress-next/issues/1195.

Other fixes:

* fix: website js tests triggering properly
* chore: clean up test workflows
* fix: yarn packages
* fix: renovate config & medium rate limit
* fix: don't need to require docker build for JS code
* fix: muffet config
* fix: properly name website test

---------

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2023-07-24 23:03:09 -04:00
renovate[bot]
4590b58c8a fix(deps): update module github.com/bradleyfalzon/ghinstallation/v2 to v2.6.0 in go.mod (#3602)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-24 16:08:17 -07:00