Skip to content

SIR-1522 - cli v2 pre flight validation gate on raisely deploy no validate#68

Open
KeinerM wants to merge 5 commits intodevelopfrom
sir-1522-cli-v2-pre-flight-validation-gate-on-raisely-deploy-no-validate
Open

SIR-1522 - cli v2 pre flight validation gate on raisely deploy no validate#68
KeinerM wants to merge 5 commits intodevelopfrom
sir-1522-cli-v2-pre-flight-validation-gate-on-raisely-deploy-no-validate

Conversation

@KeinerM
Copy link
Copy Markdown

@KeinerM KeinerM commented May 6, 2026

What changed

  • Added a deploy pre-flight validation gate for campaign SCSS and component source.
  • Added --no-validate on raisely deploy to bypass validation when needed.
  • Deploy now exits before uploads when validation fails, and prints all failures with campaign/component context.
  • Added integration-style deploy tests covering:
    • bad SCSS validation
    • bad component validation
    • network failure during validation
    • --no-validate bypass
    • validation gating under --force
    • validation gating when cli: true
  • Migrated the CLI test suite from node:test to vitest.

Note

Medium Risk
Changes the deploy flow to run new pre-flight validation (SCSS transpiler + component parsing) and to fail fast before uploads, which can block deployments if validation behavior differs from production. Also adds a new test runner (vitest) and updates lockfile, increasing dependency/tooling change surface.

Overview
Adds a pre-flight validation gate to raisely deploy that validates campaign SCSS (via the transpiler service) and local component source before any uploads, and aborts the deploy with contextual campaign/component error messages when validation fails.

Introduces a --no-validate flag to bypass this gate, refactors deploy to support dependency injection for testing, and migrates the test suite from node:test to vitest with a new deploy test suite covering validation success/failure and bypass scenarios.

Reviewed by Cursor Bugbot for commit 4b95fa8. Bugbot is set up for automated code reviews on this repo. Configure here.

KeinerM and others added 2 commits May 6, 2026 12:25
Run campaign and component validators before any deploy uploads, add the --no-validate escape hatch, and stop the deploy with contextual errors when validation fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add explicit integration-style tests for bad SCSS, bad component, network failure, --no-validate bypass, and gate behavior under --force and cli mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
@KeinerM KeinerM requested a review from xolott-ark May 6, 2026 17:14
@KeinerM KeinerM self-assigned this May 6, 2026
Move the CLI test runner and all test files to Vitest while preserving existing test coverage and behavior. Add a shared Vitest config to support cwd-dependent tests and keep filenames standardized as *.test.js.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread src/deploy.js Outdated
Comment thread src/deploy.js
Comment thread src/deploy.js
Normalize malformed validator results into explicit deploy validation failures and stop the styles upload spinner on error before returning. Add coverage for malformed validator output to prevent regressions.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread src/deploy.js
Comment thread src/deploy.js Outdated
…IR-1522)

Limit pre-flight validation fan-out with bounded concurrency and treat a missing components directory as an empty component set. Add deploy test coverage for the missing-components path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4b95fa8. Configure here.

Comment thread src/deploy.js
};
})
),
];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Race condition in validation error handling

Medium Severity

The validation runs in parallel with a concurrency limit of 4, but the loader is started before all tasks begin. If validation fails very quickly (e.g., first batch fails), the loader shows "Validation passed" or "Deploy validation failed" before all validations complete, potentially missing errors from later batches.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4b95fa8. Configure here.

Comment thread src/deploy.js
if (result && typeof result === 'object' && typeof result.ok === 'boolean') {
return {
ok: result.ok,
error:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing error normalization for empty strings

Low Severity

The normalizeValidationResult function checks if result.error is a non-empty string with result.error.trim(), but doesn't handle the case where result.error is an empty string after trimming. This results in the fallback error being used even when an empty string error was explicitly provided.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4b95fa8. Configure here.

Comment thread src/deploy.js
}

if (options.validate !== false) {
const validationPassed = await runPreflightValidation({ config }, deps);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Token retrieval happens before validation option check

Low Severity

Authentication token is retrieved even when using --no-validate flag and validation might not require it. This causes unnecessary API calls and potential authentication prompts when skipping validation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4b95fa8. Configure here.

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