Skip to content

⚡ Bolt: 저장소 인벤토리 생성을 위한 O(N) 단일 루프 성능 최적화 - #1374

Closed
seonghobae wants to merge 9 commits into
developfrom
bolt-performance-optimization-org-inventory-10511473752300410370
Closed

seonghobae wants to merge 9 commits into
developfrom
bolt-performance-optimization-org-inventory-10511473752300410370

Conversation

@seonghobae

@seonghobae seonghobae commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Retired duplicate — verified complete successor carryover

#1292 preserves the valid single-pass intent more strongly with one language computation per repository and an executable traversal regression. It remains Draft because its base diverges from protected develop, CodeQL settlement is pending, and no qualifying approval exists.

appguardrail_core/org_intelligence.py 파일의 `build_org_inventory` 함수 내에서
여러 번의 리스트 컴프리헨션과 카운팅 과정을 하나의 명시적인 for 루프로 통합하여
성능을 최적화했습니다. 이를 통해 반복적인 함수 호출과 요소 접근을 줄여 큰 저장소 집합에서의
처리 성능을 향상시켰습니다.
@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.

@github-project-automation github-project-automation Bot moved this to Backlog in Security Oct 2, 2026
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: eac4456f-8b8c-4854-b353-bcc5a29a7724

📥 Commits

Reviewing files that changed from the base of the PR and between c3d5094 and 1886074.

📒 Files selected for processing (1)
  • appguardrail_core/org_intelligence.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • appguardrail_core/org_intelligence.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

build_org_inventory가 저장소 iterable을 한 번 순회하며 저장소 유형, 언어, 기본 브랜치 및 비공개 저장소 수를 누적합니다. 반환 인벤토리는 누적값을 사용하며, 최적화 기록이 추가되었습니다.

Changes

저장소 인벤토리 집계

Layer / File(s) Summary
단일 순회 집계
appguardrail_core/org_intelligence.py, .jules/bolt.md
build_org_inventory가 전체 저장소와 포크·비포크·비공개 저장소 수를 순회 중에 집계합니다. 기본 언어와 기본 브랜치 수를 누적하고, 비포크 저장소의 지원 언어 수와 "Unknown"을 제외한 미지원 언어를 기록합니다. 반환값은 누적 결과와 정렬된 미지원 언어를 사용합니다. 최적화 기록도 추가되었습니다.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to a3706

The inventory results remain consistent for the inspected repository inputs; no actionable merge risk remains after normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to 4e584

The change affects 1 system.

Changed systems: appguardrail_core

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — appguardrail_core (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in appguardrail_core/org_intelligence.py: build_org_inventory replaces list-based filtering and repeated passes with incremental counting. Each repository contributes to total, language, and default-branch counts; fork status determines fork versus non-fork counts, and only non-forks contribute to supported-language totals or the distinct unsupported-language set. Private repositories are counted independently.
  • observed — Modified behavior in appguardrail_core/org_intelligence.py: The inventory return now uses the incrementally accumulated counts and sorts the unsupported-language set when converting it to a tuple; the active-target comparison uses the non-fork count instead of the removed non-fork list length.
  • observed — Modified behavior in .jules/bolt.md: 저장소 분류, 기본 언어 집계, 기본 브랜치 집계를 여러 번 순회하는 대신 단일 루프로 처리하는 build_org_inventory 최적화에 관한 학습 및 액션 기록이 추가되었습니다. 문서에는 상수 배수 성능 개선과 테스트 문자열 일치 조건이 명시되어 있습니다.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 저장소 인벤토리 생성 로직을 여러 번 순회하는 방식에서 O(N) 단일 루프로 변경한 핵심 성능 최적화를 정확히 설명합니다.
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.
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
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

seonghobae and others added 8 commits October 2, 2026 05:05
`build_org_inventory` 함수의 불필요한 다중 순회 성능 병목 현상을 해결하기 위해
7번의 순회 처리를 하나의 명시적인 for 루프로 합쳤습니다. 이를 통해 O(K*N) 병목을 제거하고
결과적으로 큰 레포지토리에서의 속도를 상수 계수(constant-factor) 최적화로 개선했습니다.
`build_org_inventory` 함수의 불필요한 다중 순회 성능 병목 현상을 해결하기 위해
7번의 순회 처리를 하나의 명시적인 for 루프로 합쳤습니다. 이를 통해 O(K*N) 병목을 제거하고
결과적으로 큰 레포지토리에서의 속도를 상수 계수(constant-factor) 최적화로 개선했습니다.
`build_org_inventory` 함수의 불필요한 다중 순회 성능 병목 현상을 해결하기 위해
여러 순회 처리를 명시적인 단일 for 루프로 합쳤습니다. 이를 통해 O(K*N) 병목을 제거하고
결과적으로 큰 레포지토리에서의 속도를 상수 계수(constant-factor) 최적화로 개선했습니다.
`build_org_inventory` 함수의 불필요한 다중 순회 성능 병목 현상을 해결하기 위해
여러 순회 처리를 명시적인 단일 for 루프로 합쳤습니다. 이를 통해 O(K*N) 병목을 제거하고
결과적으로 큰 레포지토리에서의 속도를 상수 계수(constant-factor) 최적화로 개선했습니다.
`build_org_inventory` 함수의 불필요한 다중 순회 성능 병목 현상을 해결하기 위해
여러 순회 처리를 명시적인 단일 for 루프로 합쳤습니다. 이를 통해 O(K*N) 병목을 제거하고
결과적으로 큰 레포지토리에서의 속도를 상수 계수(constant-factor) 최적화로 개선했습니다.
`build_org_inventory` 함수의 불필요한 다중 순회 성능 병목 현상을 해결하기 위해
여러 순회 처리를 명시적인 단일 for 루프로 합치고, 설명 주석을 추가했습니다.
이를 통해 O(K*N) 병목을 제거하고 결과적으로 큰 레포지토리에서의 속도를
상수 계수(constant-factor) 최적화로 개선했습니다.
`build_org_inventory` 함수의 불필요한 다중 순회 성능 병목 현상을 해결하기 위해
여러 순회 처리를 명시적인 단일 for 루프로 합치고, 설명 주석을 추가했습니다.
이를 통해 O(K*N) 병목을 제거하고 결과적으로 큰 레포지토리에서의 속도를
상수 계수(constant-factor) 최적화로 개선했습니다.
PR #1374 has no unique valid delta beyond #1292. The successor computes language once per repository, preserves the same inventory semantics, adds an executable single-pass regression, and has current-head Tests plus seven security and coverage workflows green. Restore the protected tree through ordinary ancestry; keep #1292 Draft until its wrong base, CodeQL settlement, and independent review gates are repaired.

Copy link
Copy Markdown
Contributor Author

Duplicate retirement evidence — 2026-10-03

This lane's valid intent is completely carried by the stronger canonical #1292 writer.

  • original head: 54c5b983faa982d8ea52bed8ef2664121d973cca
  • ordinary restoration child: a3706cef82415c49419be8f89add7a1aa6bfda7b (no force)
  • protected base: develop@2949d30718752ea5915c7713ba227e8c19d9e5bf
  • final compare: 9 ahead / 0 behind / 0 changed files
  • successor: refactor(inventory): stream repository aggregation #1292 live exact df5657b8bdf6ec81ea800d07359c56b3002635b9

#1374 had no executable regression and called _primary_language() twice for each non-fork repository. #1292 carries the same single-pass inventory semantics, computes the language once per item, and adds tests/test_org_inventory_single_pass.py. At the successor exact head, Tests 36464610910 and seven security/coverage workflows are terminal SUCCESS. CodeQL 36464610690 remains fail-closed because both shards reported VERDICT_STATE=pending; #1292 is also 11 commits behind protected develop and has no qualifying approval. Its body now records those current boundaries, and it remains Draft.

Closing #1374 unmerged therefore removes only a weaker duplicate. It does not assert a material performance gain, transfer CodeQL evidence, or make #1292 merge-ready.

@seonghobae seonghobae closed this Oct 3, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Security Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant