mirror of
https://github.com/gadievron/raptor.git
synced 2026-04-24 21:46:00 +03:00
[GH-ISSUE #41] Fix JSON serialization of Path objects in CodeQLWorkflowResult #7
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/raptor#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gadievron on GitHub (Dec 22, 2025).
Original GitHub issue: https://github.com/gadievron/raptor/issues/41
Problem
Autonomous analysis workflow fails at final step when attempting to serialize
CodeQLWorkflowResultto JSON. Theto_dict()method usesasdict()which doesn't convertpathlib.Pathobjects to strings, causingTypeError: Object of type PosixPath is not JSON serializable.Current incorrect fix: Adding
default=strat json.dump() site treats symptom, not cause.Root Cause
The
to_dict()method inCodeQLWorkflowResult(agent.py:46-59) manually convertslanguages_detectedbut relies onasdict()for everything else. Python'sasdict()doesn't convert non-dataclass types likePath.Affected Path Objects (4 total)
databases_created[lang].database_path(Optional[Path])analyses_completed[lang].database_path(Path)analyses_completed[lang].sarif_path(Optional[Path])sarif_files(List[Path]) - Type annotation incorrectly claims List[str]Impact
autonomous_summary.jsoncannot be createdFix
Extend
to_dict()inCodeQLWorkflowResultto manually convert all Path objects to strings.File:
packages/codeql/agent.py:46-59Type
Related
@gadievron commented on GitHub (Dec 22, 2025):
Fixed in PR #47