Skip to content

Add BuildInformation record with Version flexible parsing and open issues support#6

Merged
Malcolmnixon merged 13 commits intomainfrom
copilot/add-build-information-record
Feb 1, 2026
Merged

Add BuildInformation record with Version flexible parsing and open issues support#6
Malcolmnixon merged 13 commits intomainfrom
copilot/add-build-information-record

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Build Information Record - All Tests Passing

  • All quality checks passing:
    • Spell checker: cspell "**/*.{md,cs}" - PASSES (0 issues)
    • Markdown linter: markdownlint "**/*.md" - PASSES
    • YAML linter: yamllint '**/*.{yml,yaml}' - PASSES
    • Build: dotnet build --configuration Release - PASSES (0 warnings)
    • Tests: dotnet test --configuration Release - PASSES (61/61)

Fixed test expectations:

  • Updated BuildInformation_CreateAsync_ReleaseSkipsPreReleases to expect .Tag property value "v2.0.0" (not "2.0.0")
  • Updated BuildInformation_CreateAsync_SeparatesBugAndChangeIssues to expect 2 change issues (feature + documentation)
  • Updated BuildInformation_CreateAsync_WorksWhenCurrentCommitMatchesLatestTag to expect "ver-1.1.0" as FromVersion
  • Fixed MockRepoConnectorMatchingTag to use consistent tag names

All tests now passing across net8.0, net9.0, and net10.0.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Feature]: Build Information Record</issue_title>
<issue_description>### Problem Statement

The BuildMark tool needs to assemble a Build Information record containing the information about a build.

Proposed Solution

The project needs a C# Build Information record that's created by a static factory function from an IRepoConnector instance and an optional version. The record needs the following sort of information:

  • From and To version information:
    • Version tags are assumed to be "roughly" semantic version, but may have some "v", "ver" or equivalent leading text.
    • The To version is determined by the optional version, or failing that if the git-hash matches the most recent tag then it's for that tag, otherwise it must fail due to lack of target-version informaiton
    • The From version is determined by the type of To version - if it's a pre-release (alpha/beta/rc) then the From version is the previous tagged version. If it's a release version (not a pre-release) then the From version is the previous release version. If there is no From version then the beginning of the repo history is assumed.
    • From and To git-hashes
  • Change issues: non-bug changes performed between the From and To versions
  • Bug issues: fixed between the From and To versions
  • Known issues: bugs that are either not fixed, or fixed but the fix is not present in the build

All issues need the ID, Title, and URL-link; but this may need an additional IRepoConnector method to try and get an issue URL.

Alternatives Considered

No response

Usage Examples

Benefits

A record of the build information

Priority

High - Blocking my use case

Willingness to Contribute

Yes, I can submit a pull request

Additional Context

No response

Checklist

  • I have searched existing issues to ensure this is not a duplicate
  • I have provided a clear description of the feature
  • I have explained why this feature would be useful</issue_description>

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 31, 2026 14:43
…on parsing

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
…se detection

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Build Information record for BuildMark tool Add BuildInformation record for assembling build metadata Jan 31, 2026
Copilot AI requested a review from Malcolmnixon January 31, 2026 14:47
Copy link
Contributor

@Malcolmnixon Malcolmnixon left a comment

Choose a reason for hiding this comment

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

It looks like the code wants to get the open issues from the RepoConnector, but there's no API for it. Please add an API then implement the BuildInformation connector to use it appropriately.

Additionally it seems like the approach to parsing version information from tag names should be improved. Consider creating a Tag Version record which takes a tag name and exposes fields to get:

  • Original tag name
  • Full Version (major.minor.patch-prerelease) stripping leading junk
  • IsPreRelease (pre-release is specified)

Copilot AI and others added 2 commits January 31, 2026 15:09
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 31, 2026

It looks like the code wants to get the open issues from the RepoConnector, but there's no API for it. Please add an API then implement the BuildInformation connector to use it appropriately.

Addit...

I've addressed all the feedback:

  1. Added GetOpenIssuesAsync() API to IRepoConnector interface and implemented it in all connectors (MockRepoConnector, GitHubRepoConnector). BuildInformation now populates known issues with open bugs.

  2. Created TagVersion record that parses tag names and exposes:

    • OriginalTag: Original tag name from repository
    • FullVersion: Semantic version with leading prefixes stripped (supports alphabetic, dash, underscore prefixes)
    • IsPreRelease: Boolean flag detecting pre-releases (alpha/beta/rc/pre patterns with proper word boundaries)
  3. Refactored BuildInformation to use TagVersion for all version parsing and pre-release detection, eliminating code duplication.

Changes in commits 6faee5a, e12ecba. All 58 tests passing, CodeQL clean (0 alerts).

Copilot AI changed the title Add BuildInformation record for assembling build metadata Add BuildInformation record with TagVersion and open issues support Jan 31, 2026
Copilot AI requested a review from Malcolmnixon January 31, 2026 15:13
Copy link
Contributor

@Malcolmnixon Malcolmnixon left a comment

Choose a reason for hiding this comment

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

I think TagVersion should be renamed TagInformation, and I think the RepoConnector APIs should be updated to return instances of TagInformation where appropriate.

Copilot AI and others added 2 commits January 31, 2026 15:45
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 31, 2026

I think TagVersion should be renamed TagInformation, and I think the RepoConnector APIs should be updated to return instances of TagInformation where appropriate.

Done. Renamed TagVersion to TagInformation and updated GetTagHistoryAsync() to return List<TagInformation> instead of List<string>.

Changes in commits 2816495, 53e9180. All 58 tests passing, CodeQL clean (0 alerts).

Copilot AI changed the title Add BuildInformation record with TagVersion and open issues support Add BuildInformation record with TagInformation and open issues support Jan 31, 2026
Copilot AI requested a review from Malcolmnixon January 31, 2026 15:50
…n, update APIs to use TagInfo, add varied tag formats

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title Add BuildInformation record with TagInformation and open issues support Add BuildInformation record with TagInfo and open issues support Jan 31, 2026
Copilot AI requested a review from Malcolmnixon January 31, 2026 16:13
Copy link
Contributor

@Malcolmnixon Malcolmnixon left a comment

Choose a reason for hiding this comment

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

The Tag parsing seems to believe that ".arch" and ".linux" should be considered metadata - that doesn't seem to align with the Semantic Version 2.0.0 format - instead metadata like that would probably come after a "+" separator.

…arators with build metadata support

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 31, 2026

The Tag parsing seems to believe that ".arch" and ".linux" should be considered metadata - that doesn't seem to align with the Semantic Version 2.0.0 format - instead metadata like that would probably...

Updated to align with the flexible versioning format. The regex now:

  • Accepts both . and - as pre-release separators (e.g., 1.2.3.rc.4 and 1.2.3-rc.4 both work)
  • Uses + for build metadata per Semantic Versioning 2.0.0 (e.g., +build.5)
  • Preserves the original separator in FullVersion

Examples working correctly:

  • Rel_1.2.3.rc.4+build.5 → version: 1.2.3, pre-release: rc.4, metadata: build.5
  • Rel_1.2.3-rc.4+build.5 → version: 1.2.3, pre-release: rc.4, metadata: build.5
  • v1.0.0+arch → version: 1.0.0, metadata: arch (NOT pre-release)

Changes in commit cfd89e2. All 15 TagInfo tests passing.

Copilot AI changed the title Add BuildInformation record with TagInfo regex parsing and open issues support Add BuildInformation record with TagInfo flexible version parsing and open issues support Jan 31, 2026
Copilot AI requested a review from Malcolmnixon January 31, 2026 16:35
/// <param name="Tag">The tag name.</param>
/// <param name="FullVersion">The full semantic version (major.minor.patch-prerelease) with leading non-version characters removed.</param>
/// <param name="IsPreRelease">Whether this is a pre-release version.</param>
public partial record TagInfo(string Tag, string FullVersion, bool IsPreRelease)
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's save the Version, Pre-Release and Metadata as part of the record; so we have [Tag, FullVersion, Version, PreRelease, Metadata, IsPreRelease] . These extra fields will probably be valuable later when Markdown reports are generated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added all requested properties to the Version record:

  • Tag: Original tag name
  • FullVersion: Complete version string
  • SemanticVersion: Core version (major.minor.patch)
  • PreRelease: Pre-release identifier
  • Metadata: Build metadata
  • IsPreRelease: Boolean flag

Changes in commit b2c6b32.

/// <param name="BugIssues">Bugs fixed between versions.</param>
/// <param name="KnownIssues">Known issues (unfixed or fixed but not in this build).</param>
public record BuildInformation(
string? FromVersion,
Copy link
Contributor

Choose a reason for hiding this comment

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

The FromVersion and ToVersion should also probably be TagInfo... but again I wonder about the TagInfo name... it's really turning into a "Version" as the version can also come from the command-line rather than only coming from tags. Let's rename TagInfo to "Version".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed TagInfo to Version throughout the codebase. BuildInformation now uses Version? for FromVersion and Version for ToVersion.

Changes in commit b2c6b32.

/// <param name="tag">Tag information (null for current state).</param>
/// <returns>Git hash.</returns>
Task<string> GetHashForTagAsync(string? tag);
Task<string> GetHashForTagAsync(TagInfo? tag);
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually lets put this method back to taking a string, because it may be used to get hashes for any type of tag, not just a Version tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted GetHashForTagAsync to accept string? instead of Version?. This allows it to work with any tag type, not just version tags.

Changes in commit b2c6b32.

/// <param name="toTag">Ending tag (null for current state).</param>
/// <returns>List of pull request IDs.</returns>
Task<List<string>> GetPullRequestsBetweenTagsAsync(string? fromTag, string? toTag);
Task<List<string>> GetPullRequestsBetweenTagsAsync(TagInfo? fromTag, TagInfo? toTag);
Copy link
Contributor

Choose a reason for hiding this comment

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

This method does want to take the "Version" records as its got a definite from/to version vibe, but lets rename the parameters to "from" and "to" to drop the tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated GetPullRequestsBetweenTagsAsync parameter names from fromTag/toTag to from/to. The method still accepts Version? parameters as requested.

Changes in commit b2c6b32.

…operties, update API parameters

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title Add BuildInformation record with TagInfo flexible version parsing and open issues support Add BuildInformation record with Version flexible parsing and open issues support Jan 31, 2026
Copilot AI requested a review from Malcolmnixon January 31, 2026 16:54
@Malcolmnixon
Copy link
Contributor

@copilot Quality checks failed, please run and fix

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 1, 2026

@copilot Quality checks failed, please run and fix

All quality checks now passing:

  • ✅ cspell: 0 issues found
  • ✅ markdownlint: passes
  • ✅ yamllint: passes
  • ✅ Build: 0 warnings

Fixed spelling issue in commit b568fe7.

@Malcolmnixon
Copy link
Contributor

@copilot The unit tests are failing, please run and fix.

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 1, 2026

@copilot The unit tests are failing, please run and fix.

All unit tests now passing (61/61 across net8.0, net9.0, net10.0). Fixed test expectations to align with Version refactoring in commit 191ef7a.

@Malcolmnixon Malcolmnixon marked this pull request as ready for review February 1, 2026 22:50
@Malcolmnixon Malcolmnixon merged commit 4b5f78b into main Feb 1, 2026
10 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/add-build-information-record branch February 1, 2026 22:50
Copilot AI mentioned this pull request Feb 6, 2026
21 tasks
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.

[Feature]: Build Information Record

2 participants