Skip to content

Commit

Permalink
Update bicep generator to use bicep-types and new contract (#7506)
Browse files Browse the repository at this point in the history
# Description

Update bicep generator to use bicep-types and new contract

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: sk593 <shruthikumar@microsoft.com>
  • Loading branch information
sk593 committed Jun 4, 2024
1 parent e3900e3 commit d0cf79c
Show file tree
Hide file tree
Showing 24 changed files with 11,675 additions and 4,413 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "bicep-types"]
path = bicep-types
url = https://github.com/Azure/bicep-types
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@
"RADIUSBACKENDURI": "http://localhost:9000",
},
},
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/hack/bicep-types-radius/src/autorest.bicep/node_modules/.bin/jest",
"--runInBand",
"--no-cache"
],
"cwd": "${workspaceFolder}/hack/bicep-types-radius/src/autorest.bicep/src",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"sourceMaps": true
},
],
"compounds": [
{
Expand Down
1 change: 1 addition & 0 deletions bicep-types
Submodule bicep-types added at cd259b
5 changes: 4 additions & 1 deletion build/generate.mk
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ generate-go: generate-mockgen-installed ## Generates go with 'go generate' (Mock
generate-bicep-types: generate-node-installed ## Generate Bicep extensibility types
@echo "$(ARROW) Generating Bicep extensibility types from OpenAPI specs..."
@echo "$(ARROW) Build autorest.bicep..."
cd hack/bicep-types-radius/src/autorest.bicep; \
git submodule update && git submodule init
cd bicep-types/src/bicep-types; \
npm ci && npm run build; \
cd ../../../hack/bicep-types-radius/src/autorest.bicep; \
npm ci && npm run build; \
cd ../generator; \
echo "Run generator from hack/bicep-types-radius/src/generator dir"; \
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

53 changes: 52 additions & 1 deletion hack/bicep-types-radius/generated/index.json
Original file line number Diff line number Diff line change
@@ -1 +1,52 @@
{"Resources":{"Applications.Core/applications@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":58},"Applications.Core/containers@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":123},"Applications.Core/environments@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":158},"Applications.Core/extenders@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":176},"Applications.Core/gateways@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":197},"Applications.Core/secretStores@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":220},"Applications.Core/volumes@2023-10-01-preview":{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":257},"Applications.Dapr/pubSubBrokers@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":49},"Applications.Dapr/secretStores@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":66},"Applications.Dapr/stateStores@2023-10-01-preview":{"RelativePath":"applications/applications.dapr/2023-10-01-preview/types.json","Index":84},"Applications.Datastores/mongoDatabases@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":50},"Applications.Datastores/redisCaches@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":69},"Applications.Datastores/sqlDatabases@2023-10-01-preview":{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":88},"Applications.Messaging/rabbitMQQueues@2023-10-01-preview":{"RelativePath":"applications/applications.messaging/2023-10-01-preview/types.json","Index":50}},"Functions":{"applications.core/extenders":{"2023-10-01-preview":[{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":258}]},"applications.core/secretstores":{"2023-10-01-preview":[{"RelativePath":"applications/applications.core/2023-10-01-preview/types.json","Index":264}]},"applications.datastores/mongodatabases":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":90}]},"applications.datastores/rediscaches":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":92}]},"applications.datastores/sqldatabases":{"2023-10-01-preview":[{"RelativePath":"applications/applications.datastores/2023-10-01-preview/types.json","Index":94}]},"applications.messaging/rabbitmqqueues":{"2023-10-01-preview":[{"RelativePath":"applications/applications.messaging/2023-10-01-preview/types.json","Index":52}]}}}
{
"resources": {
"Applications.Core/applications@2023-10-01-preview": {
"$ref": "applications/applications.core/2023-10-01-preview/types.json#/53"
},
"Applications.Core/containers@2023-10-01-preview": {
"$ref": "applications/applications.core/2023-10-01-preview/types.json#/119"
},
"Applications.Core/environments@2023-10-01-preview": {
"$ref": "applications/applications.core/2023-10-01-preview/types.json#/154"
},
"Applications.Core/extenders@2023-10-01-preview": {
"$ref": "applications/applications.core/2023-10-01-preview/types.json#/173"
},
"Applications.Core/gateways@2023-10-01-preview": {
"$ref": "applications/applications.core/2023-10-01-preview/types.json#/194"
},
"Applications.Core/secretStores@2023-10-01-preview": {
"$ref": "applications/applications.core/2023-10-01-preview/types.json#/223"
},
"Applications.Core/volumes@2023-10-01-preview": {
"$ref": "applications/applications.core/2023-10-01-preview/types.json#/260"
},
"Applications.Dapr/pubSubBrokers@2023-10-01-preview": {
"$ref": "applications/applications.dapr/2023-10-01-preview/types.json#/44"
},
"Applications.Dapr/secretStores@2023-10-01-preview": {
"$ref": "applications/applications.dapr/2023-10-01-preview/types.json#/61"
},
"Applications.Dapr/stateStores@2023-10-01-preview": {
"$ref": "applications/applications.dapr/2023-10-01-preview/types.json#/79"
},
"Applications.Datastores/mongoDatabases@2023-10-01-preview": {
"$ref": "applications/applications.datastores/2023-10-01-preview/types.json#/48"
},
"Applications.Datastores/redisCaches@2023-10-01-preview": {
"$ref": "applications/applications.datastores/2023-10-01-preview/types.json#/69"
},
"Applications.Datastores/sqlDatabases@2023-10-01-preview": {
"$ref": "applications/applications.datastores/2023-10-01-preview/types.json#/90"
},
"Applications.Messaging/rabbitMQQueues@2023-10-01-preview": {
"$ref": "applications/applications.messaging/2023-10-01-preview/types.json#/48"
}
},
"resourceFunctions": {},
"settings": {
"name": "radius",
"version": "latest",
"isSingleton": false
}
}
Loading

0 comments on commit d0cf79c

Please sign in to comment.