Skip to content

Update .build README#2139

Merged
johlju merged 23 commits intomainfrom
fix/build-readme
Aug 19, 2025
Merged

Update .build README#2139
johlju merged 23 commits intomainfrom
fix/build-readme

Conversation

@johlju
Copy link
Copy Markdown
Member

@johlju johlju commented Aug 19, 2025

Pull Request (PR) description

  • Update .build README

This Pull Request (PR) fixes the following issues

None.

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation updated in the resource's README.md.
  • Resource parameter descriptions updated in schema.mof.
  • Comment-based help updated, including parameter descriptions.
  • Localization strings updated.
  • Examples updated.
  • Unit tests updated. See DSC Community Testing Guidelines.
  • Integration tests updated (where possible). See DSC Community Testing Guidelines.
  • Code changes adheres to DSC Community Style Guidelines.

This change is Reviewable

@johlju johlju requested a review from a team as a code owner August 19, 2025 10:36
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 19, 2025

Walkthrough

Adds branch-aware pipeline gating that invokes .build/Test-ShouldRunDscResourceIntegrationTests.ps1 (now supporting a -UseMergeBase mode) to compute a boolean ShouldRunDscResourceIntegrationTests; updates script docs, pipeline wiring, editor spell list, changelog, and style guidelines.

Changes

Cohort / File(s) Summary
Build script & docs
./.build/Test-ShouldRunDscResourceIntegrationTests.ps1, ./.build/README.md
Adds UseMergeBase SwitchParameter and threads it through Test-ShouldRunDscResourceIntegrationTestsGet-ChangedFiles; when set, diffs from git merge-base (falls back to From..To), includes untracked files for HEAD, updates messages and examples; README rewritten to document script-centric categories, parameters, outputs, and Azure Pipelines usage.
Pipeline YAML
azure-pipelines.yml
Replaces unconditional logic with branch-aware flow that computes $shouldRun using the script (PR target: origin/<PR target>/HEAD; default branch: set true; non-default: origin/<defaultBranch>/HEAD with -UseMergeBase); exports raw ShouldRunDscResourceIntegrationTests output and updates downstream stage conditions to use lower(...) == 'true'; adds host logging.
Editor settings
.vscode/settings.json
Appends cSpell words: SOURCEBRANCH, SOURCEBRANCHNAME, setvariable.
Changelog
CHANGELOG.md
Removes a single Unreleased "Changed" bullet (documentation-only deletion).
Contributor guidelines
.github/instructions/dsc-community-style-guidelines-markdown.instructions.md
Updates 80-character wrap guidance to exclude tables/code blocks and adds instruction to disable MD013 for long tables/code blocks.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Pipeline as Azure Pipeline
    participant Script as Test-ShouldRunDscResourceIntegrationTests.ps1
    participant Git as Git repo

    Pipeline->>Git: determine build context (PR target? default branch?)
    alt PR build
        Pipeline->>Script: invoke -BaseBranch origin/<PR target> -CurrentBranch HEAD
    else Default branch build
        Pipeline->>Pipeline: set ShouldRun = true
    else Non-default branch build
        Pipeline->>Script: invoke -BaseBranch origin/<defaultBranch> -CurrentBranch HEAD -UseMergeBase
    end
    Script->>Script: if -UseMergeBase compute merge-base(From,To) else use From
    Script-->>Pipeline: return boolean ShouldRun
    Pipeline->>Pipeline: export ShouldRunDscResourceIntegrationTests
    Pipeline->>Stages: run integration/resource stages if lower(ShouldRun) == 'true'
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7cbe0fd and bc784e2.

📒 Files selected for processing (2)
  • .build/README.md (2 hunks)
  • .build/Test-ShouldRunDscResourceIntegrationTests.ps1 (9 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Applied to files:

  • .build/README.md
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Include the standard integration test setup block (BeforeDiscovery/BeforeAll with module loading) before the first Describe block

Applied to files:

  • .build/README.md
🪛 LanguageTool
.build/README.md

[grammar] ~1-~1: Use correct spacing
Context: # .build scripts Documentation for the SqlServerDsc modul...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...erDsc module build and pipeline scripts. ## Test-ShouldRunDscResourceIntegrationTests.ps1 This script dynamically determines wheth...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: There might be a mistake here.
Context: ...s whether DSC resource integration tests should run in Azure Pipelines. ### What...

(QB_NEW_EN)


[grammar] ~8-~8: Use correct spacing
Context: ...ion tests should run in Azure Pipelines. ### What the Script Does <!-- markdownlint-d...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~10-~10: Use correct spacing
Context: ...ure Pipelines. ### What the Script Does The [`Test-ShouldRunDscResourceIntegrati...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~14-~14: There might be a mistake here.
Context: ...rs which public commands are used by DSC resources and classes, then checks if an...

(QB_NEW_EN)


[grammar] ~15-~15: Use correct spacing
Context: ...f any relevant files have been modified. ### How It Works The script checks for chan...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~17-~17: Use correct spacing
Context: ...es have been modified. ### How It Works The script checks for changes to: 1. **...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~30-~30: Use correct spacing
Context: .../Integration/Resources/` ### Parameters | Parameter | Type | Default | Purpose |...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~32-~32: There might be a mistake here.
Context: ...| Parameter | Type | Default | Purpose | |-----------|------|---------|---------|...

(QB_NEW_EN)


[grammar] ~33-~33: There might be a mistake here.
Context: ...|-----------|------|---------|---------| | BaseBranch | String | `'origin/main'...

(QB_NEW_EN)


[grammar] ~34-~34: There might be a mistake here.
Context: ...ain'| Base branch to compare against | |CurrentBranch| String |'HEAD'` | ...

(QB_NEW_EN)


[grammar] ~35-~35: There might be a mistake here.
Context: ... | Current branch or commit to compare | | UseMergeBase | Switch | $false | U...

(QB_NEW_EN)


[grammar] ~36-~36: Use correct spacing
Context: ... | Use merge-base to compute diff base | ### Outputs <!-- markdownlint-disable MD013...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~38-~38: Use correct spacing
Context: ...base to compute diff base | ### Outputs | Output | Type | Description | |-------...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~41-~41: There might be a mistake here.
Context: ...ions --> | Output | Type | Description | |--------|------|-------------| | Return...

(QB_NEW_EN)


[grammar] ~42-~42: There might be a mistake here.
Context: ...iption | |--------|------|-------------| | Return value | Boolean | $true when ...

(QB_NEW_EN)


[grammar] ~43-~43: Use correct spacing
Context: ...lse` when no such changes are detected | ### Usage #### Azure Pipelines The Azure P...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~46-~46: Use correct spacing
Context: ...markdownlint-enable MD013 --> ### Usage #### Azure Pipelines The Azure Pipelines tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~48-~48: Use correct spacing
Context: ...013 --> ### Usage #### Azure Pipelines The Azure Pipelines task sets an output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~51-~51: There might be a mistake here.
Context: ...ce integration tests. The script returns a boolean value that the pipeline captur...

(QB_NEW_EN)


[grammar] ~52-~52: Use correct spacing
Context: ... value that the pipeline captures, e.g.: yaml - powershell: | $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD -UseMergeBase Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun" displayName: 'Determine if DSC resource tests should run' name: determineShouldRun Downstream stages reference this output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~64-~64: There might be a mistake here.
Context: ... output variable in a stage condition: using the pattern: <!-- markdownlint-dis...

(QB_NEW_EN)


[grammar] ~65-~65: Use correct spacing
Context: ... a stage condition: using the pattern: yaml condition: | and( succeeded(), eq(lower(dependencies.stageName.outputs['jobName.taskName.ShouldRunDscResourceIntegrationTests']), 'true') ) #### Command Line ```powershell # Basic usag...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~76-~76: Use correct spacing
Context: ...lint-enable MD013 --> #### Command Line powershell # Basic usage (compares current HEAD with origin/main) .build/Test-ShouldRunDscResourceIntegrationTests.ps1 # Custom branches .build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \ -CurrentBranch 'feature-branch'

(QB_NEW_EN_OTHER_ERROR_IDS_5)

🔇 Additional comments (6)
.build/Test-ShouldRunDscResourceIntegrationTests.ps1 (4)

20-24: UseMergeBase parameter docs and examples are clear and consistent

Good addition. The synopsis, parameter descriptions, and examples align with the implemented behavior and improve discoverability.

Also applies to: 31-33, 161-170, 168-170, 393-397, 407-409


48-50: Plumbing -UseMergeBase through all call sites looks correct

The switch is correctly added to the top-level parameter block, forwarded into Get-ChangedFiles, and consumed by Test-ShouldRunDscResourceIntegrationTests.

Also applies to: 187-190, 426-429


451-452: Good: forwarding -UseMergeBase into Get-ChangedFiles

Ensures end-to-end correctness of the switch.


542-543: Good: main-path invocation also wires -UseMergeBase

Keeps CLI usage consistent with function semantics.

.build/README.md (2)

1-9: Scope and intro read well

The retitled header and concise summary make the page immediately useful.


55-61: Nice: example uses -UseMergeBase and names the step

The snippet aligns with the pipeline gating intent and makes the output consumable across jobs/stages.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/build-readme

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
.build/README.md (4)

45-47: Mention the requirement to set a step name when referencing outputs

Since the reference pattern uses StepName.VariableName, call out explicitly that the producing step must have a name: property (not just displayName).

Example reference:

  • dependencies.PreChecks.outputs['SetShouldRunVar.ShouldRunDscResourceIntegrationTests']

32-43: Optional: Show a gated stage/job example (aligns with repo practices)

Add a short example demonstrating how to gate, e.g., Integration_Test_Resources_SqlServer stage, using the output variable. This aligns with the repo convention of grouping integration tests (per prior learnings).

stages:
- stage: Integration_Test_Resources_SqlServer
  condition: and(succeeded(), eq(dependencies.PreChecks.outputs['SetShouldRunVar.ShouldRunDscResourceIntegrationTests'], 'true'))
  jobs:
  - job: Run_Resource_Tests
    steps:
    - script: echo "Running resource integration tests..."

Note: Based on previously captured guidance about organizing integration test groups in the pipeline (referencing Integration_Test_* stages).


49-58: Fix PowerShell invocation and line continuation in CLI examples

  • Use the call operator (&) when invoking a script by path.
  • Forward slashes are fine, but prefix with ./ for relative path.
  • PowerShell uses backtick (`) for line continuation, not backslash ().
 ```powershell
 # Basic usage (compares current HEAD with origin/main)
-.build/Test-ShouldRunDscResourceIntegrationTests.ps1
+& ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1

 # Custom branches
-.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \
-    -CurrentBranch 'feature-branch'
+& ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 `
+    -BaseBranch 'origin/dev' `
+    -CurrentBranch 'feature-branch'

---

`32-43`: **Update Azure Pipelines snippet in .build/README.md**

- Use the full `PowerShell@2` task with `pwsh: true` (cross-platform) rather than the old `powershell:` shorthand.  
- Add a `name: determineDscResourceTests` so downstream jobs can reference  
  `dependencies.<JobName>.outputs['determineDscResourceTests.ShouldRunDscResourceIntegrationTests']`.  
- Normalize the output to lowercase strings (`'true'`/`'false'`) for reliable conditions.  
- Initialize `$targetBranch` from `$(System.PullRequest.TargetBranch)`, falling back to `origin/main` if unset.

```diff
 File: .build/README.md
 Lines: 32-43

 #### Azure Pipelines

-The Azure Pipelines task sets an output variable that downstream stages can
-use to conditionally run DSC resource integration tests. The script returns
-a boolean value that the pipeline captures, e.g.:
+The Azure Pipelines task sets an output variable that downstream stages can
+use to conditionally run DSC resource integration tests. Example:

-```yaml
-- powershell: |
-    $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD
-    Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun"
-  displayName: 'Determine if DSC resource tests should run'
-```
+```yaml
+- task: PowerShell@2
+  name: determineDscResourceTests
+  displayName: 'Determine if DSC Resource Integration Tests Should Run'
+  inputs:
+    targetType: inline
+    script: |
+      # Determine the target branch (PR target or default to main)
+      $targetBranch = "origin/$(System.PullRequest.TargetBranch)"
+      if (-not $env:SYSTEM_PULLREQUEST_TARGETBRANCH) {
+        $targetBranch = 'origin/main'
+      }
+
+      Write-Output "Target branch: $targetBranch"
+      Write-Output "Current branch: HEAD"
+
+      # Run the DSC-tests detection script
+      $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 `
+        -BaseBranch $targetBranch -CurrentBranch HEAD
+
+      # Normalize and publish the boolean output
+      Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$($shouldRun.ToString().ToLower())"
+  pwsh: true
+```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9df1132 and e831d79.

📒 Files selected for processing (2)
  • .build/README.md (3 hunks)
  • CHANGELOG.md (0 hunks)
💤 Files with no reviewable changes (1)
  • CHANGELOG.md
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Applied to files:

  • .build/README.md
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Include the standard integration test setup block (BeforeDiscovery/BeforeAll with module loading) before the first Describe block

Applied to files:

  • .build/README.md
🪛 LanguageTool
.build/README.md

[grammar] ~1-~1: Use correct spacing
Context: # Scripts Documentation for the specific SqlServer...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...ic SqlServerDsc module pipeline scripts. ## Test-ShouldRunDscResourceIntegrationTests.ps1 The script is used to dynamically determ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: There might be a mistake here.
Context: ...sed to dynamically determine whether DSC resource integration tests should run in...

(QB_NEW_EN)


[grammar] ~8-~8: Use correct spacing
Context: ...ion tests should run in Azure Pipelines. ### What the Script Does The `Test-ShouldRu...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~10-~10: Use correct spacing
Context: ...ure Pipelines. ### What the Script Does The `Test-ShouldRunDscResourceIntegratio...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~14-~14: There might be a mistake here.
Context: ...rs which public commands are used by DSC resources and classes, then checks if an...

(QB_NEW_EN)


[grammar] ~15-~15: Use correct spacing
Context: ...f any relevant files have been modified. ### How It Works The script checks for chan...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~17-~17: Use correct spacing
Context: ...es have been modified. ### How It Works The script checks for changes to: 1. **...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~30-~30: Use correct spacing
Context: ...tests/Integration/Resources/` ### Usage #### Azure Pipelines The Azure Pipelines tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~32-~32: Use correct spacing
Context: ...urces/` ### Usage #### Azure Pipelines The Azure Pipelines task sets an output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~49-~49: Use correct spacing
Context: ...rce tests should run. #### Command Line powershell # Basic usage (compares current HEAD with origin/main) .build/Test-ShouldRunDscResourceIntegrationTests.ps1 # Custom branches .build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \ -CurrentBranch 'feature-branch'

(QB_NEW_EN_OTHER_ERROR_IDS_5)

🔇 Additional comments (3)
.build/README.md (3)

5-5: Section heading looks good


10-10: Heading level and content are clear


17-17: Clear breakdown of detection categories

The auto-numbered list and category definitions read well.

Comment thread .build/README.md Outdated
Comment thread .build/README.md
Comment thread .build/README.md
johlju and others added 4 commits August 19, 2025 12:49
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
.build/README.md (3)

36-41: Azure Pipelines: add step name to enable output variable consumption

To reference step outputs via dependencies.Job.outputs['Step.Var'], the step must have a name.

Apply:

 - powershell: |
     $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD
     Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun"
   displayName: 'Determine if DSC resource tests should run'
+  name: setShouldRunDscResourceTests

43-46: Show a concrete downstream usage with dependencies + condition

Give readers a copy-pasteable condition that gates a job on the step output. Using toLower hardens the comparison.

Apply:

 Downstream stages reference this output variable using the pattern:
 `dependencies.JobName.outputs['StepName.VariableName']` to gate their
 execution based on whether DSC resource tests should run.
+
+Example:
+
+```yaml
+jobs:
+- job: DetermineTests
+  steps:
+  - powershell: |
+      $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD
+      Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun"
+    name: setShouldRunDscResourceTests
+    displayName: 'Determine if DSC resource tests should run'
+
+- job: RunIntegration
+  displayName: 'Run DSC resource integration tests'
+  dependsOn: DetermineTests
+  condition: >
+    eq(
+      toLower(dependencies.DetermineTests.outputs['setShouldRunDscResourceTests.ShouldRunDscResourceIntegrationTests']),
+      'true'
+    )
+  steps:
+  - script: echo "Running integration tests..."
+```
+
+Note: Align the DetermineTests/RunIntegration job names with your pipeline. Per team conventions, you’ll typically wire this into the Integration_Test_Commands_SqlServer stage. 

I can open a follow-up PR to update azure-pipelines.yml with this gating, grouped under the appropriate Integration_Test_Commands_SqlServer buckets (based on our prior guideline).


49-56: PowerShell line continuation is incorrect; use backtick (not backslash)

Backslash is not a line continuation in PowerShell; the sample would not run as intended. Also make the path explicitly relative for consistency.

Apply:

 ```powershell
 # Basic usage (compares current HEAD with origin/main)
-.build/Test-ShouldRunDscResourceIntegrationTests.ps1
+./.build/Test-ShouldRunDscResourceIntegrationTests.ps1
 
 # Custom branches
-.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \
-    -CurrentBranch 'feature-branch'
+./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' `
+    -CurrentBranch 'feature-branch'

</blockquote></details>

</blockquote></details>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between e831d79 and 4b76372.

📒 Files selected for processing (1)
  • .build/README.md (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Applied to files:

  • .build/README.md
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Include the standard integration test setup block (BeforeDiscovery/BeforeAll with module loading) before the first Describe block

Applied to files:

  • .build/README.md
🪛 LanguageTool
.build/README.md

[grammar] ~1-~1: Use correct spacing
Context: # .build scripts Documentation for the SqlServerDsc modul...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...ServerDsc module build/pipeline scripts. ## Test-ShouldRunDscResourceIntegrationTests.ps1 This script dynamically determines wheth...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~8-~8: Use correct spacing
Context: ...zure Pipelines. ### What the Script Does The `Test-ShouldRunDscResourceIntegratio...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~12-~12: There might be a mistake here.
Context: ...rs which public commands are used by DSC resources and classes, then checks if an...

(QB_NEW_EN)


[grammar] ~13-~13: Use correct spacing
Context: ...f any relevant files have been modified. ### How It Works The script checks for chan...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~15-~15: Use correct spacing
Context: ...es have been modified. ### How It Works The script checks for changes to: 1. **...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~28-~28: Use correct spacing
Context: ...tests/Integration/Resources/` ### Usage #### Azure Pipelines The Azure Pipelines tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~30-~30: Use correct spacing
Context: ...urces/` ### Usage #### Azure Pipelines The Azure Pipelines task sets an output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~47-~47: Use correct spacing
Context: ...rce tests should run. #### Command Line powershell # Basic usage (compares current HEAD with origin/main) .build/Test-ShouldRunDscResourceIntegrationTests.ps1 # Custom branches .build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \ -CurrentBranch 'feature-branch'

(QB_NEW_EN_OTHER_ERROR_IDS_5)

🪛 markdownlint-cli2 (0.17.2)
.build/README.md

7-7: Line length
Expected: 80; Actual: 104

(MD013, line-length)


8-8: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above

(MD022, blanks-around-headings)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
  • GitHub Check: PSScriptAnalyzer
🔇 Additional comments (1)
.build/README.md (1)

1-1: Title scope is clear — good change

Renaming to “.build scripts” clarifies the scope of this README.

Comment thread .build/README.md Outdated
Comment thread .build/README.md Outdated
Comment thread .build/README.md
Comment thread .build/README.md
johlju and others added 4 commits August 19, 2025 13:59
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@johlju
Copy link
Copy Markdown
Member Author

johlju commented Aug 19, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 19, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4b76372 and 848af0d.

📒 Files selected for processing (4)
  • .build/README.md (2 hunks)
  • .vscode/settings.json (1 hunks)
  • CHANGELOG.md (0 hunks)
  • azure-pipelines.yml (6 hunks)
💤 Files with no reviewable changes (1)
  • CHANGELOG.md
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit Configuration File

**: # DSC Community Guidelines

Terminology

  • Command: Public command
  • Function: Private function
  • Resource: DSC class-based resource

Build & Test Workflow

  • Run project scripts in PowerShell from repository root
  • Build after source changes: .\build.ps1 -Tasks build
  • Test workflow: Build → Invoke-Pester -Path @('<test paths>') -Output Detailed
  • New session required after class changes

File Organization

  • Public commands: source/Public/{CommandName}.ps1
  • Private functions: source/Private/{FunctionName}.ps1
  • Unit tests: tests/Unit/{Classes|Public|Private}/{Name}.Tests.ps1
  • Integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Requirements

  • Always update CHANGELOG.md Unreleased section
  • Localize all strings using string keys
  • Check DscResource.Common before creating private functions
  • Separate reusable logic into private functions
  • Add unit tests for all commands/functions/resources
  • Add integration tests for all public commands and resources

Files:

  • azure-pipelines.yml
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Applied to files:

  • .build/README.md
  • azure-pipelines.yml
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Include the standard integration test setup block (BeforeDiscovery/BeforeAll with module loading) before the first Describe block

Applied to files:

  • .build/README.md
🪛 LanguageTool
.build/README.md

[grammar] ~1-~1: Use correct spacing
Context: # .build scripts Documentation for the SqlServerDsc modul...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...erDsc module build and pipeline scripts. ## Test-ShouldRunDscResourceIntegrationTests.ps1 This script dynamically determines wheth...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: There might be a mistake here.
Context: ...s whether DSC resource integration tests should run in Azure Pipelines. ### What...

(QB_NEW_EN)


[grammar] ~8-~8: Use correct spacing
Context: ...ion tests should run in Azure Pipelines. ### What the Script Does <!-- markdownlint-d...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~10-~10: Use correct spacing
Context: ...ure Pipelines. ### What the Script Does The [`Test-ShouldRunDscResourceIntegrati...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~14-~14: There might be a mistake here.
Context: ...rs which public commands are used by DSC resources and classes, then checks if an...

(QB_NEW_EN)


[grammar] ~15-~15: Use correct spacing
Context: ...f any relevant files have been modified. ### How It Works The script checks for chan...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~17-~17: Use correct spacing
Context: ...es have been modified. ### How It Works The script checks for changes to: 1. **...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~30-~30: Use correct spacing
Context: .../Integration/Resources/` ### Parameters | Parameter | Type | Default | Purpose |...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~32-~32: There might be a mistake here.
Context: ...| Parameter | Type | Default | Purpose | |-----------|------|---------|---------|...

(QB_NEW_EN)


[grammar] ~33-~33: There might be a mistake here.
Context: ...|-----------|------|---------|---------| | BaseBranch | String | `'origin/main'...

(QB_NEW_EN)


[grammar] ~34-~34: There might be a mistake here.
Context: ...ain'| Base branch to compare against | |CurrentBranch| String |'HEAD'` | ...

(QB_NEW_EN)


[grammar] ~35-~35: Use correct spacing
Context: ... | Current branch or commit to compare | ### Usage #### Azure Pipelines The Azure P...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~37-~37: Use correct spacing
Context: ...branch or commit to compare | ### Usage #### Azure Pipelines The Azure Pipelines tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~39-~39: Use correct spacing
Context: ...mpare | ### Usage #### Azure Pipelines The Azure Pipelines task sets an output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~42-~42: There might be a mistake here.
Context: ...ce integration tests. The script returns a boolean value that the pipeline captur...

(QB_NEW_EN)


[grammar] ~43-~43: Use correct spacing
Context: ... value that the pipeline captures, e.g.: yaml - powershell: | $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun" displayName: 'Determine if DSC resource tests should run' Downstream stages reference this output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~54-~54: There might be a mistake here.
Context: ... output variable in a stage condition: using the pattern: <!-- markdownlint-dis...

(QB_NEW_EN)


[grammar] ~55-~55: Use correct spacing
Context: ... a stage condition: using the pattern: yaml condition: | and( succeeded(), eq(lower(dependencies.stageName.outputs['jobName.taskName.ShouldRunDscResourceIntegrationTests']), 'true')` ) #### Command Line ```powershell # Basic usag...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~67-~67: Use correct spacing
Context: ...lint-enable MD013 --> #### Command Line powershell # Basic usage (compares current HEAD with origin/main) .build/Test-ShouldRunDscResourceIntegrationTests.ps1 # Custom branches .build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \ -CurrentBranch 'feature-branch'

(QB_NEW_EN_OTHER_ERROR_IDS_5)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: dsccommunity.SqlServerDsc (Quality Test and Unit Test Unit)
  • GitHub Check: dsccommunity.SqlServerDsc (Quality Test and Unit Test HQRM)
  • GitHub Check: dsccommunity.SqlServerDsc (Quality Test and Unit Test Determine DSC Resource Test Requirements)
  • GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
🔇 Additional comments (2)
.vscode/settings.json (1)

89-93: LGTM: dictionary additions are appropriate

Adding SOURCEBRANCH, SOURCEBRANCHNAME, and setvariable aligns with the new Azure DevOps variable usage in the pipeline. No runtime impact.

azure-pipelines.yml (1)

452-452: Good: robust boolean handling in conditions

Using lower(...) around the output before comparing to 'true' makes the gating resilient to different casings/types of the output variable.

Also applies to: 550-550, 646-646, 721-721, 788-788

Comment thread .build/README.md Outdated
Comment thread .build/README.md
Comment thread .build/README.md
Comment thread azure-pipelines.yml Outdated
Comment thread azure-pipelines.yml Outdated
Comment thread azure-pipelines.yml
Comment thread azure-pipelines.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
azure-pipelines.yml (1)

286-301: Add all missing integration tests to PesterPath in azure-pipelines.yml

Several .Integration.Tests.ps1 files under tests/Integration/Commands aren’t referenced in the PesterPath array. Please include these scripts—grouped logically—so the CI stage covers every public command:

Missing scripts:

  • tests/Integration/Commands/Get-SqlDscInstalledInstance.Integration.Tests.ps1
  • tests/Integration/Commands/Get-SqlDscRSSetupConfiguration.Integration.Tests.ps1
  • tests/Integration/Commands/Test-SqlDscRSInstalled.Integration.Tests.ps1
  • tests/Integration/Commands/Install-SqlDscReportingService.Integration.Tests.ps1
  • tests/Integration/Commands/Install-SqlDscBIReportServer.Integration.Tests.ps1
  • tests/Integration/Commands/Repair-SqlDscReportingService.Integration.Tests.ps1
  • tests/Integration/Commands/Repair-SqlDscBIReportServer.Integration.Tests.ps1
  • tests/Integration/Commands/Uninstall-SqlDscReportingService.Integration.Tests.ps1
  • tests/Integration/Commands/Uninstall-SqlDscBIReportServer.Integration.Tests.ps1

Example diff (insert after the Group 2 block):

   # Group 2
   'tests/Integration/Commands/Remove-SqlDscLogin.Integration.Tests.ps1'
+  # Group 3: Instance checks
+  'tests/Integration/Commands/Get-SqlDscInstalledInstance.Integration.Tests.ps1'
+  'tests/Integration/Commands/Get-SqlDscRSSetupConfiguration.Integration.Tests.ps1'
+  'tests/Integration/Commands/Test-SqlDscRSInstalled.Integration.Tests.ps1'
+  # Group 4: Reporting Services install
+  'tests/Integration/Commands/Install-SqlDscReportingService.Integration.Tests.ps1'
+  'tests/Integration/Commands/Install-SqlDscBIReportServer.Integration.Tests.ps1'
+  # Group 5: Service repair
+  'tests/Integration/Commands/Repair-SqlDscReportingService.Integration.Tests.ps1'
+  'tests/Integration/Commands/Repair-SqlDscBIReportServer.Integration.Tests.ps1'
+  # Group 6: Service uninstall
+  'tests/Integration/Commands/Uninstall-SqlDscReportingService.Integration.Tests.ps1'
+  'tests/Integration/Commands/Uninstall-SqlDscBIReportServer.Integration.Tests.ps1'
   # Group 9
   'tests/Integration/Commands/Uninstall-SqlDscServer.Integration.Tests.ps1'

This will ensure every integration test script under tests/Integration/Commands runs in CI.

♻️ Duplicate comments (3)
azure-pipelines.yml (3)

97-102: Normalize PR target branch before composing origin/

System.PullRequest.TargetBranch often includes the refs/heads/ prefix. Using it verbatim yields origin/refs/heads/, which is not a valid remote-tracking ref.

Apply this diff to normalize:

-                if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH)
-                {
-                    $targetBranch = "origin/$env:SYSTEM_PULLREQUEST_TARGETBRANCH"
-                    Write-Host "Pull request detected, branch $targetBranch. Using script analysis to determine test requirements."
-                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch 'HEAD'
-                }
+                if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH)
+                {
+                    $prTarget = $env:SYSTEM_PULLREQUEST_TARGETBRANCH
+                    if ($prTarget -like 'refs/heads/*') { $prTarget = $prTarget.Substring(11) }
+                    $targetBranch = "origin/$prTarget"
+                    Write-Host "Pull request detected, branch $targetBranch. Using script analysis to determine test requirements."
+                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch 'HEAD'
+                }

103-107: Fix PowerShell env var name and stray quote in elseif condition

PowerShell environment variables use underscores, not dots. There is also an extra trailing single quote causing a syntax error.

Apply this diff:

-                elseif ($env:BUILD.SOURCEBRANCHNAME -eq '$(defaultBranch)'')
+                elseif ($env:BUILD_SOURCEBRANCHNAME -eq '$(defaultBranch)')
                 {
                     Write-Host "Target is default branch ($(defaultBranch)). Always running DSC resource integration tests."
                     $shouldRun = $true
                 }

108-112: Use correct env var and avoid hardcoding base branch

Replace the dotted env var with the proper underscore name and parameterize the base branch with $(defaultBranch) to avoid drift.

Apply this diff:

-                    Write-Host "Target is non-default branch ($env:BUILD.SOURCEBRANCH). Using script analysis to determine test requirements against default branch."
-                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/main' -CurrentBranch $env:BUILD.SOURCEBRANCH
+                    Write-Host "Target is non-default branch ($env:BUILD_SOURCEBRANCH). Using script analysis to determine test requirements against default branch."
+                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch "origin/$(defaultBranch)" -CurrentBranch $env:BUILD_SOURCEBRANCH
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 848af0d and b0834f8.

📒 Files selected for processing (1)
  • azure-pipelines.yml (6 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
azure-pipelines.yml

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Files:

  • azure-pipelines.yml
**

⚙️ CodeRabbit Configuration File

**: # DSC Community Guidelines

Terminology

  • Command: Public command
  • Function: Private function
  • Resource: DSC class-based resource

Build & Test Workflow

  • Run project scripts in PowerShell from repository root
  • Build after source changes: .\build.ps1 -Tasks build
  • Test workflow: Build → Invoke-Pester -Path @('<test paths>') -Output Detailed
  • New session required after class changes

File Organization

  • Public commands: source/Public/{CommandName}.ps1
  • Private functions: source/Private/{FunctionName}.ps1
  • Unit tests: tests/Unit/{Classes|Public|Private}/{Name}.Tests.ps1
  • Integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Requirements

  • Always update CHANGELOG.md Unreleased section
  • Localize all strings using string keys
  • Check DscResource.Common before creating private functions
  • Separate reusable logic into private functions
  • Add unit tests for all commands/functions/resources
  • Add integration tests for all public commands and resources

Files:

  • azure-pipelines.yml
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Applied to files:

  • azure-pipelines.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
  • GitHub Check: PSScriptAnalyzer
  • GitHub Check: PSScriptAnalyzer

Comment thread azure-pipelines.yml
Comment thread azure-pipelines.yml
Comment thread azure-pipelines.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.build/README.md (1)

79-81: PowerShell line continuation uses backtick (`), not backslash

Backslash line breaks won’t work in PowerShell. Use the backtick or place parameters on one line.

-.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \
-    -CurrentBranch 'feature-branch'
+.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' `
+    -CurrentBranch 'feature-branch'
♻️ Duplicate comments (4)
azure-pipelines.yml (3)

103-107: Fix PowerShell env var name and condition syntax

Use $env:BUILD_SOURCEBRANCHNAME (underscore), not $env:BUILD.SOURCEBRANCHNAME (dot).

-                elseif ($env:BUILD.SOURCEBRANCHNAME -eq '$(defaultBranch)')
+                elseif ($env:BUILD_SOURCEBRANCHNAME -eq '$(defaultBranch)')
                 {
                     Write-Host "Target is default branch ($(defaultBranch)). Always running DSC resource integration tests."
                     $shouldRun = $true
                 }

97-102: Normalize PR target branch ref before prefixing with origin/

SYSTEM_PULLREQUEST_TARGETBRANCH often includes the refs/heads/ prefix. Using it directly yields origin/refs/heads/, which won’t exist as a remote-tracking ref locally.

-                if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH)
-                {
-                    $targetBranch = "origin/$env:SYSTEM_PULLREQUEST_TARGETBRANCH"
-                    Write-Host "Pull request detected, targeting branch $targetBranch. Using script analysis to determine test requirements."
-                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch 'HEAD'
-                }
+                if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH)
+                {
+                    $prTarget = $env:SYSTEM_PULLREQUEST_TARGETBRANCH
+                    if ($prTarget -like 'refs/heads/*') { $prTarget = $prTarget.Substring(11) }
+                    $targetBranch = "origin/$prTarget"
+                    Write-Host "Pull request detected, targeting base $targetBranch. Using script analysis to determine test requirements."
+                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch 'HEAD'
+                }

94-118: Make output deterministic and log evaluated refs for diagnostics

Emit explicit 'true'/'false' strings and log BaseRef/CurrentRef to aid troubleshooting. This also allows conditions to compare directly without a lowercase function.

-                # Determine if we should run DSC resource integration tests based on branch logic
-                $shouldRun = $false
-
-                if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH)
-                {
-                    $targetBranch = "origin/$env:SYSTEM_PULLREQUEST_TARGETBRANCH"
-                    Write-Host "Pull request detected, targeting branch $targetBranch. Using script analysis to determine test requirements."
-                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch 'HEAD'
-                }
-                elseif ($env:BUILD.SOURCEBRANCHNAME -eq '$(defaultBranch)')
-                {
-                    Write-Host "Target is default branch ($(defaultBranch)). Always running DSC resource integration tests."
-                    $shouldRun = $true
-                }
-                else
-                {
-                    Write-Host "Target is non-default branch ($env:BUILD.SOURCEBRANCH). Using script analysis to determine test requirements against default branch."
-                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch "origin/$env:BUILD.SOURCEBRANCH" -CurrentBranch 'HEAD'
-                }
-
-                # Set Azure DevOps output variable for pipeline conditions
-                Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun"
-
-                Write-Host "Variable ShouldRunDscResourceIntegrationTests is set to: $shouldRun"
+                # Determine if we should run DSC resource integration tests based on branch logic
+                $shouldRun = $false
+                $baseRef = $null
+                $currentRef = 'HEAD'
+
+                if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH)
+                {
+                    $prTarget = $env:SYSTEM_PULLREQUEST_TARGETBRANCH
+                    if ($prTarget -like 'refs/heads/*') { $prTarget = $prTarget.Substring(11) }
+                    $baseRef = "origin/$prTarget"
+                    Write-Host "Pull request detected. Using script analysis to determine test requirements."
+                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $baseRef -CurrentBranch $currentRef
+                }
+                elseif ($env:BUILD_SOURCEBRANCHNAME -eq '$(defaultBranch)')
+                {
+                    $baseRef = "origin/$(defaultBranch)"
+                    Write-Host "Target is default branch ($(defaultBranch)). Always running DSC resource integration tests."
+                    $shouldRun = $true
+                }
+                else
+                {
+                    $baseRef = "origin/$(defaultBranch)"
+                    Write-Host "Target is non-default branch ($env:BUILD_SOURCEBRANCH). Using script analysis to determine test requirements against default branch."
+                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $baseRef -CurrentBranch $currentRef
+                }
+
+                $shouldRunStr = if ($shouldRun) { 'true' } else { 'false' }
+
+                Write-Host "Determine DSC Resource Tests - BaseRef: $baseRef"
+                Write-Host "Determine DSC Resource Tests - CurrentRef: $currentRef"
+                Write-Host "Determine DSC Resource Tests - ShouldRun: $shouldRunStr"
+
+                # Set Azure DevOps output variable for pipeline conditions
+                Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRunStr"
.build/README.md (1)

10-16: Use a shorter heading and keep link formatting consistent

Optional wording tweak: “What It Does” is concise and avoids repeating “Script.”

-### What the Script Does
+### What It Does
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7398aac and bc080ac.

📒 Files selected for processing (3)
  • .build/README.md (2 hunks)
  • .github/instructions/dsc-community-style-guidelines-markdown.instructions.md (1 hunks)
  • azure-pipelines.yml (6 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
azure-pipelines.yml

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Files:

  • azure-pipelines.yml
**

⚙️ CodeRabbit Configuration File

**: # DSC Community Guidelines

Terminology

  • Command: Public command
  • Function: Private function
  • Resource: DSC class-based resource

Build & Test Workflow

  • Run project scripts in PowerShell from repository root
  • Build after source changes: .\build.ps1 -Tasks build
  • Test workflow: Build → Invoke-Pester -Path @('<test paths>') -Output Detailed
  • New session required after class changes

File Organization

  • Public commands: source/Public/{CommandName}.ps1
  • Private functions: source/Private/{FunctionName}.ps1
  • Unit tests: tests/Unit/{Classes|Public|Private}/{Name}.Tests.ps1
  • Integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Requirements

  • Always update CHANGELOG.md Unreleased section
  • Localize all strings using string keys
  • Check DscResource.Common before creating private functions
  • Separate reusable logic into private functions
  • Add unit tests for all commands/functions/resources
  • Add integration tests for all public commands and resources

Files:

  • azure-pipelines.yml
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to **/*.md : Markdown: wrap lines at word boundaries when exceeding 80 characters; use 2 spaces for indentation

Applied to files:

  • .github/instructions/dsc-community-style-guidelines-markdown.instructions.md
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Applied to files:

  • azure-pipelines.yml
  • .build/README.md
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Include the standard integration test setup block (BeforeDiscovery/BeforeAll with module loading) before the first Describe block

Applied to files:

  • .build/README.md
🪛 LanguageTool
.github/instructions/dsc-community-style-guidelines-markdown.instructions.md

[grammar] ~8-~8: There might be a mistake here.
Context: ...0 characters (except tables/code blocks) - Use 2 spaces for indentation - Use '1.' ...

(QB_NEW_EN_OTHER)


[grammar] ~12-~12: Use articles correctly
Context: ...d fenced code blocks with blank lines - Disable MD013 rule for tables/code blocks exc...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~12-~12: There might be a mistake here.
Context: ...bles/code blocks exceeding 80 characters

(QB_NEW_EN_OTHER)

.build/README.md

[grammar] ~1-~1: Use correct spacing
Context: # .build scripts Documentation for the SqlServerDsc modul...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...erDsc module build and pipeline scripts. ## Test-ShouldRunDscResourceIntegrationTests.ps1 This script dynamically determines wheth...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: There might be a mistake here.
Context: ...s whether DSC resource integration tests should run in Azure Pipelines. ### What...

(QB_NEW_EN)


[grammar] ~8-~8: Use correct spacing
Context: ...ion tests should run in Azure Pipelines. ### What the Script Does <!-- markdownlint-d...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~10-~10: Use correct spacing
Context: ...ure Pipelines. ### What the Script Does The [`Test-ShouldRunDscResourceIntegrati...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~14-~14: There might be a mistake here.
Context: ...rs which public commands are used by DSC resources and classes, then checks if an...

(QB_NEW_EN)


[grammar] ~15-~15: Use correct spacing
Context: ...f any relevant files have been modified. ### How It Works The script checks for chan...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~17-~17: Use correct spacing
Context: ...es have been modified. ### How It Works The script checks for changes to: 1. **...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~30-~30: Use correct spacing
Context: .../Integration/Resources/` ### Parameters | Parameter | Type | Default | Purpose |...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~32-~32: There might be a mistake here.
Context: ...| Parameter | Type | Default | Purpose | |-----------|------|---------|---------|...

(QB_NEW_EN)


[grammar] ~33-~33: There might be a mistake here.
Context: ...|-----------|------|---------|---------| | BaseBranch | String | `'origin/main'...

(QB_NEW_EN)


[grammar] ~34-~34: There might be a mistake here.
Context: ...ain'| Base branch to compare against | |CurrentBranch| String |'HEAD'` | ...

(QB_NEW_EN)


[grammar] ~35-~35: Use correct spacing
Context: ... | Current branch or commit to compare | ### Outputs | Output | Type | Description |...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~37-~37: Use correct spacing
Context: ...anch or commit to compare | ### Outputs | Output | Type | Description | |-------...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~39-~39: There might be a mistake here.
Context: ...Outputs | Output | Type | Description | |--------|------|-------------| | Return...

(QB_NEW_EN)


[grammar] ~40-~40: There might be a mistake here.
Context: ...iption | |--------|------|-------------| | Return value | Boolean | $true if br...

(QB_NEW_EN)


[grammar] ~41-~41: Use correct spacing
Context: ...if branches differ, $false otherwise | ### Usage #### Azure Pipelines The Azure P...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~43-~43: Use correct spacing
Context: ... differ, $false otherwise | ### Usage #### Azure Pipelines The Azure Pipelines tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~45-~45: Use correct spacing
Context: ...rwise | ### Usage #### Azure Pipelines The Azure Pipelines task sets an output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~48-~48: There might be a mistake here.
Context: ...ce integration tests. The script returns a boolean value that the pipeline captur...

(QB_NEW_EN)


[grammar] ~49-~49: Use correct spacing
Context: ... value that the pipeline captures, e.g.: yaml - powershell: | $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun" displayName: 'Determine if DSC resource tests should run' Downstream stages reference this output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~60-~60: There might be a mistake here.
Context: ... output variable in a stage condition: using the pattern: <!-- markdownlint-dis...

(QB_NEW_EN)


[grammar] ~61-~61: Use correct spacing
Context: ... a stage condition: using the pattern: yaml condition: | and( succeeded(), eq(lower(dependencies.stageName.outputs['jobName.taskName.ShouldRunDscResourceIntegrationTests']), 'true') ) #### Command Line ```powershell # Basic usag...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~72-~72: Use correct spacing
Context: ...lint-enable MD013 --> #### Command Line powershell # Basic usage (compares current HEAD with origin/main) .build/Test-ShouldRunDscResourceIntegrationTests.ps1 # Custom branches .build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \ -CurrentBranch 'feature-branch'

(QB_NEW_EN_OTHER_ERROR_IDS_5)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
  • GitHub Check: PSScriptAnalyzer
  • GitHub Check: PSScriptAnalyzer

Comment thread .build/README.md Outdated
Comment thread .github/instructions/dsc-community-style-guidelines-markdown.instructions.md Outdated
Comment thread azure-pipelines.yml Outdated
Comment thread azure-pipelines.yml
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (3)
.github/instructions/dsc-community-style-guidelines-markdown.instructions.md (2)

8-8: Clarify phrasing: “except in tables or code blocks”

Improves readability and aligns with natural English.

- - Wrap lines at word boundaries when over 80 characters (except tables/code blocks)
+ - Wrap lines at word boundaries when over 80 characters (except in tables or code blocks)

12-12: Use an article and parallel phrasing; specify “that exceed”

Reads more naturally and matches terminology used elsewhere in the repo.

- - Disable `MD013` rule by adding a comment for tables/code blocks exceeding 80 characters
+ - Disable the `MD013` rule for tables and code blocks that exceed 80 characters
.build/README.md (1)

10-12: Tighten heading and capitalize Git

Minor doc polish: more concise section title; use proper “Git” capitalization.

-### What the Script Does
+### What It Does
 <!-- markdownlint-disable-next-line MD013 -->
-The [`Test-ShouldRunDscResourceIntegrationTests.ps1`](./Test-ShouldRunDscResourceIntegrationTests.ps1) script analyzes git
+The [`Test-ShouldRunDscResourceIntegrationTests.ps1`](./Test-ShouldRunDscResourceIntegrationTests.ps1) script analyzes Git
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bc080ac and 11c7af0.

📒 Files selected for processing (2)
  • .build/README.md (2 hunks)
  • .github/instructions/dsc-community-style-guidelines-markdown.instructions.md (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to **/*.md : Markdown: wrap lines at word boundaries when exceeding 80 characters; use 2 spaces for indentation

Applied to files:

  • .github/instructions/dsc-community-style-guidelines-markdown.instructions.md
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Applied to files:

  • .build/README.md
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Include the standard integration test setup block (BeforeDiscovery/BeforeAll with module loading) before the first Describe block

Applied to files:

  • .build/README.md
🪛 LanguageTool
.github/instructions/dsc-community-style-guidelines-markdown.instructions.md

[grammar] ~8-~8: There might be a mistake here.
Context: ...0 characters (except tables/code blocks) - Use 2 spaces for indentation - Use '1.' ...

(QB_NEW_EN_OTHER)


[grammar] ~12-~12: Use articles correctly
Context: ...d fenced code blocks with blank lines - Disable MD013 rule by adding a comment for ta...

(QB_NEW_EN_OTHER_ERROR_IDS_11)


[grammar] ~12-~12: There might be a mistake here.
Context: ...bles/code blocks exceeding 80 characters

(QB_NEW_EN_OTHER)

.build/README.md

[grammar] ~1-~1: Use correct spacing
Context: # .build scripts Documentation for the SqlServerDsc modul...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...erDsc module build and pipeline scripts. ## Test-ShouldRunDscResourceIntegrationTests.ps1 This script dynamically determines wheth...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: There might be a mistake here.
Context: ...s whether DSC resource integration tests should run in Azure Pipelines. ### What...

(QB_NEW_EN)


[grammar] ~8-~8: Use correct spacing
Context: ...ion tests should run in Azure Pipelines. ### What the Script Does <!-- markdownlint-d...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~10-~10: Use correct spacing
Context: ...ure Pipelines. ### What the Script Does The [`Test-ShouldRunDscResourceIntegrati...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~14-~14: There might be a mistake here.
Context: ...rs which public commands are used by DSC resources and classes, then checks if an...

(QB_NEW_EN)


[grammar] ~15-~15: Use correct spacing
Context: ...f any relevant files have been modified. ### How It Works The script checks for chan...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~17-~17: Use correct spacing
Context: ...es have been modified. ### How It Works The script checks for changes to: 1. **...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~30-~30: Use correct spacing
Context: .../Integration/Resources/` ### Parameters | Parameter | Type | Default | Purpose |...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~32-~32: There might be a mistake here.
Context: ...| Parameter | Type | Default | Purpose | |-----------|------|---------|---------|...

(QB_NEW_EN)


[grammar] ~33-~33: There might be a mistake here.
Context: ...|-----------|------|---------|---------| | BaseBranch | String | `'origin/main'...

(QB_NEW_EN)


[grammar] ~34-~34: There might be a mistake here.
Context: ...ain'| Base branch to compare against | |CurrentBranch| String |'HEAD'` | ...

(QB_NEW_EN)


[grammar] ~35-~35: Use correct spacing
Context: ... | Current branch or commit to compare | ### Outputs <!-- markdownlint-disable MD013...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~37-~37: Use correct spacing
Context: ...anch or commit to compare | ### Outputs | Output | Type | Description | |-------...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~40-~40: There might be a mistake here.
Context: ...ions --> | Output | Type | Description | |--------|------|-------------| | Return...

(QB_NEW_EN)


[grammar] ~41-~41: There might be a mistake here.
Context: ...iption | |--------|------|-------------| | Return value | Boolean | $true when ...

(QB_NEW_EN)


[grammar] ~42-~42: Use correct spacing
Context: ...lse` when no such changes are detected | ### Usage #### Azure Pipelines The Azure P...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~45-~45: Use correct spacing
Context: ...markdownlint-enable MD013 --> ### Usage #### Azure Pipelines The Azure Pipelines tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~47-~47: Use correct spacing
Context: ...013 --> ### Usage #### Azure Pipelines The Azure Pipelines task sets an output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~50-~50: There might be a mistake here.
Context: ...ce integration tests. The script returns a boolean value that the pipeline captur...

(QB_NEW_EN)


[grammar] ~51-~51: Use correct spacing
Context: ... value that the pipeline captures, e.g.: yaml - powershell: | $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun" displayName: 'Determine if DSC resource tests should run' Downstream stages reference this output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~62-~62: There might be a mistake here.
Context: ... output variable in a stage condition: using the pattern: <!-- markdownlint-dis...

(QB_NEW_EN)


[grammar] ~63-~63: Use correct spacing
Context: ... a stage condition: using the pattern: yaml condition: | and( succeeded(), eq(lower(dependencies.stageName.outputs['jobName.taskName.ShouldRunDscResourceIntegrationTests']), 'true') ) #### Command Line ```powershell # Basic usag...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~74-~74: Use correct spacing
Context: ...lint-enable MD013 --> #### Command Line powershell # Basic usage (compares current HEAD with origin/main) .build/Test-ShouldRunDscResourceIntegrationTests.ps1 # Custom branches .build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \ -CurrentBranch 'feature-branch'

(QB_NEW_EN_OTHER_ERROR_IDS_5)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
  • GitHub Check: PSScriptAnalyzer
  • GitHub Check: PSScriptAnalyzer
🔇 Additional comments (7)
.build/README.md (7)

1-1: Good re-title: scoped to “.build scripts”

The heading clearly signals the README’s scope.


3-3: Wording LGTM

“build and pipeline scripts” is clear and consistent.


17-29: Change categorization is clear and actionable

The five monitored categories are well-defined and match the script’s behavior.


30-36: Parameters section reads well

Defaults and purposes are explicit. No changes needed.


37-44: Output semantics clarified correctly

Accurately conveys that the boolean is based on monitored changes between refs.


7-9: Line wrapping and lint suppressions are applied correctly

Complies with MD013 guidance and the repo’s markdown style.


74-83: Command-line examples are clear

Good defaults and an override example; nothing to change.

Comment thread .build/README.md
Comment thread .build/README.md
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.build/Test-ShouldRunDscResourceIntegrationTests.ps1 (1)

107-114: Escape identifiers in regex and use word-boundary-safe pattern

Hyphens and other non-word chars in command/function names make \b unreliable and can cause false negatives or false positives. Also, raw interpolation risks regex injection. Use [regex]::Escape(...) and a boundary-safe pattern.

-                foreach ($commandName in $publicCommandNames)
+                foreach ($commandName in $publicCommandNames)
                 {
-                    # Look for command usage patterns: commandName, & commandName, or | commandName
-                    if ($content -match "\b$commandName\b")
+                    # Look for command usage (use escaped name and word-boundary-safe checks).
+                    $escaped = [regex]::Escape($commandName)
+                    if ($content -match "(?<!\w)$escaped(?!\w)")
                     {
                         $usedCommands += $commandName
                     }
                 }
@@
-    $privateFunctionFiles = Get-ChildItem -Path (Join-Path -Path $SourcePath -ChildPath "Private") -Filter "*.ps1" | Select-Object -ExpandProperty BaseName
+    $privateFunctionFiles = Get-ChildItem -Path (Join-Path -Path $SourcePath -ChildPath "Private") -Filter "*.ps1" -ErrorAction SilentlyContinue | Select-Object -ExpandProperty BaseName
@@
-        if ($content -match "\b$privateFunction\b")
+        $escaped = [regex]::Escape($privateFunction)
+        if ($content -match "(?<!\w)$escaped(?!\w)")
         {
             $privateFunctions += $privateFunction
         }
@@
-                    if ($content -match "\b$privateFunction\b")
+                    $escaped = [regex]::Escape($privateFunction)
+                    if ($content -match "(?<!\w)$escaped(?!\w)")
                     {
                         $privateFunctions += $privateFunction
                     }

Also applies to: 131-136, 296-299, 363-366

.build/README.md (1)

75-85: Add a merge-base command-line example

Showcli usage mirroring the new switch for feature-branch diffs.

 # Custom branches
 .build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \
     -CurrentBranch 'feature-branch'
+
+# Compare only changes introduced by the current branch (via merge-base)
+.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/main' -CurrentBranch 'HEAD' -UseMergeBase
♻️ Duplicate comments (4)
.build/README.md (1)

63-72: Fix function name in condition and reference the named step

Azure DevOps uses toLower(), not lower(). Also, align the outputs reference with the step name used above.

 condition: |
 and(
    succeeded(),
-   eq(lower(dependencies.stageName.outputs['jobName.taskName.ShouldRunDscResourceIntegrationTests']), 'true')
+   eq(toLower(dependencies.stageName.outputs['jobName.determineShouldRun.ShouldRunDscResourceIntegrationTests']), 'true')
 )
azure-pipelines.yml (3)

94-112: Fix PowerShell env vars, normalize PR target ref, and use merge-base for PRs

  • Use underscores in env var names (BUILD_SOURCEBRANCHNAME/BUILD_SOURCEBRANCH).
  • Normalize SYSTEM_PULLREQUEST_TARGETBRANCH (strip refs/heads/) before prefixing with origin/.
  • Use -UseMergeBase for PRs to isolate branch-introduced changes.
-                # Determine if we should run DSC resource integration tests based on branch logic
-                $shouldRun = $false
-
-                if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH)
-                {
-                    $targetBranch = "origin/$env:SYSTEM_PULLREQUEST_TARGETBRANCH"
-                    Write-Host "Pull request detected, targeting branch $targetBranch. Using script analysis to determine test requirements."
-                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch 'HEAD'
-                }
-                elseif ($env:BUILD.SOURCEBRANCHNAME -eq '$(defaultBranch)')
-                {
-                    Write-Host "Target is default branch ($(defaultBranch)). Always running DSC resource integration tests."
-                    $shouldRun = $true
-                }
-                else
-                {
-                    Write-Host "Target is non-default branch ($env:BUILD.SOURCEBRANCH). Using script analysis to determine test requirements against default branch."
-                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch "origin/$(defaultBranch)" -CurrentBranch 'HEAD' -UseMergeBase
-                }
+                # Determine if we should run DSC resource integration tests based on branch logic
+                $shouldRun = $false
+
+                if ($env:SYSTEM_PULLREQUEST_TARGETBRANCH)
+                {
+                    $prTarget = $env:SYSTEM_PULLREQUEST_TARGETBRANCH
+                    if ($prTarget -like 'refs/heads/*') { $prTarget = $prTarget.Substring(11) }
+                    $targetBranch = "origin/$prTarget"
+                    Write-Host "Pull request detected, targeting branch $targetBranch. Using script analysis (merge-base) to determine test requirements."
+                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch 'HEAD' -UseMergeBase
+                }
+                elseif ($env:BUILD_SOURCEBRANCHNAME -eq '$(defaultBranch)')
+                {
+                    Write-Host "Target is default branch ($(defaultBranch)). Always running DSC resource integration tests."
+                    $shouldRun = $true
+                }
+                else
+                {
+                    Write-Host "Target is non-default branch ($env:BUILD_SOURCEBRANCH). Using script analysis (merge-base) to determine test requirements against default branch."
+                    $shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch "origin/$(defaultBranch)" -CurrentBranch 'HEAD' -UseMergeBase
+                }

452-453: Fix unsupported lower(...) in conditions

Azure DevOps expressions provide toLower(), not lower(). Either switch to toLower(), or if you adopt explicit 'true'/'false' outputs, compare directly.

-        eq(lower(dependencies.Quality_Test_and_Unit_Test.outputs['Determine_DSC_Resource_Test_Requirements.determineDscResourceTests.ShouldRunDscResourceIntegrationTests']), 'true')
+        eq(toLower(dependencies.Quality_Test_and_Unit_Test.outputs['Determine_DSC_Resource_Test_Requirements.determineDscResourceTests.ShouldRunDscResourceIntegrationTests']), 'true')

Also applies to: 550-551, 645-646, 721-722, 788-789


115-117: Optional: Normalize output to explicit strings for more robust conditions

Booleans may serialize as “True/False”. Emitting 'true'/'false' avoids case functions in conditions and makes logs consistent.

-                Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun"
-
-                Write-Host "Variable ShouldRunDscResourceIntegrationTests is set to: $shouldRun"
+                $shouldRunStr = if ($shouldRun) { 'true' } else { 'false' }
+                Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRunStr"
+                Write-Host "Variable ShouldRunDscResourceIntegrationTests is set to: $shouldRunStr"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 11c7af0 and 7cbe0fd.

📒 Files selected for processing (3)
  • .build/README.md (2 hunks)
  • .build/Test-ShouldRunDscResourceIntegrationTests.ps1 (9 hunks)
  • azure-pipelines.yml (6 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
azure-pipelines.yml

📄 CodeRabbit Inference Engine (.github/copilot-instructions.md)

Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Files:

  • azure-pipelines.yml
**

⚙️ CodeRabbit Configuration File

**: # DSC Community Guidelines

Terminology

  • Command: Public command
  • Function: Private function
  • Resource: DSC class-based resource

Build & Test Workflow

  • Run project scripts in PowerShell from repository root
  • Build after source changes: .\build.ps1 -Tasks build
  • Test workflow: Build → Invoke-Pester -Path @('<test paths>') -Output Detailed
  • New session required after class changes

File Organization

  • Public commands: source/Public/{CommandName}.ps1
  • Private functions: source/Private/{FunctionName}.ps1
  • Unit tests: tests/Unit/{Classes|Public|Private}/{Name}.Tests.ps1
  • Integration tests: tests/Integration/Commands/{CommandName}.Integration.Tests.ps1

Requirements

  • Always update CHANGELOG.md Unreleased section
  • Localize all strings using string keys
  • Check DscResource.Common before creating private functions
  • Separate reusable logic into private functions
  • Add unit tests for all commands/functions/resources
  • Add integration tests for all public commands and resources

Files:

  • azure-pipelines.yml
🧠 Learnings (2)
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to azure-pipelines.yml : Add each public command integration test script to a group within the Integration_Test_Commands_SqlServer stage in ./azure-pipelines.yml, choosing the appropriate group

Applied to files:

  • azure-pipelines.yml
  • .build/README.md
📚 Learning: 2025-08-17T09:48:55.756Z
Learnt from: CR
PR: dsccommunity/SqlServerDsc#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T09:48:55.756Z
Learning: Applies to tests/Integration/Commands/*.Integration.Tests.ps1 : Include the standard integration test setup block (BeforeDiscovery/BeforeAll with module loading) before the first Describe block

Applied to files:

  • .build/README.md
🪛 LanguageTool
.build/README.md

[grammar] ~1-~1: Use correct spacing
Context: # .build scripts Documentation for the SqlServerDsc modul...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~3-~3: Use correct spacing
Context: ...erDsc module build and pipeline scripts. ## Test-ShouldRunDscResourceIntegrationTests.ps1 This script dynamically determines wheth...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~7-~7: There might be a mistake here.
Context: ...s whether DSC resource integration tests should run in Azure Pipelines. ### What...

(QB_NEW_EN)


[grammar] ~8-~8: Use correct spacing
Context: ...ion tests should run in Azure Pipelines. ### What the Script Does <!-- markdownlint-d...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~10-~10: Use correct spacing
Context: ...ure Pipelines. ### What the Script Does The [`Test-ShouldRunDscResourceIntegrati...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~14-~14: There might be a mistake here.
Context: ...rs which public commands are used by DSC resources and classes, then checks if an...

(QB_NEW_EN)


[grammar] ~15-~15: Use correct spacing
Context: ...f any relevant files have been modified. ### How It Works The script checks for chan...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~17-~17: Use correct spacing
Context: ...es have been modified. ### How It Works The script checks for changes to: 1. **...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~30-~30: Use correct spacing
Context: .../Integration/Resources/` ### Parameters | Parameter | Type | Default | Purpose |...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~32-~32: There might be a mistake here.
Context: ...| Parameter | Type | Default | Purpose | |-----------|------|---------|---------|...

(QB_NEW_EN)


[grammar] ~33-~33: There might be a mistake here.
Context: ...|-----------|------|---------|---------| | BaseBranch | String | `'origin/main'...

(QB_NEW_EN)


[grammar] ~34-~34: There might be a mistake here.
Context: ...ain'| Base branch to compare against | |CurrentBranch| String |'HEAD'` | ...

(QB_NEW_EN)


[grammar] ~35-~35: Use correct spacing
Context: ... | Current branch or commit to compare | ### Outputs <!-- markdownlint-disable MD013...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~37-~37: Use correct spacing
Context: ...anch or commit to compare | ### Outputs | Output | Type | Description | |-------...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~40-~40: There might be a mistake here.
Context: ...ions --> | Output | Type | Description | |--------|------|-------------| | Return...

(QB_NEW_EN)


[grammar] ~41-~41: There might be a mistake here.
Context: ...iption | |--------|------|-------------| | Return value | Boolean | $true when ...

(QB_NEW_EN)


[grammar] ~42-~42: Use correct spacing
Context: ...lse` when no such changes are detected | ### Usage #### Azure Pipelines The Azure P...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~45-~45: Use correct spacing
Context: ...markdownlint-enable MD013 --> ### Usage #### Azure Pipelines The Azure Pipelines tas...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~47-~47: Use correct spacing
Context: ...013 --> ### Usage #### Azure Pipelines The Azure Pipelines task sets an output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~50-~50: There might be a mistake here.
Context: ...ce integration tests. The script returns a boolean value that the pipeline captur...

(QB_NEW_EN)


[grammar] ~51-~51: Use correct spacing
Context: ... value that the pipeline captures, e.g.: yaml - powershell: | $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun" displayName: 'Determine if DSC resource tests should run' name: determineShouldRun Downstream stages reference this output ...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~63-~63: There might be a mistake here.
Context: ... output variable in a stage condition: using the pattern: <!-- markdownlint-dis...

(QB_NEW_EN)


[grammar] ~64-~64: Use correct spacing
Context: ... a stage condition: using the pattern: yaml condition: | and( succeeded(), eq(lower(dependencies.stageName.outputs['jobName.taskName.ShouldRunDscResourceIntegrationTests']), 'true') ) #### Command Line ```powershell # Basic usag...

(QB_NEW_EN_OTHER_ERROR_IDS_5)


[grammar] ~75-~75: Use correct spacing
Context: ...lint-enable MD013 --> #### Command Line powershell # Basic usage (compares current HEAD with origin/main) .build/Test-ShouldRunDscResourceIntegrationTests.ps1 # Custom branches .build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \ -CurrentBranch 'feature-branch'

(QB_NEW_EN_OTHER_ERROR_IDS_5)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: dsccommunity.SqlServerDsc (Quality Test and Unit Test HQRM)
  • GitHub Check: dsccommunity.SqlServerDsc (Quality Test and Unit Test Determine DSC Resource Test Requirements)
  • GitHub Check: dsccommunity.SqlServerDsc (Quality Test and Unit Test Unit)
  • GitHub Check: dsccommunity.SqlServerDsc (Build Package Module)
🔇 Additional comments (2)
.build/Test-ShouldRunDscResourceIntegrationTests.ps1 (2)

20-24: Good addition: document and example for -UseMergeBase

The new parameter and example are clear and helpful for feature-branch comparisons. No issues.

Also applies to: 31-33


46-51: Plumbing -UseMergeBase end-to-end is correct

  • Parameter surfaced at the script level
  • Forwarded into Test-ShouldRunDscResourceIntegrationTests and Get-ChangedFiles
  • Used when running as a script

Looks good.

Also applies to: 426-429, 451-452, 542-542

Comment thread .build/README.md
Comment thread .build/README.md
Comment thread .build/Test-ShouldRunDscResourceIntegrationTests.ps1
Comment thread .build/Test-ShouldRunDscResourceIntegrationTests.ps1
Copy link
Copy Markdown
Member Author

@johlju johlju left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3, 1 of 3 files at r4, 1 of 2 files at r7, 1 of 3 files at r8, 2 of 2 files at r9, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @johlju)

@johlju johlju merged commit c40236a into main Aug 19, 2025
23 of 25 checks passed
@johlju johlju deleted the fix/build-readme branch August 19, 2025 18:39
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94%. Comparing base (4881d27) to head (bc784e2).
⚠️ Report is 62 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@         Coverage Diff          @@
##           main   #2139   +/-   ##
====================================
  Coverage    94%     94%           
====================================
  Files       110     110           
  Lines      8171    8171           
====================================
  Hits       7732    7732           
  Misses      439     439           
Flag Coverage Δ
unit 94% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant