Skip to content

schema: allow comma-separated maturity criteria - #4618

Open
LiliDeng wants to merge 1 commit into
mainfrom
feature/maturity-csv-split
Open

schema: allow comma-separated maturity criteria#4618
LiliDeng wants to merge 1 commit into
mainfrom
feature/maturity-csv-split

Conversation

@LiliDeng

Copy link
Copy Markdown
Collaborator

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

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

Impacted LISA Features:

Tested Azure Marketplace Images:

Test Results

Image VM Size Result
PASSED / FAILED / SKIPPED

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).
Copilot AI review requested due to automatic review settings July 29, 2026 05:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 maturity strings into a list during Criteria.__post_init__.
  • Move maturity value validation into a dedicated _normalize_maturity() helper (empty string becomes “no filter”).
  • Keep maturity backward compatible for existing single-value string and list usages.

@LiliDeng

Copy link
Copy Markdown
Collaborator Author

AI Test Case Selection

Selected 1 test case(s): smoke_test

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Result: Succeeded

View full logs in Azure DevOps

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 assume maturity is 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.maturity isn’t covered by existing selftests (they cover single string and list inputs). Please add a selftest that loads a runbook with maturity: "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]

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