Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/tests/lightspeed-install.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ describe('OLS UI', () => {
const args =
csv.spec.install.spec.deployments[0].spec.template.spec.containers[0].args.map(
(arg) =>
arg.startsWith('--console-image=')
? `--console-image=${Cypress.env('CONSOLE_IMAGE')}`
arg.startsWith('--console-image')
? arg.replace(/=.*/, `=${Cypress.env('CONSOLE_IMAGE')}`)
Comment on lines +176 to +177
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Apr 24, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Handle --console-image without =; current replacement can be a no-op.

When the arg is exactly --console-image, arg.replace(/=.*/, ...) does not inject the PR image. That means this path can still skip forcing the PR image.

Proposed fix
-                  (arg) =>
-                    arg.startsWith('--console-image')
-                      ? arg.replace(/=.*/, `=${Cypress.env('CONSOLE_IMAGE')}`)
-                      : arg,
+                  (arg) =>
+                    arg === '--console-image' || arg.startsWith('--console-image=')
+                      ? `--console-image=${Cypress.env('CONSOLE_IMAGE')}`
+                      : arg,
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
arg.startsWith('--console-image')
? arg.replace(/=.*/, `=${Cypress.env('CONSOLE_IMAGE')}`)
(arg) =>
arg === '--console-image' || arg.startsWith('--console-image=')
? `--console-image=${Cypress.env('CONSOLE_IMAGE')}`
: arg,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/tests/lightspeed-install.cy.ts` around lines 176 - 177, The current
conditional using arg.startsWith('--console-image') with arg.replace(/=.*/,
`=${Cypress.env('CONSOLE_IMAGE')}`) misses the case where arg is exactly
'--console-image'; update the logic in tests/tests/lightspeed-install.cy.ts (the
code handling each arg) to detect if arg === '--console-image' and return
`--console-image=${Cypress.env('CONSOLE_IMAGE')}`, otherwise perform the
existing replace to swap any existing value; this ensures the PR console image
is always injected whether the arg has an '=' or not.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We know that they all have the format --console-image.*=

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@kyoto, understood — since all --console-image args in the CSV are guaranteed to have an = (i.e., the format is always --console-image.*=), the arg.replace(/=.*/, ...) will always find a match and correctly substitute the PR image. My concern doesn't apply here. Thanks for the clarification!


📝 Learnings were identified and not saved (knowledge base disabled). Enable

: arg,
);

Expand Down