Skip to content

Fix known issues rules: closed bugs with matching affected-versions are known issues (LTS back-port gap)#159

Merged
Malcolmnixon merged 5 commits intomainfrom
copilot/update-user-guide-links-and-bug-affects
Apr 12, 2026
Merged

Fix known issues rules: closed bugs with matching affected-versions are known issues (LTS back-port gap)#159
Malcolmnixon merged 5 commits intomainfrom
copilot/update-user-guide-links-and-bug-affects

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Pull Request

Description

The --include-known-issues flag had incorrect logic: it pre-filtered bugs to open/unresolved state before checking affected-versions, so a closed bug with a matching version range was silently excluded. The correct rules are:

Condition Known issue?
Closed bug, no affected-versions No
Open bug, no affected-versions Yes
Any-state bug, affected-versions contains build version Yes
Any-state bug, affected-versions does not contain build version No

Rules 3 and 4 cover the LTS back-port gap: a bug fixed in v2.0 and closed, but never back-ported to the v1.x branch, must still appear in v1.x release notes when its affected-versions range says so.

GitHub connector

Removed the Where(i => i.State == "OPEN") pre-filter. Rewrote as foreach to keep issue state in scope as a fallback:

var isKnownIssue = itemInfo.AffectedVersions != null
    ? itemInfo.AffectedVersions.Contains(targetVersion)
    : issue.State == "OPEN";

GetAllIssuesAsync now passes states: [OPEN, CLOSED] in the GraphQL query so that closed issues are actually fetched from GitHub:

issues(first: 100, states: [OPEN, CLOSED], after: $after)

Azure DevOps connector

Removed AND [System.State] NOT IN ('Done', 'Closed', 'Resolved') from the WIQL query. IsWorkItemResolved is now only the no-affected-versions fallback, not a blanket gate.

var isKnownIssue = itemInfo.AffectedVersions != null
    ? itemInfo.AffectedVersions.Contains(targetVersion)
    : !WorkItemMapper.IsWorkItemResolved(workItem);

Mock connector

CollectKnownIssuesAsync now iterates all _issueTitles keys (not just _openIssues); _openIssues is only consulted when AffectedVersions is null. Added issue 7 — a closed bug with AV = [1.0.0,1.0.0] — to model the LTS scenario in tests.

Requirements and design documentation

  • BuildMark-Report-KnownIssues: enumerated all four rules explicitly with the LTS back-port motivation
  • Design docs for GitHub, Azure DevOps, and Mock connectors updated to describe the two-tier rule, with the GitHub doc now also mentioning the states: [OPEN, CLOSED] GraphQL filter
  • Subsystem YAML requirements updated with new justification text and test references

README links

Five README links that all pointed to introduction.md updated to target the specific user guide page for the relevant content (configuration.md, item-controls.md, cli-reference.md).

Tests

Three new tests — one per connector — verify the closed-bug LTS back-port scenario:

  • GitHubRepoConnector_GetBuildInformationAsync_ClosedBugWithMatchingAffectedVersions_IsKnownIssue
  • AzureDevOpsRepoConnector_GetBuildInformationAsync_ClosedBugWithMatchingAffectedVersions_IsKnownIssue
  • MockRepoConnector_GetBuildInformationAsync_ClosedBugWithMatchingAffectedVersions_IsKnownIssue

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

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All tests pass: dotnet test --configuration Release
  • Self-validation tests pass:
    dotnet run --project src/DemaConsulting.BuildMark --configuration Release --framework net10.0
    --no-build -- --validate
  • 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

  • All linters pass: ./lint.sh (Unix/macOS) or cmd /c lint.bat / ./lint.bat (Windows)

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

473 tests pass across .NET 8, 9, and 10. CodeQL clean.

Copilot AI and others added 4 commits April 12, 2026 15:00
…s filtering

Agent-Logs-Url: https://github.com/demaconsulting/BuildMark/sessions/02d2cba2-d8bb-4eea-a334-e47b5cb254ef

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

Agent-Logs-Url: https://github.com/demaconsulting/BuildMark/sessions/02d2cba2-d8bb-4eea-a334-e47b5cb254ef

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
…nts, fix lint issues

Agent-Logs-Url: https://github.com/demaconsulting/BuildMark/sessions/02d2cba2-d8bb-4eea-a334-e47b5cb254ef

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
…are known issues

Agent-Logs-Url: https://github.com/demaconsulting/BuildMark/sessions/2b3a96fc-c54b-48d2-9d93-ce916ecfb1c9

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
@Malcolmnixon Malcolmnixon marked this pull request as ready for review April 12, 2026 16:37
Copilot AI review requested due to automatic review settings April 12, 2026 16:37
Copy link
Copy Markdown
Contributor

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

Fixes known-issues reporting so that bugs with affected-versions are evaluated against the target build version regardless of open/closed state (covering the LTS back-port gap scenario), with corresponding updates across connectors, tests, and documentation.

Changes:

  • Update known-issues collection logic in GitHub, Azure DevOps, and Mock connectors to apply a two-tier rule: version-range match when affected-versions exists, otherwise fall back to open/unresolved status.
  • Add/adjust unit tests to cover affected-versions filtering and the “closed bug with matching affected-versions” LTS scenario for each connector.
  • Refresh requirements/design docs and README links to reflect the clarified behavior and point to more specific user-guide pages.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/DemaConsulting.BuildMark/RepoConnectors/GitHub/GitHubRepoConnector.cs Removes open-only prefilter and applies affected-versions-first rule when determining known issues.
src/DemaConsulting.BuildMark/RepoConnectors/AzureDevOps/AzureDevOpsRepoConnector.cs Broadens WIQL to include all states and applies affected-versions-first rule with unresolved fallback.
src/DemaConsulting.BuildMark/RepoConnectors/Mock/MockRepoConnector.cs Extends mock dataset and known-issues logic to model affected-versions behavior and closed-bug LTS case.
test/DemaConsulting.BuildMark.Tests/RepoConnectors/GitHub/GitHubRepoConnectorTests.cs Adds coverage for affected-versions filtering and closed bug with matching affected-versions.
test/DemaConsulting.BuildMark.Tests/RepoConnectors/AzureDevOps/AzureDevOpsRepoConnectorTests.cs Adds coverage for affected-versions filtering and resolved bug with matching affected-versions.
test/DemaConsulting.BuildMark.Tests/RepoConnectors/Mock/MockRepoConnectorTests.cs Adds coverage for affected-versions filtering and closed bug with matching affected-versions.
test/DemaConsulting.BuildMark.Tests/BuildNotes/BuildNotesTests.cs Updates expected known-issues output to reflect affected-versions filtering in the mock dataset.
test/DemaConsulting.BuildMark.Tests/BuildNotes/BuildInformationTests.cs Updates known-issues expectations to reflect affected-versions filtering in the mock dataset.
docs/reqstream/build-mark/build-mark.yaml Expands the requirements text to explicitly enumerate the four known-issues rules and LTS motivation.
docs/reqstream/build-mark/repo-connectors/github/github-repo-connector.yaml Documents the updated known-issues rules and adds test references.
docs/reqstream/build-mark/repo-connectors/azure-devops/azure-devops-repo-connector.yaml Documents the updated known-issues rules and adds test references.
docs/reqstream/build-mark/repo-connectors/mock/mock-repo-connector.yaml Documents mock dataset rationale for testing the two-tier known-issues rule and adds test references.
docs/design/build-mark/repo-connectors/github/github-repo-connector.md Updates design narrative to describe affected-versions-first known-issues behavior.
docs/design/build-mark/repo-connectors/azure-devops/azure-devops-repo-connector.md Updates design narrative to describe affected-versions-first known-issues behavior.
docs/design/build-mark/repo-connectors/mock/mock-repo-connector.md Updates design narrative to describe affected-versions-first known-issues behavior in the mock connector.
README.md Updates documentation links to point to more specific user-guide pages (e.g., config, item controls, CLI reference).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/DemaConsulting.BuildMark/RepoConnectors/Mock/MockRepoConnector.cs Outdated
@Malcolmnixon
Copy link
Copy Markdown
Member

@copilot apply changes based on the comments in this thread

… feedback

Agent-Logs-Url: https://github.com/demaconsulting/BuildMark/sessions/b1b11b89-5c5e-4b7e-a3ad-6115576bfaf0

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

Copilot AI commented Apr 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

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://api.github.com/graphql
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net10.0/DemaConsulting.BuildMark.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net10.0/DemaConsulting.BuildMark.Tests.deps.json /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net10.0/testhost.dll --port 37477 --endpoint 127.0.0.1:037477 --role client --parentprocessid 4267 --telemetryoptedin false (http block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net9.0/DemaConsulting.BuildMark.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net9.0/DemaConsulting.BuildMark.Tests.deps.json /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net9.0/testhost.dll --port 43903 --endpoint 127.0.0.1:043903 --role client --parentprocessid 4250 --telemetryoptedin false (http block)
    • Triggering command: /usr/share/dotnet/dotnet /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net8.0/DemaConsulting.BuildMark.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net8.0/DemaConsulting.BuildMark.Tests.deps.json /home/REDACTED/work/BuildMark/BuildMark/test/DemaConsulting.BuildMark.Tests/bin/Debug/net8.0/testhost.dll --port 46785 --endpoint 127.0.0.1:046785 --role client --parentprocessid 4259 --telemetryoptedin false (http block)

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

Copy link
Copy Markdown
Contributor

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

Fixes known-issues classification across GitHub, Azure DevOps, and Mock connectors so that affected-versions takes precedence over item state, enabling “LTS back-port gap” scenarios (closed bugs can still be known issues for older branches if their affected-versions include the target build).

Changes:

  • Update known-issues collection logic to: use AffectedVersions.Contains(targetVersion) when present; otherwise fall back to open/unresolved state.
  • Ensure GitHub connector actually fetches closed issues (states: [OPEN, CLOSED]) and Azure DevOps connector no longer pre-filters out resolved items in WIQL.
  • Add/adjust connector + build-notes tests and update requirements/design docs + README links to reflect the clarified behavior.

Reviewed changes

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

Show a summary per file
File Description
test/DemaConsulting.BuildMark.Tests/RepoConnectors/Mock/MockRepoConnectorTests.cs Adds tests for affected-versions filtering and closed-bug LTS scenario in the mock connector.
test/DemaConsulting.BuildMark.Tests/RepoConnectors/GitHub/GitHubRepoConnectorTests.cs Adds GitHub tests for AV filtering and closed-bug AV inclusion.
test/DemaConsulting.BuildMark.Tests/RepoConnectors/AzureDevOps/AzureDevOpsRepoConnectorTests.cs Adds Azure DevOps tests for AV filtering and resolved-bug AV inclusion.
test/DemaConsulting.BuildMark.Tests/BuildNotes/BuildNotesTests.cs Updates markdown assertions to reflect AV-filtered known issues.
test/DemaConsulting.BuildMark.Tests/BuildNotes/BuildInformationTests.cs Updates expected known-issues IDs/titles after AV filtering changes.
src/DemaConsulting.BuildMark/RepoConnectors/Mock/MockRepoConnector.cs Implements two-tier known-issues logic; adds mock data for AV + closed LTS case.
src/DemaConsulting.BuildMark/RepoConnectors/GitHub/GitHubRepoConnector.cs Removes OPEN-only pre-filter; applies AV-first known-issue rule with state fallback.
src/DemaConsulting.BuildMark/RepoConnectors/GitHub/GitHubGraphQLClient.cs Fetches issues with states: [OPEN, CLOSED] so closed bugs can be evaluated.
src/DemaConsulting.BuildMark/RepoConnectors/AzureDevOps/AzureDevOpsRepoConnector.cs Removes WIQL resolved-state exclusion; applies AV-first known-issue rule with unresolved fallback.
README.md Updates several doc links to more specific user guide pages and adds CLI reference link.
docs/reqstream/build-mark/repo-connectors/mock/mock-repo-connector.yaml Documents mock dataset + tests for LTS closed-bug AV behavior.
docs/reqstream/build-mark/repo-connectors/github/github-repo-connector.yaml Updates requirement text + adds test references for AV/state two-tier logic.
docs/reqstream/build-mark/repo-connectors/azure-devops/azure-devops-repo-connector.yaml Updates requirement text + adds test references for AV/state two-tier logic.
docs/reqstream/build-mark/build-mark.yaml Expands known-issues requirement with explicit rules and LTS justification; links to connector subsystems.
docs/design/build-mark/repo-connectors/mock/mock-repo-connector.md Documents AV-first known-issue rule and state fallback for mock connector.
docs/design/build-mark/repo-connectors/github/github-repo-connector.md Documents closed-issue fetch + AV-first known-issue rule and rationale.
docs/design/build-mark/repo-connectors/azure-devops/azure-devops-repo-connector.md Documents querying all bugs + AV-first known-issue rule and rationale.
Comments suppressed due to low confidence (1)

src/DemaConsulting.BuildMark/RepoConnectors/AzureDevOps/AzureDevOpsRepoConnector.cs:592

  • The WIQL was broadened to query all 'Bug'/'Issue' work items regardless of state. In real Azure DevOps projects this can return a very large ID set, which then triggers GetWorkItemsAsync to batch-fetch full details for every item (200 per request), even though most resolved items will be discarded later (no affected-versions + resolved => not a known issue). Consider narrowing server-side to reduce API load, e.g. query unresolved items OR resolved items that declare affected-versions via Custom.AffectedVersions (and/or System.Description CONTAINS 'affected-versions' if you need to support buildmark blocks), or run two targeted WIQL queries and union the results before fetching details.
        // Query all bugs and issues — state filtering is applied in code so that resolved
        // bugs with a declared affected-versions range are still considered as known issues.
        const string wiql = "SELECT [System.Id] FROM workitems " +
                            "WHERE [System.WorkItemType] IN ('Bug', 'Issue')";

        var queryResult = await restClient.QueryWorkItemsAsync(wiql);
        if (queryResult.WorkItems.Count == 0)
        {
            return [];
        }

        // Fetch full work item details
        var workItemIds = queryResult.WorkItems.Select(r => r.Id).ToList();
        var workItems = await restClient.GetWorkItemsAsync(workItemIds);


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants