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

Docs/quickstart for ado #3220

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

that-ar-guy
Copy link
Contributor

@that-ar-guy that-ar-guy commented Jan 7, 2025

fixes: #3106
Summary
This PR adds a new quickstart guide called for using PSRule for Azure with Azure DevOps at PSRules.Rules.Azure/docs/quickstart . The guide provides detailed steps for setting up a pipeline to validate Infrastructure as Code (IaC) templates, including ARM and Bicep files. The pipeline includes:

  • Installation of the PSRule.Rules.Azure module.
  • Validation of IaC templates.
  • Publishing results as Azure DevOps Test Reports.

The guide aligns with the format of the existing GitHub Actions quickstart and addresses user requests for Azure DevOps examples.

PR Checklist

  • PR has a meaningful title
  • Summarized changes
  • Change is not breaking
  • This PR is ready to merge and is not Work in Progress

@that-ar-guy that-ar-guy requested a review from a team as a code owner January 7, 2025 17:14
Copy link
Collaborator

@BernieWhite BernieWhite left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @that-ar-guy. Great work!

A few suggestions, below. Also let's change the file name to test-bicep-with-azure-pipelines.md and add any entry to:

docs/quickstarts/quickstart-for-ado.md Outdated Show resolved Hide resolved
docs/quickstarts/quickstart-for-ado.md Outdated Show resolved Hide resolved
docs/quickstarts/quickstart-for-ado.md Outdated Show resolved Hide resolved

- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Publishing results in NUnit would require configuring ps-rule.yaml or setting options via environment variables. Also expansion needs to be enabled.

We should add something similar to: https://azure.github.io/PSRule.Rules.Azure/quickstarts/test-bicep-with-github/#create-an-options-file

Maybe you can use the same markdown and add the adjustments for outputting results by setting options for Output.Format and Output.Path into ps-rule.yaml.

https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Options/#outputpath

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before I proceed with the updates, I’d like to confirm if I’m heading in the right direction:

  1. Switch to NUnit for Test Results:
    Should I update the pipeline to use NUnit instead of JUnit for publishing results? I’ll also ensure the results are outputted to .psrule-output/results.xml.

  2. Update ps-rule.yaml Configuration:
    You mentioned configuring the ps-rule.yaml file. I plan to include the following settings:

    • Output.Format: NUnit
    • Output.Path: .psrule-output/results.xml
    • Expand: true to enable detailed rule explanations.
  3. Documentation Update:
    I’ll update the quickstart guide to explain how to configure the ps-rule.yaml file with these settings, and also reference the relevant PSRule documentation.

Is that aligned with what you were expecting?

docs/quickstarts/quickstart-for-ado.md Outdated Show resolved Hide resolved
@that-ar-guy
Copy link
Contributor Author

Hi @BernieWhite,

Thanks for reviewing my PR and sharing your feedback! I’ll work on the requested changes and get them done ASAP.

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.

Create a quickstart for Azure DevOps
2 participants