-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Trigger Actions and Add Ability To Kick Off Runs With Specified Terraform Version #20
Refactor Trigger Actions and Add Ability To Kick Off Runs With Specified Terraform Version #20
Conversation
mplachter
commented
Jan 25, 2023
- Work in Progress trigger_actions refactor
- Why
- Simplify implementation and API
- Make it easier to add arguments to pass back to trigger_actions
- Pending
- fix mocks
- fix unit tests
- Why
- Pass TF Version to overwrite run with diff terraform version
- good from a testing perspective
I will rebase -i and sign this later this is still a WIP leaving in Draft for now |
…dability Signed-off-by: Matt Plachter <matthew.plachter@zapier.com> refactored options and mock tests add ability to pass back tfversion to run fixed functionality for setting version during plans only for upgrade testing. removed commented out mocks from left over config regenerated mocks with updated interface minor doc additions
004f1d6
to
e85c22f
Compare
README.md
Outdated
@@ -27,6 +27,10 @@ TFBuddy consists of the webhook handler and a NATS cluster. | |||
|
|||
See [Installation Docs](https://tfbuddy.readthedocs.io/en/stable/usage/) | |||
|
|||
## Contributing | |||
|
|||
The [contributing](./docs/contributing.md) has everything you need to start working on TFBuddy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mind linking this to read the docs instead?
pkg/comment_actions/parsing.go
Outdated
"github.com/zapier/tfbuddy/pkg/utils" | ||
) | ||
|
||
var ( | ||
ErrNotTFCCommand = errors.New("not a TFC command") | ||
ErrOtherTFTool = errors.New("Use 'tfc' to interact with tfbuddy.") | ||
ErrOtherTFTool = errors.New("use 'tfc' to interact with tfbuddy") | ||
ErrNoNotePassed = errors.New("no notes passed in not block") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note instead of not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a useful new feature and some great code cleanup.
Just a couple of nits, to cleanup some commented out code.
pkg/mocks/helpers.go
Outdated
@@ -225,7 +211,7 @@ func CreateTestSuite(mockCtrl *gomock.Controller, overrides TestOverrides, t *te | |||
mockGitDisc := NewMockMRDiscussionNotes(mockCtrl) | |||
mockMRNote := NewMockMRNote(mockCtrl) | |||
|
|||
mockTriggerConfig := NewMockTriggerConfig(mockCtrl) | |||
// mockTriggerConfig := NewMockTriggerConfig(mockCtrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this now?
pkg/mocks/helpers.go
Outdated
MockGitRepo: mockGitRepo, | ||
MockGitDisc: mockGitDisc, | ||
MockMRNote: mockMRNote, | ||
// MockTriggerConfig: mockTriggerConfig, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
pkg/mocks/helpers.go
Outdated
MockGitRepo *MockGitRepo | ||
MockGitDisc *MockMRDiscussionNotes | ||
MockMRNote *MockMRNote | ||
// MockTriggerConfig *MockTriggerConfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// MockTriggerConfig *MockTriggerConfig |
Signed-off-by: Matt Plachter <matthew.plachter@zapier.com> redirect to contrib url fix spelling error remove commented out code
14dbccd
to
b1c58ea
Compare
}) | ||
if err != nil { | ||
log.Error().Err(err).Msg("could not create TFCTriggerConfig") | ||
return projectName, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should wrap this as a Permanent Error unless it can recovered. utils.CreatePermanentError
since that'll put it back on the Nats queue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes 100p sense. i moved it into the NewTFCTriggerConfig function so the error will always be wrapped with the permanent error. 👍
Signed-off-by: Matt Plachter <matthew.plachter@zapier.com>