Skip to content

feat: provider label discovery and catalog test_id metadata#485

Merged
abegnoche merged 10 commits into
NVIDIA:mainfrom
abegnoche:feat/provider-label-discovery
Jun 30, 2026
Merged

feat: provider label discovery and catalog test_id metadata#485
abegnoche merged 10 commits into
NVIDIA:mainfrom
abegnoche:feat/provider-label-discovery

Conversation

@abegnoche

@abegnoche abegnoche commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Add provider-scoped label discovery: isvctl test run --provider <name> --label <x> scans isvctl/configs/providers/<name>/config/*.yaml, matches configs whose resolved wiring carries all requested labels (release-gated, honoring ISVTEST_INCLUDE_UNRELEASED), and runs each matching config as its own lifecycle. --dry-run prints the planned configs and matched checks.
  • Clarify discovery errors: --label without --provider/-f names both options; an unknown --provider lists the available providers; a valid provider with no label match lists the labels that provider exposes (surfacing typos like control-plane vs control_plane).
  • Add isvctl catalog labels to list every catalog label with a per-label test count.
  • Annotate catalog entries with test_ids (union of the test_ids declared on each check's suite/provider wiring, "N/A" excluded, variant ids propagated to the base class). Surfaced in isvctl catalog list and forwarded by the isvreporter catalog upload. Entry identity stays the validation class name, so result correlation and coverage are unchanged.
  • Exclude the abstract _TenantSanitizationCheck base from the catalog (the four concrete subclasses remain).

Test plan

  • make test
  • make demo-test
  • uv run isvctl test run --provider aws --label iam --dry-run
  • uv run isvctl catalog labels / uv run isvctl catalog list

Summary by CodeRabbit

  • New Features
    • Added catalog labels to browse labels with per-label test counts, with optional --json and --files output.
    • Enhanced test run with provider-based label discovery (including --dry-run discovery plans).
  • Improvements
    • Catalog entries now include test_ids; catalog list now shows a dedicated “Test IDs” column and consolidates labels/platforms formatting.
    • JUnit XML path selection now prefers the user-specified --junitxml when present.
    • Uploads now include test_ids in the sent catalog payload.
  • Bug Fixes
    • Updated catalog visibility so tenant-sanitization checks are listed correctly.

@copy-pr-bot

copy-pr-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 5205a618-67cc-4234-9fda-7367e25a441a

📥 Commits

Reviewing files that changed from the base of the PR and between 10b0851 and 3419456.

📒 Files selected for processing (1)
  • isvctl/src/isvctl/cli/catalog.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • isvctl/src/isvctl/cli/catalog.py

📝 Walkthrough

Walkthrough

Adds test_ids to catalog generation and upload, adds a catalog labels command, and introduces provider-based label discovery for isvctl test run with dry-run support.

Changes

test_ids field in catalog pipeline

Layer / File(s) Summary
test_id extraction and catalog entry population
isvtest/src/isvtest/catalog.py, isvtest/src/isvtest/validations/sanitization.py
Adds shared attribute-map extraction for labels and test IDs, includes test_ids in catalog entries, and sets sanitization base and subclass catalog visibility flags.
Reporter upload and catalog CLI output
isvreporter/src/isvreporter/client.py, isvctl/src/isvctl/cli/catalog.py
Sends test_ids in catalog uploads, updates catalog list columns, and adds the catalog labels command with table and JSON output.
Tests for test_ids, upload, and catalog labels
isvtest/tests/test_catalog.py, isvreporter/tests/test_catalog_upload.py, isvctl/tests/test_catalog_cli.py
Updates catalog/upload expectations for test_ids and adds CLI coverage for labels listing, counts, and file lists.

Provider label discovery for isvctl test run

Layer / File(s) Summary
label_discovery module
isvctl/src/isvctl/config/label_discovery.py
Adds provider label discovery types and functions for listing providers, collecting labels, and selecting matching configs.
test run CLI provider flow
isvctl/src/isvctl/cli/test.py
Adds --provider, discovery helpers, validation, dry-run plan output, and per-config execution with JUnit path handling.
Tests for discovery module and CLI provider dispatch
isvctl/tests/test_provider_label_discovery.py, isvctl/tests/test_test_cli_labels.py
Adds discovery fixture helpers and CLI tests for matching, filtering, errors, dispatch, and dry-run output.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: provider label discovery and catalog test_id metadata.
Docstring Coverage ✅ Passed Docstring coverage is 100.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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@abegnoche abegnoche force-pushed the feat/provider-label-discovery branch from b3575fc to 3e8b822 Compare June 29, 2026 14:33
@abegnoche abegnoche marked this pull request as ready for review June 29, 2026 14:35
@abegnoche abegnoche requested a review from a team as a code owner June 29, 2026 14:35
@github-actions

Copy link
Copy Markdown

🔐 TruffleHog Secret Scan

No secrets or credentials found!

Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉

🔗 View scan details

🕐 Last updated: 2026-06-29 14:36:40 UTC | Commit: 3e8b822

abegnoche and others added 7 commits June 29, 2026 10:37
Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
`isvctl test run --label <x>` with neither --provider nor -f previously
emitted "At least one --config/-f config file is required", omitting the
--provider discovery path. Name both options so the label-discovery entry
point is discoverable from the error.

Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
Provider label discovery now applies the same released_tests.json filter as
execution, so a config is not selected solely on an unreleased check that
would be skipped at runtime (honoring ISVTEST_INCLUDE_UNRELEASED).

Discovery failures are now distinguishable: an unknown --provider lists the
available providers, and a valid provider with no label match lists the
labels that provider exposes (surfacing typos like control-plane vs
control_plane).

Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
Aggregates the catalog into the set of labels with a per-label test count,
giving a first-class way to discover valid label values for label filtering
and provider discovery. Honors the same release gate as `catalog list`.

Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
Each catalog entry now carries the union of test-plan ids declared on its
suite/provider YAML wiring ("N/A" excluded), with a variant's ids propagated
to its base class. The entry identity stays the validation class name, so
result correlation and coverage are unchanged; test_ids is purely additive
metadata. isvreporter forwards the field on upload, and `isvctl catalog list`
shows a Test IDs column alongside a merged "Labels (Platforms)" column.

Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
The shared _TenantSanitizationCheck base class was surfacing as its own
catalog entry. Mark it catalog_exclude and re-enable the flag on the four
concrete subclasses (which would otherwise inherit the exclusion), so only
the real sanitization checks appear in the catalog.

Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
- Generalize build_label_map/build_test_id_map over a shared
  _build_check_attribute_map(extract_fn) helper (scan + variant->base
  propagation written once).
- Extract _iter_config_validations() in label_discovery so available_labels
  and discover_provider_label_configs share one merge+parse walk.
- Sort catalog labels counts once in labels_cmd instead of per output branch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
@abegnoche abegnoche force-pushed the feat/provider-label-discovery branch from 3e8b822 to d09a269 Compare June 29, 2026 14:37

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
isvctl/tests/test_catalog_cli.py (1)

80-93: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the per-label counts in the table-path test too.

This only proves the labels are rendered. If the Tests column disappeared or showed the wrong numbers, the new table output would still pass. Add assertions for the rendered counts so the non-JSON path verifies the command’s main behavior as well.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@isvctl/tests/test_catalog_cli.py` around lines 80 - 93, The
`test_catalog_labels_table` coverage only checks that label names appear, so it
can miss regressions in the `Tests` column output from `catalog labels`. Update
this test to also assert the rendered per-label counts for the table path, using
the existing `runner.invoke(app, ["labels"])` result from
`test_catalog_labels_table` and the patched `build_catalog` entries to verify
the expected numbers are shown alongside each label.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@isvctl/src/isvctl/cli/catalog.py`:
- Around line 92-100: The combined labels/platforms display in catalog rendering
adds empty parentheses when an entry has platforms but no labels. Update the
formatting in the catalog table builder around the labels_platforms logic so the
code in the catalog listing only wraps platforms in parentheses when labels are
present, and otherwise renders just the platform text; use the existing symbols
entry, labels, platforms, and labels_platforms in the catalog.py table row
construction to locate the fix.

In `@isvctl/src/isvctl/cli/test.py`:
- Around line 286-305: Provider-discovery runs in test.py are generating a
per-config JUnit path via _junitxml_for_discovered_config in the recursive run()
call, but the upload path still only resolves junit-validation.xml and can miss
the actual artifact. Update the upload flow in run() and the discovered-config
loop to carry through the resolved junitxml for each match (including
provider-discovered runs) so the lab upload uses the per-config report instead
of falling back to a missing file. Refer to run(),
_junitxml_for_discovered_config(), and the provider-discovery branch that
iterates over matches.

In `@isvctl/tests/test_test_cli_labels.py`:
- Around line 98-110: Add PEP 257 docstrings to the new methods on
_FakeOrchestrator. Update both _FakeOrchestrator.__init__ and
_FakeOrchestrator.run in the test helper to include brief docstrings describing
their purpose and behavior, matching the style used elsewhere in the test suite.

---

Nitpick comments:
In `@isvctl/tests/test_catalog_cli.py`:
- Around line 80-93: The `test_catalog_labels_table` coverage only checks that
label names appear, so it can miss regressions in the `Tests` column output from
`catalog labels`. Update this test to also assert the rendered per-label counts
for the table path, using the existing `runner.invoke(app, ["labels"])` result
from `test_catalog_labels_table` and the patched `build_catalog` entries to
verify the expected numbers are shown alongside each label.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c8806135-d507-412b-9832-053a20ebc1bd

📥 Commits

Reviewing files that changed from the base of the PR and between 6fe807b and d09a269.

📒 Files selected for processing (11)
  • isvctl/src/isvctl/cli/catalog.py
  • isvctl/src/isvctl/cli/test.py
  • isvctl/src/isvctl/config/label_discovery.py
  • isvctl/tests/test_catalog_cli.py
  • isvctl/tests/test_provider_label_discovery.py
  • isvctl/tests/test_test_cli_labels.py
  • isvreporter/src/isvreporter/client.py
  • isvreporter/tests/test_catalog_upload.py
  • isvtest/src/isvtest/catalog.py
  • isvtest/src/isvtest/validations/sanitization.py
  • isvtest/tests/test_catalog.py

Comment thread isvctl/src/isvctl/cli/catalog.py
Comment thread isvctl/src/isvctl/cli/test.py
Comment thread isvctl/tests/test_test_cli_labels.py
Add an opt-in --files flag to `isvctl catalog labels` that lists, per label,
the config file(s) declaring it (via a new build_label_file_map config scan).
Off by default so the table/JSON stay compact; --files adds a Files column
and a per-label `files` array in --json.

Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
- Upload the per-config JUnit report from provider label discovery: the
  results upload now prefers the requested --junitxml path before the
  default name, so discovered runs no longer upload a null report.
- catalog list: render platforms-only entries as "PLATFORM" instead of
  " (PLATFORM)" when a check has platforms but no labels.
- Add PEP 257 docstrings to the _FakeOrchestrator test double methods.

Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@isvctl/src/isvctl/cli/catalog.py`:
- Around line 136-137: The helper files_for() is missing the required PEP 257
docstring even though it has a return type annotation. Add a concise docstring
directly above files_for() that describes what label it takes and that it
returns the sorted list of files for that label, following the repo’s docstring
convention.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 121797ad-b8e1-4d41-ad33-ed68690abab4

📥 Commits

Reviewing files that changed from the base of the PR and between d09a269 and 10b0851.

📒 Files selected for processing (5)
  • isvctl/src/isvctl/cli/catalog.py
  • isvctl/src/isvctl/cli/test.py
  • isvctl/tests/test_catalog_cli.py
  • isvctl/tests/test_test_cli_labels.py
  • isvtest/src/isvtest/catalog.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • isvctl/src/isvctl/cli/test.py
  • isvtest/src/isvtest/catalog.py
  • isvctl/tests/test_test_cli_labels.py

Comment thread isvctl/src/isvctl/cli/catalog.py
Address review: PEP 257 docstring required on the nested files_for() helper.

Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
@abegnoche abegnoche merged commit 13b51e6 into NVIDIA:main Jun 30, 2026
7 checks passed
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.

2 participants