I had a situation when the folder was empty, and the git log collected
commits from the parent repo compose-multiplatform instead of
compose-multiplatform-core
## Release Notes
N/A
When the 1.8.2 release was prepared, the release notes from
https://github.com/JetBrains/compose-multiplatform/pull/5323 were
malformed by stripping empty lines:
```
- Support Preview parameters for Previews in common source sets in IJ and AS. Note: IDEs also need to implement support on their end. Please check the respective IDE release notes to confirm this is supported [#5323](https://github.com/JetBrains/compose-multiplatform/pull/5323)
Example usage:
\\\
import androidx.compose.runtime.Composable
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.jetbrains.compose.ui.tooling.preview.PreviewParameterProvider
class MyPreviewParameterProvider : PreviewParameterProvider<String> {
override val values = sequenceOf("Hello, Compose!", "Hello, World!")
}
/**
* This function will generate two preview images with different texts
*/
@Preview@Composable
fun MyPreview(@PreviewParameter(MyPreviewParameterProvider::class) text: String) {
Text(text)
}
\\\
```
The correct release notes are:
```
- Support Preview parameters for Previews in common source sets in IJ and AS. Note: IDEs also need to implement support on their end. Please check the respective IDE release notes to confirm this is supported [#5323](https://github.com/JetBrains/compose-multiplatform/pull/5323)
Example usage:
\\\
import androidx.compose.runtime.Composable
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.jetbrains.compose.ui.tooling.preview.PreviewParameterProvider
class MyPreviewParameterProvider : PreviewParameterProvider<String> {
override val values = sequenceOf("Hello, Compose!", "Hello, World!")
}
/**
* This function will generate two preview images with different texts.
*/
@Preview@Composable
fun MyPreview(@PreviewParameter(MyPreviewParameterProvider::class) text: String) {
Text(text)
}
\\\
```
To fix this issue, the parsing is changed. Previously `ChangelogEntry`
represented a single line, even if it is part of a single change. Now it
represents the change as a whole.
## Testing
These commands give the same result, with the exception that multiline
release notes are handled correctly now:
```
kotlin changelog.main.kts v1.8.1..v1.9.0-alpha02
kotlin changelog.main.kts v1.8.1..v1.8.2
kotlin changelog.main.kts v1.8.0..v1.8.1
kotlin changelog.main.kts v1.8.0-beta02..v1.8.0-rc01
```
## Release Notes
N/A
Fixes
https://youtrack.jetbrains.com/issue/CMP-8192/Changelog-script.-Handle-multi-cherry-pick-PRs-into-a-release
Now there is a special format for Release Notes, not for the PR.
Example: https://github.com/JetBrains/compose-multiplatform/pull/5312
- There was an old non-structured way determined it by "Cherry-picked
from ...", it is removed, as it is less convenient (we still need to
define Release Notes)
- We can determine cherry-picks automatically by git, but not always (in
case of conflicts or additional fixes). Because of this, now it is a
requirement either to describe the release notes the usual way or add
links to the original PRs.
## Testing
```
kotlin changelog.main.kts v1.7.3..v1.8.0
kotlin changelog.main.kts v1.8.0..v1.8.1+dev2468
```
Doesn't change old entries, and include new ones
## Release Notes
N/A
---------
Co-authored-by: Victor Kropp <victor.kropp@jetbrains.com>
- identify cherry-picks
- via "git log --cherry-pick" (we have to clone repos for that)
- in case it doesn't work, additionally identified via "cherry-picked
from" in PR descriptions
- fix multiline changes formatting
- exclude prerelease fixes
## Release Notes
N/A
---------
Co-authored-by: Victor Kropp <victor.kropp@jetbrains.com>
Treat it as a feature rather than a fix.
Example of a performance improvement:
https://github.com/JetBrains/compose-multiplatform-core/pull/1863
Alternative A - treat it as a fix, not a feature:
```
- Highlights # major features, performance improvements
- Features # minor features
- Fixes # bug fixes, undefined behavior changes, performance improvements
```
Alternative B - refer Fixes in Highlights:
```
- Highlights # major features and fixes
- Features # minor features
- Fixes # bug fixes, undefined behavior changes, performance improvements
```
## Release Notes
N/A
Fixes
https://youtrack.jetbrains.com/issue/CMP-7409/Add-a-CI-check-for-PR-containing-Release-Notes
- Add a GitHub workflow that checks Release Notes are correctly added.
Runs automatically on creation and description change
- Move the guide into one file from the PR templates
- Parse categories for the script instead of hardcoding them (to have a
single source of truth in the guide)
- Don't do network requests to avoid rate limit (60 requests per hour),
read the description from the workflow variable
Also added to
[compose-multiplatform-core](https://github.com/JetBrains/compose-multiplatform-core/pull/1900)
## Testing
1. Change Release Notes in this PR
2. CI successes with correct Release Notes
3. CI fails with incorrect ones
(Replace RR by R, otherwise the check picks a wrong section, I think no
need to write additional logic just for this PR)
Correct N/A:
```
## RRelease Notes
N/A
```
Correct change:
```
## RRelease Notes
### Features - iOS
- Simple feature
```
Release notes missing:
```
```
Title is incorrect:
```
## RRelease Note
### Features - iOS
- Simple feature
```
Section isn't standard:
```
## RRelease Notes
### Features - Compose
- Simple feature
```
Items are missing:
```
## RRelease Notes
### Features - iOS
```
Sections are missing:
```
## RRelease Notes
- Simple feature
```
## Testing
Tested for injections
1. For script injection
```
"; echo QQ > prDescription.txt #
```
2. For workflow injection
```
q
run: |
echo "QQ"
```
3. Verified that injection into `changelog.main.kts` isn't possible, as
it doesn't execute anything parsed (including links)
## Release Notes
N/A
Needed for
https://youtrack.jetbrains.com/issue/CMP-7409/Add-a-CI-check-for-PR-containing-Release-Notes
Also fix a bug with not working N/A release notes
## Testing
```
action=checkPr JetBrains/compose-multiplatform 5188
```
works with different values correctly
```
changelog.main.kts v1.8.0-alpha01..HEAD
```
excludes N/A
Better to compare not via GitHub diff, as it hard to compare identated
code.
## Release Notes
N/A
Needed for 1.7.2:
```
kotlin changelog.main.kts v1.7.1..release/1.7.2
```
Otherwise it compares with `1.8.0-alpha01`
---------
Co-authored-by: Ivan Matkov <ivan.matkov@jetbrains.com>
Remove:
```
__LATEST_COMPOSE_RELEASE_VERSION__
__KOTLIN_COMPOSE_VERSION__
System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION")
```
They pollute templates/examples.
Now, all paths where we need to change the version are hardcoded in the script.
Usage:
```
./replace.sh 1.0.0-rc6
```
This script is planned to run on CI
In the future I will add support for changing Kotlin version