Skip to content

Allow to use component.reference or component.sha#1836

Open
jrd wants to merge 1 commit intofirecow:masterfrom
jrd:master
Open

Allow to use component.reference or component.sha#1836
jrd wants to merge 1 commit intofirecow:masterfrom
jrd:master

Conversation

@jrd
Copy link
Copy Markdown

@jrd jrd commented Apr 20, 2026

When including another component B from a component A, allow to use @$[[ component.reference ]] notation for component B.

@jrd jrd changed the title Allow to use components.reference or components.sha Allow to use component.reference or component.sha Apr 20, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/parser-includes.ts Outdated
Comment thread src/parser-includes.ts Outdated
return text;
}
return text.replace(
/\$\[\[ *component.([a-z]+) *\]\]/g,
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Apr 20, 2026

Choose a reason for hiding this comment

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

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,
Fix with Cubic

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