Skip to content
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

chore: Move release relevant actions to GH actions #4993

Merged
merged 113 commits into from
Sep 16, 2024
Merged

Conversation

marikaner
Copy link
Contributor

@marikaner marikaner commented Sep 12, 2024

There is quite some logic going on when merging the changesets, so I didn't want to repeat it. Also bumping and tagging the version is the same action, so moved all three of those into actions, so that we can reuse them in our other project.

I had to refactor a few places to not duplicate the code and I changes smaller things along the way (removing unixEOL and executing file write and read options async instead of sync).

I left a few TODOs for potential follow ups (does not have to happen immediately, but I would like to attempt it on the friday ;) ). I would like to separate those from this already big PR.

Copy link
Contributor

@deekshas8 deekshas8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it looks like a huge improvement; I just have a few minor comments.

@@ -13,7 +16,7 @@ export const validMessageTypes = [
interface Change {
packageNames: string[];
commit: string;
type: typeof validMessageTypes[number];
type: (typeof validMessageTypes)[number];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[q] Unrelated to this PR and also not often used I guess, but do you know why 'Updated Dependencies' is already plural?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea. But I am already working on a follow up where this won't matter anymore. I think this is not meant to be used manually.

@marikaner marikaner requested a review from deekshas8 September 13, 2024 12:02
const content = await readFile(fileName, { encoding: 'utf-8' });
const match = content.match(parseCs);
if (!match) {
console.error(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not find any replacement for this logic in your code.
I take it you deliberately removed this validation step?

Copy link
Contributor

@deekshas8 deekshas8 Sep 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validate changeset message types was moved to the check-pr/merge-changelog action, but maybe validate structure (parseCs) should also be moved there?

const unifiedChangelog = await readFile('CHANGELOG.md', { encoding: 'utf8' });
await writeFile(
'CHANGELOG.md',
unifiedChangelog.split('\n').slice(0, 30).join('\n') +
Copy link
Member

@tomfrenken tomfrenken Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this a bit?
This looks like the first (arbitrarily?) 30 lines are taken, put in front of the new changelog & version, and then the remaining lines are attached at the end??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really to be honest. I think this just takes out the comments that we have in the changelog file. Nobody is touching it manually anyways, so they are not helpful. I didn't touch this logic in this PR, only moved it to a different place.

Copy link
Member

@tomfrenken tomfrenken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, many nice refactors, before you merge though, make sure to read & answer my remaining comments.

@marikaner marikaner merged commit 6430020 into main Sep 16, 2024
14 checks passed
@marikaner marikaner deleted the merge-changelogs branch September 16, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants