-
Notifications
You must be signed in to change notification settings - Fork 17
feat: provider label discovery and catalog test_id metadata #485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
abegnoche
merged 10 commits into
NVIDIA:main
from
abegnoche:feat/provider-label-discovery
Jun 30, 2026
+736
−30
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
100a18a
feat: add provider label discovery
abegnoche d529e43
fix: clarify error when --label has no --provider or --config
abegnoche 198154f
fix: gate label discovery by release filter and clarify failures
abegnoche 66d59f4
feat: add `isvctl catalog labels` to list all labels
abegnoche 1821039
feat(catalog): annotate catalog entries with test_ids
abegnoche 52fd30c
fix(catalog): exclude abstract _TenantSanitizationCheck base
abegnoche d09a269
refactor: dedup catalog map builders and label-discovery config walk
abegnoche 279e648
feat(catalog): add `catalog labels --files` to show declaring configs
abegnoche 10b0851
fix: address review on provider discovery and catalog list
abegnoche 3419456
fix: add docstring to catalog labels files_for helper
abegnoche File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Provider-scoped label discovery helpers.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Iterator | ||
| from dataclasses import dataclass | ||
| from pathlib import Path | ||
|
|
||
| from isvtest.core.resolution import ValidationEntry, parse_validations, resolve_class_key | ||
|
|
||
| from isvctl.config.merger import merge_yaml_files | ||
|
|
||
|
|
||
| def _iter_config_validations(config_path: Path) -> Iterator[ValidationEntry]: | ||
| """Yield the validation entries of a config with its imports resolved.""" | ||
| merged = merge_yaml_files([config_path]) | ||
| raw_validations = (merged.get("tests") or {}).get("validations") or {} | ||
| yield from parse_validations(raw_validations) | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class MatchedCheck: | ||
| """A validation check that matched requested labels.""" | ||
|
|
||
| category: str | ||
| name: str | ||
| labels: tuple[str, ...] | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class ProviderConfigMatch: | ||
| """A provider config selected by label discovery.""" | ||
|
|
||
| config_path: Path | ||
| matched_checks: tuple[MatchedCheck, ...] | ||
|
|
||
|
|
||
| def list_providers(configs_root: Path) -> list[str]: | ||
| """Return provider names that expose a discoverable ``config/*.yaml`` directory.""" | ||
| providers_dir = configs_root / "providers" | ||
| if not providers_dir.is_dir(): | ||
| return [] | ||
| return sorted( | ||
| provider_dir.name | ||
| for provider_dir in providers_dir.iterdir() | ||
| if provider_dir.is_dir() and any((provider_dir / "config").glob("*.yaml")) | ||
| ) | ||
|
|
||
|
|
||
| def available_labels(provider: str, *, configs_root: Path) -> set[str]: | ||
| """Return every label declared across a provider's resolved config wiring.""" | ||
| provider_config_dir = configs_root / "providers" / provider / "config" | ||
| labels: set[str] = set() | ||
| for config_path in provider_config_dir.glob("*.yaml"): | ||
| for entry in _iter_config_validations(config_path): | ||
| labels.update(entry.labels) | ||
| return labels | ||
|
|
||
|
|
||
| def discover_provider_label_configs( | ||
| provider: str, | ||
| labels: list[str], | ||
| *, | ||
| configs_root: Path, | ||
| released_tests: set[str] | None = None, | ||
| ) -> list[ProviderConfigMatch]: | ||
| """Return provider configs whose resolved validation wiring matches all labels. | ||
|
|
||
| A check counts toward a match only if it is also runnable under the release | ||
| filter, mirroring orchestrator execution: when ``released_tests`` is a set, | ||
| unreleased checks are ignored so a config is not selected solely on a check | ||
| that would be skipped at runtime. ``None`` disables the filter (include all), | ||
| matching ``ISVTEST_INCLUDE_UNRELEASED``. | ||
| """ | ||
| requested = {label for label in labels if label} | ||
| provider_config_dir = configs_root / "providers" / provider / "config" | ||
| matches: list[ProviderConfigMatch] = [] | ||
|
|
||
| for config_path in sorted(provider_config_dir.glob("*.yaml")): | ||
| matched_checks = tuple( | ||
| MatchedCheck(category=entry.category, name=entry.name, labels=entry.labels) | ||
| for entry in _iter_config_validations(config_path) | ||
| if requested.issubset(entry.labels) | ||
| and (released_tests is None or resolve_class_key(entry.name, released_tests) is not None) | ||
| ) | ||
| if matched_checks: | ||
| matches.append(ProviderConfigMatch(config_path=config_path, matched_checks=matched_checks)) | ||
| return matches |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.