-
Notifications
You must be signed in to change notification settings - Fork 909
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
Fix e2e notify script again #5911
Conversation
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
testUrl: workflowUrl | ||
}; | ||
|
||
if (versionOrTag) { |
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.
is there a risk that versionOrTag is a truthy non-string? something like 1
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 don't think so because the workflow_dispatch input type defaults to string
if you don't specify a type and I haven't here:
versionOrTag: |
if (versionOrTag) { | ||
// Matches a staging version tag pattern. | ||
const match = versionOrTag.match(/^(\d+.\d+.\d+)-\d+$/); | ||
if (match) { |
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.
Feels like we should do a length check in case match has fewer than expected matches. Accessing 1 directly without validating that it's a valid key seems dangerous
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'm not sure that outcome is possible, if the capturing group doesn't exist in the string, it won't match at all and match will be null. I think the only outcomes are null or an array of length 2. I tried a couple of test strings in the console and can't think of a case that would return non-null but also not have a captured group, let me know if I haven't thought of a case though, regex isn't my strength.
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.
Sounds good I'm ok approving if you are confident
Send version and tag.