Skip to content

[UPDATE PRIMITIVE] codeql_bqrs_decode tool support for singular file OR list of files#303

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-codeql-bqrs-decode-file-argument
Open

[UPDATE PRIMITIVE] codeql_bqrs_decode tool support for singular file OR list of files#303
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-codeql-bqrs-decode-file-argument

Conversation

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

This pull request improves the usability and robustness of the codeql_bqrs_decode tool by allowing it to accept both a singular file argument and a plural files array, addressing issues encountered by automated and LLM-based clients. It also adds clear error handling when neither argument is provided, updates the tool schema and documentation, and introduces regression and unit tests to ensure correct behavior.

Key changes:

Tool Input Handling & Validation

  • Updated the codeql_bqrs_decode tool definition to accept either a singular file (string) or plural files (array) argument, with both being optional but at least one required. This improves compatibility with clients that naturally provide a single file path.
  • Enhanced the CLI tool registry logic to normalize both file and files arguments and to throw a clear, actionable error naming both parameters if neither is supplied, instead of a generic schema error. Whitespace-only paths are treated as missing.

Testing & Regression Coverage

  • Added comprehensive unit tests to verify that both file and files arguments are accepted, that missing or whitespace-only arguments produce clear errors, and that the correct positional arguments are passed to the CLI. [1] [2]
  • Introduced a regression integration test (decode_singular_file) to ensure the tool correctly decodes a BQRS file when provided with a singular file argument. [1] [2] [3] [4]

Documentation & Changelog

  • Updated the changelog to document the new support for the singular file argument and the improved error message, referencing the relevant issues and pull requests.
  • Added documentation for the new regression test, explaining its purpose and expected behavior.

Miscellaneous

  • Updated the tool schema test to verify the presence of both file and files properties and their correct validation in the input schema. [1] [2]

Copilot AI requested review from Copilot and removed request for Copilot June 20, 2026 14:55
Copilot AI requested review from Copilot and removed request for Copilot June 20, 2026 15:18
Copilot AI changed the title [WIP] Fix codeql_bqrs_decode to accept files array argument [UPDATE PRIMITIVE] Accept singular file argument in codeql_bqrs_decode Jun 20, 2026
Copilot AI requested a review from data-douser June 20, 2026 15:21
Copilot AI review requested due to automatic review settings June 20, 2026 15:38
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the codeql_bqrs_decode MCP server tool contract to accept a singular file argument (in addition to files), aligning the advertised schema with the existing registry normalization, and adds tests/docs plus a rebuilt server bundle.

Changes:

  • Extend codeql_bqrs_decode input schema to support optional file and optional files.
  • Add a runtime guard for codeql_bqrs_* tools to produce a clearer “file/files required” error when no BQRS path is provided.
  • Add unit + integration test coverage and update CHANGELOG.md (plus rebuilt server/dist bundle).
Show a summary per file
File Description
server/src/tools/codeql/bqrs-decode.ts Advertises file (singular) alongside files (plural) in the tool input schema.
server/src/lib/cli-tool-registry.ts Adds a BQRS-tool guard error when no positional BQRS path is provided.
server/test/src/tools/codeql/bqrs-decode.test.ts Adds schema-level tests to ensure both file and files parse.
server/test/src/lib/cli-tool-registry.test.ts Adds handler-level tests for file/files normalization and missing-path error behavior.
client/integration-tests/primitives/tools/codeql_bqrs_decode/decode_singular_file/test-config.json New integration test config exercising the singular file argument path.
client/integration-tests/primitives/tools/codeql_bqrs_decode/decode_singular_file/README.md Documents the new integration test’s purpose/inputs/outputs.
client/integration-tests/primitives/tools/codeql_bqrs_decode/decode_singular_file/before/monitoring-state.json New fixture (legacy) for integration test directory structure.
client/integration-tests/primitives/tools/codeql_bqrs_decode/decode_singular_file/after/monitoring-state.json New fixture (legacy) for integration test directory structure.
server/dist/codeql-development-mcp-server.js Rebuilt bundled server output reflecting the TypeScript changes.
CHANGELOG.md Adds an Unreleased “Fixed” entry for the file vs files schema mismatch.

Copilot's findings

  • Files reviewed: 9/12 changed files
  • Comments generated: 3

Comment thread server/src/lib/cli-tool-registry.ts Outdated
Comment thread CHANGELOG.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 9/12 changed files
  • Comments generated: 2

Comment thread server/src/lib/cli-tool-registry.ts
Comment thread server/test/src/tools/codeql/bqrs-decode.test.ts
Copilot AI and others added 4 commits June 23, 2026 09:08
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
Co-authored-by: data-douser <70299490+data-douser@users.noreply.github.com>
@data-douser data-douser force-pushed the copilot/fix-codeql-bqrs-decode-file-argument branch from 9d62125 to 1bbb282 Compare June 23, 2026 15:13
@data-douser data-douser changed the title [UPDATE PRIMITIVE] Accept singular file argument in codeql_bqrs_decode [UPDATE PRIMITIVE] codeql_bqrs_decode tool support for singular file OR a list of files Jun 23, 2026
@data-douser data-douser changed the title [UPDATE PRIMITIVE] codeql_bqrs_decode tool support for singular file OR a list of files [UPDATE PRIMITIVE] codeql_bqrs_decode tool support for singular file OR list of files Jun 23, 2026
@data-douser data-douser marked this pull request as ready for review June 23, 2026 18:31
@data-douser data-douser requested review from a team and enyil as code owners June 23, 2026 18:31
Copilot AI review requested due to automatic review settings June 23, 2026 18:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 9/12 changed files
  • Comments generated: 2

Comment thread server/test/src/tools/codeql/bqrs-decode.test.ts
Comment thread server/test/src/tools/codeql/bqrs-decode.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants