Skip to content

Align qlref inline-expectation conversion with recipe for ql tests#21967

Draft
Copilot wants to merge 10 commits into
mainfrom
copilot/conversion-of-codeql-queries
Draft

Align qlref inline-expectation conversion with recipe for ql tests#21967
Copilot wants to merge 10 commits into
mainfrom
copilot/conversion-of-codeql-queries

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This updates the branch to follow the agreed .qlref conversion recipe: convert eligible @kind problem / @kind path-problem tests to inline expectations, keep generated .expected files untouched, and avoid out-of-scope languages/fixtures. The main change is adding the missing ql/ql/test/queries coverage and backing out prior work that violated the conversion boundaries.

  • ql test coverage

    • Converted the eligible .qlref tests under ql/ql/test/queries/{bugs,overlay,performance,style} to use utils/test/InlineExpectationsTestQuery.ql.
    • Added inline $ Alert markers to the owned QL test sources at the existing expected-result end lines.
    • Kept empty .expected files unchanged for zero-result tests.
  • Recipe conformance

    • Preserved the compact single-postprocessor form in converted .qlref files.
    • Left the non-convertible QlRefInlineExpectations cases unchanged:
      • kind-less AST-dump tests (PrintAst.qlref, Test4.qlref)
      • the self-check on .qlref YAML (QlRefInlineExpectations.qlref), where inline source comments are not the right ownership boundary
  • Out-of-scope cleanup

    • Reverted the earlier actions inline-expectation conversion work, per the updated scope.
    • Reverted generated .expected edits and unrelated source/schema changes that were not part of the .qlref conversion recipe.

Example of the converted shape:

query: queries/style/Misspelling.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
predicate isXML() { any() } // $ Alert
Original prompt

Please do the same for all other languages that CodeQL supports (i.e. other than go or java), using what you have learned. Do not make a PR. List any queries you do not convert and why. I think you will not have access to CodeQL to test your changes, so do your best without that feedback. I will provide a list of failing tests at a future point.

It seems like you have provided a context about the current date and some previous requests related to CodeQL files. If you need assistance with anything specific, such as formatting .qlref files for Java or addressing the test output failures, please let me know how I can help!

Created from VS Code.

Copilot AI changed the title [WIP] Convert CodeQL queries for supported languages Normalize non-Go/Java .qlref files to explicit query: format Jun 10, 2026
Copilot AI requested a review from owen-mc June 10, 2026 12:39
Copilot AI changed the title Normalize non-Go/Java .qlref files to explicit query: format Convert non-Go/Java qlref tests to inline expectation tests via postprocess Jun 10, 2026
@github-actions github-actions Bot added C# JS C++ Python Ruby Rust Pull requests that update Rust code Swift Actions Analysis of GitHub Actions labels Jun 10, 2026
@owen-mc

owen-mc commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
Rerun has been triggered, but no failed runs found ⚠️

@owen-mc owen-mc force-pushed the copilot/conversion-of-codeql-queries branch from aa3982d to 4d2e16e Compare June 10, 2026 20:59

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copilot AI changed the title Convert non-Go/Java qlref tests to inline expectation tests via postprocess Align qlref inline-expectation conversion with recipe for ql tests Jun 11, 2026
@github-actions github-actions Bot added documentation QL-for-QL and removed Actions Analysis of GitHub Actions labels Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants