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(scripts): improve release script with git diff [skip-bc] #3686

Merged
merged 7 commits into from
Sep 11, 2024

Conversation

millotp
Copy link
Collaborator

@millotp millotp commented Sep 10, 2024

🧭 What and Why

For the longest time, we based changelogs and release on the commit title only, but its often misleading or wrong.
Instead, we can use git diff to know exactly which commits impact which client, and based the release and changelog based of that.

Also take the time to refactor and simplify the release script and lint the tests.
The changelog will automatically use the correct language scope also, even if the commit was wrong.

@millotp millotp self-assigned this Sep 10, 2024
@algolia-bot
Copy link
Collaborator

algolia-bot commented Sep 10, 2024

No code generated

If you believe code should've been generated, please, report the issue.

📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
javascript 1587
php 1510
csharp 1061
python 1020
java 985
ruby 861
swift 769
go 568

@millotp millotp marked this pull request as ready for review September 11, 2024 12:44
@millotp millotp requested a review from a team as a code owner September 11, 2024 12:44
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

nice clean!!

continue;
}

// sometimes the scope of the commits is not set correctly and concerns another language, we can fix it.
if (LANGUAGES.includes(validCommit.scope as Language) && validCommit.scope !== lang) {
validCommit.message = validCommit.message.replace(`(${validCommit.scope}):`, `(${lang}):`);
Copy link
Member

Choose a reason for hiding this comment

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

is this reflected in the changelog? I'd rather keep it matching the git history but still include it in the new version computing if possible

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I find it weird to see a feat(python): add linter in the java changelog

Copy link
Member

Choose a reason for hiding this comment

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

can we replace it with feat(clients) maybe then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure

Copy link
Member

Choose a reason for hiding this comment

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

just make the scope wider idk D: it's weird to differ from the git history imo but you are right

scripts/release/createReleasePR.ts Show resolved Hide resolved
@millotp millotp changed the title chore(scripts): improve release script with git diff chore(scripts): improve release script with git diff [skip-bc] Sep 11, 2024
@shortcuts shortcuts enabled auto-merge (squash) September 11, 2024 14:55
@shortcuts shortcuts merged commit 8df0b72 into main Sep 11, 2024
27 checks passed
@shortcuts shortcuts deleted the chore/release-diff branch September 11, 2024 15:11
algolia-bot added a commit to algolia/algoliasearch-client-csharp that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-dart that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-go that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-java that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-javascript that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-kotlin that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-php that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-python that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-ruby that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-scala that referenced this pull request Sep 11, 2024
algolia-bot added a commit to algolia/algoliasearch-client-swift that referenced this pull request Sep 11, 2024
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