Skip to content

Suppress Azure DevOps work items in the 'Removed' state#176

Merged
Malcolmnixon merged 3 commits into
mainfrom
copilot/suppress-removed-work-items
May 9, 2026
Merged

Suppress Azure DevOps work items in the 'Removed' state#176
Malcolmnixon merged 3 commits into
mainfrom
copilot/suppress-removed-work-items

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

Pull Request

Description

Azure DevOps work items in the Removed state (explicitly abandoned/cancelled) were appearing in build notes as delivered changes and open known issues. Since Removed is an explicit abandonment state, these items should not surface in any section of build notes.

Changes

  • WorkItemMapper.cs — Added SuppressedStates HashSet ("Removed") and an early-exit null return at the top of MapWorkItemToItemInfo. A single check covers both code paths (PR-linked changes via ProcessLinkedWorkItems and known-issues collection), since both call MapWorkItemToItemInfo and guard on null:

    private static readonly HashSet<string> SuppressedStates = new(StringComparer.OrdinalIgnoreCase)
    {
        "Removed"
    };
    
    public static ItemInfo? MapWorkItemToItemInfo(...)
    {
        var state = GetFieldValue(workItem, "System.State") ?? string.Empty;
        if (SuppressedStates.Contains(state))
            return null;
        // ...
    }
  • WorkItemMapperTests.cs — Added WorkItemMapper_MapWorkItemToItemInfo_RemovedState_ReturnsNull covering bug and feature work items in the Removed state.

  • work-item-mapper.yaml (reqstream) — Added BuildMark-AzureDevOps-SuppressRemovedWorkItems requirement.

  • work-item-mapper.md (design) — Documented SuppressedStates as a distinct concept from ResolvedStates; corrected MapWorkItemToItemInfo steps so that System.State is listed only under the suppressed-state check (step 1) and not repeated in step 2.

  • work-item-mapper.md (verification) — Corrected the verification approach text to accurately reflect covered behaviours; aligned all test scenario names with the actual test methods; corrected requirement coverage IDs from BuildMark-RepoConnectors-WorkItemMapper to BuildMark-AzureDevOps-WorkItemMapper; added coverage entries for BuildMark-AzureDevOps-CustomFields and BuildMark-AzureDevOps-SuppressRemovedWorkItems.

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

Pre-Submission Checklist

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

Build and Test

  • Code builds successfully and all tests pass: pwsh ./build.ps1
  • Code produces zero warnings

Code Quality

  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • All linters pass: pwsh ./lint.ps1

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 docs/ documentation (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

SuppressedStates is intentionally separate from ResolvedStatesRemoved is not semantically "resolved" (completed), it was abandoned. This separation keeps the intent of IsWorkItemResolved clean and makes it straightforward to add other abandonment states in the future.

Copilot AI changed the title [WIP] Suppress Azure DevOps work items in the 'Removed' state Suppress Azure DevOps work items in the 'Removed' state May 9, 2026
Copilot AI requested a review from Malcolmnixon May 9, 2026 21:22
@Malcolmnixon Malcolmnixon marked this pull request as ready for review May 9, 2026 22:00
Copilot AI review requested due to automatic review settings May 9, 2026 22:00
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

This pull request updates the Azure DevOps work-item mapping so that work items in the Removed state are fully excluded from BuildMark build notes (both delivered changes and known issues), aligning output with Azure DevOps semantics for explicitly abandoned/cancelled items.

Changes:

  • Add a suppressed-state check (Removed) to WorkItemMapper.MapWorkItemToItemInfo that returns null early.
  • Add a unit test validating Removed work items are suppressed for both bug and feature types.
  • Update reqstream/design/verification docs to capture the new suppression requirement and behavior.

Reviewed changes

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

Show a summary per file
File Description
src/DemaConsulting.BuildMark/RepoConnectors/AzureDevOps/WorkItemMapper.cs Adds SuppressedStates and early null return to suppress Removed work items globally.
test/DemaConsulting.BuildMark.Tests/RepoConnectors/AzureDevOps/WorkItemMapperTests.cs Adds coverage ensuring Removed items map to null.
docs/reqstream/build-mark/repo-connectors/azure-devops/work-item-mapper.yaml Introduces a new requirement for suppressing Removed work items and links it to the new test.
docs/design/build-mark/repo-connectors/azure-devops/work-item-mapper.md Documents suppressed states and updates mapping steps.
docs/verification/build-mark/repo-connectors/azure-devops/work-item-mapper.md Updates verification narrative and adds a scenario for the new suppression behavior.

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

Comment thread docs/design/build-mark/repo-connectors/azure-devops/work-item-mapper.md Outdated
Comment thread docs/verification/build-mark/repo-connectors/azure-devops/work-item-mapper.md Outdated
Comment thread docs/verification/build-mark/repo-connectors/azure-devops/work-item-mapper.md Outdated
@Malcolmnixon
Copy link
Copy Markdown
Member

@copilot apply changes based on the comments in this thread

Additionally once done please run lint-fix

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 9, 2026

@copilot apply changes based on the comments in this thread

Additionally once done please run lint-fix

Done in commit 0df1465. Three issues addressed from the review thread:

  1. Design doc step 2 — removed System.State from the list of fields read in step 2 (it's only read once in step 1 for the suppressed-state check).
  2. Verification approach text — removed inaccurate claims about "description extraction" and "change link generation"; updated the scenario list to match the actual test method names.
  3. Requirement coverage IDs — corrected all references from BuildMark-RepoConnectors-WorkItemMapper to BuildMark-AzureDevOps-WorkItemMapper.

lint-fix was also run and the one MD013 line-length violation it found was auto-fixed.

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

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

@Malcolmnixon Malcolmnixon merged commit 7723002 into main May 9, 2026
19 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/suppress-removed-work-items branch May 9, 2026 22:45
@Malcolmnixon Malcolmnixon added the bug Something isn't working label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress Azure DevOps work items in the 'Removed' state

3 participants