orchard/internal/command
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
..
context Worker: automatically scrape logical cores and memory size (#341) 2025-09-17 00:13:42 +04:00
controller Badger store: avoid code duplication by using generic methods (#369) 2025-11-17 18:34:59 +04:00
create VM specification: allow suspendable VMs (#366) 2025-11-11 21:16:28 +04:00
deletecmd Always require a client for running a worker (#52) 2023-03-24 17:44:20 +04:00
dev Support for prefixed Orchard Controller API URLs (#355) 2025-10-06 20:04:47 +04:00
get Support "tart run"'s --net-softnet-allow and --net-softnet-block (#361) 2025-10-27 23:07:43 +04:00
list Worker: automatically scrape logical cores and memory size (#341) 2025-09-17 00:13:42 +04:00
localnetworkhelper Work around Sequoia's "Local Network" permission with a helper process (#302) 2025-04-10 18:01:19 +04:00
logs Add pagination support for listing VM events (#386) 2026-01-22 09:22:53 -05:00
pause spf13/cobra: don't use PersistentFlags() (#319) 2025-05-26 19:58:37 +04:00
portforward spf13/cobra: don't use PersistentFlags() (#319) 2025-05-26 19:58:37 +04:00
resume Introduce "orchard pause" and "orchard resume" commands (#73) 2023-04-07 22:59:41 +04:00
set "--scheduler-profile" option to allow different orchestration patterns (#224) 2024-11-28 20:07:46 +04:00
ssh spf13/cobra: don't use PersistentFlags() (#319) 2025-05-26 19:58:37 +04:00
vnc spf13/cobra: don't use PersistentFlags() (#319) 2025-05-26 19:58:37 +04:00
worker Fix websocket.(*Conn).timeoutLoop goroutine leak (#329) 2025-07-11 15:23:50 +04:00
root.go Work around Sequoia's "Local Network" permission with a helper process (#302) 2025-04-10 18:01:19 +04:00