[PR #37] Fix CodeQL --command argument parsing for multi-word commands #47

Open
opened 2026-03-02 04:08:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/gadievron/raptor/pull/37
Author: @AndrewMohawk
Created: 12/21/2025
Status: 🔄 Open

Base: mainHead: fix/codeql-command-quoting


📝 Commits (1)

  • f9fded8 Fix CodeQL build command handling for shell operators

📊 Changes

1 file changed (+130 additions, -3 deletions)

View changed files

📝 packages/codeql/database_manager.py (+130 -3)

📄 Description

Summary

  • Fix CodeQL database creation failing for build commands containing spaces or shell operators (e.g., npm install && npm run build)
  • Changed from --command=value syntax to --command value (separate arguments)

Problem

When running CodeQL database creation with multi-word build commands, the command was being split incorrectly:

/usr/local/bin/codeql database create ... --command=npm install && npm run build
Unmatched argument at index 4: 'install'

Solution

Use cmd.extend(["--command", build_system.command]) instead of cmd.append(f"--command={build_system.command}") to ensure the entire command string is passed as a single argument to CodeQL.

Test plan

  • Run CodeQL scan on a TypeScript/JavaScript project with npm install && npm run build command
  • Verify database creation completes successfully

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/gadievron/raptor/pull/37 **Author:** [@AndrewMohawk](https://github.com/AndrewMohawk) **Created:** 12/21/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/codeql-command-quoting` --- ### 📝 Commits (1) - [`f9fded8`](https://github.com/gadievron/raptor/commit/f9fded8cf73eab015309935c22137554b3d7a229) Fix CodeQL build command handling for shell operators ### 📊 Changes **1 file changed** (+130 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/codeql/database_manager.py` (+130 -3) </details> ### 📄 Description ## Summary - Fix CodeQL database creation failing for build commands containing spaces or shell operators (e.g., `npm install && npm run build`) - Changed from `--command=value` syntax to `--command value` (separate arguments) ## Problem When running CodeQL database creation with multi-word build commands, the command was being split incorrectly: ``` /usr/local/bin/codeql database create ... --command=npm install && npm run build Unmatched argument at index 4: 'install' ``` ## Solution Use `cmd.extend(["--command", build_system.command])` instead of `cmd.append(f"--command={build_system.command}")` to ensure the entire command string is passed as a single argument to CodeQL. ## Test plan - [ ] Run CodeQL scan on a TypeScript/JavaScript project with `npm install && npm run build` command - [ ] Verify database creation completes successfully 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/raptor#47
No description provided.