* 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
* 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.
* 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>
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>
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>
* ORCA-731 Force PR authors to rebase if master has diverged (#70)
* initial commit for undiverge apply req
* Update documentation
* Fix existing unit tests
* HasDiverged unit test
* project command runner unit test
* Global config tests cases
* update parser unit tests
* Update project_test unit tests
* Fix linting
* fix test case with logging output
* add space on readme markdown
* Remove unused variable
* remove deprecated flag option
* Use global args struct instead of passing in args
* Fix merge issue
* Add `--autoplan-file-list` server flag to allow modifying the list of files that trigger planning.
* Set default value for `--autoplan-file-list` and add `terragrunt.hcl` to the list.
* Default is handled in server now. No need for it here.
* Fix syntax error test.
* Fix e2e tests
This is two changes:
Replacing all usages of SimpleLogger with it's interface SimpleLogging which makes it easier to swap out loggers going forward
Nukes SimpleLogger in favor of StructuredLogger which allows us to better analyze logs in our log management system we choose.
* Adding policy_check support into yaml config
* Added policy check model and runtime structs
* Adding BuildPolicyCheckCommand to ProjectCommandBuilder
* Return incorrectly deleted code
* Remove BuildAutoPolicyPlanCommand from ProjectCommandBuilder
* Split runAutoCommand into two functions
runAutoPlanCommand - does what originally RunAutoplancommand was doing
except now it returns CommandResult and []models.ProjectCommandContext
runAutoPolicyCheckCommand - accepts CommandContext, CommandResult, and
[]models.ProjectCommandContext as arguments and runs PolicyCheckStep runner
* Refactor RunCommentCommand
* Remove BuildPolicyCheckCommand and rename StepCmdExec back to TerraformExec
* Add policy step runner logic and conftest interfaces.
* Add show step runner to policy check stage.
* Adding models.PolicyCheckCommand to buildCtx
This also means buildPlanAllCommands call buildCtx twice once with
models.PlanCommand and once with models.PolicyCheckCommand
* Adding new project_command_builder that supports policy_check
* Refactoring PolicyCheck specific logic into a PolicyCheckProjectCommandBuilder
* Moving events.CommandContext to models.CommandContext this will allow me
to remove buildCtx method and move ProjectCommandContext creation into
models package
* Policy Owners might be different types, for that reason we are
refactoring Owners into its own struct with specific keys defining
different owner types
Co-authored-by: Nish Krishnan <nishk@lyft.com>
Co-authored-by: Nish Krishnan <nishkrishnan@users.noreply.github.com>
- 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
The AzureDevopsUser, AzureDevopsToken, and the AzureDevopsURL are combined
to create the .git-credentials file.
When supplying the full FQDN, https://dev.azure.com, https://
is written twice to the .git-credentials file.