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

asf-gitbox-commits pushed a commit to branch branch_10_1
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 1a45846c45bf0ee08a650a1050c96bf5c04d4a73
Author: Andrzej BiaƂecki <[email protected]>
AuthorDate: Wed Oct 21 14:41:45 2026 +0200

    Make sure the dependencyChanges.py processes also already existing
    solrbot changelog entries added in earlier RCs.
    
    Co-authored-by: Claude Sonnet 5.5 <[email protected]>
    (cherry picked from commit 62620f6466cba1feaa51625d9fe8de1bc2b749be)
---
 dev-docs/changelog.adoc                |  3 ++-
 dev-tools/scripts/dependencyChanges.py | 25 ++++++++++++++++++++++++-
 dev-tools/scripts/releaseWizard.yaml   |  3 ++-
 3 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/dev-docs/changelog.adoc b/dev-docs/changelog.adoc
index bd8d3e5cd4a..29121fa3ed7 100644
--- a/dev-docs/changelog.adoc
+++ b/dev-docs/changelog.adoc
@@ -277,7 +277,8 @@ Wizard but can also be run standalone.  Run with `--help` 
for usage.
 `dev-tools/scripts/dependencyChanges.py` summarizes the third-party dependency 
changes
 since the previous release by diffing `solr/licenses/`.  By default it prints 
to stdout;
 with `--write`, the Release Wizard uses it to write `dependency_update` 
changelog entries
-(one each for added, upgraded, and removed).
+(one each for added, upgraded, and removed) and to delete the per-PR 
`dependency_update`
+entries authored by `solrbot` from `changelog/unreleased/`, which the summary 
replaces.
 
 == 7. Further Reading
 
diff --git a/dev-tools/scripts/dependencyChanges.py 
b/dev-tools/scripts/dependencyChanges.py
index c5d71a381f4..bb2c49c0f1c 100644
--- a/dev-tools/scripts/dependencyChanges.py
+++ b/dev-tools/scripts/dependencyChanges.py
@@ -21,7 +21,9 @@ jar checksum files in solr/licenses/ between two git refs (by 
default: the
 previous release tag and HEAD).  Jars that moved between the same two versions
 are listed together, since they are typically from the same project.
 
-Prints the summary to stdout, or with --write, writes changelog YAML entries.
+Prints the summary to stdout, or with --write, writes changelog YAML entries 
and
+deletes the per-PR dependency_update entries authored by solrbot, which the 
summary
+supersedes.
 
 This is a stopgap until Solr publishes an SBOM per release, which would be the
 better source to diff.
@@ -165,6 +167,26 @@ def to_yaml(title, version):
           f'    url: 
https://github.com/apache/solr/tree/releases/solr/{version}/solr/licenses\n')
 
 
+def is_solrbot_dependency_entry(path):
+  """Whether a changelog YAML entry is a dependency_update with solrbot among 
its authors."""
+  with open(path, encoding='utf-8') as f:
+    text = f.read()
+  return (re.search(r'^type:\s*dependency_update\s*$', text, re.M) is not None
+          and re.search(r'^\s*-?\s*name:\s*[\'"]?solrbot[\'"]?\s*$', text, 
re.M) is not None)
+
+
+def remove_solrbot_entries(directory):
+  """Deletes solrbot's per-PR dependency_update entries; the generated summary 
replaces them."""
+  count = 0
+  for name in sorted(os.listdir(directory)):
+    path = os.path.join(directory, name)
+    if (name.endswith('.yml') and not name.startswith('dependency-changes-')
+        and is_solrbot_dependency_entry(path)):
+      os.remove(path)
+      count += 1
+  print(f'Removed {count} solrbot dependency_update entries from {directory}')
+
+
 def main():
   parser = argparse.ArgumentParser(description=__doc__, 
formatter_class=argparse.RawDescriptionHelpFormatter)
   parser.add_argument('--from', dest='from_ref',
@@ -196,6 +218,7 @@ def main():
     elif os.path.exists(path):
       os.remove(path)
       print(f'Removed {path}; no {category} dependency changes')
+  remove_solrbot_entries(args.write)
 
 
 if __name__ == '__main__':
diff --git a/dev-tools/scripts/releaseWizard.yaml 
b/dev-tools/scripts/releaseWizard.yaml
index 1e13c326851..63b5712344d 100644
--- a/dev-tools/scripts/releaseWizard.yaml
+++ b/dev-tools/scripts/releaseWizard.yaml
@@ -677,12 +677,13 @@ groups:
     description: |
       Add changelog entries summarizing third-party dependencies added, 
upgraded, and removed since the
       previous release, derived from the jar checksum files in 
`solr/licenses/`.
+      It also deletes the individual `dependency_update` entries by solrbot, 
which the summary replaces.
       Re-running it overwrites the entries, e.g. if dependencies changed 
before a respin.
       Run the script without `--write` to just print the summary.
     depends: clean_git_checkout
     commands: !Commands
       root_folder: '{{ git_checkout_folder }}'
-      commands_text: We call out to a helper script that writes 
`changelog/unreleased/dependency-changes-*.yml`
+      commands_text: We call out to a helper script that writes 
`changelog/unreleased/dependency-changes-*.yml` and removes solrbot's per-PR 
dependency entries
       confirm_each_command: true
       commands:
       - !Command

Reply via email to