Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bicepconfig.json linter update #318

Merged
merged 16 commits into from
Sep 20, 2022

Conversation

DaFitRobsta
Copy link
Contributor

@DaFitRobsta DaFitRobsta commented Sep 13, 2022

Overview/Summary

As part of Bicep release v0.10.13 new linter rules have been added. Azure/bicep: Bicep is a declarative language for describing and deploying Azure resources (github.com)

We need to update the bicepconfig.json and Contribution Guide Wiki example of the bicepconfig.json file in ALZ-Bicep to ensure our tests utilize these new rules.

This PR fixes/adds/changes/removes

  1. Update Linter Rules to Latest Available in Bicep v0.10.13 for all bicepconfig.json files under /infra-as-code/bicep
        "artifacts-parameters":{
          "level": "error"
        },
        "no-unused-existing-resources":{
          "level": "error"
        },
        "prefer-unquoted-property-names":{
          "level": "error"
        },
        "secure-params-in-nested-deploy":{
          "level": "error"
        },
        "secure-secrets-in-params":{
          "level": "error"
        },
        "use-recent-api-versions":{
          "level": "error"
        },
        "use-resource-id-functions":{
          "level": "error"
        },
        "use-stable-resource-identifiers":{
          "level": "error"
        }
  1. After updating all linter rules, there were a number of bicep files that failed to compile. Most of them needed their resource provider API version updated to the latest.

Breaking Changes

None

Testing Evidence

Automated testing will suffice.

As part of this Pull Request I have

@ghost ghost added the Needs: Triage 🔍 Needs triaging by the team label Sep 13, 2022
@jtracey93 jtracey93 added hygiene and removed Needs: Triage 🔍 Needs triaging by the team labels Sep 13, 2022
@DaFitRobsta DaFitRobsta changed the title doc: PE and wiki, linter chore: bicepconfig.json linter update Sep 13, 2022
@jtracey93 jtracey93 self-requested a review September 15, 2022 09:29
@jtracey93
Copy link
Collaborator

/azp run validateazcloud

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

jtracey93
jtracey93 previously approved these changes Sep 15, 2022
Copy link
Collaborator

@jtracey93 jtracey93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, will merge once checks pass.

Thanks

@jtracey93 jtracey93 self-requested a review September 15, 2022 10:37
Copy link
Collaborator

@jtracey93 jtracey93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @DaFitRobsta,

So, it did look good but the validation tests picked up an error based on the new linting rules for management groups at least which I think is a bicep bug so have raised here: Azure/bicep#8410

This then got me thinking why did ADO find it but not the GitHub Action. Investigation shows that the bicep version on the GitHub Action runner was 0.9.1 and not the latest. So have added some steps to the workflow .github/workflows/bicep-build-to-validate.yml in your branch (so just do a git pull to update your local clone of it) to now include a step to tell us the version and also install the latest version of bicep so we dont get hit by this again 👍

Now for you to investigate and work through these linter issues being highlighted as well as the upstream issue I created (I suspect we will get an answer from PG today/tomorrow - hopefully)

Any questions, ping me

@ghost ghost removed the Needs: Author Feedback label Sep 15, 2022
@DaFitRobsta
Copy link
Contributor Author

Hello @jtracey93,
I updated the CARML container registry bicep based on the linter failed check for using the latest API version. Also updated my local Bicep to the latest.
Thank you!

@jtracey93
Copy link
Collaborator

Hello @jtracey93,

I updated the CARML container registry bicep based on the linter failed check for using the latest API version. Also updated my local Bicep to the latest.

Thank you!

Onto the next failure. Might be worth changing the action to continue on error instead of throw straight out. And capture all failure in a variable and then display them all at the end.

Might make the process a bit better.

@DaFitRobsta
Copy link
Contributor Author

Hey @jtracey93,
The pipeline ran successfully. Please review and let me know if you have any questions.
Thank you

@jtracey93
Copy link
Collaborator

/azp run validateazcloud

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jtracey93
Copy link
Collaborator

/azp run e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jtracey93
Copy link
Collaborator

E2Es failed due to FW and VWAN trying to be deployed at same time due to condition check error on ADO E2E (bug has been logged for this to be fixed)

Will merge PR

@jtracey93 jtracey93 merged commit 2d3d5b8 into Azure:main Sep 20, 2022
@DaFitRobsta DaFitRobsta deleted the bicep-config-update-2022-09 branch September 20, 2022 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants