Skip to content

Conversation

@SylvainJuge
Copy link
Member

Fixes #692

This is a first step to improve release automation, there are definitely rough edges and future improvements will be necessary. In particular, it adds an DEPENDENCIES-NOTES section at runtime to include the dependencies versions. In the future maybe managing everything within gradle would be cleaner and more reliable.

We can test it locally for the release 1.6.0 in the current state of main by running the following commands:

echo '<!--DEPENDENCIES-NOTES-START-->' >> CHANGELOG.next-release.md
echo -e "This release is based on the following upstream versions:\n\n" >> CHANGELOG.next-release.md
./gradlew -q printUpstreamDependenciesMarkdown >> CHANGELOG.next-release.md
echo '<!--DEPENDENCIES-NOTES-END-->' >> CHANGELOG.next-release.md

java \
.ci/ReleaseChangelog.java \
CHANGELOG.next-release.md \
docs/release-notes 1.6.0

@SylvainJuge SylvainJuge requested review from a team as code owners October 6, 2025 12:42
@github-actions
Copy link

github-actions bot commented Oct 6, 2025

🔍 Preview links for changed docs

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ReleaseChangelog {
Copy link
Member Author

Choose a reason for hiding this comment

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

[for reviewer] almost copied as-is from apm-agent-java with minor tweaks to handle the lack of previous version.

Comment on lines +61 to +62
Lines dependenciesNotes = nextChangelogLines.cutLinesBetween("<!--DEPENDENCIES-NOTES-START-->",
"<!--DEPENDENCIES-NOTES-END-->");
Copy link
Member Author

Choose a reason for hiding this comment

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

[for reviewer] this section does not exists in the next release changelog template, we have to append it manually at runtime. This is due to the fact that we can't easily invoke the gradle task from here, doing everything from gradle in the future would simplify this.

Comment on lines +221 to +222
# note: release notes here will be copied as-is from 'CHANGELOG.next-release.md'
# the 'pre-post-release' workflow executed after this will reset contents of 'CHANGELOG.next-release.md'
Copy link
Member Author

Choose a reason for hiding this comment

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

[for reviewer] here the github release changelog needs to be in pure markdown, so we can't append our custom markdown from breaking changes.

% *

# 1.5.0 [edot-java-1.5.0-release-notes]
## 1.5.0 [edot-java-1.5.0-release-notes]
Copy link
Member Author

Choose a reason for hiding this comment

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

[for reviewer] this made the changelog generation not properly detect the previous version.

@theletterf
Copy link
Contributor

Interesting! For now, we don't use have Known issues / Breaking changes pages for EDOT Java, but those could eventually be filled out. Does this PR account for that possibility? Does it produce a PR we can review before merging? And, if we edit the PR, would subsequent runs override the content?

A more general approach for release notes automation is in the works (+CC @alexandra5000 @lcawl @colleenmcginnis ). While I think it's totally fine to implement some automation right now, I guess we might want to align in the future.

Copy link
Contributor

@jackshirazi jackshirazi left a comment

Choose a reason for hiding this comment

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

lets try and see, we can fix anything broken afterwards

@jackshirazi
Copy link
Contributor

@theletterf we do have breaking changes after this release

@theletterf
Copy link
Contributor

Comment on lines +101 to +104
echo '<!--DEPENDENCIES-NOTES-START-->' >> CHANGELOG.next-release.md
echo -e "This release is based on the following upstream versions:\n\n" >> CHANGELOG.next-release.md
./gradlew -q printUpstreamDependenciesMarkdown >> CHANGELOG.next-release.md
echo '<!--DEPENDENCIES-NOTES-END-->' >> CHANGELOG.next-release.md
Copy link
Member

Choose a reason for hiding this comment

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

what's the reason those headers/bottom are not also generated by printUpstreamDependenciesMarkdown?

Copy link
Member Author

Choose a reason for hiding this comment

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

printUpstreamDependenciesMarkdown is also used to generate the github release markdown, which should not include those, again this is a shortcut and I'll create an issue with all the things we could improve here.

@SylvainJuge
Copy link
Member Author

Interesting! For now, we don't use have Known issues / Breaking changes pages for EDOT Java, but those could eventually be filled out. Does this PR account for that possibility? Does it produce a PR we can review before merging? And, if we edit the PR, would subsequent runs override the content?

This PR just tries to fills what we currently have in the changelog, I think that having a more structured approach later is needed: for example a yaml description of changes that we can output in multiple markdown variants, for now it's mostly copy-pasta markdown.

A more general approach for release notes automation is in the works (+CC @alexandra5000 @lcawl @colleenmcginnis ). While I think it's totally fine to implement some automation right now, I guess we might want to align in the future.

Is there already an existing issue to track progress and requirements here ?

On our side we need:

  • a way to describe the changes in a structured way, yaml seems a good fit
  • having the ability to generate/update markdown for changelog, also for github release notes publication
  • having the ability to get the upstream/embedded dependencies versions as 99% of EDOT is actually from upstream repositories (it is currently provided through gradle).

For example, the way to handle changes in otel semconv is quite interesting with a tool called chloggen where each PR has its own yaml from a template in a folder and they are removed on release: https://github.com/open-telemetry/semantic-conventions/tree/main/.chloggen, hence also preventing conflicts like we often have with a single changelog file.

@SylvainJuge SylvainJuge merged commit 9b0ce73 into elastic:main Oct 6, 2025
16 checks passed
@SylvainJuge SylvainJuge deleted the release-changelog-automation branch October 6, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate release note markdown generation

4 participants