Repository navigation
[FEATURE] 커뮤니티 템플릿 카탈로그 조회 API 신설 및 Peer 허브 실연동 (#914) - #924
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⛓️ Related Issues
Closes #914
☁️ what to do
Peer 허브(
/peers/hub) 커뮤니티 템플릿 카탈로그를 백엔드 단일 정본으로 두고, 프론트가 조회 API로 받아 채우도록 했습니다.그동안 카탈로그는 프론트 정적 시드(
communityTemplates.ts)로 화면을 채웠고, #910에서 그 시드를 제거하면서 Peer 허브가 빈 카탈로그가 됐습니다. 조회 API는 원래부터 없었고, 백엔드CommunityTemplateRegistry는 lineage 검증용id/version/name만 들고 있어 카드 표시용 메타(설명/아이콘/공개자/사용수/필요 MCP)와 출처가 어긋난 상태였습니다. 이 PR이 백엔드를 카탈로그 정본으로 확장하고 조회 API를 신설해, 프론트가 실 API로 카드를 다시 띄울 수 있게 합니다.💫 Changes in the project
백엔드 (api-server)
CommunityTemplateRegistry: 카드 표시용 전체 메타를 카테고리(줄)별로 갖는 단일 정본으로 확장했습니다(CommunityTemplateCard/CommunityTemplateCategoryrecord 추가). 기존 lineage 검증 계약(WorkflowSourceTemplate,resolve())은 그대로 두고, lineage용id/version/name맵을 이 카탈로그에서 파생시켜(buildLineage()) 출처를 하나로 합쳤습니다.CommunityTemplateController:GET /api/v1/community-templates로 카탈로그를 카테고리별로 반환합니다. 정적 카탈로그라 요청자별 분기가 없어Authentication을 받지 않으며, 보안 필터의 기본 인증 정책은 그대로 적용됩니다(/api/v1/agents/catalog와 동일 취급).CommunityTemplateRow/CommunityTemplate과 camelCase로 정합합니다.프론트 (frontend)
api/communityTemplates.ts:GET /api/v1/community-templates호출 모듈.stores/communityTemplates.ts:rows/loading/loaded/error상태와load()액션을 가진 Pinia 스토어.PeerHubPage.vue: 정적 시드 대신 스토어 카탈로그를 쓰고,onMounted에서load()를 호출합니다. 로딩(스피너)/에러/빈 상태/카드 4단계로 분기해, 실패 시 가짜 데이터로 메우지 않습니다.✅ How to Test
백엔드:
cd api-server && mvn -o test -Dtest='CommunityTemplateRegistryTest,CommunityTemplateControllerTest'→Tests run: 6, Failures: 0(lineage 회귀 + 카탈로그 + 컨트롤러)프론트:
cd frontend && npm cinpm run typecheck→ 통과(exit 0)npm run build→ 통과(exit 0)node --test tests/communityTemplateCatalog.test.mjs→ 4/4 통과/peers/hub에서 카탈로그가 실 API로 로드되어 카드가 표시되는지, 백엔드 응답이 비면 빈 상태 안내가 뜨는지 확인👀 References
CommunityTemplateRegistry.java,CommunityTemplateController.java(신규), 각 테스트,api/communityTemplates.ts(신규),stores/communityTemplates.ts(신규),PeerHubPage.vue, 테스트 2종.peerBuilderFlow.test.mjs의 lineage 테스트는 #910으로 시드가 빠지며 깨져 있었는데, 이번 변경(카드 데이터가 백엔드 카탈로그로 이동)에 맞게 검증을 갱신했습니다.npm run test전체 스위트 중 3건(클러스터 mock 병합,login-new 시안,넓은 UI 내부 스크롤)은 이 PR과 무관하게 main(4afcf9e)에서 이미 실패 중인 항목으로, 본 변경 전후 동일합니다(변경으로 새로 깨진 테스트 없음).