Skip to content

๐Ÿงช Add tests for scanner stat errors and large files#90

Merged
seonghobae merged 20 commits into
developfrom
jules-2070900741305223408-e636d098
Jun 16, 2026
Merged

๐Ÿงช Add tests for scanner stat errors and large files#90
seonghobae merged 20 commits into
developfrom
jules-2070900741305223408-e636d098

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

๐ŸŽฏ What: This PR addresses a testing gap in scanner/cli/vibesec.py by adding coverage for the except (OSError, PermissionError) block and the large file (>10MB) OOM protection block during the file stat checks in the _scan_file function.

๐Ÿ“Š Coverage:

  • Tests OSError handling during file lstat.
  • Tests PermissionError handling during file lstat.
  • Tests the skipping logic for files larger than 10MB by providing a mocked large stat_result.

โœจ Result: Missing lines in scanner/cli/vibesec.py (specifically lines 546-551 according to coverage metrics) are now successfully covered, improving the overall reliability of the scanner error paths.


PR created automatically by Jules for task 2070900741305223408 started by @seonghobae

@google-labs-jules

Copy link
Copy Markdown

๐Ÿ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a ๐Ÿ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Copilot, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 32 minutes and 57 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running โ€” you're only billed for reviews past your plan's rate limits ($0.25/file).

โŒ› How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

๐Ÿšฆ How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

โ„น๏ธ Review info
โš™๏ธ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ebc620d2-7643-4cfd-a79b-ae5019308888

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between f1b81c3 and 5c05d2f.

๐Ÿ“’ Files selected for processing (1)
  • tests/test_vibesec.py
โœจ Finishing Touches
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jules-2070900741305223408-e636d098
โœจ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch jules-2070900741305223408-e636d098

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

โค๏ธ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

@google-labs-jules

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

This command appears to be directed at Copilot, not me. I will ignore it as per instructions.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

@google-labs-jules

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

This command appears to be directed at Copilot. I will ignore it.

โ€ฆ98' into jules-2070900741305223408-e636d098

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in 153773a.

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Latest PR head is 82a32be, which already includes the conflict-resolution update from this branch. I donโ€™t have any additional local changes to push from this clone.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

@google-labs-jules

Copy link
Copy Markdown

@copilot resolve the merge conflicts in this pull request

This command appears to be directed at Copilot. I will ignore it.

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved in 3af2cda.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 5c05d2f1493a2b58dadcaf04d349d0476b5c9751
  • Workflow run: 27599727991
  • Workflow attempt: 2
  • Gate result: APPROVE (exit 0)

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OpenCode Agent requested changes.

Review identified critical regressions in security rules and performance optimizations. Findings include missing security checks and inefficient path handling.

  • Result: REQUEST_CHANGES
  • Reason: Security and performance regressions identified

1. CRITICAL scanner/cli/vibesec.py:217 - Missing OWASP rule enforcement

  • Problem: Removed enforcement of OWASP rules in automated scanning.
  • Root cause: Regression from previous version where OWASP rule enforcement was removed.
  • Fix: Reintroduce OWASP rule enforcement in the scan command.
  • Regression test: Add test cases to verify OWASP rule enforcement in scans.
  • Suggested diff:
+ - When dealing with OWASP rules or security vulnerabilities, automatically run `vibesec scan .` as a hook or use tools like `semgrep` to verify the codebase.

2. HIGH scanner/cli/vibesec.py:217 - Set literal replaced with tuple

  • Problem: Replaced set literal with tuple for membership checks, reducing performance.
  • Root cause: Performance regression from replacing O(1) set lookups with O(n) tuple scans.
  • Fix: Revert to set literals for constant membership checks.
  • Regression test: Add benchmarks for membership check performance.
  • Suggested diff:
-     if f["severity"] in ("CRITICAL", "HIGH") for f in findings) else 0
+     if f["severity"] in {"CRITICAL", "HIGH"} for f in findings) else 0
  • Head SHA: 3af2cda48c5564082d78699bdf1257553872612f
  • Workflow run: 27599061276
  • Workflow attempt: 2

@seonghobae

Copy link
Copy Markdown
Contributor Author

@copilot ๋ฆฌ๋ทฐ๋ฅผ ๋ฐ˜์˜ํ•˜์—ฌ ์ˆ˜์ •ํ•˜์‹œ์˜ค. ๊ทธ๋ฆฌ๊ณ  merge conflict ์ƒํƒœ๋ฅผ ํ•ด์†Œํ•˜์‹œ์˜ค.

@google-labs-jules

Copy link
Copy Markdown

@copilot ๋ฆฌ๋ทฐ๋ฅผ ๋ฐ˜์˜ํ•˜์—ฌ ์ˆ˜์ •ํ•˜์‹œ์˜ค. ๊ทธ๋ฆฌ๊ณ  merge conflict ์ƒํƒœ๋ฅผ ํ•ด์†Œํ•˜์‹œ์˜ค.

This command appears to be directed at Copilot. I will ignore it.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Copilot AI commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

@copilot ๋ฆฌ๋ทฐ๋ฅผ ๋ฐ˜์˜ํ•˜์—ฌ ์ˆ˜์ •ํ•˜์‹œ์˜ค. ๊ทธ๋ฆฌ๊ณ  merge conflict ์ƒํƒœ๋ฅผ ํ•ด์†Œํ•˜์‹œ์˜ค.

์ˆ˜์ • ๋ฐ˜์˜ ๋ฐ merge conflict ํ•ด์†Œ๋ฅผ 5c05d2f์—์„œ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OpenCode Agent approved this PR.

The changes in PR #90 are well-tested and focused on improving error handling and file scanning logic. No security, privacy, or regression risks were identified.

  • Result: APPROVE
  • Reason: No blockers found in the changes.
  • Head SHA: 5c05d2f1493a2b58dadcaf04d349d0476b5c9751
  • Workflow run: 27599727991
  • Workflow attempt: 2

@seonghobae seonghobae merged commit 77de292 into develop Jun 16, 2026
3 checks passed
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.

2 participants