Skip to content

Conversation

raccoon-mh
Copy link
Member

Category

  • New feature
  • Bug fix
  • Improvement
  • Refactor
  • etc

Description

Known issue

Code Changes Summary

주요 변경 파일

1. src/plugin/manager/account_collector_manager.py

추가된 기능

  • 깊이 제어 옵션: start_depth, include_location_from_depth
  • 캐싱 시스템: @lru_cache로 API 호출 최적화
  • 무한 루프 방지: visited_folders set으로 순환 참조 감지
  • 향상된 에러 처리: 권한 에러 시 즉시 종료

변경된 로직

# 기존: 모든 깊이에서 프로젝트 수집 및 위치 추적
self._create_project_response(parent, current_locations)
next_locations = current_locations + [{"name": folder_name, "resource_id": folder_parent}]

# 변경: 깊이 조건에 따른 프로젝트 수집 및 위치 추적
if current_depth >= self.start_depth:
    self._create_project_response(parent, current_locations)  # start_depth 조건

if current_depth >= self.include_location_from_depth:
    next_locations = current_locations + [{"name": folder_name, "resource_id": folder_parent}]  # include_location_from_depth 조건
else:
    next_locations = current_locations

추가된 메서드

@lru_cache(maxsize=100)
def _get_folders_cached(self, parent):
    return self.resource_manager_v3_connector.list_folders(parent)

@lru_cache(maxsize=50)
def _get_projects_cached(self, parent):
    return self.resource_manager_v3_connector.list_projects(parent)

2. src/plugin/main.py

추가된 옵션 스키마

"start_depth": {
    "title": "Start Depth",
    "type": "integer",
    "default": 0,
    "minimum": 0,
    "description": "Depth level to start collection from. 0=Organization, 1=First level folders, 2=Second level folders, etc."
},
"include_location_from_depth": {
    "title": "Include Location From Depth",
    "type": "integer",
    "default": 0,
    "minimum": 0,
    "description": "Depth level to start including folder location in project path. Must be less than or equal to start_depth. If not set, uses start_depth value."
}

코드 변경 요약

변경 항목 기존 변경 후
깊이 제어 없음 start_depth, include_location_from_depth 옵션 추가
API 호출 매번 새로 호출 캐싱으로 중복 호출 방지
무한 루프 방지 없음 visited_folders set으로 방지
에러 처리 일반적 권한 에러 시 즉시 종료
위치 추적 모든 깊이 조건부 위치 추적

성능 개선

  • API 호출 감소: 캐싱으로 중복 호출 방지
  • 메모리 효율성: 방문 기록으로 중복 방지
  • 안정성: 무한 루프 방지

호환성

  • Breaking Changes: 없음
  • 기존 API: 완전 호환
  • 새로운 옵션: 선택적 사용

Copy link

⚠️ @raccoon-mh the signed-off-by was not found in the following 1 commits:

  • 80d74b9: feat: add start_depth and include_location_from_depth options to account collector

✅ Why it is required

The Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. Here is the full text of the DCO.

Contributors sign-off that they adhere to these requirements by adding a Signed-off-by line to commit messages.

This is my commit message

Signed-off-by: Random Developer <[email protected]>

Git even has a -s command line option to append this automatically to your commit message:

$ git commit -s -m 'This is my commit message'

Copy link

⚠️ @raccoon-mh the signed-off-by was not found in the following 1 commits:

  • 80d74b9: feat: add start_depth and include_location_from_depth options to account collector

✅ Why it is required

The Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. Here is the full text of the DCO.

Contributors sign-off that they adhere to these requirements by adding a Signed-off-by line to commit messages.

This is my commit message

Signed-off-by: Random Developer <[email protected]>

Git even has a -s command line option to append this automatically to your commit message:

$ git commit -s -m 'This is my commit message'

@kang2453 kang2453 merged commit 0e8b7c4 into cloudforet-io:master Sep 3, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants