Skip to content

Fix baseline version selection for new releases#40

Merged
Malcolmnixon merged 2 commits intomainfrom
copilot/fix-target-version-selection
Feb 6, 2026
Merged

Fix baseline version selection for new releases#40
Malcolmnixon merged 2 commits intomainfrom
copilot/fix-target-version-selection

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Pull Request

Description

When generating build notes for a version not yet in history (e.g., 1.2.0 with existing releases 1.1.0 and 1.0.0), BuildMark incorrectly selected 1.0.0 as the baseline instead of 1.1.0.

Root Cause: DetermineSearchStartIndex in GitHubRepoConnector returned index 1 when the target version was not found in release history, skipping the most recent release at index 0.

Fix: Changed return value from 1 to 0 when toIndex == -1, ensuring search starts from the most recent release. GitHub orders releases newest-first, so index 0 is always the correct starting point for a new version.

// Before: Skipped most recent release
if (toIndex == -1 && releaseCount > 1)
    return 1;

// After: Start from most recent release  
if (toIndex == -1 && releaseCount > 0)
    return 0;

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All tests pass: dotnet test --configuration Release
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • Spell checker passes: cspell "**/*.{md,cs}"
  • Markdown linter passes: markdownlint "**/*.md"
  • YAML linter passes: yamllint '**/*.{yml,yaml}'

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

All 84 existing tests pass. CodeQL security scan shows no vulnerabilities. The fix is a single-line change with updated comments for clarity.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1108766/chrome-linux.zip
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node install.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Target Version Selection</issue_title>
<issue_description>### Description

The wrong version is sometimes selected.

Steps to Reproduce

  1. Have a repository with existing releases [1.0.0 and 1.1.0] and then some commits
  2. Run BuildMark with a new version [1.2.0]
  3. BuildMark picks 1.0.0 rather than 1.1.0 as the base version

Expected Behavior

BuildMark should pick 1.1.0 as the base and 1.2.0 as the new version - then include the commits done after 1.1.0 as the changes.

Actual Behavior

1.0.0 is selected rather than 1.1.0

Code Sample

Tool Version

Head build

.NET Version

.NET 8

Operating System

No response

Additional Context

The issue appears to be in DetermineSearchStartIndex where it returns 1 as the index ignoring the newest version in index 0. This decision should be reviewed - should it always be 0 or is there a reason why 1 would ever be the correct index.

Checklist

  • I have searched existing issues to ensure this is not a duplicate
  • I have provided a clear description of the problem
  • I have included steps to reproduce the issue</issue_description>

Comments on the Issue (you are @copilot in this section)


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

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix target version selection in BuildMark Fix baseline version selection for new releases Feb 6, 2026
Copilot AI requested a review from Malcolmnixon February 6, 2026 01:17
@Malcolmnixon Malcolmnixon marked this pull request as ready for review February 6, 2026 01:31
@Malcolmnixon Malcolmnixon merged commit 9dede92 into main Feb 6, 2026
11 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/fix-target-version-selection branch February 6, 2026 01:31
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.

[Bug]: Target Version Selection

2 participants