orchard/internal
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
..
bootstraptoken Certificate-less bootstrap tokens (#93) 2023-06-23 00:53:03 +04:00
certificatefingerprint controller run: make bootstrap process more user-friendly (#201) 2024-09-03 18:54:28 +04:00
command Add pagination support for listing VM events (#386) 2026-01-22 09:22:53 -05:00
concurrentmap More RPC-related logs (#136) 2023-09-27 20:16:00 +04:00
config Use a separate lock file on Windows to protect configuration (#216) 2024-11-01 22:38:25 +04:00
controller Add pagination support for listing VM events (#386) 2026-01-22 09:22:53 -05:00
imageconstant Support "tart run"'s --net-softnet-allow and --net-softnet-block (#361) 2025-10-27 23:07:43 +04:00
netconncancel Prevent goroutine leak when Close()'ing *grpc_net_conn.Conn (#237) 2025-01-23 18:17:14 +04:00
netconstants Support for prefixed Orchard Controller API URLs (#355) 2025-10-06 20:04:47 +04:00
opentelemetry Bump go.opentelemetry.io/otel/sdk/metric from 1.27.0 to 1.34.0 (#257) 2025-02-20 02:19:11 +04:00
orchardhome Use os.MkdirAll instead of os.Mkdir to create Orchard's home directory (#96) 2023-06-26 19:35:50 +04:00
proxy Orchard Controller: implement an SSH server that acts as a jump host (#179) 2024-06-11 19:32:45 +04:00
responder Switch from golang.org/x/net/websocket to nhooyr.io/websocket and handle NotFound errors (#105) 2023-07-04 18:10:41 +04:00
simplename Orchard Controller: implement an SSH server that acts as a jump host (#179) 2024-06-11 19:32:45 +04:00
structpath orchard create vm: support --image-pull-policy=Always (#110) 2023-07-26 17:43:14 +04:00
tests Add pagination support for listing VM events (#386) 2026-01-22 09:22:53 -05:00
version Prepare for release (#37) 2023-03-20 15:28:24 -04:00
worker Worker: define VM interface and make tart.VM conform to it (#388) 2026-01-21 18:57:22 +01:00