Commit Graph

94 Commits

Author SHA1 Message Date
Ken Kaizu
27b9897517 chore(build): rm pegomock experimental feature for smooth mock generation (#2886)
* disable pegomock --use-experimental-model-gen, cause random fail by segv

* make regen-mocks

* fix mock code which uses non experimental pegomock codes
2022-12-27 19:58:15 -06:00
Ken Kaizu
692ceae171 upgrade go-playground/validator from v9 to v10 (#2863)
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
2022-12-23 11:26:07 -06:00
nitrocode
b94575ac88 Use go-github v48 (#2839) 2022-12-20 10:38:21 -06:00
James Williams
71819a28f4 Switch clone URL structure for *.visualstudio.com URLs for AzureDevOps (#2810)
* Switch clone URL structure for visualstudio.com URLs

* Add comment for ADO URL if statement. Add test

* Test else statement in ParseAzureDevopsRepo
2022-12-18 18:32:46 -06:00
chavacava
57b01166a6 fix #2537 by removing redundant conditional branch (#2545) 2022-10-10 21:13:24 -07:00
Jonas
5bf7c93f3e ignore GitLab Draft MRs (#2468)
* feat: ignore GitLab Draft MRs

* deepcopy and overwrite unit under test

* add tests for close actions
2022-08-25 10:47:21 -07:00
Rémi Lapeyre
b409cb8470 Add the /plan and /apply endpoints (#997)
* Add the /plan and /apply endpoints

* Resolve conflicts

* Fix wrong merge

* Add missing methods for mocks

* Fix linting error

* Fix linting error

* Move api plan/apply into APIController

* Extract commond code into helper functions

* Implement GetCloneURL for GitHub

Co-authored-by: Li Lin <li.lin@hashicorp.com>
2022-07-27 11:36:49 -07:00
Quan Hoang
3744535dac Further parse Gitlab MergeRequest Update events (#1301) 2022-06-09 20:42:58 -07:00
Sarvar Muminov
90e92e3a13 chore: move CommandContext and CommandResult to models (#193) (#2093)
* Moved CommandContext and CommandResult to models (#193)

* Moved CommandContext and CommandResult to models

* move from models to command

rename CommandContext -> Context
rename CommandResult -> Result

* moved command related helpers into command package

* move ProjectCommandContext and ProjectResult to command/project package

* move project command context and project result

* revert unrelated code

* move tests

* fix left over

* fix linting

* fix tests

* remove unused import

* fix project context dependencies

* fix depenedecies

* fix typo
2022-03-21 10:36:13 -07:00
Maxime Brunet
24e8cf7a79 fix(bitbucketcloud)!: Use AccountID as username instead of Nickname (#2034)
* fix(bitbucketcloud)!: Use AccountID as username instead of Nickname

* Update PullRequest.Author as well

* Remove unused Nickname field
2022-03-07 11:57:10 -05: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
Daniel Grimes
4248e2ebf4 fix(azure): allow correct path to be derived for on premise installation (#1863)
* 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>
2021-10-26 10:34:47 -07:00
Spiros Economakis
e48f80359b Add an extra flag to disable automerge with comment apply (#1533)
```
atlantis apply --auto-merge-disabled
```

Issue: #1245
2021-06-22 09:33:07 -07:00
Sarvar Muminov
af2a806870 Implement a new policy check workflow (#1317)
* 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>
2021-02-10 18:13:44 -08:00
Luke Kysow
f787100b6a Fix bug responding to draft pr updates
Previously any update to a draft PR other than "closed" would default to
being an "open" event due to a bug in the parsing logic.
2020-09-22 09:49:41 -07: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
CJ Ketchum
d7ce63742e Add test for plan-draft behavior 2020-05-25 16:45:38 -07:00
Andrew Ring
3c87af9996 Release locks when closing draft PRs
If plan is run manually in a draft PR, the PR may hold locks. If
the draft PR is then closed, without first marking it Ready For
Review, the locks are left in place. To resolve this, we can
process closing draft PRs in the same way as non-draft PRs.
2020-05-13 10:35:22 -07:00
Christopher Ketchum
9ce981fc6c Ignore Github draft PRs (#977)
* Ignore Github draft PRs
2020-04-20 21:04:19 -07:00
Josh Soref
2cf5b0a42a Spelling (#902)
Spelling fixes
2020-01-20 12:46:00 -06:00
David McPike
09eb6ac18e Fixes #835
- Improve tests
    - Replace instead of Split
2019-11-14 17:57:58 -06:00
David McPike
71239cf943 Fixes #835
AzureDevops: Support slashes in branch names
2019-11-14 00:23:44 -06:00
Luke Kysow
07ffe179e7 Small refactoring to azure devops support 2019-10-25 18:07:18 -07:00
David McPike
9424893e1f Complete migration to PR comment event
- Update docs
- Remove work item commented event code
2019-10-05 00:17:42 -05:00
David McPike
9714c87dda Azure Devops event parser updates
- Extract owner and project from workitem.commented payload
- Process all Relations and return last error
2019-09-24 09:41:59 -05:00
David McPike
495cf76efd Azure Devops update
- Remove org and project configs
- Add support for WriteGitCreds
2019-09-23 08:24:59 -05:00
David McPike
bb88c95dff Improves Azure Devops webhook error handling 2019-09-22 16:09:04 -05:00
David McPike
e04005a682 Fix duplicate go-gitlab references 2019-08-30 13:09:50 -05:00
David McPike
c346cce484 Merge remote-tracking branch 'upstream/master' into azure-devops 2019-08-30 12:48:47 -05:00
Luke Kysow
b81fe9a5e5 Switch to gomod 2019-08-26 18:38:22 +02:00
Luke Kysow
3919f05548 Update to latest version of go-gitlab 2019-08-26 18:23:52 +02:00
David McPike
acef89adc4 Azure Devops PR minor cleanup, fix tests, checks
- Re-write tests for azuredevops_client
- CircleCI checks should pass
- NewAzureDevopsClient() now takes a hostname like NewGithubClient()
- Docs include comment about default merge strategy requirements
2019-07-28 10:37:45 -05:00
David McPike
ff611af29f Minor style updates 2019-07-26 14:56:03 -05:00
David McPike
e8cfe5af28 Fix Azure Devops Pull Events
- Event type assertion should be pointer
- Remove merge attempted webhook event type
- Move closed pull request to updated event type
2019-07-26 14:22:14 -05:00
David McPike
c9c8f01c67 Fix panic from nil error 2019-07-26 10:29:20 -05:00
David McPike
29b74d25f1 Update Azure Devops Event Parser
- Always set explicit return values
- Add baseURL func parameter to facilitate testing
2019-07-16 21:57:41 -05:00
David McPike
eeaab9f6d7 Merge tag 'v0.8.3' into azure-devops 2019-07-12 23:27:43 -05:00
Luke Kysow
a2349b64d7 Fix bug parsing BB Cloud pull rejected events
Was using the word DECLINE but the actual keyword is DECLINED.
2019-06-13 14:47:29 +01:00
David McPike
12f95c5b79 Azure Devops support
- Add blackfriday for markdown-to-html comment translation
Azure Devops doesn't support markdown in work item comments

- Restore NewRepo() to original form - removing project parameter
- Add models.SplitAzureDevopsRepoFullName() to handle project name
All Azure Devops URIs need owner, project, and repo.  This function
allows us to avoid adding project to NewRepo()

- Update calls to azuredevops.NewClient() to match library requirements
- Add context to azuredevops client to match library requirements
- Basic working CreateComment() and MergePull() support (not widely
tested)
2019-05-19 20:54:04 -05:00
David McPike
bf1ccc47db Azure Devops support
- Fixes logic error in PullIsMergeable()
- Replace GetRemoteURL() with GetWebURL() - returns what we want
2019-04-29 20:19:02 -05:00
David McPike
36a849d2b5 Fixes steps that use cloneURL for Azure Devops 2019-04-29 09:55:37 -05:00
David McPike
cbb28ec1f1 Azure Devops support
- Add bluemonday to strip HTML tags from comments
- Rename all WorkItemEvent refs to WorkItemCommentedEvent
- Rename pullEvent to event to match types
- Minor comment clean-ups
- Support multiple pull request links in a work item
2019-04-29 00:06:48 -05:00
David McPike
4eb9a010bb Azure Devops support
- Add missing headRepo set to AzureDevops event parser
- Strip 'refs/heads' from branch values sent to models.PullRequest
- Fix calls to NewClient() to use org, not username
- Add notes about use of /'s in repo FullName
- Force use of 'dev.azure.com' for VCSHost.Hostname value
- NewAzureDevopsClient(): Rename 'account' to 'username' to match docs
- NewAzureDevopsClient(): Rename unused 'hostname' to 'org'
2019-04-28 11:23:25 -05:00
David McPike
87e88e34df Fixes repo fullName for Azure Devops 2019-04-27 20:09:28 -05:00
David McPike
5cbcf25de0 Initial support for azure devops events
- Pull request events
- Work item comment events
2019-04-27 17:52:08 -05:00
David McPike
c5eb11951e update NewRepo calls with project argument 2019-04-06 12:41:15 -05:00
David McPike
03bfefe9f4 continue azure devops support 2019-04-03 23:52:48 -05: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