Apache Solr open-source search software
SOLR-17619 Cleanup after logchange cutover (#3820)
Jan Høydahlfb74fa88d95e
diff --git a/changelog/README.md b/changelog/README.mdindex 3686afdfec0..130c9a285d4 100644--- a/changelog/README.md+++ b/changelog/README.md@@ -14,8 +14,7 @@See the License for the specific language governing permissions andlimitations under the License.-->-# New changelog process+# Apache Solr Changelog-We are in the process of migrating to a new way of managing our changelog. Please see [dev-docs/changelog.adoc](../dev-docs/changelog.adoc) for details.--In a transition period it is still possible to merge your changelog entry to `solr/CHANGES.txt`, but then you can only use the new process.+This is the home of the Solr changelog, in logchange format.+Please see [dev-docs/changelog.adoc](../dev-docs/changelog.adoc) for details.diff --git a/changelog/unreleased/PR#3778.yml b/changelog/unreleased/PR#3778.ymlindex 42afbca44a9..96df91509cb 100644--- a/changelog/unreleased/PR#3778.yml+++ b/changelog/unreleased/PR#3778.yml@@ -4,5 +4,5 @@ type: added # added, changed, fixed, deprecated, removed, dependency_update, secauthors:- name: Eric Pugh- name: Andreas Rütten-merge_requests:+issues:- 3778diff --git a/dev-docs/changelog.adoc b/dev-docs/changelog.adocindex 057b2e6604b..a89b522fcb9 100644--- a/dev-docs/changelog.adoc+++ b/dev-docs/changelog.adoc@@ -30,13 +30,14 @@ solr/└── changelog/├── unreleased/ ← new fragments live here| └── SOLR-12345-fix-memory-leak.yml- ├── v10.0.0/ ← changes in already released version- └── v10.0.1/+ ├── v9.8.0/ ← changes in already released versions+ ├── v9.8.0/+ └── v9.9.0/----== 3. The YAML format-Below is an example of a changelog yaml fragment. The full yaml format is xref:https://logchange.dev/tools/logchange/reference/#tasks[documented here], but we normally only need `title`, `type`, `authors` and `links`:+Below is an example of a changelog yaml fragment. The full yaml format is xref:https://logchange.dev/tools/logchange/reference/#tasks[documented here], but we normally only need `title`, `type`, `authors` and `links`. For a change without a JIRA, you can add the PR number in `issues`:[source, yaml]----diff --git a/gradle/changelog.gradle b/gradle/changelog.gradleindex 6c5ea72e7bb..661c8cfb54f 100644--- a/gradle/changelog.gradle+++ b/gradle/changelog.gradle@@ -25,23 +25,33 @@ logchange {task writeChangelog {description = 'Generates a change/log description file (YAML)'doLast {+ def gitBranchFull = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()++ // Prevent running on main or branches prefixed with 'branch_'+ if (gitBranchFull == 'main' || gitBranchFull.startsWith('branch_')) {+ throw new GradleException("Cannot create changelog on branch '${gitBranchFull}'. This task should only be run on feature branches.")+ }++ def gitBranch = gitBranchFull.replaceFirst(/^.*\//, "")+def gitUserName = 'git config user.name'.execute().text.trim()def configuredName = providers.gradleProperty("user.name").getOrElse(gitUserName)def githubId = providers.gradleProperty("user.githubid").getOrElse(null)def nick = githubId ? "\n nick: ${githubId}" : ""def asfId = providers.gradleProperty("user.asfid").getOrElse(null)def asfIdUrl = asfId ? "\n url: https://home.apache.org/phonebook.html?uid=${asfId}" : ""- def gitBranch = 'git rev-parse --abbrev-ref HEAD'.execute().text.trim()- def jiraMatcher = gitBranch.toUpperCase() =~ /SOLR-\d\d\d+/- def jiraRef = jiraMatcher ? jiraMatcher[0] : "SOLR-XXXX"+ def jiraMatcher = gitBranch =~ /(?i)SOLR-\d\d\d+/+ 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 branchWithoutJira = gitBranch.replaceFirst(/(?i)SOLR-\d\d\d+-/, "").replace("-", " ").capitalize()- def fileName = "changelog/unreleased/${gitBranch}.yml"+ def title = gitBranch.replaceFirst(/(?i)SOLR-\d\d\d+-/, "").replace("-", " ").capitalize()+ // Strip everything before and including '/', then sanitize special characters+ def sanitizedBranchName = gitBranch.replaceAll(/^.*\//, "").replaceAll(/[^a-zA-Z0-9._-]/, "-")+ def fileName = "changelog/unreleased/${sanitizedBranchName}.yml"def file = new File(fileName)file.parentFile.mkdirs()file.text = """# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc-title: ${branchWithoutJira}+title: ${title}type: other # added, changed, fixed, deprecated, removed, dependency_update, security, otherauthors:- name: ${configuredName}${nick}${asfIdUrl}diff --git a/gradle/validation/rat-sources.gradle b/gradle/validation/rat-sources.gradleindex 8f87dcb065d..90e7d3da5e3 100644--- a/gradle/validation/rat-sources.gradle+++ b/gradle/validation/rat-sources.gradle@@ -100,6 +100,7 @@ allprojects {exclude "CHANGELOG.md"exclude "changelog/**/version-summary.md"exclude "changelog/.templates/*.md"+ exclude "changelog/archive.md"// The root project also includes patterns for the include composite// projects. Include their sources in the scan.