fix(ci): handle schedule event in change_detector and actually trigger all-changed#40105
Conversation
…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.
Code Review Agent Run #58f3f1Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
LGTM! |
SUMMARY
The daily scheduled CodeQL scan has been failing on master with:
…because
scripts/change_detector.pyonly handledpull_request,push, andworkflow_dispatchevents, and CodeQL's schedule trigger (cron: "0 4 * * *") hits the unhandledelsebranch. Example: https://github.com/apache/superset/actions/runs/25843430105/job/75933296431This 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
schedulebranch alongsideworkflow_dispatch. Both trigger types aren't tied to a specific diff, so both should treat every group as changed.workflow_dispatchbranch printed "assuming all changed" but actually triggered nothing — it leftfiles = [], anddetect_changes([], ...)returnsFalse, so no group flag was set in the output. Settingfiles = Nonemakes the existingfiles is None or detect_changes(...)short-circuit fire for every group, matching the printed intent. Same fix benefits both event types.ValueErrormessage so future surprises are easier to debug.files: Optional[List[str]]and aNoneguard on thelen(files) >= 99check.Verified locally
Same output for
--event-type workflow_dispatch.pull_requestandpushpaths 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 aworkflow_dispatchrun manually on the CodeQL workflow — Analyze should now actually run instead of silently skipping.ADDITIONAL INFORMATION