-
Notifications
You must be signed in to change notification settings - Fork 137
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
Move workflow stuff out of pkg #315
Move workflow stuff out of pkg #315
Conversation
a32aa8a
to
e0d3a62
Compare
Codecov Report
@@ Coverage Diff @@
## master #315 +/- ##
=========================================
Coverage ? 23.79%
=========================================
Files ? 14
Lines ? 1244
Branches ? 0
=========================================
Hits ? 296
Misses ? 928
Partials ? 20
Continue to review full report at Codecov.
|
e0d3a62
to
6ecf644
Compare
Is it fixing this as well #317 ? |
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.
These changes look good to me, down with pkg
and thank you for internalizing the template validation.
Thanks for the review.
soon it shall be no more.
👍 |
I'll leave this up for @gianarb til tomorrow. |
pkg is really just another name for utils and thats a bad pattern to have. We should have small concise packages over large expansive ones. Signed-off-by: Manuel Mendez <[email protected]>
Every caller of ParseYAML always calls ValidateTemplate right after. Why would we ever want to allow an invalid Template anyway? Signed-off-by: Manuel Mendez <[email protected]>
There aren't any other data formats now or in the forseeable future. Signed-off-by: Manuel Mendez <[email protected]>
The if check should have been: ```go if err == nil && test.expectedError { ``` otherwise the `err != nil` short-circuits and `test.expectedError` is never checked. But there's no real reason to check the value of `err` since we can just assert that it matches what we expected instead. Signed-off-by: Manuel Mendez <[email protected]>
Makes no sense. Signed-off-by: Manuel Mendez <[email protected]>
This was changed when validation was added when the code was changed from fmt.Errorf -> errors.New, but errors.Errorf should have been used instead. Signed-off-by: Manuel Mendez <[email protected]>
This way we can group them by what they apply to. Signed-off-by: Manuel Mendez <[email protected]>
Signed-off-by: Manuel Mendez <[email protected]>
Signed-off-by: Manuel Mendez <[email protected]>
No need to have unique strings, and avoids needing another unique long string for templates if we want to continue with the old pattern. Signed-off-by: Manuel Mendez <[email protected]>
Makes no sense to add template here too, thats all the objects with name paramenter... Signed-off-by: Manuel Mendez <[email protected]>
Signed-off-by: Manuel Mendez <[email protected]>
golangci-lint was printing the following warning: WARN [runner/nolint] Found unknown linters in //nolint directives: staticcheck sa1019 we will do it later Signed-off-by: Manuel Mendez <[email protected]>
6ecf644
to
80db407
Compare
Description
Move workflow types and funcs out of pkg/ and into its own package. Also cleaned up some of the API and added some more validation while I'm here.
Why is this needed
Helps address #300
How Has This Been Tested?
go test
passes.How are existing users impacted? What migration steps/scripts do we need?
Low impact. A bc-break is occurring here, but its in internalish code and no user is expected to be using this code. If they are
gofmt -w -r 'p.ParseYAML(b) -> p.Parse(b)' .
and removing the call toValidateTemplate
is all thats needed.Checklist:
I have: