Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 5, 2025

This PR updates the GitVersion.yml configuration to use more precise regular expressions for feature and hotfix branch pattern matching.

Changes Made

Feature Branch Regex Update

  • Before: f(eature(s)?)?[\/-]
  • After: ^f(eature(s)?)?[\/-]

The addition of the ^ anchor ensures that the pattern matches only at the beginning of the branch name, providing more precise branch name matching and avoiding false positives where "feature" might appear elsewhere in the branch name.

Hotfix Branch Regex

  • Remains unchanged: (hot)?fix(es)?[\/-]

The hotfix regex was already correctly configured and matches the required pattern.

Background

The GitVersion configuration controls how version numbers are incremented based on branch naming patterns. These regex updates ensure that:

  1. Feature branches (feature/, features/, f/) are correctly identified for minor version bumps
  2. Hotfix branches (hotfix/, hotfixes/, fix/, fixes/) are correctly identified for patch version bumps
  3. Branch name matching is more precise and less prone to false matches

This change aligns with the project's versioning strategy and improves the reliability of automated version bumping in the CI/CD pipeline.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


This change is Reviewable

Copilot AI changed the title [WIP] @copilot Update GitVersion.yml with these regular expressions: ```yaml feature: tag: useBranchName increment: Minor regex: ^f(eature(s)?)?[\/-] source-branches: ['master'] hotfix: tag: fix increment: Patch regex: (hot)?... Update GitVersion.yml with improved regex patterns for feature and hotfix branches Sep 5, 2025
Copilot AI requested a review from johlju September 5, 2025 06:05
@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94%. Comparing base (e86a3d5) to head (05ceea6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

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

@johlju johlju requested a review from Copilot September 5, 2025 06:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the GitVersion.yml configuration to improve branch pattern matching by adding a regex anchor to the feature branch pattern. The change ensures feature branches are identified more precisely by requiring the pattern to match at the beginning of the branch name.

  • Updated feature branch regex to use ^ anchor for precise pattern matching at the start of branch names
  • Added corresponding changelog entry documenting the GitVersion configuration improvement

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
GitVersion.yml Updated feature branch regex pattern with ^ anchor for precise matching
CHANGELOG.md Added changelog entry documenting the GitVersion configuration update

@coderabbitai
Copy link

coderabbitai bot commented Sep 6, 2025

Walkthrough

Workflows in GitHub Actions and Azure Pipelines were updated to stop invoking dotnet-gitversion during installation and to parse its output via ConvertFrom-Json where executed. GitVersion feature-branch regex was anchored at start. CHANGELOG updated accordingly.

Changes

Cohort / File(s) Summary
GitHub Actions: GitVersion invocation cleanup
\.github/workflows/code-analysis-built-module.yml, \.github/workflows/code-analysis.yml
Removed dotnet-gitversion execution from Install GitVersion steps; GitVersion now runs only in the dedicated “Run GitVersion” step.
GitHub Actions: Copilot setup parsing
\.github/workflows/copilot-setup-steps.yml
Changed Verify GitVersion step to pipe dotnet-gitversion output to ConvertFrom-Json, producing a parsed PowerShell object.
Azure Pipelines: GitVersion parsing
azure-pipelines.yml
Consolidated dotnet-gitversion invocation and JSON parsing into a single command assigning to $gitVersionObject; subsequent variable handling unchanged.
Versioning config
GitVersion.yml
Anchored feature branch regex to start of string by adding ^ to f(eature(s)?)?[/-].
Documentation
CHANGELOG.md
Recorded GitVersion.yml feature-branch regex anchoring under Unreleased -> Changed; removed prior Copilot workflow note.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Runner as CI Runner
  participant Tools as GitVersion.Tool
  participant PS as PowerShell

  Runner->>Tools: Install GitVersion.Tool
  note right of Tools: Install only (no execution)

  Runner->>PS: Run dotnet-gitversion | ConvertFrom-Json
  PS->>PS: Parse JSON to object
  PS-->>Runner: Expose variables (e.g., FullSemVer)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-ac1ce72f-184a-453c-8c05-2957776ed702

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@johlju johlju marked this pull request as ready for review September 6, 2025 11:57
@johlju johlju requested a review from a team as a code owner September 6, 2025 12:02
@johlju
Copy link
Member

johlju commented Sep 6, 2025

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Sep 6, 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

@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: 0

🧹 Nitpick comments (3)
CHANGELOG.md (1)

91-93: Entry looks good; optionally reference a tracking issue/PR.

If there’s an associated issue, consider appending a link like issue #NNNN to align with the changelog guidelines. Not required if no issue exists.

GitVersion.yml (2)

20-23: Anchor hotfix regex for consistency and to avoid mid-string matches.

Without start anchoring, branches like release/1.2-fix-readme could match unintentionally. Recommend anchoring to the start as done for feature.

Apply this diff:

-    regex: (hot)?fix(es)?[\/-]
+    regex: ^(hot)?fix(es)?[\/-]

17-17: Optional: make the feature regex case-insensitive.

If you want Feature/, FEATURES/, etc. to match, add an inline flag and quote the pattern to avoid YAML parsing issues.

Apply this diff:

-    regex: ^f(eature(s)?)?[\/-]
+    regex: '(?i)^f(eature(s)?)?[\/-]'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e86a3d5 and 05ceea6.

📒 Files selected for processing (6)
  • .github/workflows/code-analysis-built-module.yml (0 hunks)
  • .github/workflows/code-analysis.yml (0 hunks)
  • .github/workflows/copilot-setup-steps.yml (0 hunks)
  • CHANGELOG.md (1 hunks)
  • GitVersion.yml (1 hunks)
  • azure-pipelines.yml (0 hunks)
💤 Files with no reviewable changes (4)
  • azure-pipelines.yml
  • .github/workflows/copilot-setup-steps.yml
  • .github/workflows/code-analysis-built-module.yml
  • .github/workflows/code-analysis.yml
🧰 Additional context used
📓 Path-based instructions (3)
**

⚙️ CodeRabbit configuration file

**: # DSC Community Guidelines

Terminology

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

Build & Test Workflow

  • Run in PowerShell, from repository root
  • Build before running tests: .\build.ps1 -Tasks build
  • Always run tests in new PowerShell session: Invoke-Pester -Path @({test paths}) -Output Detailed

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

  • Follow guidelines over existing code patterns
  • Always update CHANGELOG.md Unreleased section
  • Localize all strings using string keys; remove any orphaned 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:

  • CHANGELOG.md
  • GitVersion.yml
**/*.md

⚙️ CodeRabbit configuration file

**/*.md: # Markdown Style Guidelines

  • Wrap lines at word boundaries when over 80 characters (except tables/code blocks)
  • Use 2 spaces for indentation
  • Use '1.' for all items in ordered lists (1/1/1 numbering style)
  • Disable MD013 rule by adding a comment for tables/code blocks exceeding 80 characters
  • Empty lines required before/after code blocks and headings (except before line 1)
  • Escape backslashes in file paths only (not in code blocks)
  • Code blocks must specify language identifiers

Text Formatting

  • Parameters: bold
  • Values/literals: inline code
  • Resource/module/product names: italic
  • Commands/files/paths: inline code

Files:

  • CHANGELOG.md
CHANGELOG.md

⚙️ CodeRabbit configuration file

CHANGELOG.md: # Changelog Guidelines

  • Always update the Unreleased section in CHANGELOG.md
  • Use Keep a Changelog format
  • Describe notable changes briefly, ≤2 items per change type
  • Reference issues using format issue #<issue_number>
  • No empty lines between list items in same section
  • Do not add item if there are already an existing item for the same change

Files:

  • CHANGELOG.md
⏰ 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 (2)
GitVersion.yml (2)

17-17: Anchoring the feature-branch regex is correct.

This will eliminate mid-string false positives like bug/feature-... or chore/f-... LGTM.


9-18: Confirm source-branches usage.

Using the configuration name 'master' while the regex targets '^main$' is valid in GitVersion (keys are config names, regex maps to actual branch names). Please confirm this is intentional for both feature and hotfix sections; if not, switch to 'main' consistently.

@johlju johlju merged commit 0150527 into main Sep 6, 2025
28 checks passed
@johlju johlju deleted the copilot/fix-ac1ce72f-184a-453c-8c05-2957776ed702 branch September 6, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants