Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new API leaves Kotlin implementations uncompilable, and external-file results can still bypass filtering.
Get a fresh assessment by requesting another Copilot review.
Review tier: Lite (auto)
Findings: 1
Note
Copilot is running an experiment and ran this review at Lite.
Open (1)
What changed in this PR
This PR centralizes source-directory filtering for inline expectation results by adding a shared getRelativeUrl contract.
Changes:
- Adds shared source-location filtering.
- Moves URL mapping into language-specific implementations.
- Simplifies query wiring and updates Actions support.
Unresolved findings:
- Critical (3 votes): Kotlin implementations lack the new required
getRelativeUrlmember and will fail to compile. - Moderate (1 vote):
TestPostProcessingcan still report results from external files.
| File | Summary |
|---|---|
unified/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds Unified URL mapping. |
unified/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
swift/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds Swift URL mapping. |
swift/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
shared/util/codeql/util/test/InlineExpectationsTest.qll |
Adds the shared contract and filtering. |
rust/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds Rust URL mapping. |
rust/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
ruby/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds Ruby URL mapping. |
ruby/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
ql/ql/src/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds QL URL mapping. |
ql/ql/src/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
python/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds Python URL mapping. |
python/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
javascript/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds JavaScript URL mapping. |
javascript/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
java/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds Java URL mapping. |
java/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
go/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds Go URL mapping. |
go/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
csharp/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds C# URL mapping. |
csharp/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
cpp/ql/lib/utils/test/internal/InlineExpectationsTestImpl.qll |
Adds C++ URL mapping. |
cpp/ql/lib/utils/test/InlineExpectationsTestQuery.ql |
Uses the shared adapter. |
actions/ql/test/utils/ActionsInlineExpectationsTestQuery.ql |
Adapts the Actions test wiring. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
hvitved
force-pushed
the
inline-expectations-relative-restriction
branch
from
September 16, 2026 13:25
4958c7f to
22cdf94
Compare
Contributor
Author
Rerun has been triggered: 1 restarted 🚀 |
hvitved
force-pushed
the
inline-expectations-relative-restriction
branch
from
September 16, 2026 18:04
22cdf94 to
7c8d3af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Needed for #22593, where instead of restricting each inline expectation test to elements from source, it makes sense to do it centrally in the shared library.