Skip to content

fix(extensions-cli): fail build and bundle when the frontend build fails - #44407

Open
mikebridge wants to merge 1 commit into
apache:masterfrom
mikebridge:sc-119473-extensions-cli-build-failure
Open

mikebridge wants to merge 1 commit into
apache:masterfrom
mikebridge:sc-119473-extensions-cli-build-failure

Conversation

@mikebridge

Copy link
Copy Markdown
Contributor

SUMMARY

Fixes the upstream CLI failure-propagation portion of SC-119473.

A real frontend npm build script (node -e "process.exit(1)") reproduces false success: both build and bundle returned exit 0, and bundle produced a manifest-only .supx after reporting the frontend failure. With this change both commands return exit 1, without writing a new manifest or archive.

The guard belongs at the build call site. rebuild_frontend retains its None-on-failure contract so the dev watcher can recover on a subsequent change. Backend-only builds remain unaffected. Existing archives are retained; callers must check the exit status.

Related downstream guard: https://github.com/preset-io/superset-shell/pull/5161. The unbounded apache-superset-core dependency pin is tracked separately in #42568 and is untouched.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

CLI-only change; no UI screenshots.

Real failing frontend build Before After
build exit status 0 1
bundle exit status 0 1
New archive Invalid, manifest-only .supx None

TESTING INSTRUCTIONS

From superset-extensions-cli, run pytest -o addopts='' -q tests/ with the local CLI and core packages importable. Result: 275 passed, with 15 existing Click/semver deprecation warnings. All applicable changed-file pre-commit hooks passed, including package MyPy, Ruff and custom pylint.

Updated parametrized tests cover failed build and bundle commands and the helper's nonzero compiler results. Two new command-level test functions cover successful/failed compiler propagation through real manifest/archive paths, rejection of stale frontend output on failure, and the registered dev callback recovering through success/failure/success without a live watcher thread.

Manual reproduction used an actual failing npm subprocess before and after the fix, not a mocked compiler. Before: exit 0 and a manifest-only archive. After: exit 1 and no new archive. No dependency installations or Docker builds were required.

ADDITIONAL INFORMATION

  • Has associated issue: SC-119473
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@bito-code-review

bito-code-review Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #81962d

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-extensions-cli/tests/test_cli_build.py - 1
    • Duplicated test setup · Line 204-206
      The frontend_dist setup (mkdir + write `remoteEntry.abc123.js`) is duplicated verbatim in `test_commands_propagate_frontend_result` (204-206) and `test_dev_watcher_recovers_after_frontend_failure` (240-242). If one test later changes the entry filename or layout, the other silently diverges. Consider a shared helper or fixture param.
Review Details
  • Files reviewed - 2 · Commit Range: 7218402..7218402
    • superset-extensions-cli/src/superset_extensions_cli/cli.py
    • superset-extensions-cli/tests/test_cli_build.py
  • Files skipped - 1
    • superset-extensions-cli/README.md - Reason: Filter setting
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.45%. Comparing base (00c2f22) to head (7218402).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #44407      +/-   ##
==========================================
+ Coverage   80.41%   80.45%   +0.03%     
==========================================
  Files        2932     2937       +5     
  Lines      174621   175249     +628     
  Branches    40559    40559              
==========================================
+ Hits       140419   140992     +573     
- Misses      31535    31590      +55     
  Partials     2667     2667              
Flag Coverage Δ
superset-extensions-cli 91.24% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@richardfogaca richardfogaca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Richard's agent here:

Reviewed 7218402767. No substantive issues found; approving.

Verified: bundle reaches the new non-zero exit through ctx.invoke(build), so it exits before reading a stale dist/manifest.json or writing an archive; the failure message is already emitted by rebuild_frontend, so the exit adds no duplicate output; dev is unchanged and its watcher still swallows a failed rebuild and publishes on the next success, which the new watcher test pins. The parametrized test that drives the real run_frontend_build seam for both commands is a good addition, since the old test literally asserted that a failed frontend still produced "Full build completed".

Validation: CI is green on this head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants