refactor: migrate to new printer package#653
Open
avirtopeanu-ionos wants to merge 6 commits intomasterfrom
Open
refactor: migrate to new printer package#653avirtopeanu-ionos wants to merge 6 commits intomasterfrom
avirtopeanu-ionos wants to merge 6 commits intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates a large set of CLI commands from the legacy jsontabwriter/tabheaders/jsonpaths/resource2table printing stack to the newer unified internal/printer/table package, standardizing output rendering across multiple product areas.
Changes:
- Replace legacy output generation with
table.Sprint(...)andc.Out(...)across many commands. - Convert column definitions from
[]string+ jsonpaths to[]table.Column(with JSONPath + default visibility + optional formatters) and update--colshelp/completion. - Update log/verbose output calls to
c.Msg(...)/c.Verbose(...)in many commands, and introduce some resource-specific formatting/enrichment where needed.
Reviewed changes
Copilot reviewed 186 out of 186 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| commands/vpn/wireguard/peer/update.go | Switch peer update output to table.Sprint. |
| commands/vpn/wireguard/peer/peer.go | Convert peer columns to []table.Column; update --cols help/completion; minor doc apostrophe fix. |
| commands/vpn/wireguard/peer/list.go | Switch peer list output to table.Sprint with prefix items. |
| commands/vpn/wireguard/peer/get.go | Switch peer get output to table.Sprint. |
| commands/vpn/wireguard/peer/delete.go | Replace verbose output helper with c.Verbose. |
| commands/vpn/wireguard/peer/create.go | Switch peer create output to table.Sprint. |
| commands/vpn/wireguard/gateway/update.go | Switch gateway update output to table.Sprint. |
| commands/vpn/wireguard/gateway/list.go | Switch gateway list output to table.Sprint with prefix items. |
| commands/vpn/wireguard/gateway/get.go | Switch gateway get output to table.Sprint. |
| commands/vpn/wireguard/gateway/gateway.go | Convert gateway columns to []table.Column; update --cols help/completion. |
| commands/vpn/wireguard/gateway/delete.go | Replace verbose output helper with c.Verbose. |
| commands/vpn/wireguard/gateway/create.go | Switch gateway create output to table.Sprint. |
| commands/vpn/ipsec/tunnel/list.go | Switch tunnel list output to table.Sprint with prefix items. |
| commands/vpn/ipsec/tunnel/get.go | Switch tunnel get output to table.Sprint. |
| commands/vpn/ipsec/tunnel/delete.go | Replace verbose output helper with c.Verbose. |
| commands/vpn/ipsec/tunnel/create.go | Switch tunnel create output to table.Sprint. |
| commands/vpn/ipsec/gateway/update.go | Switch gateway update output to table.Sprint. |
| commands/vpn/ipsec/gateway/list.go | Switch gateway list output to table.Sprint with prefix items. |
| commands/vpn/ipsec/gateway/get.go | Switch gateway get output to table.Sprint. |
| commands/vpn/ipsec/gateway/gateway.go | Convert gateway columns to []table.Column; update --cols help/completion. |
| commands/vpn/ipsec/gateway/delete.go | Replace verbose output helper with c.Verbose. |
| commands/vpn/ipsec/gateway/create.go | Switch gateway create output to table.Sprint. |
| commands/vm-autoscaling/server/list.go | Switch output to table.Sprint; add server enrichment step before rendering. |
| commands/vm-autoscaling/server/get.go | Switch output to table.Sprint; add server enrichment step before rendering. |
| commands/vm-autoscaling/group/put.go | Switch group put output to table.Sprint. |
| commands/vm-autoscaling/group/list.go | Switch group list output to table.Sprint with prefix items. |
| commands/vm-autoscaling/group/get.go | Switch group get output to table.Sprint. |
| commands/vm-autoscaling/group/create.go | Switch group create output to table.Sprint. |
| commands/vm-autoscaling/action/list.go | Switch action list output to table.Sprint with prefix items. |
| commands/vm-autoscaling/action/get.go | Switch action get output to table.Sprint. |
| commands/vm-autoscaling/action/action.go | Convert action columns to []table.Column; update --cols help/completion. |
| commands/version.go | Replace legacy printer log/verbose output with c.Msg/c.Verbose. |
| commands/token/token.go | Convert token columns to []table.Column; update --cols help/completion. |
| commands/token/parse.go | Switch token-parse output to table.Sprint; define table columns for token info/privileges. |
| commands/token/list.go | Switch token list output to table.Sprint; migrate verbose contract message to c.Verbose. |
| commands/token/create.go | Switch token create output to c.Verbose/c.Msg for raw token string. |
| commands/root.go | Update output-format completion values to literals (json, text, api-json). |
| commands/monitoring/pipeline/update.go | Switch pipeline update print to table.Sprint. |
| commands/monitoring/pipeline/pipeline.go | Convert pipeline columns to []table.Column; update --cols help/completion. |
| commands/monitoring/pipeline/list.go | Switch pipeline list output to table.Sprint with prefix items. |
| commands/monitoring/pipeline/get.go | Switch pipeline get output to table.Sprint. |
| commands/monitoring/pipeline/delete.go | Replace verbose output helper with c.Verbose. |
| commands/monitoring/pipeline/create.go | Switch pipeline create output to table.Sprint. |
| commands/monitoring/key/create.go | Replace raw output helper with c.Msg for key printing. |
| commands/monitoring/central/get.go | Switch central get output to table.Sprint with prefix items. |
| commands/monitoring/central/central.go | Convert central columns to []table.Column; switch enable/disable output to table.Sprint. |
| commands/man.go | Replace legacy verbose/log printer usage with direct fmt.Fprintln messages. |
| commands/logging-service/pipeline/update.go | Remove per-command --cols flag (rely on parent); printing handled by shared helpers. |
| commands/logging-service/pipeline/pipeline.go | Convert pipeline columns to []table.Column; add persistent --cols and switch printing to table.Sprint. |
| commands/logging-service/pipeline/list.go | Switch pipeline list output to table.Sprint with prefix items. |
| commands/logging-service/pipeline/key.go | Print key via c.Msg. |
| commands/logging-service/pipeline/get.go | Remove per-command --cols flag (rely on parent). |
| commands/logging-service/pipeline/delete.go | Switch messages to c.Msg; rework delete-all prompt info extraction using table.New + Extract. |
| commands/logging-service/pipeline/create.go | Remove per-command --cols flag (rely on parent). |
| commands/logging-service/logs/update.go | Remove per-command --cols flag (rely on parent). |
| commands/logging-service/logs/remove.go | Switch success message to c.Msg; remove legacy printer imports. |
| commands/logging-service/logs/list.go | Remove per-command --cols flag (rely on parent). |
| commands/logging-service/logs/get.go | Switch logs get output to table.Sprint. |
| commands/logging-service/logs/add.go | Remove per-command --cols flag (rely on parent). |
| commands/logging-service/central/get.go | Switch central get output to table.Sprint with prefix items. |
| commands/logging-service/central/central.go | Convert central columns to []table.Column; switch enable/disable output to table.Sprint. |
| commands/kafka/user/user.go | Convert user columns to []table.Column; update --cols help/completion. |
| commands/kafka/user/list.go | Switch user list output to table.Sprint with prefix items. |
| commands/kafka/topic/topic.go | Convert topic columns to []table.Column; update --cols help/completion. |
| commands/kafka/topic/list.go | Switch topic list output to table.Sprint; refactor list-all aggregation to flatten items. |
| commands/kafka/topic/get.go | Switch topic get output to table.Sprint. |
| commands/kafka/topic/create.go | Switch topic create output to table.Sprint. |
| commands/kafka/cluster/list.go | Switch cluster list output to table.Sprint with prefix items. |
| commands/kafka/cluster/get.go | Switch cluster get output to table.Sprint. |
| commands/kafka/cluster/create.go | Switch cluster create output to table.Sprint. |
| commands/kafka/cluster/cluster.go | Convert cluster columns to []table.Column; update --cols help/completion. |
| commands/dbaas/postgres/version.go | Switch Postgres version output to table.Sprint with prefix data; migrate --cols help/completion. |
| commands/dbaas/postgres/user/user.go | Convert Postgres user columns to []table.Column. |
| commands/dbaas/postgres/user/update.go | Switch user update output to table.Sprint. |
| commands/dbaas/postgres/user/get.go | Switch user get output to table.Sprint; migrate --cols help/completion. |
| commands/dbaas/postgres/user/delete.go | Switch delete success message to c.Msg. |
| commands/dbaas/postgres/user/create.go | Switch user create output to table.Sprint. |
| commands/dbaas/postgres/database/get.go | Switch database get output to table.Sprint; remove per-command --cols setup (use parent). |
| commands/dbaas/postgres/database/delete.go | Switch delete success message to c.Msg. |
| commands/dbaas/postgres/database/database.go | Add persistent --cols and completion; convert columns to []table.Column. |
| commands/dbaas/postgres/database/create.go | Switch database create output to table.Sprint. |
| commands/dbaas/mongo/user/user.go | Convert Mongo user columns to []table.Column; add custom formatter for roles. |
| commands/dbaas/mongo/user/get.go | Switch get output to table.Sprint; migrate verbose message to c.Verbose. |
| commands/dbaas/mongo/user/delete.go | Switch delete output to table.Sprint; migrate verbose delete-all message to c.Verbose. |
| commands/dbaas/mongo/user/create.go | Switch create output to table.Sprint; migrate verbose message to c.Verbose. |
| commands/dbaas/mongo/templates/templates.go | Convert template columns to []table.Column; add RAM formatter. |
| commands/dbaas/mongo/templates/list.go | Switch list output to table.Sprint with prefix items; migrate verbose message to c.Verbose. |
| commands/dbaas/mongo/snapshot/snapshot.go | Convert snapshot columns to []table.Column. |
| commands/dbaas/mongo/snapshot/list.go | Switch list output to table.Sprint with prefix items; migrate verbose message to c.Verbose. |
| commands/dbaas/mongo/logs/logs.go | Convert logs columns to []table.Column. |
| commands/dbaas/mongo/cluster/update.go | Switch update output to table.Sprint. |
| commands/dbaas/mongo/cluster/restore.go | Migrate restore verbose message to c.Verbose. |
| commands/dbaas/mongo/cluster/list.go | Switch list output to table.Sprint with prefix items; migrate verbose message to c.Verbose. |
| commands/dbaas/mongo/cluster/get.go | Switch get output to table.Sprint; migrate verbose message to c.Verbose. |
| commands/dbaas/mongo/cluster/delete.go | Switch delete verbose messages to c.Verbose; migrate --cols help/completion to table. |
| commands/dbaas/mongo/cluster/create.go | Switch create output to table.Sprint. |
| commands/dbaas/mongo/apiversion/apiversion.go | Convert API version columns to []table.Column; switch output to table.Sprint. |
| commands/dbaas/mariadb/cluster/update.go | Switch update output to table.Sprint. |
| commands/dbaas/mariadb/cluster/list.go | Switch list output to table.Sprint with prefix items; migrate verbose message to c.Verbose. |
| commands/dbaas/mariadb/cluster/get.go | Switch get output to table.Sprint; migrate verbose message to c.Verbose. |
| commands/dbaas/mariadb/cluster/delete.go | Migrate delete verbose messages to c.Verbose; migrate --cols help/completion to table. |
| commands/dbaas/mariadb/cluster/create.go | Switch create output to table.Sprint. |
| commands/dbaas/mariadb/cluster/cluster.go | Convert cluster columns to []table.Column; migrate persistent --cols help/completion. |
| commands/dbaas/mariadb/backup/list.go | Switch list output to table.Sprint with prefix items. |
| commands/dbaas/mariadb/backup/get.go | Switch get output to table.Sprint. |
| commands/dbaas/mariadb/backup/backup.go | Convert backup columns to []table.Column; add custom size/items formatters; migrate persistent --cols. |
| commands/dbaas/inmemorydb/snapshot/snapshot.go | Convert snapshot columns to []table.Column; migrate --cols help/completion. |
| commands/dbaas/inmemorydb/snapshot/restore/restore.go | Convert restore columns to []table.Column; migrate --cols help/completion. |
| commands/dbaas/inmemorydb/snapshot/restore/list.go | Switch restore list output to table.Sprint with prefix items. |
| commands/dbaas/inmemorydb/snapshot/restore/create.go | Switch restore create output to table.Sprint. |
| commands/dbaas/inmemorydb/snapshot/list.go | Switch snapshot list output to table.Sprint with prefix items. |
| commands/dbaas/inmemorydb/replicaset/update.go | Switch update output to table.Sprint. |
| commands/dbaas/inmemorydb/replicaset/replicaset.go | Convert replicaset columns to []table.Column; migrate --cols help/completion. |
| commands/dbaas/inmemorydb/replicaset/list.go | Switch list output to table.Sprint with prefix items. |
| commands/dbaas/inmemorydb/replicaset/get.go | Switch get output to table.Sprint. |
| commands/dbaas/inmemorydb/replicaset/create.go | Switch create output to table.Sprint. |
| commands/container-registry/vulnerabilities/list.go | Switch vulnerabilities list output to table.Sprint with prefix items. |
| commands/container-registry/vulnerabilities/get.go | Switch vulnerability get output to table.Sprint. |
| commands/container-registry/token/tokens.go | Convert token columns to []table.Column; add persistent --cols help/completion. |
| commands/container-registry/token/scopes/scopes.go | Convert scope columns to []table.Column; add persistent --cols help/completion; add formatters. |
| commands/container-registry/token/scopes/list.go | Switch scopes list to table.New + Extract + Render; set ScopeId cells. |
| commands/container-registry/token/scopes/delete.go | Remove per-command --cols flag (rely on parent). |
| commands/container-registry/token/scopes/add.go | Switch add output to table.New + Extract + Render; set ScopeId cells. |
| commands/container-registry/token/put.go | Switch replace output to table.Sprint; change default cols behavior for password. |
| commands/container-registry/token/post.go | Switch create output to table.Sprint; change default cols behavior for password. |
| commands/container-registry/token/patch.go | Switch patch output to table.Sprint. |
| commands/container-registry/token/list.go | Switch list output to table.Sprint; handle registry aggregation. |
| commands/container-registry/token/get.go | Switch get output to table.Sprint. |
| commands/container-registry/token/delete.go | Remove per-command --cols flag (rely on parent). |
| commands/container-registry/repository/repository.go | Convert repository columns to []table.Column; add persistent --cols help/completion; keep deprecation note printing. |
| commands/container-registry/repository/list.go | Switch list output to table.Sprint with prefix items. |
| commands/container-registry/repository/get.go | Switch get output to table.Sprint. |
| commands/container-registry/repository/delete.go | Switch delete message to c.Msg. |
| commands/container-registry/registry/registries.go | Convert registry columns to []table.Column; add persistent --cols help/completion. |
| commands/container-registry/registry/put.go | Switch replace output to table.Sprint. |
| commands/container-registry/registry/post.go | Switch create output to table.Sprint. |
| commands/container-registry/registry/patch.go | Switch patch output to table.Sprint. |
| commands/container-registry/registry/list.go | Switch list output to table.Sprint; migrate verbose filtering message to c.Verbose. |
| commands/container-registry/registry/get.go | Switch get output to table.Sprint. |
| commands/container-registry/registry/delete.go | Migrate delete verbose message to c.Verbose; remove per-command --cols flag (rely on parent). |
| commands/container-registry/name/names.go | Switch name-check messages to c.Msg. |
| commands/container-registry/location/location.go | Convert location columns to []table.Column; switch list output to table.Sprint. |
| commands/container-registry/artifacts/list.go | Switch artifacts list output to table.Sprint; adjust default cols when listing all. |
| commands/container-registry/artifacts/get.go | Switch artifacts get output to table.Sprint. |
| commands/container-registry/artifacts/artifacts.go | Convert artifact columns to []table.Column; add persistent --cols help/completion; update completer extraction to use table.New. |
| commands/cert/provider/update.go | Switch provider update print to table.Sprint. |
| commands/cert/provider/provider.go | Convert provider columns to []table.Column; migrate --cols help/completion; update completer extraction to table.New. |
| commands/cert/provider/list.go | Switch provider list output to table.Sprint with prefix items. |
| commands/cert/provider/get.go | Switch provider get output to table.Sprint. |
| commands/cert/provider/delete.go | Migrate delete-all verbose message to c.Verbose. |
| commands/cert/provider/create.go | Switch provider create output to table.Sprint. |
| commands/cert/certificate/update.go | Switch certificate update output to table.Sprint; remove per-command --cols setup (use parent). |
| commands/cert/certificate/list.go | Switch certificate list output to table.Sprint with prefix items; migrate verbose message to c.Verbose. |
| commands/cert/certificate/get.go | Switch certificate get output to table.Sprint; migrate verbose message and cert/chain printing to c.Msg. |
| commands/cert/certificate/delete.go | Migrate delete verbose message to c.Verbose; remove per-command --cols setup (use parent). |
| commands/cert/certificate/create.go | Switch certificate create output to table.Sprint; remove per-command --cols setup (use parent). |
| commands/cert/certificate/certificate.go | Convert certificate columns to []table.Column; add persistent --cols help/completion; update completer extraction to table.New. |
| commands/cert/autocertificate/update.go | Switch autocert update print to table.Sprint. |
| commands/cert/autocertificate/list.go | Switch autocert list output to table.Sprint with prefix items. |
| commands/cert/autocertificate/get.go | Switch autocert get output to table.Sprint. |
| commands/cert/autocertificate/delete.go | Migrate delete-all verbose message to c.Verbose. |
| commands/cert/autocertificate/create.go | Switch autocert create output to table.Sprint. |
| commands/cert/autocertificate/autocertificate.go | Convert autocert columns to []table.Column; migrate --cols help/completion; update completer extraction to table.New. |
| commands/cert/api-version.go | Migrate API version verbose message to c.Verbose. |
| commands/cdn/distribution/update.go | Switch CDN distribution print to table.Sprint. |
| commands/cdn/distribution/list.go | Switch CDN distribution list output to table.Sprint. |
| commands/cdn/distribution/get.go | Switch CDN distribution get output to table.Sprint. |
| commands/cdn/distribution/distribution.go | Convert CDN distribution columns to []table.Column; migrate --cols help/completion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3ddb947 to 723f641 Compare |
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.



Migrates all commands except cloudapi to the new printer package introduced in 009a6e4