Skip to content

fix: align schedule API responses with contract - #1135

Merged
cvaroqui merged 3 commits into
opensvc:mainfrom
hugobrenet:fix/object-schedule-contract
Sep 28, 2026
Merged

cvaroqui merged 3 commits into
opensvc:mainfrom
hugobrenet:fix/object-schedule-contract

Conversation

@hugobrenet

Copy link
Copy Markdown
Contributor
  • Make schedule responses deterministic by sorting entries by object, node, key, action, and schedule.
  • Return the documented 400 response for invalid object kinds and 404 for unknown objects.
  • Serialize unset run timestamps as null and empty item collections as [].
  • Align the OpenAPI schema with runtime responses by fixing the ScheduleItem kind and declaring timestamps as nullable.
  • Properly propagate peer error responses and close proxied response bodies.
  • Share schedule item construction across node and instance endpoints and add regression tests.

Comment thread daemon/daemonapi/get_object_schedule.go
Co-authored-by: aikido-pr-checks[bot] <169896070+aikido-pr-checks[bot]@users.noreply.github.com>
Comment on lines +48 to +50
if resp.StatusCode == http.StatusNotFound {
resp.Body.Close()
continue

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.

🟡 Medium - Object schedule silently drops peers with no local instance

When the aggregate's replicated instance-config cache still lists a node whose local object configuration has already disappeared, that peer returns 404 No local instance (Trigger). The new branch treats every peer 404 as an empty contribution (Mechanism). The object endpoint then returns 200 with a partial schedule list and gives callers no indication that one configured instance was omitted (Consequence).

Show fix

Only ignore the peer's explicitly expected No schedule table cached response, or otherwise verify that the 404 represents a configured-but-unscheduled instance; propagate No local instance (and other missing-instance responses) so callers do not receive a falsely complete aggregate.

More info - Reply on this comment to give feedback or ignore the issue.

@cvaroqui
cvaroqui merged commit d737d37 into opensvc:main Sep 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants