Context
Follow-up debt surfaced while reviewing the (now-closed) PR #19 "fix(logs): use project log search selectors".
That change moved function/frontend runtime + build log reads onto POST /projects/{id}/logs/search with the server's new nested resource selector ({type, ids, deployments:{ids}}).
Problem
The generated apiclient is stale: the typed body SearchProjectLogsJSONRequestBody (= common.LogSearchRequest) still carries the old flat shape (resource_type / resource_ids / bucket_count …) with no nested resource object.
To work around this, PR #19 hand-marshals a local logSearchRequest struct (internal/api/logs.go) and calls SearchProjectLogsWithBodyWithResponse instead of the typed SearchProjectLogsWithResponse. The same pattern was applied to GetProjectLogActivity (its apiclient test was rewritten to ...WithBody + a raw JSON literal).
This works today, but leaves a trap: any future caller using the typed SearchProjectLogsWithResponse will silently send the wrong wire format.
Proposed fix
Smaller related cleanup
Refs: PR #19, HOSTING-452.
Context
Follow-up debt surfaced while reviewing the (now-closed) PR #19 "fix(logs): use project log search selectors".
That change moved function/frontend runtime + build log reads onto
POST /projects/{id}/logs/searchwith the server's new nestedresourceselector ({type, ids, deployments:{ids}}).Problem
The generated apiclient is stale: the typed body
SearchProjectLogsJSONRequestBody(=common.LogSearchRequest) still carries the old flat shape (resource_type/resource_ids/bucket_count…) with no nestedresourceobject.To work around this, PR #19 hand-marshals a local
logSearchRequeststruct (internal/api/logs.go) and callsSearchProjectLogsWithBodyWithResponseinstead of the typedSearchProjectLogsWithResponse. The same pattern was applied toGetProjectLogActivity(its apiclient test was rewritten to...WithBody+ a raw JSON literal).This works today, but leaves a trap: any future caller using the typed
SearchProjectLogsWithResponsewill silently send the wrong wire format.Proposed fix
internal/apiclientfrom the updated OpenAPI spec soLogSearchRequest/ log-activity bodies match the nestedresourceshape.logSearchRequesttypes ininternal/api/logs.goand switch back to the typedSearchProjectLogs*WithResponsecalls.internal/api/logs.goexplaining why the typed body is intentionally bypassed, so it isn't "fixed" back to the broken typed call.Smaller related cleanup
internal/api/client_test.goandinternal/api/frontends_test.goroute runtime-vs-build/logs/searchresponses by call order (len(logSearchBodies)==1) rather than by request content. Branch on the body (e.g.resource.deployments != nil→ build) to make them robust, matching the approach already used in the command-level tests.Refs: PR #19, HOSTING-452.