{{ message }}
Repository navigation
Update --language support for new-query subcommand - #28
Open
data-douser wants to merge 12 commits into
Open
data-douser wants to merge 12 commits into
data-douser wants to merge 12 commits into
Conversation
Updates the `qlt query generate new-query` subcommand in order to support the equivalent set of `--language` options as the `qlt test init` subcommand. Adds unit tests to ensure that template vars (i.e. language) are defined (i.e. not empty) for subcommand templates.
There was a problem hiding this comment.
Pull Request Overview
Updates the qlt query generate new-query subcommand to support the same language options as the qlt test init subcommand by adding Python and Ruby language support. This includes adding template files for both languages and ensuring proper template variable resolution.
- Adds Python language support to
FromOptionStringmethod - Extends supported languages array to include C#, Go, Java, Python, and Ruby
- Adds comprehensive unit tests to validate template existence and proper variable substitution
Reviewed Changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 3 comments.
Show a summary per file
Comments suppressed due to low confidence (3)
src/CodeQLToolkit.Features/Templates/Query/go/new-dataflow-query.liquid:1
- The Go dataflow template uses an outdated API pattern. Line 22 is missing the
overridekeyword for theisSinkpredicate, and the template should use the newer module-based configuration pattern consistent with other language templates.
/**
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Fixes an error where cloning the `github/codeql` repo would fail when the local environment had a git config for automatically rewriting the URL scheme (to SSH) for any `git clone` task.
Refactors the 'query generate new-query' subcommand of the CodeQLToolkit.Core (qlt) CLI in order to: - Update the version of CodeQL used to 'v2.22.4' (current latest); - Support generating new queries for all currently supported languages; - Add support for generating `@kind path-problem` (dataflow) queries; - Create scripts for end-to-end testing of the `new-query` subcommand; - Create a new actions workflow for automated verification and testing of queries generated via `qlt query generate new-query`; - Ensure that (liquid) template rendering fails if a required template var is unset. Adds unit tests to ensure template vars are not empty.
Fixes to templates used to generate new queries languages such as: - cpp - csharp - go - java - ruby
Author
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.

Purpose
This main purpose of this PR is to improve the
qlt query generate new-querysubcommand in order to support the equivalent set of--languageoptions as theqlt test initsubcommand.Summary
This PR also introduces several other improvements and updates to the CodeQL Toolkit project, focusing on modernizing dependencies, enhancing CI validation, and expanding unit test coverage. The most significant changes include updating all CodeQL pack and CLI versions to the latest releases, adding a new internal GitHub Actions workflow for validating CLI outputs across multiple languages, and introducing a robust shell script for running and validating unit tests. Additionally, the solution file now includes a new test project for feature-level testing.
Outline of Changes
Automation and Testing Improvements:
.github/workflows/internal-validate-cli-outputs.ymlworkflow to automate generation, validation, and end-to-end testing of thenew-queryCLI across multiple languages.scripts/run-unit-tests.shfor running and validating CodeQL unit tests for generated queries, with improved logging and argument parsing.Dependency and Configuration Updates:
codeql-pack.lock.ymlandqlpack.ymlfiles in the example C++ packs (customizations,stuff,stuff2) to use the latest CodeQL pack versions (e.g.,codeql/cpp-allto5.4.1) and incremented pack versions. [1] [2] [3] [4] [5] [6] [7]example/qlt.conf.jsonto reference newer CodeQL CLI and standard library versions (2.22.4).Solution Structure:
CodeQLToolkit.Features.Testsproject toCodeQLToolkit.slnand configured it for build and solution folder placement. [1] [2] [3]