fix: pre-compute review artifacts and deduplicate into shared module, remove security review from workflow#34
fix: pre-compute review artifacts and deduplicate into shared module, remove security review from workflow#34varin-nair-factory wants to merge 10 commits intodevfrom
Conversation
… remove security review from workflow
b0171b1 to
7d253d4
Compare
ed85ab0 to
c3a464f
Compare
Code review completedSummaryThis PR refactors review artifact computation by extracting shared functionality into a dedicated module ( Key Changes
Important Files Changed
Code Review
Security Review
FindingsNo issues found during review. [View workflow run](https://github.com/Factory-AI/droid-action/actions/runs/${{ github.run_id }}) |
|
|
||
| // Fetch the base branch (it may not exist locally yet) | ||
| try { | ||
| execSync(`git fetch origin ${baseRef}:refs/remotes/origin/${baseRef}`, { |
There was a problem hiding this comment.
[P2] Avoid shell-interpolating branch names in execSync
baseRef is interpolated directly into execSync("git ...") command strings, which are executed via a shell. Even if baseRef usually comes from GitHub metadata, treating it as untrusted input is safer; branch/ref names can contain shell metacharacters in some setups. Prefer execFileSync/spawnSync with an args array (no shell), or validate baseRef with git check-ref-format (and/or reject anything outside an allowlist like [A-Za-z0-9._/-]).
| owner, | ||
| repo, | ||
| issue_number: prNumber, | ||
| per_page: 100, |
There was a problem hiding this comment.
[P2] Existing comments fetching is capped at 100 without pagination
listComments / listReviewComments are called with per_page: 100 but without pagination, so PRs with >100 comments will silently drop older comments. That can break deduplication and cause Droid to re-suggest issues that were already discussed. Use octokit.paginate(...) (or manual paging) to fetch the full comment set.
| ~/.factory/logs/console.log | ||
| ~/.factory/sessions/* | ||
| ~/.factory/droids/* | ||
| ~/.factory/** |
There was a problem hiding this comment.
[P1] Uploading ~/.factory/** as an artifact can leak sensitive data
This action uploads the entire ~/.factory/** directory whenever Droid runs. Factory sessions/logs frequently contain full prompts, tool outputs, and configuration that can include tokens or other sensitive data; uploading everything increases the risk of accidental secret disclosure and can also create very large artifacts. Consider gating this behind an explicit debug input and/or limiting the artifact to a small, known-safe allowlist (and excluding sessions by default).
There was a problem hiding this comment.
This PR makes the review flow more robust by precomputing review artifacts and adding a validator-driven candidate generation path. Three issues were identified: (1) uploading all of ~/.factory/** as an artifact by default poses data leakage risk, (2) shell command injection risk from interpolating baseRef in git commands, and (3) missing pagination for comments causing incomplete data on busy PRs.
No description provided.