Skip to content

CROSSLINK-288 Add PUT endpoint#633

Open
JanisSaldabols wants to merge 1 commit into
mainfrom
CROSSLINK-288
Open

CROSSLINK-288 Add PUT endpoint#633
JanisSaldabols wants to merge 1 commit into
mainfrom
CROSSLINK-288

Conversation

@JanisSaldabols
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 5, 2026 11:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds update/enable/disable capabilities for scheduler “batch actions” by moving batch-action ownership metadata onto scheduled_task (removing the separate batch_action table) and exposing a new PUT endpoint for updating an existing batch action.

Changes:

  • Add owner to scheduled_task, migrate existing batch_action.owner data, and drop the batch_action table.
  • Update scheduler SQLC queries/repo methods to read/write/list scheduled tasks by owner for the batch-actions API.
  • Extend the scheduler API/OpenAPI and tests with PUT /batch_actions/{id} plus enable/disable endpoints.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
broker/sqlc/sched_schema.sql Adds owner to scheduled_task and owner-related indexes in the SQLC schema.
broker/sqlc/sched_query.sql Updates SQLC queries to persist/lookup/list/delete scheduled tasks with owner.
broker/scheduler/db/repo.go Replaces batch_action repo methods with owner-scoped scheduled_task methods.
broker/scheduler/api/api_handler.go Implements PUT + enable/disable and switches batch-actions API to scheduled_task storage.
broker/scheduler/api/api_handler_test.go Updates/expands tests to cover the new behavior and endpoints.
broker/oapi/open-api.yaml Adds PUT + enable/disable endpoints and extends BatchAction schema fields.
broker/migrations/044_add_owner_to_scheduled_task.up.sql Migrates owner into scheduled_task and drops batch_action.
broker/migrations/044_add_owner_to_scheduled_task.down.sql Recreates batch_action table and removes scheduled_task.owner.

Comment thread broker/oapi/open-api.yaml
Comment thread broker/sqlc/sched_query.sql
Comment thread broker/sqlc/sched_query.sql
Comment thread broker/sqlc/sched_query.sql
Comment thread broker/scheduler/api/api_handler.go
Comment thread broker/scheduler/api/api_handler.go
Comment thread broker/scheduler/api/api_handler.go
Comment thread broker/migrations/044_add_owner_to_scheduled_task.up.sql
ALTER TABLE scheduled_task
ADD COLUMN owner TEXT NOT NULL DEFAULT '';

UPDATE scheduled_task st
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JanisSaldabols could you rename payload column to action_data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants