Skip to content

Commit c0606f7

Browse files
authored
Merge branch 'main' into dependabot/pip/zipp-3.23.0
2 parents 10540df + 8b99a41 commit c0606f7

44 files changed

Lines changed: 281 additions & 2853 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
description: 'Infrastructure as Code with Bicep'
3+
applyTo: '**/*.bicep'
4+
---
5+
6+
# Bicep best-practices
7+
This list of best-practices builds on top of information available at https://learn.microsoft.com/azure/azure-resource-manager/bicep. It provides a more opinionated and up-to-date set of rules for generating high-quality Bicep code. You should aim to follow these rules whenever generating or modifying Bicep code.
8+
9+
## Rules
10+
### General
11+
1. Avoid setting the `name` field for `module` statements - it is no longer required.
12+
1. If you need to input or output a set of logically-grouped values, generate a single `param` or `output` statement with a User-defined type instead of emitting a `param` or `output` statement for each value.
13+
1. If generating parameters, default to generating Bicep parameters files (`*.bicepparam`), instead of ARM parameters files (`*.json`).
14+
15+
### Resources
16+
1. Do not add references from child resources to parent resources by using `/` characters in the child resource `name` property. Instead, use the `parent` property with a symbolic reference to the parent resource.
17+
1. If you are generating a child resource type, sometimes this may require you to add an `existing` resource for the parent if the parent is not already present in the file.
18+
1. If you see diagnostic codes `BCP036`, `BCP037` or `BCP081`, this may indicate you have hallucinated resource types or resource type properties. You may need to double-check against available resource type schema to tune your output.
19+
1. Avoid using multiple `resourceId()` functions and `reference()` function where possible. Instead use symbolic names to refer to ids or properties, creating `existing` resources if needed. For example, write `foo.id` or `foo.properties.id`, instead of `resourceId('...')` or `reference('...').id`.
20+
21+
### Types
22+
1. Avoid using open types such as `array` or `object` when referencing types where possible (e.g. in `output` or `param` statements). Instead, use User-defined types to define a more precise type.
23+
1. Use typed variables instead of untyped variables when exporting values with the `@export()` decorator. For example, use `var foo string = 'blah'` instead of `var foo = bar`.
24+
1. When using User-defined types, aim to avoid repetition, and comment properties with `@description()` where the context is unclear.
25+
1. If you are passing data directly to or from a resource body via a `param` or `output` statement, try to use existing Resource-derived types (`resourceInput<'type@version'>` and `resourceOutput<'type@version'>`) instead of writing User-defined types.
26+
27+
### Security
28+
1. When generating `param` or `output` statements, ALWAYS use the `@secure()` decorator if sensitive data is present.
29+
30+
### Syntax
31+
1. If you hit warnings or errors with null properties, prefer solving them with the safe-dereference (`.?`) operator, in conjunction with the coalesce (`??`) operator. For example, `a.?b ?? c` is better than `a!.b` which may cause runtime errors, or `a != null ? a.b : c` which is unnecessarily verbose.
32+
33+
## Glossary
34+
* Child resource: an Azure resource type with type name consisting of more than 1 `/` characters. For example, `Microsoft.Network/virtualNetworks/subnets` is a child resource. `Microsoft.Network/virtualNetworks` is not.

.github/workflows/azure-dev-validation.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
security-events: write
1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v5
20+
uses: actions/checkout@v6
2121

2222
- name: Build Bicep for linting
2323
uses: azure/CLI@v2
@@ -32,7 +32,7 @@ jobs:
3232
security-events: write
3333
steps:
3434
- name: Checkout
35-
uses: actions/checkout@v5
35+
uses: actions/checkout@v6
3636

3737
- name: Run PSRule analysis
3838
uses: microsoft/ps-rule@v2.9.0

.github/workflows/azure-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ jobs:
120120
USE_SHAREPOINT_SOURCE: ${{ vars.USE_SHAREPOINT_SOURCE }}
121121
steps:
122122
- name: Checkout
123-
uses: actions/checkout@v5
123+
uses: actions/checkout@v6
124124

125125
- name: Install azd
126-
uses: Azure/setup-azd@v2.2.0
126+
uses: Azure/setup-azd@v2.2.1
127127

128128
- name: Install Nodejs
129129
uses: actions/setup-node@v6

.github/workflows/evaluate.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
})
120120
121121
- name: Checkout pull request
122-
uses: actions/checkout@v5
122+
uses: actions/checkout@v6
123123
with:
124124
ref: refs/pull/${{ github.event.issue.number }}/head
125125

@@ -137,7 +137,7 @@ jobs:
137137
node-version: 20
138138

139139
- name: Install azd
140-
uses: Azure/setup-azd@v2.2.0
140+
uses: Azure/setup-azd@v2.2.1
141141

142142
- name: Login to Azure with az CLI
143143
uses: azure/login@v2
@@ -192,19 +192,19 @@ jobs:
192192
193193
- name: Upload eval results as build artifact
194194
if: ${{ success() }}
195-
uses: actions/upload-artifact@v5
195+
uses: actions/upload-artifact@v6
196196
with:
197197
name: eval_result
198198
path: ./evals/results/pr${{ github.event.issue.number }}
199199

200200
- name: Upload server logs as build artifact
201-
uses: actions/upload-artifact@v5
201+
uses: actions/upload-artifact@v6
202202
with:
203203
name: server_logs
204204
path: ./app/backend/serverlogs.out
205205

206206
- name: Upload server error logs as build artifact
207-
uses: actions/upload-artifact@v5
207+
uses: actions/upload-artifact@v6
208208
with:
209209
name: server_error_logs
210210
path: ./app/backend/serverlogs.err

.github/workflows/frontend.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
prettier:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v5
17+
- uses: actions/checkout@v6
1818
- name: Run prettier on frontend
1919
run: |
2020
cd ./app/frontend

.github/workflows/lint-markdown.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout repo
16-
uses: actions/checkout@v5
17-
- name: Run markdownlint
18-
uses: articulate/actions-markdownlint@v1
16+
uses: actions/checkout@v6
17+
- name: Run markdownlint-cli2
18+
uses: DavidAnson/markdownlint-cli2-action@v22
1919
with:
20-
config: .github/workflows/markdownlint-config.json
21-
files: '**/*.md'
22-
ignore: data/
20+
config: .markdownlint-cli2.jsonc
21+
globs: |
22+
**/*.md
23+
!data/**
24+
!.github/**

.github/workflows/markdownlint-config.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/python-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2929
node_version: ["20.14", "22"]
3030
steps:
31-
- uses: actions/checkout@v5
31+
- uses: actions/checkout@v6
3232
with:
3333
# Fetch full history so diff-cover can compute a merge base with origin/main
3434
fetch-depth: 0
@@ -82,7 +82,7 @@ jobs:
8282
pytest tests/e2e.py --tracing=retain-on-failure
8383
- name: Upload test artifacts
8484
if: ${{ failure() && steps.e2e.conclusion == 'failure' }}
85-
uses: actions/upload-artifact@v5
85+
uses: actions/upload-artifact@v6
8686
with:
8787
name: playwright-traces${{ matrix.python_version }}
8888
path: test-results

.github/workflows/validate-markdown.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout Repo
22-
uses: actions/checkout@v5
22+
uses: actions/checkout@v6
2323
with:
2424
ref: ${{ github.event.pull_request.head.sha }}
2525
- name: Check broken Paths
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
steps:
3939
- name: Checkout Repo
40-
uses: actions/checkout@v5
40+
uses: actions/checkout@v6
4141
with:
4242
ref: ${{ github.event.pull_request.head.sha }}
4343
- name: Run Check URLs Country Locale
@@ -54,7 +54,7 @@ jobs:
5454
runs-on: ubuntu-latest
5555
steps:
5656
- name: Checkout Repo
57-
uses: actions/checkout@v5
57+
uses: actions/checkout@v6
5858
with:
5959
ref: ${{ github.event.pull_request.head.sha }}
6060
- name: Run Check Broken URLs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ node_modules
149149
static/
150150

151151
app/functions/*/prepdocslib/
152+
app/functions/*/requirements.txt
152153

153154
data/**/*.md5
154155

0 commit comments

Comments
 (0)