Skip to content

Commit 2927f73

Browse files
committed
Merge branch 'main' of https://github.com/azure/bicep
2 parents 3d56219 + 11c3334 commit 2927f73

File tree

1,013 files changed

+68009
-26028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,013 files changed

+68009
-26028
lines changed

.devcontainer/devcontainer.json

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
{
22
"name": "Bicep Development Environment",
3-
"extensions": [
4-
"msazurermtools.azurerm-vscode-tools",
5-
"ms-azuretools.vscode-bicep",
6-
"ms-dotnettools.csharp",
7-
"ms-azuretools.vscode-docker",
8-
"editorconfig.editorconfig",
9-
"github.vscode-pull-request-github"
10-
],
3+
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"msazurermtools.azurerm-vscode-tools",
8+
"ms-dotnettools.vscode-dotnet-runtime",
9+
"ms-azuretools.vscode-bicep",
10+
"ms-dotnettools.csharp",
11+
"ms-azuretools.vscode-docker",
12+
"editorconfig.editorconfig",
13+
"github.vscode-pull-request-github"
14+
]
15+
}
16+
},
1117
"features": {
12-
"github-cli": "latest",
13-
"azure-cli": "latest",
14-
"node": {
18+
"ghcr.io/devcontainers/features/azure-cli:1": {
19+
"version": "latest"
20+
},
21+
"ghcr.io/devcontainers/features/dotnet:1": {
22+
"version": "7.0"
23+
},
24+
"ghcr.io/devcontainers/features/github-cli:1": {
25+
"version": "latest"
26+
},
27+
"ghcr.io/devcontainers/features/node:1": {
1528
"version": "lts",
1629
"nodeGypDependencies": true
17-
},
18-
"dotnet": {
19-
"version": "6.0"
2030
}
2131
}
2232
}

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Azure Types Inaccuracy
4+
url: https://aka.ms/bicep-type-issues
5+
about: Report a problem with inaccurate type information, or issues deploying a particular service.

.github/workflows/build.yml

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
uses: actions/upload-artifact@v3
5858
with:
5959
name: bicep-release-${{ matrix.rid }}
60-
path: ./src/Bicep.Cli/bin/release/net6.0/${{ matrix.rid }}/publish/*
60+
path: ./src/Bicep.Cli/bin/release/net7.0/${{ matrix.rid }}/publish/*
6161
if-no-files-found: error
6262

6363
- name: Upload Bicep project assets file
@@ -110,7 +110,7 @@ jobs:
110110
uses: actions/upload-artifact@v3
111111
with:
112112
name: Bicep.LangServer
113-
path: ./src/Bicep.LangServer/bin/release/net6.0/publish/*
113+
path: ./src/Bicep.LangServer/bin/release/net7.0/publish/*
114114
if-no-files-found: error
115115

116116
# needed to generate notice file
@@ -152,11 +152,6 @@ jobs:
152152
run: npm ci
153153
working-directory: ./src/vscode-bicep
154154

155-
# we don't run this step on official builds
156-
- name: Enable params
157-
run: npm run params
158-
working-directory: ./src/vscode-bicep
159-
160155
- name: Run lint
161156
run: npm run lint
162157
working-directory: ./src/vscode-bicep
@@ -211,7 +206,7 @@ jobs:
211206
working-directory: ./src/vscode-bicep
212207

213208
- name: Show extension logs of E2E tests
214-
run: cat ./bicep.log
209+
run: cat ./bicep-e2e.log
215210
if: always()
216211
working-directory: ./src/vscode-bicep
217212

@@ -252,19 +247,12 @@ jobs:
252247
uses: microsoft/[email protected]
253248

254249
- name: Build Bicep.sln
255-
run: msbuild Bicep.sln /restore -property:Configuration=Release /v:m /bl:./src/binlog/bicep_build.binlog
256-
257-
- name: Upload Bicep.sln build binlog
258-
uses: actions/upload-artifact@v3
259-
with:
260-
name: build-binlog-files
261-
path: ./src/binlog/bicep_build.binlog
262-
if-no-files-found: error
250+
run: dotnet build --configuration release
263251

264252
- name: Build BicepInVisualStudio.sln
265-
run: msbuild src/vs-bicep/BicepInVisualStudio.sln /restore -property:Configuration=Release /v:m /bl:./src/binlog/bicep_in_visual_studio_build.binlog
253+
run: msbuild src/vs-bicep/BicepInVisualStudio.sln /restore /p:Configuration=Release /v:m /bl:./src/binlog/bicep_in_visual_studio_build.binlog
266254

267-
- name: Upload Bicep.sln build binlog
255+
- name: Upload BicepInVisualStudio.sln build binlog
268256
uses: actions/upload-artifact@v3
269257
with:
270258
name: build-binlog-files
@@ -332,7 +320,7 @@ jobs:
332320
uses: actions/upload-artifact@v3
333321
with:
334322
name: bicep-setup-win-x64
335-
path: ./src/installer-win/bin/release/net6.0/bicep-setup-win-x64.exe
323+
path: ./src/installer-win/bin/release/net7.0/bicep-setup-win-x64.exe
336324
if-no-files-found: error
337325

338326
build-cli-nugets:
@@ -615,8 +603,6 @@ jobs:
615603
- build-cli
616604
- can-run-live-tests
617605
if: needs.can-run-live-tests.outputs.access_verified == 'true'
618-
env:
619-
BICEP_SPN_PASSWORD_FF: ${{ secrets.BICEP_SPN_PASSWORD_FF }}
620606

621607
steps:
622608
- uses: actions/checkout@v3
@@ -638,11 +624,11 @@ jobs:
638624

639625
- name: Az CLI login
640626
uses: azure/login@v1
641-
if: matrix.environment == 'prod'
642627
with:
643-
client-id: ${{ secrets.LIVE_TEST_CLIENT_ID_PROD }}
644-
tenant-id: ${{ secrets.LIVE_TEST_TENANT_ID_PROD }}
645-
subscription-id: ${{ secrets.LIVE_TEST_SUBSCRIPTION_ID_PROD }}
628+
environment: ${{ (matrix.environment == 'prod' && 'AzureCloud') || 'AzureUSGovernment' }}
629+
client-id: ${{ (matrix.environment == 'prod' && secrets.LIVE_TEST_CLIENT_ID_PROD) || secrets.LIVE_TEST_CLIENT_ID_FF }}
630+
tenant-id: ${{ (matrix.environment == 'prod' && secrets.LIVE_TEST_TENANT_ID_PROD) || secrets.LIVE_TEST_TENANT_ID_FF }}
631+
subscription-id: ${{ (matrix.environment == 'prod' && secrets.LIVE_TEST_SUBSCRIPTION_ID_PROD) || secrets.LIVE_TEST_SUBSCRIPTION_ID_FF }}
646632

647633
- name: Run Bicep Live E2E Tests (${{ matrix.environment }})
648634
run: npm ci && npm run test:live:${{ matrix.environment }}
@@ -665,8 +651,6 @@ jobs:
665651
- build-cli
666652
- can-run-live-tests
667653
if: needs.can-run-live-tests.outputs.access_verified == 'true'
668-
env:
669-
BICEP_SPN_PASSWORD_FF: ${{ secrets.BICEP_SPN_PASSWORD_FF }}
670654

671655
steps:
672656
- uses: actions/checkout@v3
@@ -686,11 +670,11 @@ jobs:
686670

687671
- name: Az CLI login
688672
uses: azure/login@v1
689-
if: matrix.environment == 'prod'
690673
with:
691-
client-id: ${{ secrets.LIVE_TEST_CLIENT_ID_PROD }}
692-
tenant-id: ${{ secrets.LIVE_TEST_TENANT_ID_PROD }}
693-
subscription-id: ${{ secrets.LIVE_TEST_SUBSCRIPTION_ID_PROD }}
674+
environment: ${{ (matrix.environment == 'prod' && 'AzureCloud') || 'AzureUSGovernment' }}
675+
client-id: ${{ (matrix.environment == 'prod' && secrets.LIVE_TEST_CLIENT_ID_PROD) || secrets.LIVE_TEST_CLIENT_ID_FF }}
676+
tenant-id: ${{ (matrix.environment == 'prod' && secrets.LIVE_TEST_TENANT_ID_PROD) || secrets.LIVE_TEST_TENANT_ID_FF }}
677+
subscription-id: ${{ (matrix.environment == 'prod' && secrets.LIVE_TEST_SUBSCRIPTION_ID_PROD) || secrets.LIVE_TEST_SUBSCRIPTION_ID_FF }}
694678

695679
- name: Run Bicep Live E2E Tests (${{ matrix.environment }})
696680
run: npm ci && npm run test:live:${{ matrix.environment }}

.github/workflows/update-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: ./scripts/update_dependencies.sh
3636

3737
- name: Create Pull Request
38-
uses: peter-evans/create-pull-request@v4
38+
uses: peter-evans/create-pull-request@v5
3939
with:
4040
committer: GitHub <[email protected]>
4141
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>

.github/workflows/update-notices.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ jobs:
4747

4848
# this command is not correct for releasing the binaries but is sufficient for the purposes of this job
4949
- name: Windows Installer prerequisites
50-
run: mkdir ./src/installer-win/bicep && copy ./src/Bicep.Cli/obj/project.assets.json ./src/installer-win/bicep/ && copy ./src/Bicep.Cli/bin/Release/net6.0/bicep.* ./src/installer-win/bicep/
50+
run: mkdir ./src/installer-win/bicep && copy ./src/Bicep.Cli/obj/project.assets.json ./src/installer-win/bicep/ && copy ./src/Bicep.Cli/bin/Release/net7.0/bicep.* ./src/installer-win/bicep/
5151

5252
- name: Build Windows Installer
5353
run: dotnet build --configuration Release ./src/installer-win/installer.proj
5454

5555
- name: CLI Package prerequisites
56-
run: mkdir ./src/Bicep.Cli.Nuget/tools && copy ./src/Bicep.Cli/obj/project.assets.json ./src/Bicep.Cli.Nuget/tools/ && copy ./src/Bicep.Cli/bin/Release/net6.0/bicep.* ./src/Bicep.Cli.Nuget/tools/
56+
run: mkdir ./src/Bicep.Cli.Nuget/tools && copy ./src/Bicep.Cli/obj/project.assets.json ./src/Bicep.Cli.Nuget/tools/ && copy ./src/Bicep.Cli/bin/Release/net7.0/bicep.* ./src/Bicep.Cli.Nuget/tools/
5757

5858
- name: Build CLI Package
5959
run: dotnet build --configuration Release /p:RuntimeSuffix=win-x64 ./src/Bicep.Cli.Nuget/nuget.proj
@@ -74,19 +74,19 @@ jobs:
7474

7575
- name: Build BicepInVisualStudio.sln
7676
run: msbuild src/vs-bicep/BicepInVisualStudio.sln /restore -property:Configuration=Release /v:m
77-
78-
- name: Create Pull Request
79-
uses: peter-evans/create-pull-request@v4
77+
78+
- name: Create branch and force push
79+
uses: stefanzweifel/git-auto-commit-action@v4
8080
with:
81-
committer: GitHub <[email protected]>
82-
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
83-
signoff: false
84-
add-paths: '**/local-tpn.txt'
81+
commit_message: Update Local TPN Files
82+
commit_user_name: ${{ github.actor }}
83+
commit_user_email: ${{ github.actor }}@users.noreply.github.com
84+
commit_author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
85+
file_pattern: '*.txt'
8586
branch: update-local-tpn-files
86-
delete-branch: true
87-
title: |
88-
Update Local TPN Files
89-
commit-message: |
90-
Update Local TPN Files
91-
labels: dependencies
92-
draft: false
87+
commit_options: '--no-verify --signoff'
88+
status_options: '--untracked-files=no'
89+
push_options: '--force'
90+
skip_fetch: true
91+
skip_checkout: true
92+
create_branch: true

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"type": "coreclr",
2929
"request": "launch",
3030
"preLaunchTask": "Build CLI",
31-
"program": "${workspaceFolder}/src/Bicep.Cli/bin/Debug/net6.0/bicep",
31+
"program": "${workspaceFolder}/src/Bicep.Cli/bin/Debug/net7.0/bicep",
3232
"args": [
3333
"build",
3434
"${file}"

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We are very happy to accept community contributions to Bicep, whether those are
66

77
## Getting Started
88

9-
* If you haven't already, you will need [dotnet](https://dotnet.microsoft.com/download) core sdk 6.0.100 and [node + npm](https://nodejs.org/en/download/) 10 (or later) installed locally to build and run this project.
9+
* If you haven't already, you will need [dotnet](https://dotnet.microsoft.com/download) core sdk 7.0.100 and [node + npm](https://nodejs.org/en/download/) 10 (or later) installed locally to build and run this project.
1010
* You are free to work on Bicep on any platform using any editor, but you may find it quickest to get started using [VSCode](https://code.visualstudio.com/Download) with the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp).
1111
* Fork this repo (see [this forking guide](https://guides.github.com/activities/forking/) for more information).
1212
* Checkout the repo locally with `git clone [email protected]:{your_username}/bicep.git`.
@@ -78,6 +78,7 @@ If you have an active branch pushed to your GitHub fork, you can use the "Update
7878
* The name of the entry should match the name of the folder you create (same casing), and there should be a main.bicep file in that folder.
7979
1. Make changes to main.bicep.
8080
1. Create empty `main.<suffix>.bicep` assertion files in the folder. You need to create following suffixes: `diagnostics`, `formatted`, `symbols`, `syntax`, `tokens`
81+
* If the dataset is expected to compile successfully, add additional bicep files with suffixes `ir`, `sourcemap` and two json files `main.json` and `main.symbolicnames.json` with initial content `{}`.
8182
1. Follow [Updating test baselines](#updating-test-baselines) to generate baseline files.
8283
* The naming and file structure is important here as it's used by the test runner to assert e.g. whether the example should compile, and the end-of-line characters.
8384
* For tests that deal with module, you may see some unexpected behavior because the test could be using a mock file resolver instead of the standard one. Similarly, some tests may be using a mock resource type provider instead of the standard ones - usually that explains why some types aren't recognized in tests.
@@ -87,7 +88,7 @@ If you have an active branch pushed to your GitHub fork, you can use the "Update
8788
* On the first run, you'll need to ensure you have installed all the npm packages required by the Bicep VSCode extension with the following:
8889
* `cd src/vscode-bicep`
8990
* `npm i`
90-
* In the [VSCode Run View](https://code.visualstudio.com/Docs/editor/debugging), select the "VSCode Extension" task, and press the "Start" button. This will launch a new VSCode window with the Bicep extension and LanguageServer containing your changes. When running on WSL, create a symbolic link in `src/vscode-bicep` named `bicepLanguageServer` to `../Bicep.LangServer/bin/Debug/net6.0`.
91+
* In the [VSCode Run View](https://code.visualstudio.com/Docs/editor/debugging), select the "VSCode Extension" task, and press the "Start" button. This will launch a new VSCode window with the Bicep extension and LanguageServer containing your changes. When running on WSL, create a symbolic link in `src/vscode-bicep` named `bicepLanguageServer` to `../Bicep.LangServer/bin/Debug/net7.0`.
9192
* If you want the ability to set breakpoints and step through the C# code, you can also use the "Attach" run configuration once the extension host has launched, and select the Bicep LanguageServer process by searching for "dotnet" processes with a command line containing "...\Bicep.LangServer.dll --pipe=..." (Windows) or "vscode-*.sock" (MacOs).
9293

9394
### Running the Bicep CLI

docs/grammar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ typeExpression -> singularTypeExpression ("|" singularTypeExpression)*
141141
singularTypeExpression ->
142142
primaryTypeExpression |
143143
singularTypeExpression "[]" |
144+
singularTypeExpression "?" |
144145
parenthesizedTypeExpression
145146
146147
primaryTypeExpression ->

docs/release-checklist.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Bicep Release Checklist
2+
3+
1. (**end-of-month releases only**) Update Bicep Az types:
4+
1. Run the [Update Types](https://github.com/Azure/bicep-types-az/actions/workflows/update-types.yml) GitHub Action to generate the latest type definitions.
5+
1. Wait ~3hrs for the previous step to complete. Ensure it runs successfully, and generates + merges a PR (example [here](https://github.com/Azure/bicep-types-az/pull/1299)).
6+
1. Run the Official Build (see [this README](https://msazure.visualstudio.com/One/_git/BicepMirror-Types-Az) for instructions).
7+
1. Publish Bicep.Types NuGet packages to nuget.org. Follow the latter half of the readme [here](https://dev.azure.com/msazure/One/_git/BicepMirror-Types-Az) and the below steps.
8+
1. Find your build [here](https://dev.azure.com/msazure/One/_build?definitionId=179851&_a=summary) and wait for it to finish successfully. Then click on it and for the `drop_build_main`, download the artifacts.
9+
1. Follow instructions to download the nuget.exe from [here](https://learn.microsoft.com/en-us/nuget/install-nuget-client-tools)
10+
1. Run `./scripts/UploadPackages.ps1 -PackageDirectory <downloads>/drop_build_main -NuGetPath <nuget_tool_directory>`
11+
1. You need to be part of the armdeployments org on nuget.org. (Ask one of the admins to be added) You must generate an API key and then use that as the password for when the popup window appears after running the above command. (Username can be anything)
12+
1. Bump the Bicep.Types NuGet package version in this project in this [file](https://github.com/Azure/bicep/blob/main/src/Bicep.Core/Bicep.Core.csproj) by creating and merging a PR
13+
1. Might need to run a `dotnet refresh` to update the packages.lock.json files
14+
1. Might also need to update baseline tests (run `bicep/scripts/SetBaseline.ps1`)
15+
1. Verify the latest build on the `main` branch is green: ![Build on main](https://github.com/Azure/bicep/actions/workflows/build.yml/badge.svg?branch=main).
16+
1. Review history for changes to [bicepconfig.schema.json](https://github.com/Azure/bicep/commits/main/src/vscode-bicep/schemas/bicepconfig.schema.json). Raise an issue for any recently-added linter rules which do not have public documentation.
17+
1. (**end-of-month releases only**) Bump the version number by incrementing the minor version number in [this file](https://github.com/Azure/bicep/blob/main/version.json) (example [here](https://github.com/Azure/bicep/pull/9698))
18+
1. Run the Official Build (see [this README](https://msazure.visualstudio.com/One/_git/BicepMirror) for instructions).
19+
1. Get version number from official build by looking at the artifacts and push a new tag to the Bicep repo. This should be of format `vXX.YY.ZZ` - e.g `v0.14.85`.
20+
1. In the Bicep repo, make sure you are on the main branch and on the latest commit.
21+
1. Run git tag v<new_release_number> (ex: git tag v0.15.31)
22+
1. Run git push origin v<new_release_number> (ex: git push origin v0.15.31)
23+
1. [Create a draft release](https://github.com/Azure/bicep/releases/new) for the new tag and set release title to the tag name. Use the "Save draft" button to save the changes without publishing it.
24+
1. Run `bicep/scripts/CreateReleaseNotes -FromTag <previous tag> -ToTag <new tag>` and set the output as the release description.
25+
1. Give the output of this script to a PM, and ask them to clean up the notes for the release.
26+
1. Once they have cleaned up the notes, copy + paste them into the draft notes, and hit "Save draft" again.
27+
1. Run `BicepMirror/scripts/UploadSignedReleaseArtifacts.ps1` to add official artifacts to the release.
28+
* `-WorkingDir` can be any empty temporary directory that you create
29+
* `-BuildId` is only needed if the latest official build is NOT the official build you are trying to release
30+
1. Validate VSCode extension and Bicep CLI manually on Windows, Mac & Linux:
31+
1. Download `vscode-bicep.vsix` from the draft release, and [Install it from VSIX](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix). Verify that you can open a Bicep file, that text is correctly colorized, and that error messages show up as expected.
32+
1. Download the appropriate Bicep executable for your platform (e.g. `bicep-linux-x64`). Verify you can invoke it with e.g. `bicep-linux-x64 --version`, and that it prints the expected output.
33+
1. Publish the release on GitHub.
34+
1. Upload copyleft dependency source to 3rd party disclosure site. See [instructions](https://msazure.visualstudio.com/One/_wiki/wikis/Azure%20Deployments%20Team%20Wiki/369910/Bicep-release-step-Upload-copyleft-source-to-3rd-party-disclosure-site).
35+
1. Upload vscode-bicep.VSIX to the VS marketplace [here](https://marketplace.visualstudio.com/manage).
36+
1. Click on the ... for Bicep, then Update, then upload the .vsix file. The site will verify it then the version number should be updated to the right one.
37+
1. Upload vs-bicep.VSIX to VS marketplace
38+
1. Click on the ... for Bicep for Visual Studio, then Edit. Once on the new page, upload the new vs-bicep.VSIX file at the top. This should update the Version number automatically for you. Verify that it does then scroll to the bottom and hit Save and Upload.
39+
1. Upload NuGet packages to nuget.org via `./scripts/PublishPackages.ps1`. (Make sure to include CLI packages. Easiest is to use the `__assets` directory created by the `UploadSignedReleaseArtifacts.ps1` script.)
40+
1. Update homebrew by going here [here](https://github.com/Azure/homebrew-bicep/actions/workflows/update-homebrew.yml) and clicking on `Run workflow`
41+
* A PR will be auto created by this action (example [here](https://github.com/Azure/homebrew-bicep/pull/40)). Approve and merge it.

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
},
55
"sdk": {
66
"allowPrerelease": false,
7-
"version": "6.0.400",
7+
"version": "7.0.100",
88
"rollForward": "latestFeature"
99
}
1010
}

0 commit comments

Comments
 (0)