Skip to content

feat(info_collector): add test to fetch versions for tools in cluster#997

Open
silvi-t wants to merge 1 commit into
Kuadrant:mainfrom
silvi-t:tools-version-collection
Open

feat(info_collector): add test to fetch versions for tools in cluster#997
silvi-t wants to merge 1 commit into
Kuadrant:mainfrom
silvi-t:tools-version-collection

Conversation

@silvi-t

@silvi-t silvi-t commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Important

This PR modifies shared/core testsuite code that could potentially affect multiple test areas. 2 reviewers should review this PR to ensure adequate coverage.

Description

  • Add test_tools_properties collector test that resolves actual deployed versions of tools (e.g. keycloak:latestkeycloak:26.4.11) by querying container registry APIs
  • Add container_image_versions.py module with ContainerRegistryResolver that matches image digests from pod status against semver tags in quay.io, ghcr.io, and Red Hat Catalog
  • Extract image digests from status.containerStatuses[].imageID via new get_pod_images() method

Changes

New Features

  • testsuite/container_image_versions.py: New module with ContainerRegistryResolver class that resolves container image digests to semver version tags via registry APIs (quay.io, ghcr.io, Red Hat Catalog)
  • testsuite/tests/info_collector.py: New test_tools_properties test that collects images from the tools namespace, resolves :latest tags to actual versions, and records them as Report Portal launch attributes
  • testsuite/tests/info_collector.py: New _resolve_tools_versions() helper that skips resolution for images already tagged with semver and falls back gracefully on failure

Modifications

  • testsuite/component_metadata.py: Refactored get_component_images() into get_pod_images() which additionally extracts image digests from pod status.containerStatuses; get_component_images() now wraps
    get_pod_images() for backwards compatibility
  • testsuite/tests/info_collector.py: Filtered testsuite-pipelines-tools from test_kuadrant_properties output as it is a CI tool, not a Kuadrant component

Verification steps

  1. Run the collector:
    make collect
  2. Check junit-00-collect.xml for resolved tools versions
  3. Optionally import into Report Portal and verify the tools version attributes:
rptool write junit-00-collect.xml

Summary by CodeRabbit

  • New Features

    • Added container image digest-to-version tag resolution, enabling accurate version identification across container registries
    • Enhanced metadata collection to capture additional digest information for improved image tracking
  • Tests

    • Extended test suite with improved tool image version resolution and property reporting capabilities

Signed-off-by: Silvia Tarabova <starabov@redhat.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bbf08645-76ac-4e44-aaff-cb3c26188c0e

📥 Commits

Reviewing files that changed from the base of the PR and between 01fde25 and 54c10a7.

📒 Files selected for processing (3)
  • testsuite/component_metadata.py
  • testsuite/container_image_versions.py
  • testsuite/tests/info_collector.py

📝 Walkthrough

Walkthrough

Pod metadata collection is enriched to extract container image digests from Kubernetes status fields. A new container registry resolver module handles digest-to-version-tag conversion for both standard and Red Hat registries. Tool image properties are collected, version-resolved, and recorded in the test suite reporting pipeline.

Changes

Container image metadata enrichment and version resolution

Layer / File(s) Summary
Pod image metadata enrichment with digest extraction
testsuite/component_metadata.py
get_pod_images now extracts digest from container status and returns four-element tuples: (name, tag, full_image, digest). get_component_images adapts by extracting the first three elements.
Container registry digest-to-tag resolver
testsuite/container_image_versions.py
New ContainerRegistryResolver class resolves image digests to semver version tags. Supports standard registry auth flows and Red Hat's catalog API. Handles manifest lists, pagination via HTTP Link headers, and token caching. Includes version sorting logic and manifest digest comparison.
Tool image collection and version reporting
testsuite/tests/info_collector.py
Imports digest resolver and semver patterns. Filters testsuite-pipelines-tools from Kuadrant properties. New _resolve_tools_versions helper normalises tool image tags (preserving semver, resolving others via registry). New test_tools_properties collects tool pod images from tools namespace, resolves versions per cluster, and records unique tool properties.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • Kuadrant/testsuite#911: Both PRs modify testsuite reporting in component_metadata.py and info_collector.py around ReportPortalMetadataCollector.get_component_images and cluster image property collection.
  • Kuadrant/testsuite#983: Both PRs modify component_metadata.py and rework info_collector.py property collection logic including test_kuadrant_properties.

Suggested reviewers

  • trepel
  • averevki
  • azgabur

Poem

🐰 Digests now flow through the registry deep,
Each version tag sorted, no secrets to keep,
From Kubernetes status to manifest hashes,
Tool versions resolved in resolving flashes,
The testsuite reports what containers proclaim!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a test to fetch and resolve tool versions in the cluster.
Description check ✅ Passed The description includes all required sections (Description, Changes, Verification) with comprehensive details about new features and modifications.
Docstring Coverage ✅ Passed Docstring coverage is 85.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@silvi-t silvi-t requested a review from a team June 10, 2026 12:38
@silvi-t silvi-t self-assigned this Jun 10, 2026
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