Skip to content

Fix TfsSharedQueryProcessor to preserve area selection with @CurrentIteration macro #2716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented May 20, 2025

Problem

When migrating queries that use the @CurrentIteration macro, the TfsSharedQueryProcessor fails to preserve area path selections in the migrated query. This results in queries being migrated without any errors but missing their area selection criteria.

As shown in the screenshot from the issue, queries with both area selection and @CurrentIteration lose their area path condition during migration:

Query missing area path

Solution

This PR implements a solution that ensures area path conditions are preserved when migrating queries with @CurrentIteration macros. The implementation:

  1. Adds special handling for queries containing @CurrentIteration
  2. Detects when a query contains both area path conditions and the @CurrentIteration macro
  3. Reorders conditions when necessary to put area path conditions before iteration path conditions
  4. Preserves the query structure and ensures all conditions are maintained in the migrated query
  5. Adds enhanced logging to help with troubleshooting

Changes

  • Modified MigrateQuery method to capture and log the original query text
  • Added a new PreserveMacros method to handle special macros like @CurrentIteration
  • Implemented condition reordering when needed to preserve area path selections
  • Added new test cases to verify the fix

Testing

Added unit tests that verify:

  • Queries with both @CurrentIteration and area path selections are properly preserved
  • When area path conditions appear after @CurrentIteration, they are reordered to ensure preservation

Fixes #2705.

Warning

Firewall rules blocked me from connecting to one or more addresses

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

  • crl3.digicert.com
    • Triggering command: dotnet build (dns block)
  • crl4.digicert.com
    • Triggering command: dotnet build (dns block)
  • ocsp.digicert.com
    • Triggering command: dotnet build (dns block)
  • s.symcb.com
    • Triggering command: dotnet build (dns block)
  • s.symcd.com
    • Triggering command: dotnet build (dns block)
  • ts-crl.ws.symantec.com
    • Triggering command: dotnet build (dns block)
  • ts-ocsp.ws.symantec.com
    • Triggering command: dotnet build (dns block)
  • www.microsoft.com
    • Triggering command: dotnet build (dns block)

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@nkdagility-actions-bot
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://blue-river-093197403-2716.westeurope.5.azurestaticapps.net

@Copilot Copilot AI changed the title [WIP] [Bug]: TfsSharedQueryProcessor doesn't migrate area selection where @CurrentIteration is used Fix TfsSharedQueryProcessor to preserve area selection with @CurrentIteration macro May 20, 2025
@Copilot Copilot AI requested a review from MrHinsh May 20, 2025 16:07
@nkdagility-actions-bot
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://blue-river-093197403-2716.westeurope.5.azurestaticapps.net

@CLAassistant
Copy link

CLAassistant commented May 21, 2025

CLA assistant check
All committers have signed the CLA.

@MrHinsh MrHinsh closed this May 22, 2025
@nkdagility-actions-bot
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://blue-river-093197403-2716.westeurope.5.azurestaticapps.net

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]: TfsSharedQueryProcessor doesn't migrate area selection where @CurrentIteration is used
3 participants