Commit Graph

1194 Commits

Author SHA1 Message Date
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
David McPike
cb9bdb017d Resolve merge conflict on DisableApplyAll flag 2019-05-24 21:26:59 -05: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
David McPike
12f95c5b79 Azure Devops support
- Add blackfriday for markdown-to-html comment translation
Azure Devops doesn't support markdown in work item comments

- Restore NewRepo() to original form - removing project parameter
- Add models.SplitAzureDevopsRepoFullName() to handle project name
All Azure Devops URIs need owner, project, and repo.  This function
allows us to avoid adding project to NewRepo()

- Update calls to azuredevops.NewClient() to match library requirements
- Add context to azuredevops client to match library requirements
- Basic working CreateComment() and MergePull() support (not widely
tested)
2019-05-19 20:54:04 -05:00
David McPike
dd9041f131 Merge remote-tracking branch 'upstream/master' into azure-devops 2019-05-17 09:31:44 -05:00
David McPike
7f1fd23f0f Azure Devops fork updates
- Remove project from NewRepo() calls
- Add new function SplitAzureDevopsRepoFullName
2019-05-17 09:31:01 -05: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
David McPike
bf1ccc47db Azure Devops support
- Fixes logic error in PullIsMergeable()
- Replace GetRemoteURL() with GetWebURL() - returns what we want
2019-04-29 20:19:02 -05:00
David McPike
36a849d2b5 Fixes steps that use cloneURL for Azure Devops 2019-04-29 09:55:37 -05:00
David McPike
cbb28ec1f1 Azure Devops support
- Add bluemonday to strip HTML tags from comments
- Rename all WorkItemEvent refs to WorkItemCommentedEvent
- Rename pullEvent to event to match types
- Minor comment clean-ups
- Support multiple pull request links in a work item
2019-04-29 00:06:48 -05:00
David McPike
10f210c562 Merge remote-tracking branch 'upstream/master' into azure-devops 2019-04-28 17:31:22 -05:00
David McPike
10abea0875 fix CreateStatus() if TargetURL is empty 2019-04-28 15:57:39 -05:00
David McPike
4eb9a010bb Azure Devops support
- Add missing headRepo set to AzureDevops event parser
- Strip 'refs/heads' from branch values sent to models.PullRequest
- Fix calls to NewClient() to use org, not username
- Add notes about use of /'s in repo FullName
- Force use of 'dev.azure.com' for VCSHost.Hostname value
- NewAzureDevopsClient(): Rename 'account' to 'username' to match docs
- NewAzureDevopsClient(): Rename unused 'hostname' to 'org'
2019-04-28 11:23:25 -05:00
David McPike
87e88e34df Fixes repo fullName for Azure Devops 2019-04-27 20:09:28 -05:00
David McPike
5cbcf25de0 Initial support for azure devops events
- Pull request events
- Work item comment events
2019-04-27 17:52:08 -05:00
David McPike
4d11f8089a add Azure Devops pull getter support 2019-04-27 17:50:52 -05:00
David McPike
4bffa57c52 Updates to azuredevops_client.go
- remove unneeded NewAzureDevopsClient() code
- change to using const refs
- add GetPullRequest()
2019-04-27 17:49:04 -05:00
David McPike
7dd268709a Azure Devops support fork development
cmd/server.go:
- Add default empty strings for Azure Devops webhook basic user/pass

server/user_config.go:
- Rename AzureDevopsBasicUser to AzureDevopsWebhookBasicUser to signify
difference from the API call credentials

server/server.go:
- fix azuredevopsClient var
- add Azure Devops to []supportedVCSHosts
- add AzureDevopsRequestValidator for basic auth webhook support

server/azuredevops_request_validator*.go:
- add charset utf-8 to support content-types for webhooks
- start adding validator tests

server/events_controller.go*:
- change azuredevops webhook header to Request-Id
- move Validate() and Basic Auth webhook support to go-azuredevops
- add pull and comment event functions
2019-04-27 17:48:17 -05:00
David McPike
a058a661eb initial commit of azuredevops client 2019-04-26 09:05:29 -05: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
David McPike
b7ff1c23b1 add project parameter to bitbucketcloud NewRepo() 2019-04-14 18:19:05 -05:00
David McPike
811a2a6ec9 replace azuredevops secret for basic auth 2019-04-13 21:36:21 -05:00
David McPike
262e31bc59 Merge remote-tracking branch 'upstream/master' into azure-devops 2019-04-13 19:06:54 -05: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
David McPike
a17e565ba6 - switch to go-azuredevops package
- remove ADHostname
- add ADOrg and ADProject
2019-04-07 01:57:54 -05:00
David McPike
08d47de047 azure devops should ignore appending .git to clone url 2019-04-06 13:23:29 -05:00
Niko Virtala
6ee1cf6ce4 expose project name environment variable. 2019-04-06 21:18:16 +03:00
David McPike
c5eb11951e update NewRepo calls with project argument 2019-04-06 12:41:15 -05:00
David McPike
5a1eb59d2a add project memeber to Repo struct, NewRepo, and tests 2019-04-06 12:35:06 -05:00
David McPike
03bfefe9f4 continue azure devops support 2019-04-03 23:52:48 -05:00
David McPike
1946dc0477 merge from head 2019-04-03 23:48:04 -05:00
David McPike
cfcf59d8e0 continue adding skeleton for azure devops support 2019-04-03 21:30:14 -05:00
David McPike
ce380ec27b initial azuredevops client - copy from bitbucketcloud 2019-04-02 22:00:13 -05: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
David McPike
fe258966f7 initial changes for azure devops support 2019-04-01 20:49:09 -05:00
Luke Kysow
8982a67b78 Run latest goimports 2019-03-30 20:22:49 -05:00