MCPcopy Create free account
hub / github.com/apache/solr / _process_version

Method _process_version

dev-tools/scripts/changes2logchange.py:924–994  ·  view source on GitHub ↗

Process all entries for a single version.

(self, version_section: VersionSection)

Source from the content-addressed store, hash-verified

922 self._print_summary()
923
924 def _process_version(self, version_section: VersionSection):
925 """Process all entries for a single version."""
926 from packaging import version as pkg_version
927
928 # Determine if this version should go to unreleased folder
929 is_unreleased = False
930 if self.last_released_version:
931 try:
932 current_ver = pkg_version.parse(version_section.version)
933 latest_ver = pkg_version.parse(self.last_released_version)
934 is_unreleased = current_ver > latest_ver
935 except Exception:
936 # If parsing fails, treat as unreleased (conservative approach)
937 is_unreleased = True
938
939 # Route to appropriate directory
940 if is_unreleased:
941 version_dir = self.output_base_dir / "unreleased"
942 print(f"\nProcessing version {version_section.version} (unreleased):")
943 self.stats['unreleased_entries'] += len(version_section.entries)
944 else:
945 version_dir = self.output_base_dir / version_section.get_directory_name()
946 print(f"\nProcessing version {version_section.version}:")
947
948 print(f" Found {len(version_section.entries)} entries")
949
950 # Write release-date.txt if we have a date for this version (only for released versions)
951 if not is_unreleased and version_section.version in self.version_dates:
952 release_date = self.version_dates[version_section.version]
953 release_date_file = version_dir / "release-date.txt"
954 version_dir.mkdir(parents=True, exist_ok=True)
955
956 with open(release_date_file, 'w', encoding='utf-8') as f:
957 f.write(release_date + '\n')
958
959 self.stats['release_dates_written'] += 1
960 print(f" Release date: {release_date}")
961
962 entry_counter = 0 # For entries without explicit issue IDs
963
964 for entry in version_section.entries:
965 # Find primary issue ID from links
966 issue_id = None
967 for link in entry.links:
968 if link.name.startswith('SOLR-'):
969 issue_id = link.name
970 break
971
972 if not issue_id:
973 # If no SOLR issue found, try to use other JIRA/PR formats
974 for link in entry.links:
975 if link.name.startswith(('LUCENE-', 'INFRA-', 'PR#', 'GITHUB#')):
976 issue_id = link.name
977 break
978
979 if not issue_id:
980 # No standard issue/PR found, generate a synthetic ID
981 # Use format: unknown-001, unknown-002, etc.

Callers 1

runMethod · 0.95

Calls 5

get_directory_nameMethod · 0.80
generate_slugMethod · 0.80
write_entryMethod · 0.80
writeMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected