Commit Graph

419 Commits

Author SHA1 Message Date
Luke Kysow
91eecbcb68 Add comment for bitbucket merge conflict detection 2019-06-12 12:28:52 +01:00
Luke Kysow
8bcb3726d4 Switch to Bitbucket 2.0 API for mergeable check 2019-06-12 12:21:47 +01:00
Luke Kysow
4944ee1687 Add comment explaining . => / replace 2019-06-05 11:30:24 +01:00
Tollef Fog Heen
8a3e342344 Include directory in slack webhook message
Fixes: https://github.com/runatlantis/atlantis/issues/660
2019-06-05 11:37:37 +02:00
Luke Kysow
8f81568e24 Fix require-approval for Bitbucket Cloud.
Bitbucket Cloud changed their APIs to deprecate the username fields.
This broke how we were checking for approvals. Rather than propagate the
UUID field through the PullRequest model, I use the pull request API
response directly while checking approvers.
2019-06-03 14:57:52 +01:00
Luke Kysow
98274cd9bb Log repo name if does not match whitelist
Should help with folks debugging, especially for BB Server.
2019-05-24 09:14:40 -04:00
Luke Kysow
7595265a6b Finishing touches to disable-apply-all
- fix missing part of a test
- log when ignoring
2019-05-23 12:09:51 -04:00
Will Soula
b77a09dc97 Add --disable-apply-all flag
Add a flag to disable the use of the command `atlantis apply` so you
can enforce that each plan must be applied separately.
2019-05-23 12:09:51 -04:00
Luke Kysow
4dbdde8543 Upgrade to Terraform 0.12
To be clear, Atlantis was compatible with 0.12 before this commit, but
this change makes 0.12 the default version *if* users haven't set the
--default-tf-version flag.
2019-05-23 11:42:58 -04:00
Luke Kysow
3160a824d8 Merge pull request #619 from runatlantis/double-error
Don't include errored cmd output twice.
2019-05-07 09:26:03 -04:00
Luke Kysow
e45bc33330 Don't include errored cmd output twice.
Since we're including the command output inside the error, we don't need
to also return the output. This was resulting in the error output being
printed twice.
2019-05-07 09:22:25 -04:00
Luke Kysow
d0308a52e7 Redact clone url during clone errors.
If there was an error during cloning, we would sometimes print the clone
credentials to the pull request and in the Atlantis logs. This change
ensures we print the redacted clone url.

We also change the redacted clone url to contain "username:<redacted>"
so that if users see the redacted url in logs, they'll know we were
using a credentialed form and so if they try to replicate with curl
they'll know to substitute the correct credentials.
2019-05-07 09:14:59 -04:00
Luke Kysow
568c7f9fd9 Add newline so bitbucket formats markdown 2019-04-24 09:50:28 -03:00
Luke Kysow
8e7eab78bd Add missing closing backticks for help output 2019-04-23 13:29:39 -03:00
Luke Kysow
559736c897 Merge pull request #585 from runatlantis/ff-merges
Never use fast-forward merges
2019-04-10 15:16:25 -03:00
Luke Kysow
93cd6a5431 Never use fast-forward merges
When using --checkout-strategy merge, we were performing the merge
without the --no-ff flag. This meant that if the branch could be merged
via a fast-forward merge (without a merge commit), then later when we
ran git rev-parse HEAD^2 to determine if the repo was at the right
commit, it would fail.

Now we merge with --no-ff which ensures the commit tree will always look
the same and git rev-parse HEAD^2 will always succeed.
2019-04-10 15:12:32 -03:00
Luke Kysow
ac41fe9b19 Merge pull request #564 from devinturner/master
Comment on why EROR and DBUG are not typos
2019-04-09 09:52:33 -03:00
Luke Kysow
cf490f86f0 Refactor run_step_runner test cases 2019-04-08 11:19:25 -03:00
Niko Virtala
83c81db7de tests with or without project name declaration. 2019-04-07 13:33:58 +03:00
Niko Virtala
6ee1cf6ce4 expose project name environment variable. 2019-04-06 21:18:16 +03:00
Devin Nathan-Turner
9c13979b8b Added comment explaining why EROR and DBUG are not typos 2019-04-02 19:25:59 -04:00
Luke Kysow
374e7a6a30 Merge in default cfg in other location 2019-04-02 18:06:35 -03:00
Luke Kysow
cfbda1e44f Better config logging 2019-04-02 18:06:11 -03:00
Luke Kysow
609bf84b9a Fix apply all with project name bug
Previously, if you were using project names and you had two projects
with the same directory and workspace but different workflows, running
"atlantis apply" would fail. This was because we weren't figuring out
what the project name was for each pending plan.

This change fixes this by extracting the project name from the planfile.
We also handle /'s in the project name by substituting them with '::'.
This allows us to convert them back to /'s when we're figuring out the
project names from the filenames. It's safe to do this because : isn't
an allowed character for project names.

We also remove a final substitution of invalid filename characters
because we rely on the validation of the project names instead which
happens when validating the atlantis.yaml file.
2019-04-02 15:44:01 -03:00
Luke Kysow
8982a67b78 Run latest goimports 2019-03-30 20:22:49 -05:00
Luke Kysow
846feaed6d Add server-side cfg integration tests 2019-03-28 15:55:34 -05:00
Luke Kysow
25fed35728 New version 3 of atlantis.yaml
This version changes how we parse custom run steps.
Previously we used the go-shlex library to parse the steps but this
caused users issues because they'd have to use weird escaping.

Now we simply pass the step directy to sh -c without any parsing. The
parsing was unnecessary.
2019-03-28 13:45:12 -05:00
Luke Kysow
b12d487cb2 Add new --repo-config-json flag
This flag will allow users to specify repo config as json instead of
writing a file to disk. This is useful in deployments where disk access
is more difficult, ex. Docker.
2019-03-27 19:52:58 -05:00
Luke Kysow
e163b47ebd Change Atlantis tagline.
Atlantis has been focused on TF pull request automation for the last
year so I want to rename its tagline to be more focused.
2019-03-27 14:59:37 -05:00
Luke Kysow
d78b106cab Refactor @jjulien's server-side config work. 2019-03-27 14:47:48 -05:00
John Julien
1fcdaba719 Added new --repo-config option and deprecated --allow-repo-config
This enables atlantis.yaml in all repos, but by default restricts
certain sensitive keys from being used.

The keys apply_requirements, workflow, and workflows can only be
specified in an atlantis.yaml file if explicitly allowed by a
server side repo config.

The repo config file provides the ability to specify a default set of
workflows, and default values for apply_requirements and workflow to use
use on a per repo basis.  It also supports applying to a collection of
repos by using regex to match a repo name.

If more than one repo name matches, the values from last repo matched
are used.

This deprecates the --allow-repo-config option
2019-03-27 14:47:48 -05:00
kenske
c9e39093ef Renamed status checks from <action>/atlantis to atlantis/<action> 2019-03-20 20:22:38 -05:00
Luke Kysow
ca58ebd7e0 Autodownload tf versions. Add --default-tf-version.
This changeset has two features:
1. We now automatically download the version of terraform specified in
atlantis.yaml configs if we don't already have that version available
locally.

2. Add a new --default-tf-version flag that allows users to set a
default version of Terraform that we will also download if it's not on
disk.

These mean that users don't need to build custom Docker images to just
add terraform versions. It also means that upgrading the version of
terraform that is packaged with the Atlantis Docker image won't cause
issues for existing users because as long as they're running with
--default-tf-version, Atlantis will always use that version.
2019-03-14 13:51:27 -05:00
Luke Kysow
08e272854c Upgrade pegomock 2019-03-13 17:52:27 -05:00
Luke Kysow
80f6b99397 Unskip working test 2019-03-13 17:52:27 -05:00
Luke Kysow
2fb49130c5 Respond to bitbucket cloud/server username.
Looks like we forgot to add the ability for bitbucket cloud/server users
to invoke Atlantis using the name of the user they're running it as.
2019-03-13 16:13:52 -05:00
Luke Kysow
2bcf17b474 Fixes #533, a regression where Atlantis will respond with errors to
comments that aren't intended to invoke Atlantis.
2019-03-13 16:13:52 -05:00
Luke Kysow
d0e0b0dfca Log rev-parse error at warn level.
We recover gracefully from this so it's not an error.
2019-03-07 09:57:29 -05:00
Luke Kysow
36925b4dc8 Ignore .terragrunt-cache dirs.
Fixes #487
2019-03-06 11:20:44 -05:00
Luke Kysow
4c887f18cf Merge pull request #514 from runatlantis/split-status-checks
Split status checks
2019-03-06 10:15:56 -05:00
Luke Kysow
30577a4c4d Support dirs with spaces.
Allow running atlantis plan -d "dir with spaces" to target a directory
that contains spaces.

Fixes #423
2019-03-05 16:16:16 -05:00
Luke Kysow
936a5f4a16 Remove mention of TERRAFORM_WORKSPACE env var 2019-03-05 15:57:43 -05:00
Luke Kysow
4fc22aedeb Split status checks into plan and apply.
Split single top-level status check into one plan and one apply check.
These checks will also now track the whole pull request status rather
than just the last action.
2019-03-05 14:29:43 -05:00
Luke Kysow
65c8f1317a Give warning for common error missing 'run' key 2019-03-05 13:32:08 -05:00
Luke Kysow
f98fe8ef80 Add new status to ProjectPlanStatus 2019-03-05 12:08:11 -05:00
Luke Kysow
393af51e4f Add Command field to ProjectResult 2019-03-05 12:01:06 -05:00
Luke Kysow
a13bce59ad updateDB should not return a pointer 2019-03-05 11:54:04 -05:00
Luke Kysow
c97c922f91 Merge pull request #510 from runatlantis/bb-server-delete-event
Support bitbucket server pr:deleted event
2019-03-01 11:49:13 -05:00
Luke Kysow
2fb8f4d4ff Support bitbucket server pr:deleted event
If a pull request is deleted, Atlantis should delete the locks.
Fixes #498
2019-03-01 11:36:22 -05:00
Luke Kysow
308a87316e Merge pull request #502 from runatlantis/bb-cloud-api-deprecation
Use new 'nickname' field for bitbucket cloud
2019-03-01 10:21:02 -05:00