fix: activate flow schedules in the Scheduler Service (not just write the config)#481
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
fix: activate flow schedules in the Scheduler Service (not just write the config)#481devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
… the config) Co-Authored-By: Zora Jelínková <zora.jelinkova@keboola.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kbagent flow schedulecreated akeboola.schedulerconfig withstate=enabledbut never registered it with the Scheduler microservice, so the schedule was never activated and never fired — even though it looked "enabled" inschedule list/detail(those read the config field, not the Scheduler Service). The Keboola UI does two steps: write the config and activate it. We only did the first.In Keboola, a
keboola.schedulerconfig and an active schedule are distinct: the cron engine lives in a separate Scheduler service (scheduler.{stack}) that only runs schedules activated viaPOST /schedules {configurationId}(which also mints the schedule's token). This PR adds that activation step (and the symmetric deactivation on removal).client.py— new Scheduler Service sub-client (siblingscheduler.host, sameX-StorageApi-Token, same retry/backoff as queue/query/encryption)flow_service.set_flow_schedule— activate after writing the configActivation is production-only. On
--branch, the config is written but not activated (activated=false); dev-branch schedules activate on deploy to production, mirroring how the Scheduler Service operates on the default branch.flow_service.remove_flow_schedule— deactivate before deletingFor each matching
keboola.schedulerconfig, delete its Scheduler Service activation first, so removal no longer orphans an activation + token that would keep firing against a deleted config. Result gainsdeactivated_schedule_ids.CLI output
flow schedulenow prints whether the schedule was activated (or that a dev-branch schedule activates on deploy).Tests
test_client.py::TestSchedulerService— activate (with/without version), list+filter, deactivate hit the correctscheduler.host/method/body.test_flow_service.py— activation happens on production, is skipped on a dev branch, and removal deactivates only the matching registration.4226 passed, 8 skipped(ruff,ruff format,ty,changelog-checkall clean). Version bumped0.66.0 → 0.66.1with changelog +version-sync; gotcha + commands-reference updated.Note
I couldn't exercise this against a live stack (no scheduler-service round-trip in unit tests). The endpoint contract (
POST/GET/DELETE /schedules,configurationId= thekeboola.schedulerconfig id) should be confirmed against the Scheduler API before/at merge, or via a quick manualflow scheduleon a real project.Link to Devin session: https://app.devin.ai/sessions/b4ab934128864f6d9e4b841e828bcc9e