Commit Graph

30 Commits

Author SHA1 Message Date
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
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
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
kangaechu
94c81eadfc enable hostname statsd host key (#2429) 2022-08-25 21:44: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
Andrey Vydrin
569031ab23 feat: add execution order group (#2178)
* feat: add execution order group

to apply/plan by order

* fix: use official golanci-lint script
2022-06-29 12:01:54 -07:00
Steve Yoon
e90aa575e0 feat: Prometheus metrics support (#2204)
* support prometheus metrics

* remove redundant error checking

* load prometheus metrics config

* dynamic separator for subscopes

* removing unnecessary config file

* adding a few more metrics test cases

* remove testing handler

* fix upstream merge error
2022-06-28 08:58:15 -07:00
Aiden Scandella
ff1094fa04 feat: stream output for custom workflows (#2261)
* Start threading job output to RunStepRunner

* Strip ANSI

* Fix lint

* Use waitgroup to avoid test flakiness

* Move waitgroup higher

* Add ANSI test and use strings.Builder

* Fix lint

* Use errors.Wrap per style guide

* Create ShellCommandRunner to encapsulate streaming

* WIP: shell command runner

* Update signatures to propagate error finding version

* Fix log output

* Fix error checking

* Fix accidental whitespace stripping

* Remove unused struct field

* Fix error checking in terraform client

* Add unit tests to verify command output handler was called

* Remove err from async interface

* Remove duplicative log now that shell command runner does it

* Hide output in stream for env/multienv

* Add comment explaining goroutines

* Use printf for better macOS compatibility
2022-06-22 09:29:41 -07:00
nitrocode
82cf170d8f Ignore gpg signing for tests (#2296) 2022-06-05 20:06:24 -07:00
Istvan Tapaszto
a491542b48 feat: MultiEnv step added (#1793)
* MultiEnv step added

* Values removed from the output

* Fixing tests

* multienv_step_runner_test added

* Documentation of new feature added

* Documentatation of new feature  modified

* multienv_step test file extension changed

* Fixed multinev_step_runner test

* Enhanced debug logging in multienv_step_runner

* Enhanced errorhandling

* Test command modified

* Test command modified

* Test command modified

* Test command modified

* Errorhandling modified

* Test command modified

* Test command modified

* Create empty map in test

* Fixing test ExpOut

* Testing, refactoring, eliminating extra debug log

* MultiEnv result modified from json to plain string

* MultiEnv step Run parameter updated

* Import added

* project_command_runner updated

* project_command_runner updated

* multienv_step_runner_test updated

* multienv doc modified

* Update runatlantis.io/docs/custom-workflows.md

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

Co-authored-by: Istvan Tapaszto <istvan.tapaszto@msci.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
2022-05-13 14:30:08 -07:00
Sarvar Muminov
90e92e3a13 chore: move CommandContext and CommandResult to models (#193) (#2093)
* 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
2022-03-21 10:36:13 -07:00
Nish Krishnan
d1d1539ced feat: Add stats support for basic operations (#2147) 2022-03-18 15:18:13 -07:00
Aayush Gupta
58e9b42bbc feat: Use UUIDs to identify log streaming jobs (#2051)
* Add UUID for Log Streaming Job ID (#167)

* Update log handler to close buffered  channels when an operation is complete (#170)

* Add preliminary check before registering new receivers in the log handler (#173)

* Using projectOutputBuffers to check for jobID instead of receiverBuffers (#181)

* Refactor log handler  (#175)

* Reverting go.mod and go.sum

* Fix lint errors

* Fix linting
2022-02-09 13:15:49 -08:00
Sarvar Muminov
7a927c050b Moving config files to core/config (#2036)
* Moving config files to core/config

* fix package names

* fix package dependencies

* linting fixes

* more linting fixes

* ran golangci-lint run --fix
2022-02-03 11:06:04 -08:00
Braden Schaeffer
1811514ecf Fix support for terraform workspaces (#2006)
Fixes #1517 and basically is a rebased version of #1578.
2022-01-18 11:56:20 -08:00
Tim McFadden
b859f72561 feat: post workflow hooks (#1990)
* Add post-workflow hooks

* docs: Add cost estimation as post workflow use case

Co-authored-by: Gerald Barker <geraldbarker@gmail.com>
2022-01-12 19:57:45 -05:00
Aayush Gupta
004074a29f feat: streaming terraform logs in real-time (#1937) 2021-12-30 09:52:52 -05:00
Justin Roberson
6dda3dfde1 fix: fallback to default TF version in apply step (#1931)
The plan step has a mechanism to use the default tf version from the Terraform
client if the context does not define one, however the apply step does not have
this. This results in remote executions of apply failing with a nil pointer
dereference when it checks tfVersion in StripRefreshingFromPlanOutput. This fix
involves copying what the PlanStepRunner does and falls back to the default
version if the context's version is nil.
2021-12-22 14:54:14 -05:00
Nish Krishnan
a8bfd77452 Move runtime common under existing runtime package. (#1875) 2021-11-01 11:32:52 -07:00
Eng Zer Jun
38cf7b0141 refactor: move from io/ioutil to io and os package (#1843)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-10-07 00:37:42 -04:00
Aayush Gupta
bb2c239dd9 Updating client interface and adding ApprovalStatus model (#1827) 2021-09-22 12:41:05 -07:00
Masayuki Morita
4b6c2f65da build(lint): use revive instead of golint (#1801)
* Use revive instead of golint

The golint was officially deprecated.
https://github.com/golang/go/issues/38968

We have been using golint via golangci-lint and golangci-lint now
recommends using revive instead of golint.
https://golangci-lint.run/usage/linters/
> golint: The repository of the linter has been archived by the owner.
> Replaced by revive.

The revive is a drop-in replacement of golint. I think switching to
revive is a reasonable choice to check the same rules for free.
https://github.com/mgechev/revive

* Fix lint errors reported by revive

The revive is almost the same as golint, but there seems to be a bit
different results.

https://app.circleci.com/pipelines/github/runatlantis/atlantis/1519/workflows/75fd7da5-1532-4ed7-ac8a-4884902818a4/jobs/8314
https://github.com/runatlantis/atlantis/runs/3565887247?check_suite_focus=true
2021-09-10 09:14:56 -07:00
Gerald Barker
7ce8cef307 Fix regression - Delete .terraform.lock.hcl if it was created by terraform init (#1701)
* Delete .terraform.lock.hcl prior to terraform init if it is not staged

* Changes suggeted by reviewer
2021-08-30 14:53:49 -07:00
Masayuki Morita
fe31bc6243 Fix typo (#1754) 2021-08-17 10:23:48 -07:00
Pat Sier
d358857e80 feat: add version command (#1691) 2021-07-12 11:10:15 -04:00
Taavi Tani
d451167175 fix: TFE remote ops detection for >= tf 1.0.0 (#1687) 2021-07-07 16:48:49 -04:00
Nish Krishnan
d914eafd2a Move core workflow packages under core. (#1684)
* Move core workflow packages under core.

* lint.
2021-07-01 12:54:44 -07:00