Skip to content

fix(tests): restore 100% TypeScript coverage for core packages#38682

Merged
michael-s-molina merged 2 commits intomasterfrom
fix/core-packages-ts-coverage
Mar 17, 2026
Merged

fix(tests): restore 100% TypeScript coverage for core packages#38682
michael-s-molina merged 2 commits intomasterfrom
fix/core-packages-ts-coverage

Conversation

@rusackas
Copy link
Copy Markdown
Member

@rusackas rusackas commented Mar 17, 2026

User description

SUMMARY

The codecov/project/core-packages-ts check has been failing on every PR since #38361, which added the GranularExportControls feature flag to the FeatureFlag enum but didn't add corresponding tests. This caused the coverage to drop from 100% to 99.92%.

This follows the same pattern as #38518 (which previously achieved 100% coverage): add explicit tests for any new feature flag enum members to keep the core-packages-ts coverage check green.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

  • Run npm run core:cover in superset-frontend/ — should pass with 100% coverage
  • The codecov/project/core-packages-ts CI check should go back to 100%

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

CodeAnt-AI Description

Add tests for GranularExportControls feature flag to restore 100% core TypeScript coverage

What Changed

  • Added a test that the GranularExportControls feature-flag enum equals 'GRANULAR_EXPORT_CONTROLS'
  • Added a test that isFeatureEnabled returns true when GRANULAR_EXPORT_CONTROLS is set on window.featureFlags

Impact

✅ Stable 100% TypeScript coverage for core packages
✅ Fewer CI coverage failures
✅ Clearer feature-flag behavior for export controls

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Add tests for the GranularExportControls feature flag introduced in
#38361, which caused the core-packages-ts codecov check to drop from
100% to 99.92%.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Mar 17, 2026

Code Review Agent Run #56e164

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 4c78ae9..4c78ae9
    • superset-frontend/packages/superset-ui-core/test/utils/featureFlag.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ 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 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

@codeant-ai-for-open-source codeant-ai-for-open-source Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Mar 17, 2026
@codeant-ai-for-open-source
Copy link
Copy Markdown
Contributor

Sequence Diagram

This PR adds targeted unit tests for the new GranularExportControls feature flag. The tests verify both the enum string mapping and that the flag is recognized as enabled when present in window feature flags, restoring full TypeScript coverage.

sequenceDiagram
    participant TestRunner
    participant FeatureFlagEnum
    participant BrowserWindow
    participant FeatureCheck

    TestRunner->>FeatureFlagEnum: Read GranularExportControls value
    FeatureFlagEnum-->>TestRunner: GRANULAR_EXPORT_CONTROLS
    TestRunner->>BrowserWindow: Set featureFlags with GRANULAR_EXPORT_CONTROLS true
    TestRunner->>FeatureCheck: Call isFeatureEnabled with GranularExportControls
    FeatureCheck->>BrowserWindow: Read feature flag state
    FeatureCheck-->>TestRunner: Return true and assertion passes
Loading

Generated by CodeAnt AI

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 17, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 46ba848
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69b99146f5873800089f06b8
😎 Deploy Preview https://deploy-preview-38682--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codeant-ai-for-open-source codeant-ai-for-open-source Bot added size:S This PR changes 10-29 lines, ignoring generated files and removed size:S This PR changes 10-29 lines, ignoring generated files labels Mar 17, 2026
@michael-s-molina michael-s-molina merged commit 91986ff into master Mar 17, 2026
76 of 77 checks passed
@michael-s-molina michael-s-molina deleted the fix/core-packages-ts-coverage branch March 17, 2026 18:28
@bito-code-review
Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

MallikarjunaReddyN pushed a commit to MallikarjunaReddyN/superset that referenced this pull request Mar 18, 2026
…e#38682)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Joe Li <joe@preset.io>
birkskyum pushed a commit to birkskyum/superset that referenced this pull request Mar 18, 2026
…e#38682)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Joe Li <joe@preset.io>
Mayankaggarwal8055 pushed a commit to Mayankaggarwal8055/superset that referenced this pull request Mar 20, 2026
…e#38682)

Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Joe Li <joe@preset.io>
michael-s-molina pushed a commit that referenced this pull request Mar 20, 2026
Co-authored-by: Claude Code <noreply@anthropic.com>
Co-authored-by: Joe Li <joe@preset.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages preset-io size/S size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants