-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Implement PrintCFG queries and corresponding query-unit-tests across all supported code languages (actions, cpp, csharp, go, java, javascript, python, ruby).
Background
This issue is a sub-issue of github/codeql-development-mcp-server#65, which tracks multi-language support for additional "tools" queries for the MCP server tool (codeql_query_run). That parent issue outlines the need for broader support for built-in queries like PrintAST, CallGraphFrom, and CallGraphTo across all supported languages.
Implementation Notes (from parent issue #65)
- Each "tools" query should be implemented for every supported language: actions, cpp, csharp, go, java, javascript, python, ruby.
- Queries should be placed in a consistent directory structure under
server/ql/<language>/tools/src/PrintCFG/PrintCFG.ql. - Use open-source implementations from github/codeql for C# and Ruby as primary references:
- Copy and adapt the C# and Ruby queries as templates for all languages.
- Maintain backward compatibility with existing API contracts.
Testing and Validation (from parent issue #65)
- All "tools" queries must have minimal unit test code in the relevant test directory.
- Unit tests should be run and validated using
server/scripts/run-query-unit-tests.sh. - MCP tool integration tests must be defined for each new query, with "after" files including
monitoring-state.json,query-results.bqrs, andquery-results.md. - All tests and integration scenarios must pass before submitting changes.
- Use test-driven development strategy:
- Develop test code and generate expected results (
codeql test run). - Develop the query to produce the expected results.
- Validate using the MCP server tool or CodeQL CLI, comparing actual to expected results.
- Develop test code and generate expected results (
Acceptance Criteria
- PrintCFG queries exist and are tested for all supported languages.
- Unit and integration tests pass for each language.
- Implementation follows reference structure and parent issue guidelines.
- Documentation updated as needed.
Priority
High
References
- Parent issue #65
- C# and Ruby printCfg queries and libraries (linked above)
Checklist:
- Backward Compatibility
- Test Coverage
- New Functionality Testing
- Error Handling
- Performance
- Documentation
- Type Safety
- Integration
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request