Skip to content

fix(logs): match server LogEvent body field, docs fixes (VOL-648 sub-tickets) - #149

Merged
swkeever merged 7 commits into
mainfrom
skeever/vol-648-frontend-hosting-feedback
Jul 30, 2026
Merged

fix(logs): match server LogEvent body field, docs fixes (VOL-648 sub-tickets)#149
swkeever merged 7 commits into
mainfrom
skeever/vol-648-frontend-hosting-feedback

Conversation

@swkeever

@swkeever swkeever commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes for VOL-648 sub-tickets scoped to volcano-cli:

  • VOL-636: volcano-hosting renamed LogEvent's content field from message (string) to body (oneOf string/object/array/number/boolean) in a prior release, but the vendored OpenAPI spec and generated client here were never updated — volcano cloud frontends logs/volcano functions logs streamed blank lines for every event since event.Message no longer existed in the API response. Regenerated the client from a corrected spec and updated both log-rendering call sites and the affected tests.
  • VOL-645: docs/databases.md's --region example used a plain AWS region (us-east-1); the API expects Neon-style aws-<region> identifiers and 400s otherwise. Fixed the example.
  • VOL-646: investigated "no CLI/API way to retrieve a project's anon key" — found this already fully shipped (volcano projects keys, PR feat(cli): add 'volcano projects keys' command to retrieve a project's anon key #86) but undocumented in the CLI overview, so a user searching under cloud wouldn't find it. Added it to docs/README.md.

VOL-640 (setup --harness/--yes mutual exclusivity) is scoped to a different in-flight ticket and not touched here — also independently already resolved on main (--agent rename, PR #146).

Ticket

VOL-648 (umbrella, cancelled as duplicate) — sub-tickets VOL-636, VOL-645, VOL-646

Todo (gates — each requires evidence)

  • Ownership confirmed and ticket In Progress
  • Research prior art and relevant UI/UX guidance (n/a — CLI/docs only)
  • Finalize the implementation plan and acceptance checks
  • Regenerate OpenAPI client for LogEvent/LogSearchEvent body field (VOL-636)
  • Fix region format + surface projects keys docs (VOL-645/VOL-646)
  • Add or update automated tests
  • Run focused and broader local validation — commands listed under Testing
  • Verify the integrated flow in a local browser, or record why not applicable
  • self-review-work clean — cycles: 3, final pass no blockers
  • Required CI checks passing
  • Merged to default branch — commit 057dbacc
  • Staging validation succeeded — see Testing (CLI has no separate "deployment"; validated by running the built binary against the live staging API)
  • Staging smoke test passed — see Testing
  • Jira tickets moved to Done — VOL-636, VOL-645, VOL-646

Prior Art

  • internal/output/functions.go's existing pattern for other oapi-codegen oneOf union types — reused the MarshalJSON/string-unmarshal accessor pattern rather than inventing a new one.

Testing

  • make openapi-generated-check
  • make test (now passes cleanly, go build ./... + go vet ./... clean)
  • make lint — fails on a pre-existing, unrelated issue in internal/auth/auth.go (stale //nolint:contextcheck directive now flagged as unused); reproduced on a clean origin/main checkout with none of this branch's changes, so it predates this PR. Flagged separately for its own fix.
  • self-review-work: 3 cycles.
    • Round 1: the null-body case in the new table test only proved no panic — asserted nothing about the rendered output. Fixed by asserting the render doesn't contain the literal "null".
    • Round 2: no blocking findings. Two optional nits — LogEvent/LogSearchEvent render helpers' test-fixture builders still named their string param message post-rename (fixed for consistency with client_test.go's already-renamed logsResponse); extra LogSearchEvent non-string coverage suggested but skipped as low-value (shares the same bodyText helper LogEvent already covers for all variants).
    • Separately, self-caught (not a review finding): running the full go test ./... — broader than either review pass's own scope of "packages touched by the diff" — surfaced that internal/cmd/frontends, internal/cmd/functions, and internal/logfollow still built their test log fixtures with the old message field, so TestFrontendsLogs/TestFunctionsLogs silently asserted on blank rendered output, and internal/logfollow's stream tests hung indefinitely (the follow loop never observed a non-empty body to detect progress). Fixed all three files' fixtures to use body.
    • Round 3 (confirming pass after the fixture fixes and a param-naming cleanup): no blocking findings.
  • Local browser: N/A (CLI-only change; verified via unit tests)
  • Staging smoke test: pending merge

swkeever added 3 commits July 30, 2026 11:13
volcano-hosting renamed LogEvent's content field from message (string) to
body (oneOf string/object/array/number/boolean), but the vendored OpenAPI
spec and generated client were never updated. Build/publish log streaming
rendered blank lines for every event since event.Message no longer existed
in the API response.

Regenerate the client from the corrected spec and render the union body
type for both function log commands.

VOL-636
Database regions are Neon-style aws-<region> identifiers (e.g.
aws-us-east-1); the example used a plain AWS region and would 400.

volcano projects keys already returns a project's anon/publishable keys
for browser SDK use, but wasn't mentioned in the CLI overview.

VOL-645, VOL-646
internal/api's own test fixtures and assertions still referenced the old
LogSearchEvent.Message field/JSON key, missed in the initial client.gen.go
regeneration for the message->body rename.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

swkeever added 4 commits July 30, 2026 11:56
--region's usage string gave no hint of the aws-<aws-region> format the API
expects, so a --help user could still hit the same 400 the docs fix
addresses. Also add array/number/boolean/null coverage for LogEvent body
rendering alongside the existing string/object cases.
The null-body case in TestLogEventsRendersEveryBodyVariant only proved
no panic; assert the rendered line actually stays empty so a
regression that prints the literal "null" would be caught.
internal/cmd/frontends, internal/cmd/functions, and internal/logfollow
still built test log events with the old "message" field, so their
fixtures silently decoded to an empty body under the regenerated
client and left TestFrontendsLogs/TestFunctionsLogs asserting on blank
output. internal/logfollow's stream tests additionally hung: the
follow loop never observed a non-empty body to detect stream progress,
so it blocked forever on the next read instead of failing fast.
These test helpers build the "body" wire field but still named the
parameter "message" from before the server-side rename, same as
client_test.go's logsResponse already does.
@swkeever
swkeever marked this pull request as ready for review July 30, 2026 17:35
@swkeever
swkeever requested a review from a team as a code owner July 30, 2026 17:35
Copilot AI review requested due to automatic review settings July 30, 2026 17:35
@swkeever
swkeever merged commit 057dbac into main Jul 30, 2026
9 of 10 checks passed
@swkeever
swkeever deleted the skeever/vol-648-frontend-hosting-feedback branch July 30, 2026 17:37
@kong-volcano-app kong-volcano-app Bot mentioned this pull request Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates log handling to match the server’s polymorphic body field and corrects database/project documentation.

Changes:

  • Regenerates API log models and renders all supported body types.
  • Updates log fixtures and regression tests.
  • Corrects database-region guidance and documents project anon keys.

Reviewed changes

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

Show a summary per file
File Description
openapi/openapi.yaml Defines the new log body schema.
internal/apiclient/client.gen.go Regenerates log models and unions.
internal/output/functions.go Renders polymorphic log bodies.
internal/output/functions_test.go Tests body variants and null handling.
internal/logfollow/follow_test.go Updates streaming fixtures.
internal/cmd/functions/logs_test.go Updates function-log fixtures.
internal/cmd/frontends/logs_test.go Updates frontend-log fixtures.
internal/api/log_stream_test.go Verifies streamed body decoding.
internal/api/frontends_test.go Updates frontend API assertions.
internal/api/client_test.go Adds body extraction test support.
internal/cmd/databases/create.go Clarifies region flag help.
docs/README.md Documents project anon-key retrieval.
docs/databases.md Corrects database region examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

},
}
cmd.Flags().StringVar(&region, "region", "", "Database region")
cmd.Flags().StringVar(&region, "region", "", "Database region (aws-<aws-region>, e.g. aws-us-east-1)")
Comment thread docs/databases.md
# Create a database (defaults to type volcano-db-xs)
volcano databases create app
volcano databases create app --type volcano-db-s --region us-east-1
volcano databases create app --type volcano-db-s --region aws-us-east-1
Comment thread openapi/openapi.yaml
Comment on lines +9050 to +9051
nullable: true
oneOf:
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.

3 participants