-
Notifications
You must be signed in to change notification settings - Fork 877
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
gowrap fault injection #7056
gowrap fault injection #7056
Conversation
@printf $(COLOR) "Process go:generate directives..." | ||
@go generate ./... | ||
$(MAKE) copyright |
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.
Without this addition, the generated code has no copyright header. Fortunately, this step is idempotent (and fast).
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.
thoughts:
- should we copyright generated code?
- If we do - should we add it to the template? Otherwise it will still be "Uber 2020"
- I remember we have this discussion about "do we even need copyright at every file"? Where does it go?
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.
All good questions.
(1) The other generated code does, so I followed that here. (not a lawyer)
(2) Same as for (1)
(3) I'm told @alexshtin wants to follow up internally on that question.
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.
I am on it. Let this line be there for now.
@@ -95,31 +94,3 @@ func inject0(f *fault, op func() error) error { | |||
} | |||
return f.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.
Simpler!
67cbcdb
to
ae4621b
Compare
ae4621b
to
3b1532f
Compare
@printf $(COLOR) "Process go:generate directives..." | ||
@go generate ./... | ||
$(MAKE) copyright |
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.
thoughts:
- should we copyright generated code?
- If we do - should we add it to the template? Otherwise it will still be "Uber 2020"
- I remember we have this discussion about "do we even need copyright at every file"? Where does it go?
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.
I am sorry to see my baby go but this is a good change!
What changed?
Use gowrap for generating fault injection code. Similar to #7050.
Why?
Less code to maintain.
Before: 238 LOC.
After: 34 line Go Template.
How did you test it?
Existing tests + eyeballing the output.
Potential risks
Documentation
Is hotfix candidate?