-
Notifications
You must be signed in to change notification settings - Fork 17
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
test(ci): add tests for release process #241
Conversation
✔️ Deploy Preview for api-clients-automation canceled. 🔨 Explore the source changes: d68ccee 🔍 Inspect the deploy log: https://app.netlify.com/sites/api-clients-automation/deploys/622a0f3a489db20008a4d947 |
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.
Look fine on my side, but maybe it would be better to have a double-check on the typescript
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.
this looks good! small comments
it('returns error when language scope is missing', () => { | ||
expect(parseCommit(`abcdefg fix: fix the thing`)).toEqual({ | ||
error: 'missing-language-scope', | ||
}); | ||
}); | ||
|
||
it('returns error when language scope is unknown', () => { | ||
expect(parseCommit(`abcdefg fix(basic): fix the thing`)).toEqual({ | ||
error: 'unknown-language-scope', | ||
}); | ||
}); |
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.
shouldn't it be a throw
or we handle this error?
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.
It returns error
and prints some warning logs.
Assuming most of the commits follow semantic rules, some of commits might slip through (like "Merge ...."), and it shouldn't fail the release process. We can just ignore those commits and exclude from the changelogs, and versioning process.
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.
Yep that make sense, but I believe it would also make sense to have an error log in that case (maybe a file like yarn does for example, or a commit, or msg to slack).
Otherwise, we might not see the error and have release with missing commits, it might be intended to skip that commit in particular but it could also be a mistake on our side.
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.
Oh I'm dumb it's in the issue then ._.
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.
Oh, it's not in the issue, but we should definitely include them in the issue, like
Expand to see skipped commit messages:
lack of language scope
abcdefg fix: fix this
unknown language scope
abcdefg fix(blah): fix this
lack of language scope
abcdefg fix: fix this
unknown language scope
abcdefg fix(blah): fix this
I can do this in a separate PR.
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.
Yep it make sense then, we definitely need to track those
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.
Good to go! thanks for the tests :D
(Don't forget to add the task to track no-languages commits)
* test(ci): add tests for release process * chore: update test case * chore: update tests
🧭 What and Why
Changes included:
I'm going to change the release process a bit, and need some tests to make sure the changes won't fail.
🧪 Test