radius-project / radius

Radius is a cloud-native, portable application platform that makes app development easier for teams building cloud-native apps.
https://radapp.io
Apache License 2.0
1.48k stars 95 forks source link

Centralize declaration of Radius resource types (Core + Connector RP) #3379

Open kachawla opened 2 years ago

kachawla commented 2 years ago

Overview of feature request Currently we have duplicated definition Radius resource types in several places, for example - https://github.com/project-radius/radius/blob/main/test/validation/corerp.go#L28 https://github.com/project-radius/radius/blob/main/pkg/cli/ucp/ucp_management.go#L34 https://github.com/project-radius/radius/blob/main/pkg/connectorrp/renderers/sqldatabases/types.go#L14 https://github.com/project-radius/radius/blob/main/pkg/connectorrp/datamodel/sqldatabase.go#L26 https://github.com/project-radius/radius/blob/main/pkg/connectorrp/frontend/controller/sqldatabases/types.go#L9

This structure could easily result into failures due to typos/misspellings etc, we should move resource type definition into a separate top level directory that can be used a single source of truth, that will be updated any time a new resource type is added and can be consumed by all of the above code paths.

AB#6984

nicolejms commented 2 years ago

triage: code clean up - moving to global backlog

kachawla commented 1 year ago

Done for LinkRP as part of https://dev.azure.com/azure-octo/Incubations/_workitems/edit/5822 https://github.com/project-radius/radius/pull/5012. Core rp types are still pending.

shalabhms commented 1 year ago

Closing this issue. Please file the issue if anything remaining in this issue or valid.

kachawla commented 1 year ago

Reopening since this still hasn't been done for Core RP as I mentioned in my previous comment.