-
Notifications
You must be signed in to change notification settings - Fork 809
SOLR-17619 Use logchange for changelog management #3044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+2,424
−1,389
Merged
Changes from all commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
1e63065
add logchange plugin
dsmiley b38a7b2
Fix
dsmiley 3cc1497
Task generateChangeYaml
dsmiley 5ba088f
sorted deps
dsmiley 0421dc9
Bump version
janhoy 04251c2
Add logchange-config.yml
janhoy e6a6132
Dev-doc and gradle.properties template
janhoy ebb0d82
Auto generate title
janhoy a577537
Merge branch 'main' into logchange
janhoy 13dc016
Merge branch 'main' into logchange
janhoy 03fb455
Prefix gradle.properties keys with 'user'
janhoy 09756e1
Update dev-docs/changelog.adoc
janhoy 26be74c
Repeated 'deprecated' docs
janhoy 3558b97
Merge remote-tracking branch 'dsmiley/logchange' into logchange
janhoy 1f1be03
Upgrade to 1.19.5 and start using versioned unreleased dirs
janhoy 9d57c49
Remove config for unreleasedVersionDir
janhoy 68343bf
Customized entryTypes for solr
janhoy 535c661
Merge branch 'main' into logchange
janhoy f58ac9c
Merge branch 'main' into logchange
janhoy 362acdf
Use single unreleased folder
janhoy cc696a0
Do not gitignore CHANGELOG.md
janhoy 0c1fa19
Remove target version feature from changelog.gradle
janhoy e890f16
Rewrite dev-docs for single unreleased folder
janhoy 8337c29
Bump logchange version
janhoy 0faad7c
New script changes2logchange.py to migrate CHANGES.txt to logchange f…
janhoy 0e099ab
Updated docs to mention no need for changelog for minor issues
janhoy 9216ee8
Remove the optimized type
janhoy b995e6f
Doc change
janhoy be619cf
Generate newest entries in 'unreleased' folder
janhoy 463892d
Add a github workflow to warn about lack of changelog
janhoy 31992b2
Update PR template
janhoy 7be559d
Update addVersions.py
janhoy b10c09b
Update addDepsToChanges.py to write yaml
janhoy 7b2c8bf
New changes2html.py script and change gradle task
janhoy 6d34500
Note about not using upgrade_notes type
janhoy 6cc1684
Escape only < and >
janhoy 297acb5
Dummy changelog file to keep build from failing
janhoy 2398f39
Document migratino tool in dev-docs, including new option to convert …
janhoy 3e494b6
s/disallowed/deprecated/
janhoy 6bdfe64
Add a README (tmp) in the changelog/ folder
janhoy bcfb568
Include CHANGELOG.md in tarball
janhoy a1fad3c
Remove CHANGES.txt mention from addDepsToChanges.py
janhoy a26cfd1
Remove sentence from dev-docs/git.adoc
janhoy 6e965bb
Fix ExternalPaths.java
janhoy 2e1711f
Remove unused script releasedJirasRegex.py
janhoy d9a1344
Update smokeTestRelease.py to require CHANGELOG.md
janhoy 1e9a97b
Update releaseWizard changelog handling
janhoy 2e20ca0
License header for README
janhoy c5755af
ExternalPaths check other path which is allowed
janhoy b1db3ff
Clarify docs
janhoy b130f53
Fix releaseWizard.yaml syntax errors
janhoy 3fc4e84
Correct spelling of dev-docs/changelog.adoc
janhoy 2c8f6db
Rename task
janhoy 9dc20a0
Clean up the changelog.adoc doc
janhoy adc0b09
Re-organize adoc
janhoy a4f661f
Rename task once again as writeChangelog with an alias changelog
janhoy 59dd661
Wrong numbering in adoc
janhoy 9cc30b0
Improve addDepsTochanges
janhoy e4a8933
Improve addDepsTochanges
janhoy 0a3949e
Merge remote-tracking branch 'dsmiley/logchange' into logchange
janhoy e874d67
Revert unneccessary whitespace change in wiz
janhoy 0fe8fc7
Rewrite extract_jira_issues_from_title
janhoy 1ac5622
Mention task aliases
janhoy c50748c
Refactor changes2html.py to make it more readable and smaller
janhoy 074d639
Packaging build - include CHANGELOG.md from correct folder
janhoy 0ae2fbd
Nicer filename for changes yaml files
janhoy d1a8c4a
changes2logchange.py: Allow spaces in changelog yml files
janhoy bdadd40
Merge branch 'main' into logchange
janhoy 2c68693
Add a changelog yml to the PR
janhoy 265c156
Fixes in changelog validation workflow
janhoy 9d160cb
No need to print more than a link to changelog doc
janhoy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| #!/usr/bin/env python3 | ||
| # -*- coding: utf-8 -*- | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one or more | ||
| # contributor license agreements. See the NOTICE file distributed with | ||
| # this work for additional information regarding copyright ownership. | ||
| # The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with | ||
| # the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| """ | ||
| Validates changelog YAML files in changelog/unreleased/ folder. | ||
|
|
||
| Checks: | ||
| - File is valid YAML | ||
| - Contains required 'title' field (non-empty string) | ||
| - Contains required 'type' field (one of: added, changed, fixed, deprecated, removed, dependency_update, security, other) | ||
| - Contains required 'authors' field with at least one author | ||
| - Each author has a 'name' field (non-empty string) | ||
| """ | ||
|
|
||
| import sys | ||
| import yaml | ||
|
|
||
|
|
||
| def validate_changelog_yaml(file_path): | ||
| """Validate a changelog YAML file.""" | ||
| valid_types = ['added', 'changed', 'fixed', 'deprecated', 'removed', 'dependency_update', 'security', 'other'] | ||
|
|
||
| try: | ||
| with open(file_path, 'r', encoding='utf-8') as f: | ||
| data = yaml.safe_load(f) | ||
|
|
||
| # Check if file contains a mapping (dictionary) | ||
| if not isinstance(data, dict): | ||
| print(f"::error file={file_path}::File must contain YAML mapping (key-value pairs)") | ||
| return False | ||
|
|
||
| # Validate 'title' field | ||
| if 'title' not in data or not data['title']: | ||
| print(f"::error file={file_path}::Missing or empty 'title' field") | ||
| return False | ||
|
|
||
| if not isinstance(data['title'], str) or not data['title'].strip(): | ||
| print(f"::error file={file_path}::Field 'title' must be a non-empty string") | ||
| return False | ||
|
|
||
| # Validate 'type' field | ||
| if 'type' not in data or not data['type']: | ||
| print(f"::error file={file_path}::Missing or empty 'type' field") | ||
| return False | ||
|
|
||
| if data['type'] not in valid_types: | ||
| print(f"::error file={file_path}::Invalid 'type': '{data['type']}'. Must be one of: {', '.join(valid_types)}") | ||
| return False | ||
|
|
||
| # Validate 'authors' field | ||
| if 'authors' not in data or not data['authors']: | ||
| print(f"::error file={file_path}::Missing or empty 'authors' field") | ||
| return False | ||
|
|
||
| if not isinstance(data['authors'], list): | ||
| print(f"::error file={file_path}::Field 'authors' must be a list") | ||
| return False | ||
|
|
||
| if len(data['authors']) == 0: | ||
| print(f"::error file={file_path}::Field 'authors' must contain at least one author") | ||
| return False | ||
|
|
||
| # Validate each author | ||
| for i, author in enumerate(data['authors']): | ||
| if not isinstance(author, dict): | ||
| print(f"::error file={file_path}::Author {i} must be a mapping (key-value pairs)") | ||
| return False | ||
| if 'name' not in author or not author['name']: | ||
| print(f"::error file={file_path}::Author {i} missing or empty 'name' field") | ||
| return False | ||
| if not isinstance(author['name'], str) or not author['name'].strip(): | ||
| print(f"::error file={file_path}::Author {i} 'name' must be a non-empty string") | ||
| return False | ||
|
|
||
| # All validations passed | ||
| print(f"✓ {file_path} is valid") | ||
| print(f" Title: {data['title']}") | ||
| print(f" Type: {data['type']}") | ||
| print(f" Authors: {', '.join(a['name'] for a in data['authors'])}") | ||
| return True | ||
|
|
||
| except yaml.YAMLError as e: | ||
| print(f"::error file={file_path}::Invalid YAML: {e}") | ||
| return False | ||
| except Exception as e: | ||
| print(f"::error file={file_path}::Error validating file: {e}") | ||
| return False | ||
|
|
||
|
|
||
| if __name__ == '__main__': | ||
| if len(sys.argv) < 2: | ||
| print("Usage: validate-changelog-yaml.py <yaml-file>") | ||
| sys.exit(1) | ||
|
|
||
| file_path = sys.argv[1] | ||
| if not validate_changelog_yaml(file_path): | ||
| sys.exit(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| name: Validate Changelog | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - '*' | ||
|
|
||
| jobs: | ||
| validate-changelog: | ||
| name: Check changelog entry | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check for no-changelog label | ||
| id: check-label | ||
| run: | | ||
| LABELS='${{ toJson(github.event.pull_request.labels) }}' | ||
| if echo "$LABELS" | grep -q '"no-changelog"'; then | ||
| echo "skip=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "skip=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Check for CHANGES.txt edits | ||
| if: steps.check-label.outputs.skip == 'false' | ||
| run: | | ||
| # Get the list of changed files | ||
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) | ||
|
|
||
| if echo "$CHANGED_FILES" | grep -q "^solr/CHANGES\.txt$"; then | ||
| echo "::error::Use of solr/CHANGES.txt is deprecated. Please create a changelog yaml file instead." | ||
| echo "" | ||
| echo "Instead of editing CHANGES.txt, please:" | ||
| echo "1. Run: ./gradlew writeChangelog" | ||
| echo "2. Edit the generated YAML file in changelog/unreleased/" | ||
| echo "3. Commit both the code change and the YAML file" | ||
| echo "" | ||
| echo "For more information, see: dev-docs/changelog.adoc" | ||
| echo "" | ||
| echo "If this PR should not have a changelog entry (e.g., documentation-only changes)," | ||
| echo "add the 'no-changelog' label to this PR." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Check for changelog entry | ||
| if: steps.check-label.outputs.skip == 'false' | ||
| run: | | ||
| # Get the list of changed files | ||
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) | ||
|
|
||
| # Check if any files were added to changelog/unreleased/ | ||
| if echo "$CHANGED_FILES" | grep -q "^changelog/unreleased/"; then | ||
| echo "✓ Changelog entry found" | ||
| exit 0 | ||
| fi | ||
|
|
||
| # Check if only docs/tests/comments were changed (common exceptions) | ||
| HAS_NON_DOCS_CHANGES=false | ||
| while IFS= read -r file; do | ||
| # Skip changelog, docs, tests, and certain config files | ||
| if ! echo "$file" | grep -qE "(^changelog/|^solr/solr-ref-guide/|^dev-docs/|\.md$|\.adoc$|^solr/.*/test|\.gradle$|\.properties$|README|NOTICE|LICENSE)"; then | ||
| HAS_NON_DOCS_CHANGES=true | ||
| break | ||
| fi | ||
| done <<< "$CHANGED_FILES" | ||
|
|
||
| if [ "$HAS_NON_DOCS_CHANGES" = false ]; then | ||
| echo "✓ No code changes detected (docs/tests only)" | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "::error::This PR appears to contain code changes but no changelog entry was added." | ||
| echo "" | ||
| echo "Please add a changelog entry by:" | ||
| echo "1. Running: ./gradlew writeChangelog" | ||
| echo "2. Editing the generated YAML file in changelog/unreleased/" | ||
| echo "3. Committing the YAML file" | ||
| echo "" | ||
| echo "For more information, see: dev-docs/changelog.adoc" | ||
| echo "" | ||
| echo "If this PR should not have a changelog entry (e.g., refactoring, internal cleanup)," | ||
| echo "add the 'no-changelog' label to this PR." | ||
| exit 1 | ||
|
|
||
| - name: Validate changelog YAML structure | ||
| if: steps.check-label.outputs.skip == 'false' | ||
| run: | | ||
| # Get the list of changed files | ||
| CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD) | ||
|
|
||
| # Find all YAML files added to changelog/unreleased/ | ||
| YAML_FILES=$(echo "$CHANGED_FILES" | grep "^changelog/unreleased/.*\.ya\?ml$" || true) | ||
|
|
||
| if [ -z "$YAML_FILES" ]; then | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Validating changelog YAML files..." | ||
| VALIDATION_FAILED=false | ||
|
|
||
| while IFS= read -r file; do | ||
| if [ -z "$file" ]; then | ||
| continue | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "Validating: $file" | ||
|
|
||
| # Validate using a Python script | ||
| python3 .github/scripts/validate-changelog-yaml.py "$file" | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| VALIDATION_FAILED=true | ||
| fi | ||
|
|
||
| done <<< "$YAML_FILES" | ||
|
|
||
| if [ "$VALIDATION_FAILED" = true ]; then | ||
| echo "Please see dev-docs/changelog.adoc for more info." | ||
|
|
||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| <!-- @formatter:off --> | ||
| <!-- noinspection --> | ||
| <!-- Prevents auto format, for JetBrains IDE File > Settings > Editor > Code Style (Formatter Tab) > Turn formatter on/off with markers in code comments --> | ||
|
|
||
| <!-- This file is automatically generate by logchange tool 🌳 🪓 => 🪵 --> | ||
| <!-- Visit https://github.com/logchange/logchange and leave a star 🌟 --> | ||
| <!-- !!! ⚠️ DO NOT MODIFY THIS FILE, YOUR CHANGES WILL BE LOST ⚠️ !!! --> | ||
|
|
||
|
|
||
| DUMMY changelog file. | ||
|
|
||
| We are in the process of migrating from CHANGES.txt to a structured approach to changelog generation. See [SOLR-17619](https://issues.apache.org/jira/browse/SOLR-17619) as well as [dev-docs/changelog.adoc](dev-docs/changelog.adoc) for details. | ||
|
|
||
| [unreleased] | ||
| ------------ | ||
|
|
||
| ### Added (1 change) | ||
|
|
||
| - Dummy issue [SOLR-123](https://issues.apache.org/jira/browse/SOLR-123) (janhoy) | ||
|
|
||
| [9.9.0] - 2025-07-24 | ||
| -------------------- | ||
|
|
||
| ### Added (1 change) | ||
|
|
||
| - Dummy issue for release 9.9 [SOLR-124](https://issues.apache.org/jira/browse/SOLR-124) (janhoy) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one or more | ||
| contributor license agreements. See the NOTICE file distributed with | ||
| this work for additional information regarding copyright ownership. | ||
| The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| the "License"); you may not use this file except in compliance with | ||
| the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| # New changelog process | ||
|
|
||
| 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. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.