-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow integrationTests
to be a string
#157
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #157 +/- ##
===========================================
+ Coverage 97.35% 100.00% +2.64%
===========================================
Files 16 15 -1
Lines 265 169 -96
Branches 73 14 -59
===========================================
- Hits 258 169 -89
+ Misses 5 0 -5
+ Partials 2 0 -2
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
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.
Overall looks good, minor nits. When you're adding respective kraken changes to products, just make sure to enforce integration testing in the main branch (e.g. in config, if the branch is main, even if the commit message says skip, it should not skip).
* Instead upload as an artifact. | ||
* @default false | ||
*/ | ||
noPublish?: boolean; | ||
noPublish?: boolean | string; |
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 feel like noPublish
having the possibility of being a string
or a boolean
is a little unintuitive.
Maybe we can change the comments that specifies noPublish
is a "no-publish condition", or there's a better name for this variable.
Also, since it can be a string AND is optional, we can simplify the type to just be a noPublish?: string;
and check if noPublish
is undefined (truthy/falsey instead of true/false directly).
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.
Wouldn't this require a fair amount of refactoring in other places? Like we'd have to change noPublish
to "true"
or arbitrary truthy string value from true
everywhere we specify it right?
IMO can stick to this but include better comments if ^ turns out to be true?
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.
Also stricter typing might be slightly more unintuitive but lead to fewer errors down the line if we're passing around config, accidentally passing around undefined
could be problematic.
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.
Another consideration is having non-confusing typing. Either make a boolean disabling publishing, or make a variable specifying the conditions to disable publishing. If you feel the need to preserve a simple true/false interface, we can introduce this feature as a separate variable.
I took a look at existing code using a defined noPublish
and the only place is a test case, which means this would not be a breaking change. Even if it was used in prod, for this change to apply to a product, we would need to bump kraken
's version in package.json
.
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.
What would you lean towards for the default value of integrationTests
if I want it to be enabled/disabled? Do you tink it's ok if convention is to set integrationTests
to something like "true" as opposed to true
in, for example, this file?
I'd be ok with that and just using truthy/falsey conditioning if you think it's fine!
* @default false | ||
*/ | ||
integrationTests?: boolean; | ||
integrationTests?: boolean | string; |
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 as above.
Allow
integrationTests
to be a string to enable passing in a commit message flag which would (hopefully) compile down to a boolean.The idea is to use something like this
"!contains(github.event.head_commit.message, '[skip int]')"
as the argument tointegrationTests
in individual app config