This is an automated email from the ASF dual-hosted git repository.

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new a29f0472fde Improve writeChangelog gradle task (#4007)
a29f0472fde is described below

commit a29f0472fde9978ea0c1039e2ac978c94736f681
Author: Jan Høydahl <[email protected]>
AuthorDate: Wed Feb 4 15:50:50 2026 +0100

    Improve writeChangelog gradle task (#4007)
---
 gradle/changelog.gradle | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gradle/changelog.gradle b/gradle/changelog.gradle
index 661c8cfb54f..00770b0688d 100644
--- a/gradle/changelog.gradle
+++ b/gradle/changelog.gradle
@@ -44,7 +44,11 @@ task writeChangelog {
     def jiraRef = jiraMatcher ? jiraMatcher[0].toUpperCase() : "SOLR-XXXX"
     def jiraUrl = "https://issues.apache.org/jira/browse/${jiraRef}";
     def jiraLinks = jiraMatcher ? "links:\n  - name: ${jiraRef}\n    url: 
${jiraUrl}" : ""
-    def title = gitBranch.replaceFirst(/(?i)SOLR-\d\d\d+-/, "").replace("-", " 
").capitalize()
+    def title = gitBranch.replaceFirst(/(?i)SOLR-\d\d\d+\b-?/, 
"").replace("-", " ").capitalize()
+    // Warn user when generating empty title
+    if (title.isEmpty()) {
+      println "WARNING: Title in generated changelog is empty, please edit"
+    }
     // Strip everything before and including '/', then sanitize special 
characters
     def sanitizedBranchName = gitBranch.replaceAll(/^.*\//, 
"").replaceAll(/[^a-zA-Z0-9._-]/, "-")
     def fileName = "changelog/unreleased/${sanitizedBranchName}.yml"
@@ -58,7 +62,7 @@ authors:
 ${jiraLinks}
 """
 
-    println "Generated file: ${fileName} -- open it"
+    println "Generated file: ${fileName} -- open and edit before committing"
   }
 }
 

Reply via email to