Allow to use component.reference or component.sha#1836
Open
jrd wants to merge 1 commit intofirecow:masterfrom
Open
Allow to use component.reference or component.sha#1836jrd wants to merge 1 commit intofirecow:masterfrom
component.reference or component.sha#1836jrd wants to merge 1 commit intofirecow:masterfrom
Conversation
components.reference or components.shacomponent.reference or component.sha
Contributor
There was a problem hiding this comment.
2 issues found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/parser-includes.ts">
<violation number="1" location="src/parser-includes.ts:231">
P2: Regex in `expandWithRef` uses an unescaped `.` after `component`, so malformed placeholders can be matched and rewritten.</violation>
<violation number="2" location="src/parser-includes.ts:236">
P2: Unknown `component.*` placeholders are replaced with an empty string, causing silent corruption of include values.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| return text; | ||
| } | ||
| return text.replace( | ||
| /\$\[\[ *component.([a-z]+) *\]\]/g, |
Contributor
There was a problem hiding this comment.
P2: Regex in expandWithRef uses an unescaped . after component, so malformed placeholders can be matched and rewritten.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/parser-includes.ts, line 231:
<comment>Regex in `expandWithRef` uses an unescaped `.` after `component`, so malformed placeholders can be matched and rewritten.</comment>
<file context>
@@ -213,16 +213,32 @@ export class ParserIncludes {
+ return text;
+ }
+ return text.replace(
+ /\$\[\[ *component.([a-z]+) *\]\]/g,
+ (_match: string, name: any) => {
+ if (name === "version" || name === "reference" || name === "sha") {
</file context>
Suggested change
| /\$\[\[ *component.([a-z]+) *\]\]/g, | |
| /\$\[\[ *component\.([a-z]+) *\]\]/g, |
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.
When including another component B from a component A, allow to use
@$[[ component.reference ]]notation for component B.