Azure / Azure/enclave

Add template build and generated-artifact parity validation to PR CI

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Bicep
Stars
0
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Pull requests that change the quickstart templates currently run only the license/CLA check. No workflow builds the Bicep sources, lints them, or verifies that the committed ARM JSON matches a fresh build of its Bicep source.

## Why this matters

The README deploy links point at the committed ARM JSON artifacts, not the Bicep sources. Without a parity check, the generated JSON can drift from the Bicep it is supposed to represent, so users can deploy a contract that differs from the reviewed source. This exact drift was found during review of [PR #2](https://github.com/Azure/enclave/pull/2): several committed `*.json` artifacts did not reproduce from their `*.bicep` sources until they were regenerated. There is no automated gate that would have caught this before merge.

## Proposed workflow

Add a GitHub Actions workflow triggered on pull requests that touch `quickstart-templates/**` and does the following:

1. Installs the Bicep CLI (or the Azure CLI with the Bicep extension).
2. Builds every top-level `*.bicep` template, for example `bicep build quickstart-templates/.bicep --outfile .json`, and fails on any build error.
3. Runs `bicep lint` and fails on warnings that should block.
4. Compares each freshly built JSON against the committed JSON for that template and fails on any difference, so generated artifacts cannot drift from source.
5. Optionally runs `az deployment sub what-if` / `validate` for templates where credentials or mocking allow, to catch deployment-time expression errors early.

This gives contributors a fast signal on template changes and prevents source-to-generated drift from reaching `main`.

Reported from review of [PR #2](https://github.com/Azure/enclave/pull/2) at head `04510e90beff98b78716d2aa4fa04fbecc192963`.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the existing pull-request checks and the quickstart-templates/** layout, including the committed Bicep and ARM JSON pairs. Add a GitHub Actions workflow that installs Bicep, builds and lints each top-level template, and compares fresh JSON output with the committed artifacts. Done means template changes trigger the workflow and any build, lint, or parity failure blocks the check.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, github-actions
Domain
build-system, ci-cd, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.