Commit Graph

29 Commits

Author SHA1 Message Date
Luke Kysow
67b2217245 Retry get pull request calls to github
These calls have been 404'ing lately, likely due to eventual consistency
issues on GitHub's side where they send the PR created webhook but it's
not yet available on their API.

To work around this, we will retry up to 3 times with a 1s delay.
2020-07-25 23:46:41 -07:00
Chris Alexander
4568213356 Reversed if statement for comment splitting 2020-07-10 18:13:05 -05:00
Mark Keisler
caf3319b7d Bring back the change from
2f074727e2 (diff-e348084f0b7562996b0bd5d429158e53)
that was clobbered.
2020-07-09 11:21:00 -05:00
Chris Alexander
aa1bfc0a27 Add "plan" to continued statement 2020-07-01 10:11:33 -05:00
rob
011d3f8229 Test against a live repo, fix accordingly
more docs, add installation step
2020-06-03 20:25:11 -04:00
rob
227ce9cbf4 Upgrade to github/v31 for CompleteAppManifest
split fixtures out elsewhere, add working dir test
2020-06-03 20:18:13 -04:00
Roberto Hidalgo
199cdfe192 Play around with github app credentials 2020-06-03 20:16:24 -04:00
Sam Park
2f074727e2 Fix GraphQL URL for Github Enterprise
Partially addresses #1009, but doesn't fix it entirely. The 406 response
is still a puzzler.
2020-06-03 11:34:44 -07:00
Christopher Ketchum
88e397ed6d vcs/github_client: add logging around github API calls (#1042) 2020-06-01 16:42:03 -07:00
Luke Kysow
3eaa67e1ef Update go-github, empty automerge commit
Using an empty auto-merge commit will cause GitHub to autogenerate its
own commit message like would happen when using the UI.
2020-05-25 12:07:52 -07:00
David McPike
bc069d4b0c Add MarkdownPullLink function to VCS clients 2020-04-21 09:19:55 -05:00
Luke Kysow
80347f4c1d Merge remote-tracking branch 'origin/master' into hide-comments 2020-04-15 21:47:58 -07:00
Luke Kysow
6e8b4eed16 Small refactor 2020-04-15 21:44:34 -07:00
Luke Kysow
82afe0b061 Fix lint issues 2020-04-13 10:04:37 -07:00
Sam Park
6a4236b24d Fix lints 2020-01-24 22:59:39 -08:00
Sam Park
dcd43bead1 Add pagination 2020-01-24 21:51:01 -08:00
Sam Park
fd93af8a55 Fix body string check 2020-01-24 21:51:01 -08:00
Sam Park
815e91be36 Add tests 2020-01-24 21:51:01 -08:00
Dave D'Amico
b025a9037a Fix for Issue 727 (#762)
* initial commit for testing

* testing update

* go fmt
2019-09-03 13:00:17 -04: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
def41f6cef Add tests for GH merge-type detection. 2019-02-11 11:12:15 -06:00
Brenden Matthews
862b5228d0 [automerge] Use available merge methods.
For repos with certain merge methods disabled (such as 'merge'), simply
hitting the GitHub `/merge` endpoint is not sufficient. Instead, we need
to check which methods are actually available, then use the appropriate
method.

With this change it will:

 1. Default to 'merge' if enabled
 2. Use 'rebase' if 'merge' is disabled and rebase is enabled
 3. Use 'squash' if 'merge' is disabled
2019-02-07 16:18:28 -05: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
Luke Kysow
e93384fdb0 Use mergeable_state to determine if mergeable
- Need to use the mergeable_state field in GitHub to know if a pull
request is mergeable.
- Add tests.
- Since we updated our vendored go-github library, fix how we were
creating webhooks in testdrive.
2018-12-12 11:17:09 -06:00
Luke Kysow
bd8335f82f Rename CommitStatus enums 2018-07-20 12:43:48 +02:00
Luke Kysow
1fc4667c63 WIP bitbucket 2018-07-19 21:52:33 +02:00
Luke Kysow
6d8766403b Test GitHub client. 2018-07-01 22:12:50 +02:00