Skip to content

[🎨 Design System] Slack notification on DS changes#1902

Merged
jungcome7 merged 7 commits intodevelopfrom
roy/keplr-2050
Mar 30, 2026
Merged

[🎨 Design System] Slack notification on DS changes#1902
jungcome7 merged 7 commits intodevelopfrom
roy/keplr-2050

Conversation

@jungcome7
Copy link
Copy Markdown
Contributor

@jungcome7 jungcome7 commented Mar 30, 2026

Summary

DS 변경 시 Slack 알림 자동화

  • develop에 packages/design-system/src/ 변경이 push되면 Slack 채널에 알림 전송
  • Claude Haiku로 diff를 분석해 컴포넌트별 변경사항 자동 요약 (실패 시 기본 문구 fallback)
  • 컴포넌트명에 Storybook 링크 삽입, PR/커밋 링크 포함

필요 시크릿 -> 정환님이 등록 완료 ✅

  • ANTHROPIC_API_KEY_FOR_DS — Claude API 호출용
  • DS_NOTIFICATION_SLACK_WEBHOOK_URL — Slack webhook URL

Test plan

  • 로컬에서 각 step 시뮬레이션 통과 (컴포넌트 추출, Storybook URL 매핑, Slack payload 생성)
  • Slack webhook 실제 전송 확인 (ok 응답)
  • YAML lint 통과
  • repo에 시크릿 추가 후 develop push로 실제 동작 확인

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jungcome7 jungcome7 requested a review from a team as a code owner March 30, 2026 05:20
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
keplr-wallet-extension Ready Ready Preview, Comment Mar 30, 2026 6:40am

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab53a99c12

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# 변경된 디렉토리 목록 (foundation/color, foundation/typography 등)
CHANGED_DIRS=$(git diff --name-only $BASE_SHA...$HEAD_SHA -- 'packages/design-system/src/' \
| grep -E '(components|foundation|theme)/' \
| sed -E 's|packages/design-system/src/(components|foundation|theme)/([^/]+)/.*|\1/\2|' \
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fix invalid sed delimiter in path normalization

The sed expression uses | as the substitution delimiter while also using unescaped alternation (components|foundation|theme) inside the pattern, which GNU sed parses as a malformed command (unknown option to 's'). That breaks directory normalization for changed files (and in bash -o pipefail will fail the step), so the workflow can emit empty/incorrect component info or stop before sending notifications.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모바일과 동일하게 카테고리별 별도 sed 패턴으로 분리하여 구분자 충돌 해결했습니다.

Comment on lines +44 to +45
| sed -E 's|packages/design-system/src/(components|foundation|theme)/([^/]+)/.*|\1/\2|' \
| sort -u)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle root-level theme files in component extraction

The normalization pattern assumes paths always look like .../(components|foundation|theme)/<name>/..., but this package has files directly under packages/design-system/src/theme/ (for example theme/index.ts). Those paths are not normalized and later parsing (cut -d/ -f1/-f2) derives wrong component names/Storybook URLs, so theme-only updates generate misleading Slack headers and links.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

theme 루트 파일(theme/index.ts 등)도 theme으로 정규화되도록 패턴 추가했습니다.

@github-actions
Copy link
Copy Markdown

Storybook 배포 완료

🔗 미리보기: https://chainapsis.github.io/keplr-wallet/storybook/

Last updated: 2026-03-30T05:34:28Z

Comment thread .github/workflows/design-system-notify.yml Fixed
Copy link
Copy Markdown
Member

@piatoss3612 piatoss3612 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell injection — ${{ }} 직접 보간

${{ github.event.head_commit.message }}가 셸 스크립트에 텍스트 치환으로 삽입되고 있어서, 커밋 메시지에 셸 메타문자가 포함되면 임의 명령 실행이 가능합니다. 같은 step에 SLACK_WEBHOOK_URL env가 있어서 webhook URL 유출 경로가 됩니다.

github.event.head_commit.url도 동일 패턴입니다.

현재 코드 (line 161, 168):

COMMIT_MESSAGE="${{ github.event.head_commit.message }}"
PR_LINK="<${{ github.event.head_commit.url }}|${COMMIT_SHORT_SHA}>"

수정 제안:

env:
  SLACK_WEBHOOK_URL: ${{ secrets.DS_NOTIFICATION_SLACK_WEBHOOK_URL }}
  COMMIT_MSG: ${{ github.event.head_commit.message }}
  COMMIT_URL: ${{ github.event.head_commit.url }}
run: |
  # ...
  PR_NUMBER=$(echo "$COMMIT_MSG" | grep -oP '#\K\d+' | head -1)
  # ...
  PR_LINK="<${COMMIT_URL}|${COMMIT_SHORT_SHA}>"

env: 블록으로 넘기면 셸 변수로 안전하게 참조됩니다.

jungcome7

This comment was marked as outdated.

jungcome7 and others added 6 commits March 30, 2026 15:39
Separate sed patterns per category to avoid | delimiter collision
with alternation. Handle theme root files (e.g. theme/index.ts)
that have no subdirectory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Map foundation → foundations (plural) for Storybook path
- Use /docs/ path for stable component links

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move head_commit.message and head_commit.url to env block
to avoid direct shell interpolation of untrusted input.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…re built-in)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor Author

@jungcome7 jungcome7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

head_commit.messagehead_commit.url을 env 블록으로 이동하여 shell injection 방지했습니다. → 0591b3ccf

@jungcome7 jungcome7 requested a review from piatoss3612 March 30, 2026 06:46
@jungcome7 jungcome7 merged commit ce13667 into develop Mar 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants