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

Script for generating changelogs, new template for PR's #4351

Merged
merged 28 commits into from
Sep 23, 2024

Conversation

igordmn
Copy link
Collaborator

@igordmn igordmn commented Feb 23, 2024

No description provided.

@igordmn
Copy link
Collaborator Author

igordmn commented Feb 23, 2024

Keeping it as a draft until it proved itself useful

igordmn added a commit that referenced this pull request Feb 23, 2024
In this PR the new formatting applied:
- categories are not sections, they integrated in the title
- platforms are defined as labels
- highlighted fixes are bold

Generated by [the
script](#4351)
from the list of commits and PR's
@MatkovIvan MatkovIvan self-requested a review April 16, 2024 16:19
tools/changelog.main.kts Show resolved Hide resolved
commit
}

fun ChangelogEntry.format() = if (link != null) "$message ([link]($link))" else message
Copy link
Member

Choose a reason for hiding this comment

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

Currently we're using different format

Suggested change
fun ChangelogEntry.format() = if (link != null) "$message ([link]($link))" else message
fun ChangelogEntry.format() = if (link != null) "- [$message]($link)" else message

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

val entries = entriesForRepo("JetBrains/compose-multiplatform-core") +
entriesForRepo("JetBrains/compose-multiplatform")

println("\n# CHANGELOG")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
println("\n# CHANGELOG")
println("\n# ${version} (${currentMonth})")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

tools/changelog.main.kts Show resolved Hide resolved
@igordmn
Copy link
Collaborator Author

igordmn commented Sep 23, 2024

New features in the last commits:

  • exclude released cherry-picks
  • include non-merged cherry-picked PR's
  • change CHANGELOG.md instead of printing
  • read the previous version from CHANGELOG.md
  • if version isn't specified, use "HEAD" (we can automate writing after that)
  • set the same formatting as in the final changelog

@igordmn igordmn marked this pull request as ready for review September 23, 2024 01:39
@igordmn
Copy link
Collaborator Author

igordmn commented Sep 23, 2024

@MatkovIvan, it is ready for merge, could you review it?

fun String.removeLinks(): String = replace(Regex("\\[([^)]*)\\]\\([^\\]]*\\)"), "$1")

/**
* Extract by format https://github.com/JetBrains/compose-multiplatform/blob/b32350459acceb9cca6b9e4422b7aaa051d9ae7d/.github/PULL_REQUEST_TEMPLATE.md?plain=1
Copy link
Member

Choose a reason for hiding this comment

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

Should we refer jb-main instead b32350459acceb9cca6b9e4422b7aaa051d9ae7d?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment on lines +236 to +237
section = s.substringBefore("-", "").trim().ifEmpty { null }
subsection = s.substringAfter("-", "").trim().ifEmpty { null }
Copy link
Member

Choose a reason for hiding this comment

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

Let's print some warning if it's not in the predefined list

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@igordmn igordmn merged commit 7b58e0c into master Sep 23, 2024
@igordmn igordmn deleted the igor.demin/changelog-script branch September 23, 2024 12:35
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.

2 participants