Skip to content

Implement PrintCFG queries and unit tests for all supported languages (actions, cpp, csharp, go, java, javascript, python, ruby) #241

@data-douser

Description

@data-douser

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)

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, and query-results.md.
  • All tests and integration scenarios must pass before submitting changes.
  • Use test-driven development strategy:
    1. Develop test code and generate expected results (codeql test run).
    2. Develop the query to produce the expected results.
    3. Validate using the MCP server tool or CodeQL CLI, comparing actual to 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


Checklist:

  • Backward Compatibility
  • Test Coverage
  • New Functionality Testing
  • Error Handling
  • Performance
  • Documentation
  • Type Safety
  • Integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions