Formats the extracted data into Markdown (no issue links in lists).
(data, skip_issues_set=None)
| 238 | |
| 239 | |
| 240 | def format_markdown(data, skip_issues_set=None): |
| 241 | """Formats the extracted data into Markdown (no issue links in lists).""" |
| 242 | if skip_issues_set is None: |
| 243 | skip_issues_set = set() |
| 244 | if not data.get('version'): |
| 245 | return "Error: Version not found in parsed data." |
| 246 | |
| 247 | version = data['version'] |
| 248 | release_url = ( |
| 249 | f"https://www.pgadmin.org/docs/pgadmin4/{version}/" |
| 250 | f"release_notes_{version.replace('.', '_')}.html" |
| 251 | ) |
| 252 | download_url = "https://www.pgadmin.org/download/" |
| 253 | website_url = "https://www.pgadmin.org/" |
| 254 | |
| 255 | filtered_features = [ |
| 256 | item for item in data.get('features', []) |
| 257 | if item.get('issue') not in skip_issues_set |
| 258 | ] |
| 259 | filtered_bugs = [ |
| 260 | item for item in data.get('bugs_housekeeping', []) |
| 261 | if item.get('issue') not in skip_issues_set |
| 262 | ] |
| 263 | num_features = len(filtered_features) |
| 264 | num_bugs_housekeeping = len(filtered_bugs) |
| 265 | |
| 266 | output = ( |
| 267 | f"The pgAdmin Development Team is pleased to announce " |
| 268 | f"pgAdmin 4 version {version}. " |
| 269 | ) |
| 270 | output += ( |
| 271 | f"This release of pgAdmin 4 includes " |
| 272 | f"{pluralize(num_features, 'new feature')} and " |
| 273 | f"{pluralize(num_bugs_housekeeping, 'bug fix', 'bug fixes')}/" |
| 274 | f"housekeeping change" |
| 275 | f"{'s' if num_bugs_housekeeping != 1 else ''}. " |
| 276 | ) |
| 277 | output += (f"For more details, " |
| 278 | f"please see the [release notes]({release_url}).") |
| 279 | # Ensure markdown paragraph break |
| 280 | output += "\n \n" |
| 281 | output += ( |
| 282 | f"pgAdmin is the leading Open Source graphical management " |
| 283 | f"tool for PostgreSQL. For more information, please see " |
| 284 | f"[the website]({website_url})." |
| 285 | ) |
| 286 | output += "\n\n" |
| 287 | output += "Notable changes in this release include:\n \n" |
| 288 | |
| 289 | if filtered_features: |
| 290 | output += "### Features:\n" |
| 291 | for item in filtered_features: |
| 292 | desc = item.get('description', 'N/A').strip() |
| 293 | output += f"* {desc}.\n" # Link logic removed |
| 294 | output += "\n" |
| 295 | |
| 296 | if filtered_bugs: |
| 297 | output += "### Bugs/Housekeeping:\n" |
no test coverage detected