Repository navigation
Conversation
Member
Author
|
blocked by devcontainers/images#1966 |
Code coverage overviewLanguages: Go Go / cli
View coverage of the 8 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical serialization regressions drop selected SDK union markers from JSON and MCP responses and bypass custom marshaling for types such as time.Time and netip.Addr, causing them to print as {}.
2 open issues
What changed in this PR
Migrates JSON handling across the Scaleway CLI to encoding/json/v2 and jsontext, covering command output, configuration, integrations, and test utilities.
Changes:
- Replaces legacy JSON APIs and adds formatting, ordering, and compatibility handling.
- Updates golden outputs to reflect changed empty-object omission behavior.
- Adjusts test isolation, cassette selection, and timestamp normalization.
| File | Description |
|---|---|
internal/qa/example.go |
Migrates example JSON handling. |
internal/namespaces/secret/v1beta1/custom_secret_version.go |
Migrates secret-version JSON handling. |
internal/namespaces/registry/v1/helpers_docker.go |
Uses v2 formatted writes for Docker configuration. |
internal/namespaces/registry/v1/custom_docker_helper.go |
Preserves deterministic registry-map output. |
internal/namespaces/redis/v1/testdata/test-endpoints-single-public-endpoint.golden |
Removes the empty public-network marker. |
internal/namespaces/rdb/v1/testdata/test-upgrade-instance-simple.golden |
Updates upgrade output omission expectations. |
internal/namespaces/rdb/v1/testdata/test-update-instance-update-instance-tags.golden |
Updates tag-change output expectations. |
internal/namespaces/rdb/v1/testdata/test-update-instance-update-instance-name.golden |
Updates rename output expectations. |
internal/namespaces/rdb/v1/testdata/test-update-instance-set-a-timezone.golden |
Updates timezone-change output expectations. |
internal/namespaces/rdb/v1/testdata/test-update-instance-modify3-settings+-add-a-new-one.golden |
Updates multi-setting output expectations. |
internal/namespaces/rdb/v1/testdata/test-update-instance-modify-default-work-mem-from4-to8mb.golden |
Updates memory-setting output expectations. |
internal/namespaces/rdb/v1/testdata/test-list-instance-simple.golden |
Removes empty load-balancer markers from list output. |
internal/namespaces/rdb/v1/testdata/test-get-instance-simple.golden |
Removes empty load-balancer markers from instance output. |
internal/namespaces/rdb/v1/testdata/test-endpoint-list-multiple-endpoints.golden |
Updates endpoint-list omission expectations. |
internal/namespaces/rdb/v1/testdata/test-endpoint-get-public.golden |
Removes the empty public-endpoint marker. |
internal/namespaces/rdb/v1/testdata/test-endpoint-create-public.golden |
Updates public-endpoint creation output. |
internal/namespaces/rdb/v1/testdata/test-endpoint-create-private-static.golden |
Updates static private-endpoint creation output. |
internal/namespaces/rdb/v1/testdata/test-endpoint-create-private-ipam.golden |
Updates IPAM private-endpoint creation output. |
internal/namespaces/rdb/v1/testdata/test-create-instance-simple.golden |
Updates instance-creation omission expectations. |
internal/namespaces/rdb/v1/testdata/test-create-instance-init-endpoints-with-public-and-static-private-endpoint.golden |
Updates mixed static-endpoint creation output. |
internal/namespaces/rdb/v1/testdata/test-create-instance-init-endpoints-with-public-and-ipam-private-endpoint.golden |
Updates mixed IPAM-endpoint creation output. |
internal/namespaces/rdb/v1/testdata/test-clone-instance-simple.golden |
Updates clone output omission expectations. |
internal/namespaces/object/v1/s3configfile.go |
Migrates S3 configuration JSON handling. |
internal/namespaces/object/v1/custom_marshaler.go |
Adapts formatted output and AWS metadata serialization. |
internal/namespaces/object/v1/custom_bucket_policy.go |
Formats policy JSON with jsontext.Value. |
internal/namespaces/object/v1/custom_bucket_lifecycle.go |
Migrates lifecycle JSON handling. |
internal/namespaces/object/v1/custom_bucket_cors.go |
Migrates CORS JSON handling. |
internal/namespaces/mnq/v1beta1/custom_nats_helpers.go |
Migrates NATS helper JSON handling. |
internal/namespaces/mcp/server/mcp_tools.go |
Uses v2 for formatted tool results. |
internal/namespaces/mcp/server/mcp_tools_test.go |
Migrates tool metadata serialization tests. |
internal/namespaces/mcp/server/mcp_resources.go |
Uses v2 for formatted resource results. |
internal/namespaces/login/login.go |
Migrates login JSON handling. |
internal/namespaces/k8s/v1/custom_execcredentials.go |
Uses v2 for formatted credentials output. |
internal/namespaces/k8s/v1/custom_execcredentials_test.go |
Migrates credentials JSON tests. |
internal/namespaces/inference/v1/testdata/test-deployment-create-simple-deployment.golden |
Removes the empty public-network marker. |
internal/namespaces/inference/v1/testdata/test-deployment-create-deployment-with-wait-flag.golden |
Updates waited deployment output expectations. |
internal/namespaces/inference/v1/testdata/test-create-deployment-private-endpoint-create-deployment-private-endpoint.golden |
Updates mixed-endpoint deployment output. |
internal/namespaces/inference/v1/custom_serverless_models.go |
Decodes model responses with UnmarshalRead. |
internal/namespaces/container/v1/testdata/test-update-container-simple.golden |
Removes the empty TCP probe marker. |
internal/namespaces/container/v1/testdata/test-update-container-registry-image.golden |
Updates image-change probe output expectations. |
internal/namespaces/container/v1/testdata/test-create-container-simple.golden |
Updates container-creation probe output expectations. |
internal/namespaces/container/v1/custom_logs.go |
Migrates container-log JSON handling. |
internal/namespaces/container/v1/custom_deploy.go |
Migrates deployment JSON handling. |
internal/namespaces/baremetal/v1/testdata/test-baremetal-list-offer-simple.golden |
Removes empty option-type markers from offer listings. |
internal/namespaces/baremetal/v1/testdata/test-baremetal-get-offer-simple.golden |
Removes empty option-type markers from offer details. |
internal/editor/marshal.go |
Uses v2 for formatted editor JSON. |
core/testing.go |
Migrates JSON and adjusts test isolation and normalization. |
core/result.go |
Migrates result JSON handling. |
core/printer.go |
Adds v2 output options and empty-struct fallback. |
core/human/marshal_func.go |
Migrates JSON use in human-readable formatting. |
core/example.go |
Migrates command-example JSON handling. |
core/error.go |
Adds explicit error JSON compatibility handling. |
core/build_info.go |
Migrates build-information JSON handling. |
Review effort: Balanced
Comment on lines
+288
to
+292
| opts := []json.Options{ | ||
| json.Deterministic(true), | ||
| json.FormatNilSliceAsNull(true), | ||
| json.FormatNilMapAsNull(true), | ||
| jsontext.EscapeForHTML(true), |
Comment on lines
+307
to
+308
| if noExportedFields(data) { | ||
| _, err := writer.Write([]byte("{}\n")) |
remyleone
marked this pull request as draft
November 3, 2026 10:19
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Community Note
Relates OR Closes #0000
Release note for CHANGELOG: