* fix(web-templates): use CleanedBasePath for static content
When setting '--atlantis-url' this static content 404s.
For example, we can see this when comparig:
- /lock --> works seamless with a custom `--atlantis-url`
- /jobs --> doesn't work when using a custom `--atlantis-url`
* fix(web-templates): regenerate bindata_assetfs
* Add UUID for Log Streaming Job ID (#167)
* Update log handler to close buffered channels when an operation is complete (#170)
* Add preliminary check before registering new receivers in the log handler (#173)
* Using projectOutputBuffers to check for jobID instead of receiverBuffers (#181)
* Refactor log handler (#175)
* Reverting go.mod and go.sum
* Fix lint errors
* Fix linting
* Replacing . with _ when generating project identifier if project name is not set
* Adding test for GenerateProjectJobURL when working dir set to .
* Replacing . with _ when generating project identifier if project name is not set
* Fixing merge conflicts
* Add benchmark for /healthz endpoint
This benchmark will measure not only speed but also how much memory
each request to /healthz allocate. I'm adding the benchmark to have a
baseline to compare.
Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>
* Hardcode /healthz body into a variable
We know it will always be this value, there's no need to import and
call json.MarshalIndent.
Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>
* Initialize /healthz body only once
Signed-off-by: Leandro López (inkel) <inkel.ar@gmail.com>
The plan step has a mechanism to use the default tf version from the Terraform
client if the context does not define one, however the apply step does not have
this. This results in remote executions of apply failing with a nil pointer
dereference when it checks tfVersion in StripRefreshingFromPlanOutput. This fix
involves copying what the PlanStepRunner does and falls back to the default
version if the context's version is nil.
* adds AllowedRegexpPrefixes config and use it on the FindProjectsByName method
* adds tests for the new AllowedRegexpPrefixes config
* update documentation with the new AllowedRegexpPrefixes config
* docs: document approve_policies command in help
The `approve_policies` command was added with policy checking but was
never included in the command parser help.
Also update the comments in the file to reflect all of the commands.
* feat: Better message on policy failure
Include the specific command `approve_policies` in the message.
* add .devcontainer to .gitignore
* allow AzureDevOps host to be specified in the user_config
* fix spacing issues
* gofmt
* fixes to cmd and update to approach
* add specific self host fixtures
* add specific self host parser tests
* update code to azure self hosted devops
* go fmt
Co-authored-by: atlantisbot <lkysow+atlantis@gmail.com>
* add .devcontainer to .gitignore
* allow AzureDevOps host to be specified in the user_config
* fix spacing issues
* gofmt
* fixes to cmd and update to approach
Co-authored-by: atlantisbot <lkysow+atlantis@gmail.com>
* Migrate dgrijalva/jwt-go to golang-jwt/jwt/v4
dgrijalva's jwt is no longer maintained. The golang-jwt says it is a
drop in replacement for v4. This also fixes CVE-2020-26160 which
possibly won't be fixed in dgrijalva's version.
* Update occurrences of bradleyfalzon/ghinstallation to v2
v2.0.3 pulls in golang-jwt/jwt over the now unmaintained
dgrijalva/jwt-go.
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>
* Improve github pull request call retries
Retry with fixed 1 second backoff up to 3 retries was added by #1131 to
address #1019, but the issue continued to show up (#1453).
Increase max attempts to 5 and use exponential backoff for a maximum
total retry time of (2^n - n - 1) seconds, which is roughly 30 seconds
for current max attempts n = 5.
Also move the sleep to the top of the loop so that we never sleep
without sending the request again on the last iteration.
* Fix style with gofmt -s
* 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>
Fixes#1539
The branch matcher feature has been introduced in #1383, but the current
implementation was broken and doesn't work at all (#1539).
If my understanding is correct, there are two problems:
(1) The `GlobalCfg` has a default `Repo` instance which always matches
any repositries and branches. Therefore the branch matcher never be
functional.
(2) Validating base branches in
`DefaultPreWorkflowHooksCommandRunner.RunPreHooks()` implicitly assumed
that users customize `pre_workflow_hooks`, but the assumption isn't
always true because it defaults to empty.
For (1), I added a new method `MatchingRepo()` to `GlobalCfg` to check
`BranchMatches()` for a single `Repo` instance.
For (2), I moved validating branch to
`DefaultCommandRunner.validateCtxAndComment()`. Since the method has
already validated meta data of pull request, I think it's suitable place
to check base branches, but please let me know if there is anywhere more
suitable.
* allow user to pass gh-app-key directly instead of filename
* start fixing tests
* fix make test
* update website with info about new flag
* Apply suggestions from code review
Co-authored-by: Roberto Hidalgo <un@rob.mx>
Co-authored-by: Roberto Hidalgo <un@rob.mx>