Commit Graph

867 Commits

Author SHA1 Message Date
Ken Kaizu
cde8faaf57 Fix GitHub app uses slug as user name to work --hide-prev-plan-comments correctly (#2697)
* Fix GitHub app uses slug as user name

* Update server/events/vcs/github_credentials_test.go

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2022-11-20 16:18:34 -06:00
Alberto Rojas
949ee3fa5f metrics: Add Metrics tags to multiple Scopes (#2687)
* metrics: Add Metrics tags to multiple Scopes

* metrics: Fix base_repo and pr_number

* metrics: Refactor SetScope to SetScopeTags

* metrics: Add SetGitScopeTags function

* metrics: docs reword project_context SetScopeTags description

* metrics: test Add TestNewScope_PrometheusTaggingCapabilities
2022-11-19 08:31:46 -06:00
ribejara-te
020eeba85d upgrade Git clone locking mechanism to go1.19 (#2521)
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-11-18 18:19:24 -06:00
nitrocode
b760e8c869 Bump testing-env and go-cty@v1.12.1 (#2686)
* Bump github.com/zclconf/go-cty@v1.12.1

* Bump github.com/zclconf/go-cty@v1.11.1

* Bump github.com/zclconf/go-cty@v1.12.1

* Bump testing-env to latest

* Set conftest to 0.35.0

* conftest to 0.45.0, run docker tests locally

* set gha test.yml to latest testing-env image

* Update Makefile target descs, rm sudo

* Use testing-env:2022.11.17

* Add sudo back in for gha workflow

* Set conftest to 0.35.0

* test gha: rm setup

* Rename "Version" to "Conftest" for version regex

* Use cases and language import

* Use io instead of ioutil
2022-11-17 16:57:04 -06:00
Casey Miller
9b90f2e4f4 Adding reloading of TLS certificates (#2656)
* Adding reloading of TLS certificates

* Update server/server.go

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

* Adding test and test data

* Set minimum tls version

* Adding read header timeout

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-11-14 12:49:34 -06:00
nitrocode
d85662cdf1 Rename default branch to main (#2662)
* Rename default branch to main

* Bump git, curl, and openssl packages
2022-11-14 11:28:29 -06:00
nitrocode
ec995dd794 Bump all dependencies (#2675)
* Bump all dependencies using go get -u

* Added nolint: gosec for writing git creds
2022-11-14 00:50:57 -06:00
Luke Massa
752d86173e feat: Add status to the real-time logs page (#2426)
* Add status of the terminal to the footer

* Change function call

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-11-13 21:08:25 -06:00
Eng Zer Jun
49c5eba458 test: use T.TempDir to create temporary test directory (#2671)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-11-13 14:13:29 -06:00
Thomas Lorreyte
7f75002b6b feat: add policy check summary in wrapped messages (#2452)
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-11-12 22:45:19 -06:00
nitrocode
ac6a8239aa Use official slack/slack-go library (#2669)
* Use slack-go

* rm'ed a couple tests due open issue in pegomock
2022-11-12 20:32:19 -06:00
Ross Strickland
d620d5de98 Add custom templating support (#2647)
* added custom templates support

* made default templates DRY

* Change init to anonymous function.

* Initialize anonymous function inside var

* - Add flag/cfg param for custom template dir
- Add test for custom template

* Add documentation.

* Address PR comments.

Co-authored-by: Ricard Bejarano <ribejara@thousandeyes.com>
2022-11-11 09:56:33 -06:00
Eirik Nygaard
5e3f1a9f90 Add argument for enabling same origin check for websocket connections (#2659)
* Add argument for enabling same origin check for websocket connections

* Remove else clause and outdent return

* Add unit test for websocket origin check
2022-11-11 09:50:15 -06:00
Anton Bronnikov
4cacaeb0c7 Implement branch matching in repo-level config (#2522) 2022-11-08 22:08:20 -08:00
Adam Verigin
c3462f9073 Add COMMENT_ARGS to pre/post-workflow hook execution environment (#2621) 2022-11-07 14:50:49 -06:00
Michel Z. Santello
479f2b7edb fix: prevent commit status update in incorrect MR (#2636)
* fix: prevent commit status in incorrect MR
  - closes https://github.com/runatlantis/atlantis/issues/2484

* chore: update test 'TestGitlabClient_UpdateStatus'
2022-11-04 09:22:55 -07:00
Volodymyr Stupnytskyi
4cc5cf6848 Updating diffKeywordRegex to properly handle new test case (#2551)
* new resource was added to test TestRenderProjectResultsWithEnableDiffMarkdownFormat

* Correct test case

* 1st regex change

* Adding one more pattern to regex

Co-authored-by: dyurovskykh-tivo <Dmytro.Yurovskykh@tivo.com>
2022-11-04 09:19:39 -07:00
Devan Patel
c03ef1d68f Bitbucket Server: Send password as Bearer instead of Basic Auth (#2461)
* Bitbucket Server: Send password as Bearer instead of Basic Auth

Signed-off-by: Devan Patel <Dev25@users.noreply.github.com>

* docs: Add Bearer note for Bitbucket Server auth

Signed-off-by: Dev <Dev25@users.noreply.github.com>

Signed-off-by: Devan Patel <Dev25@users.noreply.github.com>
Signed-off-by: Dev <Dev25@users.noreply.github.com>
2022-10-31 14:48:07 -07:00
Tyler Lubeck
9ab3fd2416 Add tags to project metrics (#2623)
* Add tags to project metrics

This adds a few tags that I've found useful for our monitoring of a
many-project terraform repository. There are likely more tags that can
be added in other areas, but I figured I'd start small and get feedback
before increasing the blast radius

* Add labels, handle nils, alphabetize

* Move //nolint to line of assignment
2022-10-27 20:04:06 -05:00
Marc Barlo
3bfd769211 feat: add a flag to silence policy checks comments when there's no error (#2405)
* Add a flag to silence policy checks comments when there's no error

* Add e2e test cases for the quiet policy checks flag

* add documentation for quiet-policy-checks flag

* Update user_config.go

Fix indentation

* Update user_config.go

* fmt
2022-10-26 23:35:49 -07:00
Forest Oden
d0715faee1 fix: typo in log message when running parallel plans (#2620)
Signed-off-by: Forest Oden <forest.oden@beatport.com>
2022-10-25 17:28:34 -04:00
Joel Llacer Martinez
8e27a471d1 Silence allow list errors works again (#2535) 2022-10-10 21:35:23 -07:00
chavacava
57b01166a6 fix #2537 by removing redundant conditional branch (#2545) 2022-10-10 21:13:24 -07:00
Quan Hoang
8b20bebf16 Determine Terraform Cloud workspace from configuration (#2432) 2022-09-30 13:36:53 -07:00
giuli007
2cd8bd9ccc Delete previous plans on autoplan or atlantis plan (#1633)
* Delete previous plans on autoplan or atlantis plan

When using non-default workspaces, plans are stored
in pr-and-workspace-specific directories.
If a PR is subsequently updated it might happen that
some of the plans are no longer relevant with regards
to the latest changes.
This change ensures that plans are always deleted
when a generic plan is triggered either by autoplan
or by a "atlantis plan" command.
NB Plans are not cleaned up when specific projects are
planned explicitly with "atlantis plan -p/-d/-w".

* Also delete locks along with plans when running
autoplan or generic plan command

* Fix Plan deletion tests after 0.19.8 rebase

* Fix Plan deletion tests after v0.19.9-pre.20220912 rebase

* Rename struct field to follow camelCase naming convention

Co-authored-by: giuli007 <giuglioz@gmail.com>
2022-09-23 14:31:24 -07:00
Alberto Llamas
9829fa23c2 Fix: Error when enabling prometheus metrics (#2379) (#2528)
Prometheus metrics names have some restrictions that must match the regex `[a-zA-Z_:][a-zA-Z0-9_:]*`
2022-09-20 21:27:30 -07:00
Brian Zoetewey
1bcf938644 Adding Redis DB option (#2527)
* Adding Redis DB option
This allows selecting something other than the default database of 0.

* Add missing db argument to fix failing tests.
2022-09-20 21:27:16 -07:00
Rui Chen
6fd8130fe1 lint: gofmt -w -s . (#2504)
Signed-off-by: Rui Chen <rui@chenrui.dev>

Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-09-12 18:08:46 -07:00
Daniel Thompson
d5d8e38117 Adding Redis TLS Option (#2510)
* Adding Redis TLS option

* Test fixes and allow for tls skip verify

* Test fixes and allow for tls skip verify
2022-09-09 20:02:26 -07:00
Stas Ostrovskyi
b8297bb1f8 fix: Set mergeable correctly when branch protection doesn't require reviewers (#2470)
* Allow no required reviewers

* Fix comment in tests

Co-authored-by: Stas Ostrovskyi <stasostrovskyi@users.noreply.github.com>
2022-09-08 13:54:50 -07:00
Marc Hildenbrand
178e4a4c09 Fixes for multienv step comment (#2411)
* Fix multienv command

Correctly handles environment variable values that themselves contain "=" (e.g. AWS session tokens)

Ensures that trailing "\n" does not get published as part of the last environment variables value.

* Correct check for empty result in multienv

Check the length of the result string instead of splitting it first and checking the length of envvars (since split always returns an array of length 1)

Co-authored-by: Marc Hildenbrand <mwhildenbrand@gmail.com>
2022-09-08 11:37:09 -07:00
Rui Chen
b5e985c158 lint: remove deprecated io/util package (#2503)
As of go1.16, io/util package has been deprecated

See issue, https://github.com/golang/go/issues/42026

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

Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-09-08 13:45:00 -04:00
Andrei Vydrin
2d7ee9dfa8 feat: support parallel with execution order groups (#2403) 2022-09-08 06:14:59 -07:00
Yurii Soldak
9f31e49be8 Use single github v4 client (#2480) 2022-09-08 06:04:35 -07:00
Paul O'Connor
4143c87559 bug: Fix GitHub Markdown for added and deleted resources (#2418)
* bug: Fix GitHub Markdown for added and deleted resources

* Fix spacing in test
2022-09-07 17:48:10 -07:00
Vincent
99e1f10c2e Allow /api/ routes without WebAuthentication (#2455) 2022-09-07 17:46:18 -07:00
Daniel Thompson
ab2cdb833a External Locking DB: Redis (#2491)
* Initial build out of redis backend

* Regenerate locking mocks and matchers

* More test cleanup

* More test fixes

* Added tests for redis

* Test fix

* Linting fix

* Dcos update

* Update redis.go

* Update server.go

* Adding nolint to RedisDB struct
2022-09-07 16:57:06 -07:00
Yurii Soldak
a4a49bf46f Use proper http client for github v4 api (#2479)
* Use proper http client for github v4 api

* Remove extra print lines

Co-authored-by: Ray Terrill <rayterrill@users.noreply.github.com>
2022-09-07 16:51:23 -07:00
Håvard Anda Estensen
e1862f0e2d Omit type declaration of vars (#2476) 2022-08-30 09:45:04 -07:00
kangaechu
94c81eadfc enable hostname statsd host key (#2429) 2022-08-25 21:44:49 -07:00
Jonas
5bf7c93f3e ignore GitLab Draft MRs (#2468)
* feat: ignore GitLab Draft MRs

* deepcopy and overwrite unit under test

* add tests for close actions
2022-08-25 10:47:21 -07:00
Jack Lindamood
71233ef3b6 Allow manual PR number (#2465)
Resolves #2464
2022-08-22 11:59:16 -07:00
Ray Terrill
89d33a0737 Make required atlantis/apply status check work with mergeable (#2436)
* Make required apply work with mergeable

* Fix lint hint

* Migrate mergeable approval check to graphql, update tests

* Adding support for check suites

* Adding feature flag protection for new functionality

* Fix linting falsepos

* Adjusted logic to handle required check runs, added doc
2022-08-18 09:46:50 -07:00
Pantelis Karamolegkos
8691b5f79d Removing the check about whether a slack channel exists (#2386) 2022-07-28 08:43:13 -07:00
Rémi Lapeyre
b409cb8470 Add the /plan and /apply endpoints (#997)
* Add the /plan and /apply endpoints

* Resolve conflicts

* Fix wrong merge

* Add missing methods for mocks

* Fix linting error

* Fix linting error

* Move api plan/apply into APIController

* Extract commond code into helper functions

* Implement GetCloneURL for GitHub

Co-authored-by: Li Lin <li.lin@hashicorp.com>
2022-07-27 11:36:49 -07:00
Austin Sherron
6227b56d28 fix: Update multienv_step_runner Env Var Parsing Logic (#2351) (#2354)
* Update multienv_step_runner Env Var Parsing Logic

* Update multienv_step_runner.go to split only on the first = character
* Add affirmative and failing test cases

* Run gofmt
2022-07-27 10:40:14 -07:00
ribejara-te
e0e29bddee fix: repository cloning race condition (#2341) (#2348)
* fix: repository cloning race condition (#2341)

* fix: switched from sync to golang.org/x/sync/semaphore

* fix: check value of sem.Acquire(...)
2022-07-27 10:37:07 -07:00
Connor Edwards
4887091197 fix: use constant time comparison of webhook secret in gitlab event validator (#2392) 2022-07-15 09:54:36 -07:00
Li Lin
e153cea2bf Revert "[fix] Ignore commit checks for atlantis apply on Github (#2311)" (#2388)
* Revert "[fix] Ignore commit checks for atlantis apply on Github (#2311)"

This reverts commit a3db712920.
2022-07-13 17:11:03 -07:00
Paul O'Connor
7a6b5b85bb Only highlight Terraform changes on GitHub (#2337) 2022-07-12 08:58:39 -07:00