orchard/internal/controller
Fedor Korotkov 6fe523ef69
Add pagination support for listing VM events (#386)
* Add pagination support for listing VM events

Introduced a paginated event listing API, added support for pagination parameters in the request, and included cursor-based navigation using headers. Relevant tests and Badger store implementations were updated to support the new logic.

* Remove support for ordering VM events

Dropped `ListOrder` type, `order` query parameter, and related logic for ordering VM events. Updated tests, API schema, and Badger store to reflect the removal.

* Remove invalid VM events ordering test

Deleted a test case for invalid VM events ordering since the `order` query parameter and related functionality have been removed.

* Add support for ordering VM events

Implemented `order` query parameter for specifying sort order (ascending/descending) of VM events. Updated API schema, Badger store, and added related tests.

* Add support for limiting and ordering VM logs

Introduced `--limit` and `--order` flags for controlling the number of log lines and their sort order (ascending/descending). Updated API client to handle new options.

* Update internal/controller/store/badger/badger_events.go

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>

* fix: address PR review feedback

- switch logs CLI to --tail with desc ordering
- reuse ParseLogsOrder in controller with helpful errors
- always use ListEventsPage and scope event cursors
- move events pagination coverage to integration test

🤖 Generated with [Codex](https://chatgpt.com/codex)

Co-Authored-By: Codex <codex@openai.com>

* refactor: simplify prefix trimming and improve error formatting

- Replaced manual prefix check with `bytes.TrimPrefix` in Badger store.
- Enhanced error message formatting in VM logs controller.

* fix: address PR review feedback

- use suggested reverse seek in badger events pagination
- add events pagination client helper and use it in integration test

🤖 Generated with [Codex](https://chatgpt.com/codex)

Co-Authored-By: Codex <codex@openai.com>

---------

Co-authored-by: Nikolay Edigaryev <edigaryev@gmail.com>
Co-authored-by: Codex <codex@openai.com>
2026-01-22 09:22:53 -05:00
..
lifecycle Controller: emit lifecycle events when the VM gets restarted or deleted (#208) 2024-09-24 17:53:10 +04:00
notifier Small timout for worker notification (#242) 2025-02-06 17:30:09 +00:00
rendezvous Introduce WebSocket-based RPC v2 (#239) 2025-01-30 17:33:32 +04:00
scheduler Ability to set VM's power state and retrieve backing Tart VM's name (#373) 2025-12-02 16:43:17 -05:00
sshserver Small timout for worker notification (#242) 2025-02-06 17:30:09 +00:00
store Add pagination support for listing VM events (#386) 2026-01-22 09:22:53 -05:00
api.go Simplify state reconciliation and support changing Softnet settings (#364) 2025-11-06 20:56:31 +04:00
api_cluster_settings.go "--scheduler-profile" option to allow different orchestration patterns (#224) 2024-11-28 20:07:46 +04:00
api_controller.go Simplify state reconciliation and support changing Softnet settings (#364) 2025-11-06 20:56:31 +04:00
api_rpc_portforward.go Fix websocket.(*Conn).timeoutLoop goroutine leak (#329) 2025-07-11 15:23:50 +04:00
api_rpc_resolve_ip.go Introduce WebSocket-based RPC v2 (#239) 2025-01-30 17:33:32 +04:00
api_rpc_watch.go Fix websocket.(*Conn).timeoutLoop goroutine leak (#329) 2025-07-11 15:23:50 +04:00
api_service_accounts.go API: update service account fields on PUT (#198) 2024-08-21 20:03:52 +04:00
api_test.go REST API: provide error messages in error responses (#66) 2023-03-27 14:12:03 -04:00
api_vms.go Add pagination support for listing VM events (#386) 2026-01-22 09:22:53 -05:00
api_vms_ip.go Worker notification improvements (#246) 2025-02-07 00:38:04 +04:00
api_vms_portforward.go Fix websocket.(*Conn).timeoutLoop goroutine leak (#329) 2025-07-11 15:23:50 +04:00
api_workers.go ghcr.io/cirruslabs/macos-sequoia-base:latest for everything (#344) 2025-09-25 20:43:53 +04:00
api_workers_portforward.go Worker notification improvements (#246) 2025-02-07 00:38:04 +04:00
controller.go Badger store: avoid code duplication by using generic methods (#369) 2025-11-17 18:34:59 +04:00
datadir.go Orchard Controller: implement an SSH server that acts as a jump host (#179) 2024-06-11 19:32:45 +04:00
errorresponse.go REST API: provide error messages in error responses (#66) 2023-03-27 14:12:03 -04:00
option.go Support for prefixed Orchard Controller API URLs (#355) 2025-10-06 20:04:47 +04:00
rpc.go Introduce WebSocket-based RPC v2 (#239) 2025-01-30 17:33:32 +04:00
wserror.go Controller API: correctly detect WebSocket closure in Watch RPC (#259) 2025-02-20 02:00:57 +04:00