Write the what-if result to a JSON file (`what-if-output-file` input)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- azure, github-actions, typescript
Research direction
Start with the what-if handler in the bicep-deploy-common package, which already takes an OutputSetter, and trace how the what-if result reaches the step output for operation: whatIf. Settle the file contents first: the ARM REST body or JSON.stringify of the SDK result, which the issue leaves open. Done means the what-if-output-file input writes the file only when a result comes back, including Failed status, and sets the output path. Nothing is written on auth, compile, or input errors.
Written by the indexing model from the issue text.
Description
Background
Following up on the suggestion in #327 to track this separately.
Today the what-if result exists only as formatted text in the step log. Several issues ask to use it elsewhere:
- #155: put it in the workflow summary, a PR comment, or an artifact
- #227: same ask, per the later comments
- #322: control the result format
A machine-readable copy of the result would cover all of these with one primitive, and leave rendering to the workflow.
Feature request
An optional input that writes the what-if result to a JSON file, plus an output that returns its path. It would apply to operation: whatIf for both type: deployment and type: deploymentStack (once #327 lands).
- id: whatif
uses: azure/bicep-deploy@v2
with:
type: deployment
operation: whatIf
what-if-output-file: ${{ runner.temp }}/what-if.json
...
- run: jq '.properties.changes | length' "${{ steps.whatif.outputs.what-if-output-file }}"
In BicepDeploy@0 this would be whatIfOutputFile. The handler in bicep-deploy-common already takes an OutputSetter, so most of the work would land once for both.
Behavior
- Not set: no change from today.
- The what-if returns a result: write it, including when its
statusisFailed(the body carrieserror). - No result comes back (auth, compile or input errors): write no file and leave the output unset. Combined with
hasChangesfrom #327, a step withcontinue-on-errorcan tell "no changes" apart from "never ran".
Open question: what goes in the file
I'd suggest the ARM REST response body, if the SDK makes that practical. That shape is documented and versioned by api-version, so consumers can rely on it. The serialized SDK model can differ (Date objects, flattened or renamed properties) and could change with SDK upgrades. If the raw body isn't practical, JSON.stringify of the SDK result is still far better than parsing log text.
Contribution
I'm happy to send a PR for the common package and the action once the input/output shape is agreed. For context, I maintain an Azure DevOps extension that renders what-if results in the pipeline UI, and today it has to run what-if again itself to get the data.
- Dominant language
- TypeScript
- Stars
- 66
- Forks
- 20
- Avg merge
- 10h 16m
- Merged PRs (30d)
- 16
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/bicep-deploy
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Azure/bicep-deploy#350 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/bicep-deploy#309 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Azure/bicep-deploy#328 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Azure/bicep-deploy#322 ·
Maintainers usually reply within 1 day
-
RPC client doesn't support managementGroupId for GetSnapshotRequestMetadataDefinition.May be free again @anthony-c-martin claimed this 70 days ago, and no pull request is open. Open
Azure/bicep-deploy#319 · 2 comments · 1 reaction · 2 assignees ·
Maintainers usually reply within 1 day
All issues in Azure/bicep-deploy
Similar issues
-
area:workflow bug ready-for-human
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fil-donadoni/tolaria#6108 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/rocketmq-dashboard#7234 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vitest-dev/vitest#11656 ·
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ehmpathy/rhachet-roles-bhrain#655 ·
Maintainers usually reply within 1 day