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.
- rename gh-app-key to gh-app-key-file for clarity
- change git credentials writer to append a line if there is an existing
.git-credentials file and in the case of the github app to replace the
old github app line
- removed automatically setting --write-git-creds to true when using a
github app and instead requiring this is set specifically
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.
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.
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
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.
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.
- 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.
Introduce new `mergeable` requirement, in similar vein to the `approved`
requirement. Ran `make go-generate` to update mocks accordingly.
This addresses issue #43.
Adds close and (re)open <details> tag in between the split portions to
ensure the markup is correct across multiple comments. This isn't the prettiest, but a close result, under the assumption continued-comments are in 99% within a terraform output anyway...
Add Apache 2 license and Hootsuite copyright to all golang
files. Add a disclaimer that the files have been modified
hereafter by contributors to this repo in order to abide
by the Apache 2 license requirements.
Fixes#55. GitHub will throw an error if the comment is over
65535 characters. Now we will split up a comment into multiple
comments if it's over that size.