Skip to content

fix(ci): handle schedule event in change_detector and actually trigger all-changed#40105

Merged
hainenber merged 1 commit into
masterfrom
fix/change-detector-schedule-event
May 14, 2026
Merged

fix(ci): handle schedule event in change_detector and actually trigger all-changed#40105
hainenber merged 1 commit into
masterfrom
fix/change-detector-schedule-event

Conversation

@rusackas
Copy link
Copy Markdown
Member

SUMMARY

The daily scheduled CodeQL scan has been failing on master with:

EVENT_TYPE schedule
ValueError: Unsupported event type

…because scripts/change_detector.py only handled pull_request, push, and workflow_dispatch events, and CodeQL's schedule trigger (cron: "0 4 * * *") hits the unhandled else branch. Example: https://github.com/apache/superset/actions/runs/25843430105/job/75933296431

This was masked because the same commit also got a push-triggered Analyze run that succeeded, so the failure only shows up on whichever commit is master HEAD when the cron fires.

What this PR does

  • Add a schedule branch alongside workflow_dispatch. Both trigger types aren't tied to a specific diff, so both should treat every group as changed.
  • Fix a latent bug while here: the workflow_dispatch branch printed "assuming all changed" but actually triggered nothing — it left files = [], and detect_changes([], ...) returns False, so no group flag was set in the output. Setting files = None makes the existing files is None or detect_changes(...) short-circuit fire for every group, matching the printed intent. Same fix benefits both event types.
  • Include the unsupported event name in the ValueError message so future surprises are easier to debug.
  • Mypy plumbing: files: Optional[List[str]] and a None guard on the len(files) >= 99 check.

Verified locally

$ python scripts/change_detector.py --event-type schedule --sha <sha> --repo apache/superset
SHA: ...
EVENT_TYPE schedule
schedule run, assuming all changed
Triggering group: python
Triggering group: frontend
Triggering group: docker
Triggering group: docs
Triggering group: superset-extensions-cli

Same output for --event-type workflow_dispatch. pull_request and push paths untouched.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A.

TESTING INSTRUCTIONS

After merge, the next scheduled CodeQL run (cron: 04:00 UTC) should complete cleanly instead of failing with Unsupported event type. Or trigger a workflow_dispatch run manually on the CodeQL workflow — Analyze should now actually run instead of silently skipping.

ADDITIONAL INFORMATION

  • Has associated issue:
  • 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

…r all-changed

The change_detector script raised ValueError on scheduled workflow
runs, breaking the daily CodeQL scan. Add a schedule branch alongside
the existing workflow_dispatch branch since both trigger types aren't
tied to a specific diff.

While here, fix a latent bug: the workflow_dispatch branch printed
"assuming all changed" but actually triggered nothing - it left
files = [], and detect_changes([], ...) returns False, so no group
flag was set in the output. Setting files = None makes the
"files is None or detect_changes(...)" short-circuit fire for every
group, matching the printed intent. Same fix benefits both event
types.

Other touch-ups:
- Add the unsupported event name to the error message so future
  surprises are easier to debug.
- Type files as Optional[List[str]] (mypy required this once the
  None branch was added).
- Guard the len(files) check against None.
@dosubot dosubot Bot added the github_actions Pull requests that update GitHub Actions code label May 14, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 14, 2026

Code Review Agent Run #58f3f1

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 0a831c7..0a831c7
    • scripts/change_detector.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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

@github-actions github-actions Bot added risk:ci-script PR modifies scripts that execute in CI (supply chain risk) and removed github_actions Pull requests that update GitHub Actions code labels May 14, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.14%. Comparing base (d1e9a5d) to head (0a831c7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #40105   +/-   ##
=======================================
  Coverage   64.14%   64.14%           
=======================================
  Files        2590     2590           
  Lines      138030   138030           
  Branches    32019    32019           
=======================================
  Hits        88543    88543           
  Misses      47968    47968           
  Partials     1519     1519           
Flag Coverage Δ
hive 39.44% <ø> (ø)
mysql 59.14% <ø> (ø)
postgres 59.21% <ø> (ø)
presto 41.13% <ø> (ø)
python 60.65% <ø> (ø)
sqlite 58.85% <ø> (ø)
unit 100.00% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

@hainenber
Copy link
Copy Markdown
Contributor

LGTM!

@hainenber hainenber merged commit e56883b into master May 14, 2026
67 of 68 checks passed
@hainenber hainenber deleted the fix/change-detector-schedule-event branch May 14, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:ci-script PR modifies scripts that execute in CI (supply chain risk) size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants