Skip to content

Validate IfVersion attributes - #1306

Closed
danielporterda wants to merge 1 commit into
snippet-parse-repository-urlfrom
snippet-validate-if-version-attributes
Closed

Validate IfVersion attributes#1306
danielporterda wants to merge 1 commit into
snippet-parse-repository-urlfrom
snippet-validate-if-version-attributes

Conversation

@danielporterda

@danielporterda danielporterda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Validates the attributes on one opening <IfVersion> tag and produces a typed condition when they are valid.

It rejects unknown attributes, requires a complete registered GitHub repository URL, and requires containsPullRequest to be a positive integer expression. It does not apply nesting rules or inspect any enclosed <Snippet>.

Why

Condition identity is separate from conditional structure and from candidate/snippet matching.

Validation

  • python -m pytest tests/test_if_version_attribute_validation.py (7 passed)
  • python -m ruff check scripts/snippets/model.py scripts/snippets/validation.py tests/test_if_version_attribute_validation.py
  • python -m mypy scripts/snippets/model.py scripts/snippets/validation.py
  • git diff --check

Signed-off-by: danielporterda <daniel.porter@digitalasset.com>
@danielporterda

Copy link
Copy Markdown
Contributor Author

Closing this draft because the inline release-aware snippet stack is being retired. The branch remains available if its implementation is needed later.

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