Split off from #11. The crontab Adopter implementation shipped in v1.0.0-rc.x as the reference. Implement the same backends.Adopter interface for vercel so cronix adopt --backend vercel works.
What ships
- vercel backend implements
backends.Adopter (interface in go/internal/backends/backend.go).
- Detection heuristic: find an unmanaged entry that invokes
cronix trigger <app>.<job> (the equivalent for this backend — e.g., on K8s, a CronJob whose container args end with trigger <app>.<job>).
- Divergence reporting: schedule, command tail, env, any other field that would change semantics under management.
- Idempotent: a second adopt run on an already-managed entry returns
AlreadyManaged=true with no action.
- Dry-run honored:
opts.DryRun=true must not modify the backend.
Acceptance criteria
Reference
See go/internal/backends/crontab/adopt.go and its test file for the contract every backend's Adopt implementation should satisfy. The crontab implementation is intentionally strict (exact tail match, exact schedule match) to set a conservative bar; per-backend implementations can relax this only where the backend has cleaner equality semantics (e.g. K8s API resource comparison).
Split off from #11. The crontab Adopter implementation shipped in v1.0.0-rc.x as the reference. Implement the same backends.Adopter interface for vercel so
cronix adopt --backend vercelworks.What ships
backends.Adopter(interface ingo/internal/backends/backend.go).cronix trigger <app>.<job>(the equivalent for this backend — e.g., on K8s, a CronJob whose container args end withtrigger <app>.<job>).AlreadyManaged=truewith no action.opts.DryRun=truemust not modify the backend.Acceptance criteria
go test ./internal/backends/vercel/... -run Adoptcovers: single-schedule success, dry-run, divergent schedule, already-managed, no-candidate, multi-schedule all-present, partial multi-schedule divergence.var _ backends.Adopter = (*Backend)(nil).operations/migrating-from-<backend>.mddocumenting the per-backend gotchas.Reference
See
go/internal/backends/crontab/adopt.goand its test file for the contract every backend's Adopt implementation should satisfy. The crontab implementation is intentionally strict (exact tail match, exact schedule match) to set a conservative bar; per-backend implementations can relax this only where the backend has cleaner equality semantics (e.g. K8s API resource comparison).