feat(docs): add fresh-node-ids option to bypass Figma image cache per node#1718
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughCI 워크플로우에 ChangesFigma 노드별 캐시 우회
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Alpha Preview (Stackflow SPA)
|
Alpha Preview (Storybook)
|
Alpha Preview (Docs)
|
eb11324 to
29de604
Compare
배경
docs alpha 미리보기에서 특정 컴포넌트 문서의 Figma 이미지가 stale해지는 문제가 있습니다. 캐시(
docs/.cache/figma-image/urls)는 노드 ID → 이미지 URL을 저장하는데, Figma에서 디자인을 바꿔도 노드 ID는 그대로라 옛 렌더 URL이 계속 캐시 적중됩니다.기존
skip-figma-cache=true(FIGMA_CACHE_DISABLED)는 전역이라 전체 이미지를 fresh fetch하는데,fetchFigmaImageUrls가MAX_CONCURRENCY=1+ 429 재시도 구조라 이미지가 많으면 rate limit으로 "Build Docs"가 실패합니다.변경
특정 노드만 캐시를 무시(bypass)하는
bypass-cache-node-ids옵션을 추가합니다.env.figmaBypassCacheNodeIds←FIGMA_BYPASS_CACHE_NODE_IDS(콤마 구분 노드 ID)workflow_dispatchinputbypass-cache-node-ids→FIGMA_BYPASS_CACHE_NODE_IDSenv 배선shouldBypassCache(nodeId)= 전역 disable이거나 해당 노드가 목록에 있으면 캐시 우회fresh fetch 결과는 그대로 캐시에
set/save되므로, 특정 문서 이미지를 한 번 갱신하는 용도입니다. 모든 Figma 이미지 경로(본문FigmaImage, cover, blog)가fetchFigmaImageUrls를 통과하므로 일괄 적용됩니다.사용 예
```bash
gh workflow run deploy-seed-design-docs-alpha-pages.yml
--ref -f bypass-cache-node-ids="1702:4339,1705:5564"
```
Summary by CodeRabbit
bypass-cache-node-ids로 노드 ID 목록을 지정하면, 해당 이미지에 대해서는 캐시를 건너뛰고 항상 최신 버전으로 다시 로드합니다.