Copilot commented on code in PR #3044:
URL: https://github.com/apache/solr/pull/3044#discussion_r2452645928
##########
changelog/README.md:
##########
@@ -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
Review Comment:
License header is incomplete. Line 6 should read: 'the \"License\"); you may
not use this file except in compliance with'. The phrase 'or more' is missing
after 'one' in line 3.
```suggestion
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
```
##########
.github/workflows/validate-changelog.yml:
##########
@@ -0,0 +1,88 @@
+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 "^solr/changelog/unreleased/"; then
Review Comment:
Path pattern doesn't match the actual changelog directory structure. Based
on the diff context, changelog files are in `changelog/unreleased/` not
`solr/changelog/unreleased/`.
```suggestion
if echo "$CHANGED_FILES" | grep -q "^changelog/unreleased/"; then
```
##########
.github/workflows/validate-changelog.yml:
##########
@@ -0,0 +1,88 @@
+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 "^solr/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
"(^solr/changelog/|^solr/solr-ref-guide/|^dev-docs/|\.md$|\.adoc$|^solr/.*/test|\.gradle$|\.properties$|README|NOTICE|LICENSE)";
then
Review Comment:
Path pattern `^solr/changelog/` doesn't match the actual changelog directory
structure which is `changelog/` at the repository root.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]