fix(otel-collector): unblock Docker build after #730 apps/ normalization#745
fix(otel-collector): unblock Docker build after #730 apps/ normalization#745G4614 wants to merge 3 commits into
Conversation
…pm add-ons (cpu-features)
📝 WalkthroughWalkthroughAdds native build toolchain to the otel-collector Docker build stage, updates builder-config.yaml paths to the ChangesOTel Collector Build Configuration
API client OpenAPI defaults
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/api-client-go/api/openapi.yaml`:
- Line 9568: Constructors NewUpdateOrganizationMemberAccessWithDefaults and
NewCreateOrganizationInvitationWithDefaults leave AssignedRoleIds as nil which
causes ToMap()/MarshalJSON() to emit null instead of the OpenAPI default [];
update these constructors (and any similar factory funcs referenced around the
other occurrence) to initialize AssignedRoleIds to an empty slice (e.g.,
make([]Type, 0)) so the generated ToMap()/MarshalJSON() serializes
assignedRoleIds as [] and matches the OpenAPI default; reference
AssignedRoleIds, NewUpdateOrganizationMemberAccessWithDefaults,
NewCreateOrganizationInvitationWithDefaults, and ToMap()/MarshalJSON() when
making the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: cdb481ed-7798-4402-af2c-337fba48b1cd
📒 Files selected for processing (1)
apps/api-client-go/api/openapi.yaml
| assignedRoleIds: | ||
| default: | ||
| - 00000000-0000-0000-0000-000000000001 | ||
| default: [] |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether generated client defaults/serialization align with OpenAPI default: []
set -euo pipefail
echo "Checking UpdateOrganizationMemberAccess defaults + serialization"
rg -n -A12 -B3 'func NewUpdateOrganizationMemberAccessWithDefaults\(\)' apps/api-client-go/model_update_organization_member_access.go
rg -n -A12 -B3 'func \(o UpdateOrganizationMemberAccess\) ToMap\(\)' apps/api-client-go/model_update_organization_member_access.go
echo "Checking CreateOrganizationInvitation defaults + serialization"
rg -n -A12 -B3 'func NewCreateOrganizationInvitationWithDefaults\(\)' apps/api-client-go/model_create_organization_invitation.go
rg -n -A12 -B3 'func \(o CreateOrganizationInvitation\) ToMap\(\)' apps/api-client-go/model_create_organization_invitation.go
echo "Checking required-property validation on assignedRoleIds"
rg -n -A10 -B2 'requiredProperties := \[]string\{' apps/api-client-go/model_create_organization_invitation.goRepository: boxlite-ai/boxlite
Length of output: 2912
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "OpenAPI context around 9568/9598"
sed -n '9545,9615p' apps/api-client-go/api/openapi.yaml
echo "Inspect UpdateOrganizationMemberAccess struct fields + AssignedRoleIds type"
rg -n "type UpdateOrganizationMemberAccess struct" -n apps/api-client-go/model_update_organization_member_access.go
rg -n "AssignedRoleIds" apps/api-client-go/model_update_organization_member_access.go | head -n 50
sed -n '1,140p' apps/api-client-go/model_update_organization_member_access.go
echo "Inspect CreateOrganizationInvitation struct fields + AssignedRoleIds type"
rg -n "type CreateOrganizationInvitation struct" -n apps/api-client-go/model_create_organization_invitation.go
rg -n "AssignedRoleIds" apps/api-client-go/model_create_organization_invitation.go | head -n 80
sed -n '1,230p' apps/api-client-go/model_create_organization_invitation.go
echo "Find how ToMap() output is used/JSON marshaled in request bodies"
rg -n "ToMap\(\)" apps/api-client-go | rg -n "UpdateOrganizationMemberAccess|CreateOrganizationInvitation" | head -n 80
rg -n "UpdateOrganizationMemberAccessWithDefaults|CreateOrganizationInvitationWithDefaults" apps/api-client-go | head -n 80
# Also check whether request code uses json.Marshal(ToMap) or something that could transform nil->[].
rg -n "json\.Marshal\(.*ToMap\(\)" apps/api-client-go | head -n 80
rg -n "ToMap\(\).*json" apps/api-client-go | head -n 80Repository: boxlite-ai/boxlite
Length of output: 14920
OpenAPI default [] for assignedRoleIds isn’t applied by the Go client defaults
UpdateOrganizationMemberAccess.assignedRoleIds and CreateOrganizationInvitation.assignedRoleIds are required and set to default: [] in apps/api-client-go/api/openapi.yaml, but both NewUpdateOrganizationMemberAccessWithDefaults() and NewCreateOrganizationInvitationWithDefaults() only set Role and leave AssignedRoleIds as the Go zero value (nil slice). Since ToMap()/MarshalJSON() always serializes assignedRoleIds from AssignedRoleIds, requests built from these defaults can send assignedRoleIds: null instead of [], creating a schema/contract mismatch.
Also applies to: 9598-9598
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@apps/api-client-go/api/openapi.yaml` at line 9568, Constructors
NewUpdateOrganizationMemberAccessWithDefaults and
NewCreateOrganizationInvitationWithDefaults leave AssignedRoleIds as nil which
causes ToMap()/MarshalJSON() to emit null instead of the OpenAPI default [];
update these constructors (and any similar factory funcs referenced around the
other occurrence) to initialize AssignedRoleIds to an empty slice (e.g.,
make([]Type, 0)) so the generated ToMap()/MarshalJSON() serializes
assignedRoleIds as [] and matches the OpenAPI default; reference
AssignedRoleIds, NewUpdateOrganizationMemberAccessWithDefaults,
NewCreateOrganizationInvitationWithDefaults, and ToMap()/MarshalJSON() when
making the change.
Merging the substantive bits of #745 and #746 here so PR #724's deploy-app-services CI can actually push an otel-collector image: * otel-collector/builder-config.yaml: fix module paths after #730 moved everything under apps/ (was: ../../../api-client-go etc., now: ../../../apps/api-client-go). The OCB build was failing with `filepath does not exist: /boxlite/otel-collector/exporter`. (#745) * otel-collector/Dockerfile: apk add python3 make g++ so node-gyp can compile any musl-incompatible native add-on during workspace `yarn install`. Kept even after dropping dockerode below — small safety net in case future deps reintroduce a native build. (#745) * apps/package.json: drop unused dockerode + @types/dockerode. They were inherited from the Daytona import in #460 but never imported in source. Drops the dockerode -> docker-modem -> ssh2 -> cpu-features chain; cpu-features was the optional native addon that forced the toolchain workaround in the first place. (#746) * apps/yarn.lock: regenerated (-161 lines). * apps/api-client-go/api/openapi.yaml: regenerate to catch up with main's existing `assignedRoleIds.default: []` drift so the api-client-drift PR check passes.
… gone The previous commit kept #745's apk add as a safety net, but cpu-features was the only musl-incompatible native dep in the workspace and it came in only via the now-removed dockerode chain. Verified locally: yarn install on node:22-alpine completes without any compiler toolchain.
|
Closing — see follow-up plan |
Summary
Two commits restore
apps/otel-collectorDocker build, broken since #730 normalized the monorepo intoapps/:16873628add python3/make/g++ to build stage — node:alpine base lacks build toolchain;cpu-features@0.0.10(transitive yarn workspace native add-on) fails to compile duringyarn install --immutable.385c404afix builder-config paths —apps/otel-collector/builder-config.yamlstill references pre-apps/paths:path: otel-collector/exporter→apps/otel-collector/exporterreplaces: ../../../api-client-go→../../../apps/api-client-go(and same for common-go)Without these, OpenTelemetry collector builder errors with:
Background
Split out from PR #724's CI iteration. PR #724 added a generic deploy-app-services workflow exercising Proxy / OtelCollector / SshGateway builds; Proxy + SshGateway built+deployed cleanly, OtelCollector hit these two pre-existing bugs. Fix kept on a dedicated branch so #724 stays scoped to CI automation.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit