Skip to content

Include changelog links for major release upgrades#29

Merged
nickmoreton merged 13 commits intomainfrom
include-changelog
Jul 11, 2025
Merged

Include changelog links for major release upgrades#29
nickmoreton merged 13 commits intomainfrom
include-changelog

Conversation

@nickmoreton
Copy link
Collaborator

@nickmoreton nickmoreton commented Jul 11, 2025

This pull request introduces several improvements to dependency reporting, including enhanced update type detection, better handling of repository URLs for major updates, and refined HTML output styling. Additionally, it updates tests to reflect these changes and ensures consistency in terminology across the codebase.

Dependency update handling:

  • src/helpers.py: Added a new calculate_update_type function to determine if an update is major, minor, or a patch based on version comparison. Integrated this logic into package_table_row to reflect update types in the status and adjust styling accordingly. Major updates now include repository URLs when available.
  • src/managers/package.py: Introduced a new repository_url property to retrieve repository URLs from package metadata, prioritizing keys like "Changelog" and "Repository."

HTML output improvements:

  • src/reporters/html.py: Enhanced _table_dependency_row to handle statuses with newlines (e.g., repository URLs for major updates) and display clickable links. Added AI chat request suggestions for major updates. Updated _gather_status_class to use distinct colors for update types (major, minor, patch) and refined fallback styling.

Terminology consistency:

  • src/check_local.py and src/check_remote.py: Renamed "Production Dependencies" to "Main Dependencies" for clarity and consistency. [1] [2]

Test updates:

  • tests/test_html.py: Updated tests for _table_dependency_row to validate the new HTML structure and added detailed tests for _gather_status_class to ensure proper color mapping for different update types. [1] [2]

@nickmoreton nickmoreton requested a review from Copilot July 11, 2025 16:39

This comment was marked as outdated.

@nickmoreton nickmoreton changed the title Include changelog Include changelog links for major release upgrades Jul 11, 2025
@nickmoreton nickmoreton requested a review from Copilot July 11, 2025 17:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Enhance dependency reporting by classifying update types, linking major updates to changelog URLs, and renaming the “Production Dependencies” section to “Main Dependencies.”

  • Renamed all “Production Dependencies” headings and references to “Main Dependencies.”
  • Introduced calculate_update_type and repository_url to classify updates and fetch project URLs.
  • Updated HTML report rows to include clickable links and AI chat suggestions for major updates, and refined status color mapping.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/helpers.py Added version update classification and integrated it into package_table_row.
src/managers/package.py Added repository_url property to extract preferred project URLs.
src/reporters/html.py Enhanced row rendering: clickable update URLs, AI chat suggestions, and extended color logic.
tests/test_html.py Updated assertions to verify new row structure and status color mappings.
src/check_local.py Renamed “Production Dependencies” to “Main Dependencies.”
src/check_remote.py Renamed “Production Dependencies” to “Main Dependencies.”
Comments suppressed due to low confidence (4)

src/managers/package.py:25

  • Add unit tests for repository_url to verify correct selection from project_urls across different key orders and missing entries.
    def repository_url(self):

src/check_local.py:125

  • [nitpick] Update the comment to use consistent capitalization (# Main Dependencies) to match the heading and project style.
    # main dependencies

src/helpers.py:8

  • [nitpick] Consider adding type hints to calculate_update_type (e.g., -> Optional[str]) and annotating parameters for clearer API usage and better editor support.
def calculate_update_type(current_version, latest_version):

src/helpers.py:51

  • [nitpick] Indentation for this style assignment appears misaligned compared to surrounding elif blocks; align it with the other clauses to improve readability.
                style = "yellow1"

@nickmoreton nickmoreton merged commit f59dd55 into main Jul 11, 2025
2 checks passed
@nickmoreton nickmoreton deleted the include-changelog branch July 11, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant