Skip to content

Conversation

@asgerf
Copy link
Contributor

@asgerf asgerf commented Feb 11, 2025

Makes the inline test post-processor support queries that select a location that does not correspond to an instance of Location. This can happen when it selects an entity that uses hasLocationInfo to craft a custom location range.

To ensure the behavior is exercised, this PR also ports one of the JS queries for which this was blocking migration to post-processed inline expectations.

@asgerf asgerf added the no-change-note-required This PR does not need a change note label Feb 11, 2025
@github-actions github-actions bot added the JS label Feb 11, 2025
@asgerf asgerf marked this pull request as ready for review February 11, 2025 13:18
Copilot AI review requested due to automatic review settings February 11, 2025 13:18
@asgerf asgerf requested a review from a team as a code owner February 11, 2025 13:18
@asgerf asgerf requested a review from hvitved February 11, 2025 13:18
Copy link
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.

PR Overview

This PR extends the inline test post-processor's support to allow queries that select locations not bound to an instance of Location, and it ensures that custom location ranges via hasLocationInfo are handled correctly. In addition, one JS query—previously blocking the migration to post-processed inline expectations—has been ported as part of the tests.

  • Extended support for arbitrary locations in inline test post-processing.
  • Ported an existing JS query to exercise the new functionality.
  • Updated inline test expectations to include alert markers for duplicate dependency alerts.

Changes

File Description
javascript/ql/test/query-tests/AngularJS/DuplicateDependency/duplicates.js Updated inline test expectations and alert markers to validate the new support for arbitrary location queries.

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

Comments suppressed due to low confidence (1)

javascript/ql/test/query-tests/AngularJS/DuplicateDependency/duplicates.js:15

  • The inline alert marker for this multi-line function may be ambiguous regarding which part of the function it refers to. Consider repositioning or clarifying the alert marker to ensure that the intended location is unambiguous.
.run(['dup11a', 'dup11a', function(dup11a, dup11b){ // $ Alert - alert formatting for multi-line function

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

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

LGTM, some minor suggestions.

asgerf and others added 2 commits February 11, 2025 16:53
@asgerf asgerf merged commit 654c6bf into github:main Feb 12, 2025
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JS no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants