fix(extract): ignore Liquid expressions in named value discovery - #290
Open
Junior (seilorjunior) wants to merge 1 commit into
Open
Junior (seilorjunior) wants to merge 1 commit into
Junior (seilorjunior) wants to merge 1 commit into
Conversation
Skip Liquid set-body content when discovering named values, while preserving ordinary policy references and original extracted artifacts. Handle CDATA, comments, nested body tags, and attribute variations. Add scanner and service/fragment extraction regression coverage. Closes Azure#276 Co-authored-by: GitHub Copilot <noreply@github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix preserves other dependency scanning and includes comprehensive regression coverage.
Pull request overview
Prevents Liquid expressions from being misidentified as named-value dependencies during extraction.
Changes:
- Excludes Liquid
set-bodycontents from named-value scanning. - Adds scanner edge-case and extraction regression coverage.
File summaries
| File | Description |
|---|---|
src/services/transitive-resolver.ts |
Skips Liquid bodies during named-value discovery. |
tests/unit/services/transitive-resolver.test.ts |
Covers Liquid parsing variants and boundaries. |
tests/unit/services/extract-service.test.ts |
Verifies successful extraction without false lookups or policy changes. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This branch has not been deployed
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.
This pull request refines how policy XML is scanned for dependencies, specifically improving the detection of named value references in the presence of Liquid template bodies. It introduces logic to ignore named value lookups inside
<set-body template="liquid">elements, ensuring only real dependencies are detected. Comprehensive tests are added to validate these changes and cover various edge cases.Policy XML Parsing Improvements:
scanPolicyReferencesfunction insrc/services/transitive-resolver.tsto exclude named value references found within Liquid template bodies, using new regular expressions and parsing logic to correctly handle nested and attribute-rich tags. [1] [2]Test Coverage Enhancements:
tests/unit/services/transitive-resolver.test.tsto verify that named values inside Liquid templates are ignored, while other dependencies (like backends and fragments) are still detected. These tests cover a wide range of policy XML patterns and edge cases.tests/unit/services/extract-service.test.tsto ensure policies using Liquid templates are extracted without false dependency lookups or unintended policy modifications.Skip Liquid set-body content when discovering named values, while preserving ordinary policy references and original extracted artifacts. Handle CDATA, comments, nested body tags, and attribute variations. Add scanner and service/fragment extraction regression coverage.Closes #276