Skip to content

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

Merged
KeinerM merged 9 commits into
developfrom
sir-1522-cli-v2-pre-flight-validation-gate-on-raisely-deploy-no-validate
May 8, 2026
Merged

SIR-1522 - cli v2 pre flight validation gate on raisely deploy no validate#68
KeinerM merged 9 commits into
developfrom
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

High Risk
Deploy now performs pre-upload SCSS/component validation and includes token-refreshing validator calls, plus new test tooling/deps; mistakes here could block deployments or mishandle auth/validation flows.

Overview
Adds a pre-flight validation gate to raisely deploy that validates campaign SCSS (via remote transpiler) and local component source, failing fast before any uploads and printing all errors with campaign/component context. Introduces --no-validate to bypass this gate when needed (validation still runs under --force/cli: true).

Adds new validator helpers (validateCampaignSass, validateComponent) including transpiler URL normalization, credential refresh-on-401, and graceful handling of malformed/failed validator responses, plus deploy-focused tests covering validation failures/bypass and network/auth edge cases. Migrates the test suite to vitest and updates test config/scripts.

Risk Assessment (Framework v2.0)

Dimension Tier Score Rationale
Security 1 Low No findings
Sensitive domains 1 Medium Touches token/credential refresh paths during validation (validateCampaignSass)
Data integrity 1 Low No data access changes
Deployment 1 Medium Changes deploy command behavior and adds build/test tooling (vitest)
Scope 2 Medium Moderate modifications to deploy flow plus new tests
Architecture 2 Low Changes are contained within CLI command/actions/tests
Feature flags 2 Low Internal CLI/tooling change; flags not applicable
Dependencies 2 High Adds vitest dev dependency and updates test script/config

Mitigating Factors

  • Adds targeted deploy/validation test coverage for failure and bypass scenarios.

Findings

# Finding Status Resolution
1 Validation now blocks deploy uploads; ensure error messaging and --no-validate behavior are acceptable for all workflows (CI and interactive). Open --

Outstanding findings: 1
Overall risk: HIGH
Decision: ESCALATE
Rationale: Two Tier 1 dimensions are Medium (auth-adjacent validation + deploy behavior change), and there is an open workflow-risk finding that warrants human review.

Reviewed by Cursor Bugbot for commit 4b76e0c. 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 Outdated
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>
Comment thread src/deploy.js
Comment thread src/deploy.js
Comment thread src/deploy.js Outdated
Drop createDeployDependencies and test-only dependency parameters from deploy while preserving behavior. Rewrite deploy tests to use Vitest module mocks instead of injected stubs.

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 1 potential issue.

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 1ffc4d6. Configure here.

Comment thread src/deploy.js Outdated
Copy link
Copy Markdown

@xolott-ark xolott-ark left a comment

Choose a reason for hiding this comment

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

One last change here 🙏

Comment thread package.json Outdated
KeinerM and others added 2 commits May 7, 2026 16:00
Remove deploy dependency-injection wiring in favor of direct module calls, and handle campaign lookup failures as controlled validation failures. Update deploy tests to use vi.mock module mocks and cover campaign lookup failure handling.

Co-authored-by: Cursor <cursoragent@cursor.com>
Pin runtime and dev dependencies to exact latest versions compatible with Node 18 and refresh the lockfile for reproducible installs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@KeinerM KeinerM requested a review from xolott-ark May 7, 2026 20:01
…-1522)

Pin the CLI Babel compiler toolchain to the known-compatible versions used by the compile flow and refresh the lockfile while keeping Node 18 compatibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
@KeinerM KeinerM merged commit c11b854 into develop May 8, 2026
1 check passed
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.

2 participants