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

nzw921rx pushed a commit to branch 3.1.0-release
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


The following commit(s) were added to refs/heads/3.1.0-release by this push:
     new d082452fc0 [Fix][Tools] Support 3.x and later in connector changelogs 
(#13206)
d082452fc0 is described below

commit d082452fc067cb0674dda46e52623b03061c0cb6
Author: zhiweiniu <[email protected]>
AuthorDate: Thu Nov 12 07:32:15 2026 +0000

    [Fix][Tools] Support 3.x and later in connector changelogs (#13206)
    
    (cherry picked from commit 1f61649c24fe8a081ddf5bde136664f3cd7fe7f8)
---
 tools/documents/update_connector_change_log.py | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/tools/documents/update_connector_change_log.py 
b/tools/documents/update_connector_change_log.py
index e6e16d93a6..8d9a89b57c 100644
--- a/tools/documents/update_connector_change_log.py
+++ b/tools/documents/update_connector_change_log.py
@@ -17,7 +17,7 @@
 import os
 import subprocess
 import html
-from packaging.version import Version
+from packaging.version import InvalidVersion, Version
 from pathlib import Path
 
 
@@ -64,19 +64,29 @@ def get_tag_commit_list():
         raise RuntimeError("Failed to fetch tags")
 
     tags = result.stdout.decode('utf-8').splitlines()
-    # Only consider tags starting with 2. for now
-    tags = [tag for tag in tags if tag.startswith('2.')]
-    sorted_versions = sorted(tags, key=Version, reverse=True)
+    release_versions = {}
+    for tag in tags:
+        try:
+            version = Version(tag)
+        except InvalidVersion:
+            continue
+
+        # Keep the existing 2.x tag history and accept optional v prefixes for 
later releases.
+        if tag.startswith('2.') or version.major >= 3:
+            release_versions[tag] = version
+
+    sorted_tags = sorted(release_versions, key=release_versions.get, 
reverse=True)
 
     commit_version_map = {}
-    for version in sorted_versions:
-        result = subprocess.run(['git', 'log', version, '--abbrev=10', 
'--pretty=format:%h'],
+    for tag in sorted_tags:
+        result = subprocess.run(['git', 'log', tag, '--abbrev=10', 
'--pretty=format:%h'],
                                 cwd=directory, stdout=subprocess.PIPE)
         if result.returncode != 0:
             raise RuntimeError("Failed to fetch tag logs")
         commits = result.stdout.decode('utf-8').splitlines()
+        release_version = tag.lstrip('vV')
         for commit in commits:
-            commit_version_map[commit] = version
+            commit_version_map[commit] = release_version
 
     return commit_version_map
 

Reply via email to