Skip to content

Conversation

Williangalvani
Copy link
Member

@Williangalvani Williangalvani commented Aug 20, 2025

Summary by Sourcery

Use our own index-proxy endpoint to retrieve image tags and eliminate the custom DockerHub fetching logic.

Enhancements:

  • Switch remote image tag fetching in the version chooser to use the internal index-proxy service instead of DockerHub API.

Chores:

  • Remove the TagFetcher class, TagMetadata dataclass, and related DockerHub utility code.
  • Clean up imports and simplify set_remote_versions by directly extending remote tags from the proxy response.

Copy link

sourcery-ai bot commented Aug 20, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces the custom DockerHub API client with calls to our internal index-proxy service for retrieving image tags and streamlines tag handling in the version chooser.

Sequence diagram for fetching remote image tags via index-proxy

sequenceDiagram
    participant chooser.py
    participant aiohttp.ClientSession
    participant index-proxy (logtools.cloud)
    chooser.py->>aiohttp.ClientSession: Create session
    chooser.py->>index-proxy (logtools.cloud): GET /GetImages?repository=...&arch=...&index=dockerhub
    index-proxy (logtools.cloud)-->>chooser.py: Respond with image tags (JSON)
    chooser.py->>chooser.py: Update output["remote"] with received tags
Loading

Class diagram for removal of TagFetcher and TagMetadata

classDiagram
    class TagFetcher {
        - index_url: str
        - docker_url: str
        - last_token: str
        + fetch_sha(metadata: TagMetadata): str
        + fetch_remote_tags(repository: str, local_images: List[str]): Tuple[str, List[TagMetadata]]
    }
    class TagMetadata {
        + repository: str
        + image: str
        + tag: str
        + last_modified: str
        + sha: Optional[str]
        + digest: str
    }
    %% Both TagFetcher and TagMetadata have been removed from the codebase
Loading

File-Level Changes

Change Details Files
Remove custom DockerHub client and metadata types
  • Delete TagFetcher class responsible for fetching tokens and tags
  • Remove TagMetadata dataclass
  • Eliminate related imports (aiohttp, dataclasses, typing, warnings, logger)
core/services/versionchooser/utils/dockerhub.py
Use internal index-proxy endpoint for remote tag retrieval
  • Replace TagFetcher.fetch_remote_tags call with aiohttp GET to internal proxy URL
  • Pass repository, architecture, and index parameters in the request
  • Handle HTTP status and parse JSON response for tags
core/services/versionchooser/utils/chooser.py
Simplify remote tag integration in chooser
  • Import get_current_arch instead of TagFetcher
  • Remove asdict conversion of TagMetadata
  • Extend remote tags list directly with proxy response objects
core/services/versionchooser/utils/chooser.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Williangalvani Williangalvani force-pushed the change_index branch 3 times, most recently from e750324 to a1d4579 Compare August 20, 2025 19:12
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