Skip to content

Conversation

@dsmiley
Copy link
Contributor

@dsmiley dsmiley commented Jan 18, 2025

https://issues.apache.org/jira/browse/SOLR-17619

See logchange/logchange#397

run ./gradlew add for the wizard-style gradle task, or use our own simpler template ./gradlew writeChangelog

Included in this PR

  • Integrate logchange gradle plugin
  • Gradle task to draft a changelog yaml
  • Migration script to convert CHANGES.txt to over 7000 yaml files in changelog/ folder
  • dev-docs documentation on the new process
  • Github workflow to warn when a PR references old CHANGES.txt or does not include a changelog yaml
  • Update various docs to talk about CHANGELOG.md instead
  • Replaced changes2html.pl with a new changes2html.py which reads CHANGELOG.md
  • Upgraded releaseWizard to handle changelog tasks needed in a release, including scripts like addVersion.py and addDeps2changes.py.
  • Updated gradle packaging to include CHANGELOG.md instead of CHANGES.txt in tgz
  • Updated smoketester to validate presence of CHANGELOG.md

@dsmiley dsmiley requested a review from malliaridis January 18, 2025 18:18
@github-actions github-actions bot added dependencies Dependency upgrades tool:build labels Jan 18, 2025
@dsmiley
Copy link
Contributor Author

dsmiley commented Jan 18, 2025

However it doesn't work because a conflict of Groovy transitive dependencies between this plugin and elsewhere in our build:

* What went wrong:
A problem occurred configuring root project 'solr-root'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve org.apache.groovy:groovy:4.0.24.
     Required by:
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-ant:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-cli-picocli:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-console:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-datetime:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-docgenerator:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-groovydoc:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-groovysh:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-jmx:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-json:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-jsr223:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-macro:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-nio:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-servlet:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-sql:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-swing:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-templates:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-test:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-test-junit5:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-xml:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-yaml:4.0.24
         root project : > dev.logchange:dev.logchange.gradle.plugin:1.16.4 > org.apache.groovy:groovy-all:4.0.24 > org.apache.groovy:groovy-ant:4.0.24 > org.apache.groovy:groovy-bom:4.0.24
      > Module 'org.apache.groovy:groovy' has been rejected:
           Cannot select module with conflict on capability 'org.codehaus.groovy:groovy:4.0.24' also provided by [org.codehaus.groovy:groovy:3.0.9(runtime)]

@malliaridis I could really use your help on this aspect please. Build plugins seem special/different from a dependency standpoint.

@marwin1991
Copy link

@dsmiley Hello, check logchange/logchange#397 (comment)

@malliaridis
Copy link
Contributor

Marking the dependency to groovy-all as provided at the plugin level seems to be the best and easiest solution for solving this conflict. I am not sure how we could apply constraints to plugins that are loaded before the constraints block.

Thanks for addressing this @marwin1991 so quickly. 💪

And move logchange config
@dsmiley
Copy link
Contributor Author

dsmiley commented Jan 20, 2025

I added a gradle task that generates a change YAML. This is tailored for our project, pre-fills some things, and is overall less of a hassle that logchange:add is.

Copy link
Contributor

@malliaridis malliaridis left a comment

Choose a reason for hiding this comment

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

Tested changes on Windows, but fails with

Could not save markdown to file: .\changelog\unreleased\0001-adding-changelog-support.yml because: .\changelog\unreleased\0001-adding-changelog-support.yml

The file is successfully created, but is empty. As this is still a draft, consider this as an early feedback. :)

I also feel overwhelmed with all these dialogs popping up over and over again, but the questions that are asked are valuable if the answers are included in the changelog.

What I saw is that you are getting some of the data that are asked from the branch name, which would reduce the input dialogs. Is it possible to disable the specific questions in case the value could be fetched?

@dsmiley
Copy link
Contributor Author

dsmiley commented Jan 23, 2025

I think the plugin's generation of the YAML is too problematic and has too little value-add. This draft PR includes a task "generateChangeYaml" that generates it; we should use that instead.

@marwin1991
Copy link

@malliaridis @dsmiley

Hello,

We can improve add task by defining in logchange-config.yml questions to skip and default value for skipped questions and command do execute something like

commands:
   add:
      questions:
          fileName:
              skip: true
              value: "changelog/unreleased/${branchName}.yml"
              variables:
                - name: branchName
                  command: "git rev-parse --abbrev-ref HEAD"

But maybe adding new entry can be handle by your own custom task with needs suited for you? Generally its pure yml file and in 99% cases I use copy paste :)

I use add task (mvn mojo) for renovate post task to create entries in no interactive mode about dependency updates. For dependabot logchange/logchange#429

@dsmiley
Copy link
Contributor Author

dsmiley commented Jan 24, 2025

Maybe the "add" feature of the logchange plugin is more useful to Maven. In Gradle, with native scripting, it was quite easy to tailor something specific to the project's needs.

Copy link
Contributor

@janhoy janhoy left a comment

Choose a reason for hiding this comment

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

Some initial comments. Have not taken the gradle stuff for a spin yet.

Suppose we'll write a script to convert CHANGES.txt to a changelog/archive.md file so the history can be preserved, see https://github.com/logchange/logchange?tab=readme-ov-file#archives

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jun 21, 2025
janhoy added 2 commits June 21, 2025 02:51
# Conflicts:
#	gradle/template.gradle.properties
Copy link
Contributor Author

@dsmiley dsmiley left a comment

Choose a reason for hiding this comment

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

Thanks so much for carrying the torch forward here!

@janhoy janhoy requested a review from Copilot October 22, 2025 16:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a new structured approach to changelog management using the logchange tool. Instead of maintaining a monolithic CHANGES.txt file, changes are now tracked as individual YAML files in versioned directories, which are then compiled into a CHANGELOG.md file.

Key changes:

  • Replaces CHANGES.txt with YAML-based changelog fragments in changelog/ directory structure
  • Implements logchange gradle plugin for changelog generation and release management
  • Adds tooling for creating, validating, and migrating changelog entries

Reviewed Changes

Copilot reviewed 27 out of 29 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java Updates source home detection to use build.gradle instead of CHANGES.txt
solr/solr-ref-guide/modules/upgrade-notes/pages/solr-upgrade-notes.adoc Updates documentation references from CHANGES.txt to CHANGELOG.md
solr/packaging/build.gradle Updates distribution to include CHANGELOG.md instead of CHANGES.txt
solr/licenses/README.committers.txt Updates documentation reference to generic "changelog"
gradle/validation/rat-sources.gradle Excludes new changelog files from RAT license validation
gradle/template.gradle.properties Adds changelog generator configuration properties
gradle/libs.versions.toml Adds logchange plugin dependency and version
gradle/documentation/changes-to-html/changes2html.py New Python script to convert CHANGELOG.md to HTML
gradle/documentation/changes-to-html/changes2html.pl Removes legacy Perl script for CHANGES.txt conversion
gradle/documentation/changes-to-html.gradle Updates task to use Python script for CHANGELOG.md conversion
gradle/changelog.gradle New gradle file implementing changelog generation tasks
dev-tools/scripts/smokeTestRelease.py Updates release validation to check for CHANGELOG.md
dev-tools/scripts/scriptutil.py Adds utility function for extracting JIRA issues from titles
dev-tools/scripts/releasedJirasRegex.py Removes script that extracted JIRA regex from CHANGES.txt
dev-tools/scripts/releaseWizard.yaml Updates release wizard to use new changelog workflow
dev-tools/scripts/changes2logchange.py New migration script to convert CHANGES.txt to YAML format
dev-tools/scripts/addVersion.py Removes CHANGES.txt update logic from version addition
dev-tools/scripts/addDepsToChanges.py Updates dependency update script to create YAML entries
dev-tools/scripts/README.md Updates documentation for script changes
dev-docs/git.adoc Removes note about CHANGES.txt cherry-pick issues
dev-docs/changelog.adoc New comprehensive documentation for changelog workflow
changelog/logchange-config.yml Configuration file for logchange tool
changelog/README.md Brief documentation about new changelog process
CHANGELOG.md Dummy changelog file for testing
.github/workflows/validate-changelog.yml New workflow to validate changelog entries in PRs
.github/PULL_REQUEST_TEMPLATE.md Adds changelog entry checklist item
.editorconfig Adds configuration for releaseWizard.yaml

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@janhoy janhoy merged commit 9d0a652 into apache:main Oct 22, 2025
5 of 6 checks passed
janhoy pushed a commit that referenced this pull request Oct 22, 2025
Co-authored-by: David Smiley <dsmiley@apache.org>
(cherry picked from commit 9d0a652)
janhoy pushed a commit that referenced this pull request Oct 22, 2025
Co-authored-by: David Smiley <dsmiley@apache.org>
(cherry picked from commit 9d0a652)
janhoy added a commit to janhoy/solr that referenced this pull request Oct 22, 2025
Co-authored-by: David Smiley <dsmiley@apache.org>

(cherry picked from commit 9d0a652)
@anshumg
Copy link
Contributor

anshumg commented Oct 22, 2025

Thanks @janhoy !

@dsmiley dsmiley deleted the logchange branch December 5, 2025 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency upgrades documentation Improvements or additions to documentation scripts test-framework tool:build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants