Skip to content

⚡ Bolt: SARIF 렌더링 내 ruleIndex 계산 최적화 - #1434

Open
seonghobae wants to merge 2 commits into
developfrom
bolt-opt-sarif-index-9738380595722874670
Open

seonghobae wants to merge 2 commits into
developfrom
bolt-opt-sarif-index-9738380595722874670

Conversation

@seonghobae

@seonghobae seonghobae commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

💡 What: SARIF 렌더링 과정에서 list(dict).index(key) 대신 별도의 인덱스 매핑 딕셔너리(rule_indices)를 사용하도록 수정했습니다.
🎯 Why: 루프 내에서 list(rules).index(rule_id)를 반복 호출할 때마다 새로운 리스트를 할당하고 선형 탐색을 수행하므로 대량의 데이터에 대해 O(N*M) 병목 현상이 발생합니다.
📊 Impact: 인덱스 조회를 O(1) 시간 복잡도로 개선하여 수많은 취약점 결과를 SARIF로 변환할 때의 처리 속도를 크게 향상시킵니다.
🔬 Measurement: 수백~수천 개의 결과가 포함된 스캔 데이터 처리 시 findings_to_sarif 함수에서 발생하는 시간 소요가 크게 감소됨을 벤치마크할 수 있습니다.


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


Devin Review

Summary by CodeRabbit

  • 성능 개선

    • SARIF 결과를 생성할 때 규칙을 조회하는 작업을 최적화했습니다. 생성되는 결과와 규칙 순서는 이전과 동일합니다.
  • 문서

    • 딕셔너리 키의 인덱스를 별도로 저장해 반복 검색을 줄이는 방법을 추가했습니다.

@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 Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fd980def-b8a1-4871-a513-f85075a41d6c


📥 Commits

Reviewing files that changed from the base of the PR and between 2949d30 and 47a022b.



📒 Files selected for processing (2)
  • .jules/bolt.md
  • appguardrail_core/sarif.py


Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

findings_to_sarif는 규칙 ID의 인덱스를 저장해 결과 생성에 사용합니다. SARIF 필드와 규칙 순서는 유지됩니다. 반복적인 목록 생성과 선형 검색을 피하는 지침도 추가합니다.

Changes

SARIF 규칙 인덱스 캐싱

Layer / File(s) Summary
규칙 인덱스 캐싱 및 지침
appguardrail_core/sarif.py, .jules/bolt.md
findings_to_sarif는 새 규칙 ID가 추가될 때 해당 인덱스를 저장하고, 결과의 ruleIndex에 저장한 값을 사용합니다. SARIF 필드와 규칙 순서는 변경되지 않습니다. 반복문에서 list(dict).index(key)를 사용하는 대신 인덱스를 보조 딕셔너리에 저장하는 지침을 추가합니다.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor



Merge Risk: ⚪ Minimal · up to e6cfd

The SARIF conversion retains its existing rule ordering and indices while avoiding repeated searches. No material merge risk was identified.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 제목은 SARIF 렌더링에서 ruleIndex 계산을 최적화하는 주요 변경 사항을 정확하고 간결하게 설명합니다.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.



✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR


📝 Generate docstrings
  • Commit to this branch
  • Create a new PR



🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant