Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
This PR migrates the codebase from reflect.TypeOf(...) patterns to the generic reflect.TypeFor[T]() API for acquiring reflect.Type values without allocating sentinel values.
Changes:
- Replace
reflect.TypeOf(x{})/reflect.TypeOf((*T)(nil)).Elem()usages withreflect.TypeFor[T]()across commands, args, and human marshaling. - Update internal QA and multiple namespace command definitions to use
TypeForforArgsType. - Update unit tests accordingly to match the new type acquisition strategy.
Reviewed changes
Copilot reviewed 103 out of 103 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/qa/ignore.go | Use reflect.TypeFor for ignored error type matching. |
| internal/qa/argspec.go | Use reflect.TypeFor when checking for args.RawArgs arg types. |
| internal/namespaces/vpcgw/v2/custom_pat_rule.go | Update command ArgsType initialization to reflect.TypeFor. |
| internal/namespaces/vpc/v2/custom_acl.go | Update command ArgsType initialization to reflect.TypeFor. |
| internal/namespaces/test/v1/test_cli.go | Update test namespace commands ArgsType to reflect.TypeFor. |
| internal/namespaces/test/custom/custom_cli.go | Update custom test command ArgsType to reflect.TypeFor. |
| internal/namespaces/shell/shell.go | Update shell command ArgsType to reflect.TypeFor. |
| internal/namespaces/secret/v1beta1/custom_secret_version.go | Update builder-assigned ArgsType to reflect.TypeFor. |
| internal/namespaces/registry/v1/custom_tag.go | Update builder-assigned ArgsType to reflect.TypeFor. |
| internal/namespaces/registry/v1/custom_logout.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/registry/v1/custom_login.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/registry/v1/custom_docker_helper.go | Update multiple registry docker-helper command ArgsType values to reflect.TypeFor. |
| internal/namespaces/redis/v1/custom_version_settings.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/redis/v1/custom_cluster.go | Update builder/command ArgsType to reflect.TypeFor. |
| internal/namespaces/redis/v1/custom_acl.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/rdb/v1/custom_user.go | Update builder/command ArgsType to reflect.TypeFor. |
| internal/namespaces/rdb/v1/custom_url.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/rdb/v1/custom_log.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/rdb/v1/custom_instance.go | Update multiple builder/command ArgsType to reflect.TypeFor. |
| internal/namespaces/rdb/v1/custom_engine_settings.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/rdb/v1/custom_endpoint.go | Update builder/command ArgsType to reflect.TypeFor. |
| internal/namespaces/rdb/v1/custom_backup.go | Update builder/command ArgsType to reflect.TypeFor. |
| internal/namespaces/rdb/v1/custom_acl.go | Update builder/command ArgsType to reflect.TypeFor. |
| internal/namespaces/object/v1/custom_config_install.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/object/v1/custom_config_get.go | Update command ArgsType to reflect.TypeFor. |
| internal/namespaces/object/v1/custom_bucket_policy.go | Update bucket-policy commands ArgsType to reflect.TypeFor. |
| internal/namespaces/object/v1/custom_bucket_lifecycle.go | Update lifecycle commands ArgsType to reflect.TypeFor. |
| internal/namespaces/object/v1/custom_bucket_cors.go | Update bucket-cors commands ArgsType to reflect.TypeFor. |
| internal/namespaces/object/v1/custom_bucket.go | Update bucket commands ArgsType to reflect.TypeFor. |
| internal/namespaces/mongodb/v1alpha1/custom_instance.go | Update wait command ArgsType to reflect.TypeFor. |
| internal/namespaces/mnq/v1beta1/custom_nats.go | Update nats command ArgsType to reflect.TypeFor. |
| internal/namespaces/mcp/server/mcp_tools_test.go | Update MCP tool tests to use reflect.TypeFor for ArgsType. |
| internal/namespaces/mcp/server/list_tools.go | Update list-tools command ArgsType to reflect.TypeFor. |
| internal/namespaces/mcp/server/commands.go | Update MCP server commands ArgsType to reflect.TypeFor. |
| internal/namespaces/marketplace/v2/updated_commands.go | Update builder-assigned ArgsType to reflect.TypeFor. |
| internal/namespaces/login/login.go | Update login command ArgsType to reflect.TypeFor. |
| internal/namespaces/lb/v1/custom_lb.go | Update LB commands/builders ArgsType to reflect.TypeFor. |
| internal/namespaces/lb/v1/custom_certificate.go | Update builder-assigned ArgsType to reflect.TypeFor. |
| internal/namespaces/lb/v1/custom_backend.go | Update backend builders ArgsType to reflect.TypeFor. |
| internal/namespaces/k8s/v1/custom_pool_taints.go | Update k8s taint commands ArgsType to reflect.TypeFor. |
| internal/namespaces/k8s/v1/custom_pool_labels.go | Update k8s label commands ArgsType to reflect.TypeFor. |
| internal/namespaces/k8s/v1/custom_pool.go | Update k8s pool commands ArgsType to reflect.TypeFor. |
| internal/namespaces/k8s/v1/custom_node.go | Update k8s node wait ArgsType to reflect.TypeFor. |
| internal/namespaces/k8s/v1/custom_kubeconfig_uninstall.go | Update kubeconfig uninstall ArgsType to reflect.TypeFor. |
| internal/namespaces/k8s/v1/custom_kubeconfig_install.go | Update kubeconfig install ArgsType to reflect.TypeFor. |
| internal/namespaces/k8s/v1/custom_kubeconfig_get.go | Update kubeconfig get ArgsType to reflect.TypeFor. |
| internal/namespaces/k8s/v1/custom_cluster.go | Update k8s cluster wait ArgsType to reflect.TypeFor. |
| internal/namespaces/jobs/v1alpha2/custom_job_run.go | Update jobs wait ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_volume.go | Update instance volume builders/command ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_ssh_key.go | Update SSH key commands ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_ssh_config.go | Update ssh-config install ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_snapshot.go | Update snapshot builders/command ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_server_ssh.go | Update server ssh ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_server_rdp.go | Update get-rdp-password ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_server_delete.go | Update server delete ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_server_create.go | Update server create ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_server_console.go | Update server console ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_server_action.go | Update server action commands ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_server.go | Update server builders/commands ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_security_group.go | Update security-group builders/commands ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_placement_group.go | Update placement-group builders ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_ip.go | Update ip builders/commands ArgsType to reflect.TypeFor. |
| internal/namespaces/instance/v1/custom_image.go | Update image builders/commands ArgsType to reflect.TypeFor. |
| internal/namespaces/init/init.go | Update init command ArgsType to reflect.TypeFor. |
| internal/namespaces/info/custom.go | Update info command ArgsType to reflect.TypeFor. |
| internal/namespaces/inference/v1/custom_deployment.go | Update builder-assigned ArgsType to reflect.TypeFor. |
| internal/namespaces/iam/v1alpha1/custom_rule.go | Update IAM rule commands ArgsType to reflect.TypeFor. |
| internal/namespaces/iam/v1alpha1/custom_iam.go | Update custom builder argType to reflect.TypeFor. |
| internal/namespaces/iam/v1alpha1/custom.go | Update init-with-ssh command ArgsType to reflect.TypeFor. |
| internal/namespaces/function/v1beta1/custom_deploy.go | Update deploy command ArgsType to reflect.TypeFor. |
| internal/namespaces/edge_services/v1beta1/custom_route_rules.go | Update edit command ArgsType to reflect.TypeFor. |
| internal/namespaces/domain/v2beta1/custom_record_set.go | Update DNS record set ArgsType to reflect.TypeFor. |
| internal/namespaces/domain/v2beta1/custom_record_delete.go | Update DNS record delete ArgsType to reflect.TypeFor. |
| internal/namespaces/domain/v2beta1/custom_record_add.go | Update DNS record add ArgsType to reflect.TypeFor. |
| internal/namespaces/container/v1/custom_logs.go | Update logs command ArgsType to reflect.TypeFor. |
| internal/namespaces/container/v1/custom_deploy.go | Update deploy command ArgsType to reflect.TypeFor. |
| internal/namespaces/config/commands.go | Update config commands ArgsType to reflect.TypeFor; update getProfileKeys to use TypeFor. |
| internal/namespaces/cockpit/v1/custom_config_get.go | Update cockpit config get ArgsType to reflect.TypeFor. |
| internal/namespaces/block/v1alpha1/custom_volume.go | Update block volume wait ArgsType to reflect.TypeFor. |
| internal/namespaces/block/v1alpha1/custom_snapshot.go | Update block snapshot wait ArgsType to reflect.TypeFor. |
| internal/namespaces/billing/v2beta1/custom_invoice_export.go | Update invoice-export builder ArgsType to reflect.TypeFor. |
| internal/namespaces/billing/v2beta1/custom_invoice_download.go | Update invoice-download builder ArgsType to reflect.TypeFor. |
| internal/namespaces/baremetal/v1/custom_server_install.go | Update install builder ArgsType to reflect.TypeFor. |
| internal/namespaces/baremetal/v1/custom_server_fip.go | Update flexible IP command ArgsType to reflect.TypeFor. |
| internal/namespaces/baremetal/v1/custom_server_create.go | Update server create builder ArgsType to reflect.TypeFor. |
| internal/namespaces/baremetal/v1/custom_server.go | Update server wait ArgsType to reflect.TypeFor. |
| internal/namespaces/autocomplete/autocomplete.go | Update autocomplete commands ArgsType to reflect.TypeFor. |
| internal/namespaces/applesilicon/v1alpha1/custom_server_ssh.go | Update AppleSilicon ssh ArgsType to reflect.TypeFor. |
| internal/namespaces/applesilicon/v1alpha1/custom_server.go | Update AppleSilicon wait ArgsType to reflect.TypeFor. |
| internal/namespaces/alias/alias.go | Update alias commands ArgsType to reflect.TypeFor. |
| internal/gofields/gofields_test.go | Update gofields tests to use reflect.TypeFor for expected types. |
| internal/editor/request_test.go | Update editor request test to use reflect.TypeFor. |
| internal/args/unmarshal.go | Update unmarshal function registry keys to use reflect.TypeFor. |
| internal/args/marshal.go | Update marshal function registry keys to use reflect.TypeFor. |
| internal/args/args_test.go | Update args tests to use reflect.TypeFor for arg types. |
| core/validate_test.go | Update validation tests to use reflect.TypeFor for ArgsType. |
| core/human/marshal_func.go | Update marshaler func type registry and interface checks to reflect.TypeFor. |
| core/human/marshal.go | Update interface checks in Marshal/marshalStruct to reflect.TypeFor. |
| core/cobra_utils_test.go | Update cobra utils tests to use reflect.TypeFor for ArgsType. |
| core/cobra_usage_builder_test.go | Update usage builder test to use reflect.TypeFor. |
| core/checks_test.go | Update checks test to use reflect.TypeFor. |
| core/build_info_test.go | Update build info test to use reflect.TypeFor. |
| core/bootstrap_test.go | Update bootstrap tests to use reflect.TypeFor. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Searching for |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6107 +/- ##
=======================================
Coverage 50.80% 50.80%
=======================================
Files 359 359
Lines 82260 82260
=======================================
Hits 41790 41790
Misses 40470 40470 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Community Note
Relates OR Closes #0000
Release note for CHANGELOG: