schema: allow comma-separated maturity criteria - #4618
Open
LiliDeng wants to merge 1 commit into
Open
Conversation
Criteria.maturity now accepts a single comma/space separated string (e.g. from a -v override or pipeline) and normalizes it to a list, validating each value against the known maturity levels. Empty string becomes no filter. Single value and real list inputs are unchanged (backward compatible).
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends schema.Criteria.maturity parsing so users can provide multiple maturity levels as a single comma/space-separated string (e.g., via -v variable overrides or pipelines), while preserving existing behavior for single values and list inputs.
Changes:
- Normalize comma/space-separated
maturitystrings into a list duringCriteria.__post_init__. - Move maturity value validation into a dedicated
_normalize_maturity()helper (empty string becomes “no filter”). - Keep
maturitybackward compatible for existing single-value string and list usages.
Collaborator
Author
AI Test Case SelectionSelected 1 test case(s): smoke_test Marketplace image: Result: Succeeded |
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
lisa/schema.py:1756
- Minor: The comment says comma/space-separated maturity strings are "normalized to a list" in post_init, but _normalize_maturity intentionally keeps a single value as a string (backward compatible via
parts[0]). Please update the comment to match the actual behavior so readers don’t assumematurityis always a list.
# maturity filters tests by lifecycle stage. It accepts a single value, a
# list, or a single comma/space separated string (e.g. from a "-v" override
# or a pipeline), which is normalized to a list in __post_init__. Each value
# is validated there against the known maturity levels.
lisa/schema.py:1782
- Major: The new comma/space-separated parsing path for
Criteria.maturityisn’t covered by existing selftests (they cover single string and list inputs). Please add a selftest that loads a runbook withmaturity: "preview,experimental"(and optionally an empty string) to ensure it normalizes/filters as intended and stays backward compatible.
# split a single "stable,preview" (or space separated) string into a
# list, so a single command-line/pipeline value can select multiple.
if isinstance(maturity, str):
parts = [p for p in maturity.replace(",", " ").split() if p]
if not parts:
return None
maturity = parts[0] if len(parts) == 1 else parts
values = maturity if isinstance(maturity, list) else [maturity]
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Criteria.maturity now accepts a single comma/space separated string (e.g. from a -v override or pipeline) and normalizes it to a list, validating each value against the known maturity levels. Empty string becomes no filter. Single value and real list inputs are unchanged (backward compatible).
Description
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results