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(ci): fix commit parsing logic #336

Merged
merged 3 commits into from
Apr 6, 2022
Merged

chore(ci): fix commit parsing logic #336

merged 3 commits into from
Apr 6, 2022

Conversation

eunjae-lee
Copy link
Contributor

@eunjae-lee eunjae-lee commented Apr 5, 2022

🧭 What and Why

🎟 JIRA Ticket:

Changes included:

  • The length of commit has can be either 7 or 8. This PR fixes it to 8.
  • Some other minor changes are included (more details below)

🧪 Test

@netlify
Copy link

netlify bot commented Apr 5, 2022

Deploy Preview for api-clients-automation canceled.

Name Link
🔨 Latest commit 1abb4a4
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/624d5f2c9ebe0a0a5fd864c1

@eunjae-lee eunjae-lee changed the title Chore/parse-commit chore(ci): fix commit parsing logic Apr 5, 2022
@algolia-bot
Copy link
Collaborator

algolia-bot commented Apr 5, 2022

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the generated/main branch.

@@ -179,6 +178,13 @@ async function createReleaseIssue(): Promise<void> {
const commitsWithUnknownLanguageScope: string[] = [];
const commitsWithoutLanguageScope: string[] = [];

// Remove the local tag, and fetch it from the remote.
// We move the `released` tag as we release, so we need to make it up-to-date.
await run(`git tag -d ${RELEASED_TAG}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As explained above, we need to remove the local tag, and fetch it from the remote.

@@ -269,7 +269,9 @@ async function processRelease(): Promise<void> {
await run(`git push`);

// remove old `released` tag
await run(`git fetch origin refs/tags/released:refs/tags/released`);
await run(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just gardening.

@eunjae-lee eunjae-lee marked this pull request as ready for review April 5, 2022 14:28
@eunjae-lee eunjae-lee requested review from a team, damcou and shortcuts and removed request for a team April 5, 2022 14:28
const LENGTH_SHA1 = 8;
const hash = commit.slice(0, LENGTH_SHA1);
let message = commit.slice(LENGTH_SHA1 + 1);
const hash = commit.split(' ')[0];
Copy link
Member

Choose a reason for hiding this comment

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

Do we only care about feat and fix commits here? If so, we can use them as a split, so we don't rely on spaces or hash length

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I just discovered --abbrev=8 option!

Copy link
Member

@shortcuts shortcuts Apr 6, 2022

Choose a reason for hiding this comment

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

Wouldn't it be safer to abbrev 7? Or does abbrev 8 on a 7 char long hash works?

Copy link
Member

Choose a reason for hiding this comment

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

Ok nevermind I guess I got it now :D

@eunjae-lee eunjae-lee requested a review from a team April 5, 2022 16:10
@eunjae-lee eunjae-lee force-pushed the chore/parse-commit branch from f147bda to af879d5 Compare April 6, 2022 08:21
@eunjae-lee eunjae-lee force-pushed the chore/parse-commit branch from af879d5 to 9e70d33 Compare April 6, 2022 08:32
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.

4 participants