You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2026/05/11 09:08:30 UTC
[PR] feat(lifecycle): add cron scheduling for clone task [superset-kubernetes-operator]
villebro opened a new pull request, #41:
URL: https://github.com/apache/superset-kubernetes-operator/pull/41
## Summary
Adds a `cronSchedule` field to the clone lifecycle task that accepts a standard 5-field cron expression (e.g., `"0 2 * * *"`). When configured, the operator autonomously re-triggers the full lifecycle pipeline (clone → migrate → init) at each cron boundary — enabling CI-free periodic staging refreshes from production.
The schedule tick (most recent past time matching the expression) is included in the clone task's checksum inputs, so boundary crossings naturally cascade downstream through the existing chain propagation mechanism. The operator uses `RequeueAfter` to wake at the next cron tick.
Key design decisions:
- **No spec mutation** — the operator never patches `spec.lifecycle.clone.trigger`; avoids RBAC expansion, GitOps drift, and reconcile loops
- **Extensible type hierarchy** — `SchedulableBaseTaskSpec` extends `BaseTaskSpec`; enabling scheduling for init in the future requires switching its embedding (one-line CRD change) + adding the tick to `initInputs()` (~3 lines)
- **Pure checksum model** — no stored state needed; the schedule tick is derived from the clock on each reconcile
- **New `internal/schedule/` package** — pure Go, zero controller-runtime deps, uses `robfig/cron/v3` (same library as K8s CronJob controller)
## Details
- `SchedulableBaseTaskSpec` adds `cronSchedule` (MinLength=9, MaxLength=256)
- `CloneTaskSpec` embeds `SchedulableBaseTaskSpec` instead of `BaseTaskSpec`
- `TaskRefStatus` gains `lastScheduledAt` and `nextScheduleAt` fields
- Injectable `Now func() time.Time` on `SupersetReconciler` for deterministic testing
- `activeSchedules()` helper is pre-wired for future tasks — adding init scheduling requires one line
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(lifecycle): add cron scheduling for clone task [superset-kubernetes-operator]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #41:
URL: https://github.com/apache/superset-kubernetes-operator/pull/41#issuecomment-4419208159
## [Codecov](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/41?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `69.31818%` with `27 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 84.62%. Comparing base ([`1bf8e9b`](https://app.codecov.io/gh/apache/superset-kubernetes-operator/commit/1bf8e9b7aca79e3ba6d26cd029b1716757480cd5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`37e422f`](https://app.codecov.io/gh/apache/superset-kubernetes-operator/commit/37e422f121f17a19cf77e0b18002428ea182d387?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/41?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [internal/controller/superset\_controller.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/41?src=pr&el=tree&filepath=internal%2Fcontroller%2Fsuperset_controller.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvY29udHJvbGxlci9zdXBlcnNldF9jb250cm9sbGVyLmdv) | 58.92% | [18 Missing and 5 partials :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/41?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [internal/schedule/schedule.go](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/41?src=pr&el=tree&filepath=internal%2Fschedule%2Fschedule.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-aW50ZXJuYWwvc2NoZWR1bGUvc2NoZWR1bGUuZ28=) | 87.50% | [3 Missing and 1 partial :warning: ](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/41?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset-kubernetes-operator/pull/41?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat(lifecycle): add cron scheduling for clone task [superset-kubernetes-operator]
Posted by "villebro (via GitHub)" <gi...@apache.org>.
villebro merged PR #41:
URL: https://github.com/apache/superset-kubernetes-operator/pull/41
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org