Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove hardcoded list of resource types from cli. #8286

Open
wants to merge 31 commits into
base: main
Choose a base branch
from

Conversation

nithyatsu
Copy link
Contributor

@nithyatsu nithyatsu commented Jan 23, 2025

Description

Since we now register resource provider manifests at startup and are in process of enabling UDT end to end, we should not use static resource type lists.

This PR removes static resource type lists in cli code.

Type of change

  • This pull request adds or changes features of Radius and has an approved issue (issue link required).

Part of #6688

Contributor checklist

Please verify that the PR meets the following requirements, where applicable:

  • An overview of proposed schema changes is included in a linked GitHub issue.
    • Yes
    • [X ] Not applicable
  • A design document PR is created in the design-notes repository, if new APIs are being introduced.
    • Yes
    • [X ] Not applicable
  • The design document has been reviewed and approved by Radius maintainers/approvers.
    • Yes
    • [ X] Not applicable
  • A PR for the samples repository is created, if existing samples are affected by the changes in this PR.
    • Yes
    • [X ] Not applicable
  • A PR for the documentation repository is created, if the changes in this PR affect the documentation or any user facing updates are made.
    • Yes
    • [X ] Not applicable
  • A PR for the recipes repository is created, if existing recipes are affected by the changes in this PR.
    • Yes
    • [ X] Not applicable

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 66.95652% with 38 lines in your changes missing coverage. Please review.

Project coverage is 59.88%. Comparing base (8e6d5ff) to head (16b0589).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/cli/clients/management.go 56.25% 14 Missing and 7 partials ⚠️
pkg/cli/cmd/resource/delete/delete.go 41.66% 7 Missing ⚠️
pkg/cli/clivalidation.go 80.00% 3 Missing and 1 partial ⚠️
pkg/cli/cmd/resource/create/create.go 50.00% 2 Missing and 1 partial ⚠️
pkg/cli/cmd/resource/list/list.go 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8286      +/-   ##
==========================================
- Coverage   59.94%   59.88%   -0.07%     
==========================================
  Files         596      596              
  Lines       40432    40454      +22     
==========================================
- Hits        24238    24225      -13     
- Misses      14367    14408      +41     
+ Partials     1827     1821       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 24, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref 303cf36
Unique ID func172c46f57a
Image tag pr-func172c46f57a
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func172c46f57a
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func172c46f57a
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func172c46f57a
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func172c46f57a
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func172c46f57a
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 24, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref 2434061
Unique ID funcbbf2770f0e
Image tag pr-funcbbf2770f0e
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcbbf2770f0e
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcbbf2770f0e
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funcbbf2770f0e
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcbbf2770f0e
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcbbf2770f0e
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@nithyatsu nithyatsu marked this pull request as ready for review January 24, 2025 22:54
@nithyatsu nithyatsu requested review from a team as code owners January 24, 2025 22:54
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 24, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref f21c211
Unique ID func5b15493f3d
Image tag pr-func5b15493f3d
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func5b15493f3d
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func5b15493f3d
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func5b15493f3d
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func5b15493f3d
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func5b15493f3d
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 24, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref afa6423
Unique ID func9145f55183
Image tag pr-func9145f55183
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func9145f55183
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func9145f55183
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func9145f55183
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func9145f55183
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func9145f55183
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

pkg/cli/clients/management.go Outdated Show resolved Hide resolved
pkg/cli/clients/management.go Outdated Show resolved Hide resolved
pkg/cli/clients/management.go Show resolved Hide resolved
pkg/cli/clients/management.go Outdated Show resolved Hide resolved
pkg/cli/clients/management.go Outdated Show resolved Hide resolved
pkg/cli/clients/management_test.go Show resolved Hide resolved
pkg/cli/clients/management_test.go Show resolved Hide resolved
} else if len(foundTypes) > 1 {
return "", fmt.Errorf("multiple resource types match '%s'. Please specify the full resource type and try again:\n\n%s\n",
resourceTypeName, strings.Join(foundTypes, "\n"))
if !strings.Contains(resourceTypeName, "/") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the only check for the resource type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. Rest of the check has to happen in "Run", since we cant test statically for anything other than the format rp/rt

pkg/cli/cmd/resource/create/create.go Outdated Show resolved Hide resolved
pkg/cli/cmd/resource/list/list.go Outdated Show resolved Hide resolved
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 30, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref 84cdb59
Unique ID funce5836dc593
Image tag pr-funce5836dc593
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funce5836dc593
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funce5836dc593
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-funce5836dc593
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funce5836dc593
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funce5836dc593
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jan 30, 2025

Radius functional test overview

🔍 Go to test action run

Name Value
Repository nithyatsu/radius
Commit ref b8e9b2a
Unique ID func677bb70509
Image tag pr-func677bb70509
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr:
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func677bb70509
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func677bb70509
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func677bb70509
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func677bb70509
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func677bb70509
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@@ -99,8 +99,12 @@ func (r *Runner) Validate(cmd *cobra.Command, args []string) error {
return err
}
r.Format = format
resourceProviderName, respurceTypeName, err := cli.RequireFullyQualifiedResourceType(args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: typo on resourceTypeName

@lakshmimsft
Copy link
Contributor

/LGTM overall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants