Commit Graph

33 Commits

Author SHA1 Message Date
Michel Z. Santello
df0d58d29b fix: vcs-status-name hardcoded in PullIsMergeable function (#2312)
* feat: add userConfig.VCSStatusName to applyCommandRunner context

* fix: use vcsstatusname from context

* chore: normalize tests

* chore: update interface mock
2022-06-16 09:26:20 -07:00
Paul Erickson
bc368465a0 feat: add GitHub team allowlist configuration option (#1694)
* Add GitHub team allowlist configuration option

Co-authored-by: PePe (Jose) Amengual <jamengual@sonatype.com>
Co-authored-by: Troy Neeriemer <tneeriemer@sonatype.com>
Co-authored-by: Ted Roby <troby+github@sonatype.com>
Co-authored-by: Paul Erickson <perickson@sonatype.com>

* Check team allowlist in command runner, rather than event controller

* Remove unneeded trimming

* Test wildcard groups and commands

* Improve error logging

Co-authored-by: PePe (Jose) Amengual <jamengual@sonatype.com>
Co-authored-by: Troy Neeriemer <tneeriemer@sonatype.com>
Co-authored-by: Ted Roby <troby+github@sonatype.com>
2021-12-21 16:08:43 -08:00
Mihail Kuzmich
8c9184b80a feat: add new bitbucket server webhook event type pr:from_ref_updated (#1866) 2021-10-28 11:50:05 -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
wpbeckwith
da7e04290b Add support for deleting a branch on merge in BitBucket Server (#1792)
* Add support for deleting a branch on merge in BitBucket Server

* Add support for deleting a branch on merge in BitBucket Server

* Making linter happy although the code would fall through and return err anyway.

* Add client_test for deleting source branch

* Added err check

Co-authored-by: Wendell Beckwith <wendell.beckwith@redfin.com>
2021-09-27 09:26:37 -07:00
Aayush Gupta
bb2c239dd9 Updating client interface and adding ApprovalStatus model (#1827) 2021-09-22 12:41:05 -07:00
Nish Krishnan
79309ed39c [ORCA-559] Fix hide previous command logic (#37) (#1549) 2021-05-03 12:47:23 -07:00
Istvan Tapaszto
632460b20b Delete source branch on merge (#1357)
Co-authored-by: Tapaszto, Istvan <istvan.tapaszto@msciintegration.onmicrosoft.com>
2021-04-22 09:54:18 -07:00
Luke Kysow
cbe0b18c0e Refactor --skip-clone-no-changes work. 2020-08-18 15:48:33 -07:00
Quan Hoang
54e3dc2ef0 Skip cloning PR repository in case of no projects configured in repo config file were changed 2020-08-18 15:48:05 -07:00
Chris Alexander
aa1bfc0a27 Add "plan" to continued statement 2020-07-01 10:11:33 -05:00
David McPike
bc069d4b0c Add MarkdownPullLink function to VCS clients 2020-04-21 09:19:55 -05:00
Luke Kysow
6e8b4eed16 Small refactor 2020-04-15 21:44:34 -07:00
Sam Park
610c9b2c37 Add hide old comments VCS interface function
And implement the Github version.

The Golang Github client recommends using shurcooL/githubv4.
2020-01-24 21:51:01 -08:00
Luke Kysow
4e8d19be0a Convert AZDO paths to relative
Previously the AZDO paths returned by GetModifiedFiles were absolute.
Now they're relative to the repo root to match the rest of the VCS's.
2020-01-02 09:45:38 -06:00
Luke Kysow
8982a67b78 Run latest goimports 2019-03-30 20:22:49 -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
0a8e3e86c9 Support basepath for bitbucket server
Previously we were stripping the basepath from the passed in URL. i.e.
if I passed in --bitbucket-base-url=https://me.com/basepath then we
would just strip off /basepath.

This change fixes that bug (#508).
2019-03-01 09:14:52 -05:00
Luke Kysow
db1203bf0f Add better support for remote plan/apply.
Features:
- remote plans and applies will set a commit status with a link to the
Terraform Enterpise UI where the streaming output can be viewed.
- because remote plans don't support the -out flag, we diff the plan
output between plan and apply phases to ensure users are applying the
plan they expected

How:
We add a new capability to execute a terraform command while
concurrently reading its real-time output and performing actions
accordingly.
2019-02-27 17:26:00 -05:00
Luke Kysow
b749a32c5f Allow setting 'source' for commit statuses
This is needed so we can set different commit statuses for plan and
apply phases.

Also, append os env variables to git commands during cloning. This fixed
a bug when running tests where I got an error because git couldn't expand
'~' from its git config to my home directory because the HOME env var
wasn't set.
2019-02-25 17:10:20 -05:00
Luke Kysow
bebbcb8a4d Fix automerge bug in Bitbucket Server
BB Server requires we send a 'version' parameter along with our call to
/merge.
2019-02-19 17:30:28 -05:00
Pierre Hanselmann
dd6c3241b9 Set specific check on diagnostics:ping bitbucket event 2019-02-15 13:58:32 +01:00
Luke Kysow
81693d79b3 Add header to disable bitbucket xsrf
Fixes #465 which is caused by XSRF detection on Bitbucket server and
cloud.
2019-02-11 11:38:44 -06:00
Luke Kysow
74e9bbb82b Add automerge feature.
Automerging merges pull requests automatically if all plans have been
successfully applied.

* Save status of PR's to BoltDB so after each apply, we can check if
there are pending plans.
* Add new feature where we delete successful plans *unless* all plans
have succeeded *if* automerge is enabled. This was requested by users
because when automerge is enabled, they want to enforce that a pull
request's changes have been fully applied. They asked that plans not be
allowed to be applied "piecemeal" and instead, all plans must be
generated successfully prior to allowing any plans to be applied.
2019-02-06 16:27:43 -06:00
Luke Kysow
3d8138d3fa Include moved files in GetModifiedFiles
Implement the change from the previous commit for GitLab and Bitbucket
Server/Cloud. Test the change for GitHub.

If a file is moved, we want to run plan in the directory it is moved to
*and* the directory it was moved from.
2019-01-07 16:36:09 -05:00
Brenden Matthews
e001353ae9 Add mergeable requirement.
Introduce new `mergeable` requirement, in similar vein to the `approved`
requirement. Ran `make go-generate` to update mocks accordingly.

This addresses issue #43.
2018-12-11 16:00:04 -05:00
Luke Kysow
bf19968cec Split Bitbucket Server comments if over max length
- Refactor the comment split method into a common package
2018-12-04 09:58:37 -06:00
Luke Kysow
deebb22b5d Use int instead of string for bitbucket response. 2018-11-16 13:38:29 -05:00
Luke Kysow
3e650dc3a0 Fix error parsing tf version when TF_LOG set 2018-08-21 08:52:25 -10:00
Luke Kysow
da236e953b Test Bitbucket Server 2018-07-24 20:34:01 +02:00
Luke Kysow
e8c0f7c5bb Add webhook secret checking. 2018-07-24 20:25:20 +02:00
Luke Kysow
a4c48f5d47 Add provisional Bitbucket Server support 2018-07-24 20:23:51 +02:00