-
Notifications
You must be signed in to change notification settings - Fork 0
[feat/test deploy] - 1차 배포 테스트 pr #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @ramong26, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 첫 번째 배포 테스트를 위한 것으로, GitHub Actions와 pnpm을 활용한 CI/CD 릴리즈 워크플로우를 설정하는 데 중점을 둡니다. 또한, 컴포넌트 라이브러리 배포를 위한 package.json 메타데이터를 업데이트하고, 캐러셀 컴포넌트의 테스트 코드를 개선하여 비동기 동작의 안정성을 확보합니다. 이는 main 브랜치에 병합하기 전 변경 사항을 검증하기 위한 목적입니다. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR sets up GitHub Actions CI/CD pipeline for automated testing and npm package publishing using pnpm. The changes prepare the project for first deployment by configuring package metadata and workflow automation.
- Updated package.json with proper npm package configuration including exports, repository info, and new package name
- Added comprehensive GitHub Actions workflow for CI testing and automated npm publishing on tag releases
- Enhanced Carousel component tests with better async handling using act() wrapper
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Configured package metadata for npm publishing with new name, version, and exports |
| .github/workflows/npm-publish.yml | Added complete CI/CD workflow for testing and automated npm releases |
| src/components/Carousel/Carousel.test.tsx | Improved test reliability with proper async handling and act() wrapper |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.github/workflows/npm-publish.yml
Outdated
| repo: context.repo.repo, | ||
| tag_name: tagName, | ||
| name: `Release ${tagName}`, | ||
| body: `🚀 Package successfully published to NPM!\n\n**Version:** ${tagName}\n**Package:** [recomponent](https://www.npmjs.com/package/recomponent)`, |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package name in the NPM link should be '@ramong23/recomponent' to match the actual package name defined in package.json.
| body: `🚀 Package successfully published to NPM!\n\n**Version:** ${tagName}\n**Package:** [recomponent](https://www.npmjs.com/package/recomponent)`, | |
| body: `🚀 Package successfully published to NPM!\n\n**Version:** ${tagName}\n**Package:** [@ramong23/recomponent](https://www.npmjs.com/package/@ramong23/recomponent)`, |
| Your package has been successfully published to NPM! | ||
| Version: ${{ github.ref_name }} | ||
| Package: recomponent |
Copilot
AI
Sep 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package name should be '@ramong23/recomponent' to match the actual package name defined in package.json.
| Package: recomponent | |
| Package: @ramong23/recomponent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
이 PR은 배포 테스트를 위한 변경 사항으로, package.json의 배포 관련 설정을 추가하고 Carousel 컴포넌트의 테스트 코드를 개선했습니다. 전반적으로 좋은 방향의 수정이지만, 몇 가지 개선점을 제안합니다. package.json에 있는 저장소 관련 URL에 오타가 있는 것으로 보이며, 이를 수정해야 합니다. 또한, Carousel.test.tsx 파일의 두 테스트 케이스 모두에 반복적인 코드가 있어, 이를 루프로 리팩토링하여 가독성과 유지보수성을 향상시킬 수 있습니다. 자세한 내용은 각 파일에 남긴 주석을 확인해주세요.
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/ramong26/xp-components.git" | ||
| }, | ||
| "homepage": "https://github.com/ramong26/xp-components", | ||
| "bugs": { | ||
| "url": "https://github.com/ramong26/xp-components/issues" | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
repository, homepage, bugs URL에 오타가 있는 것 같습니다. 사용자 이름이 ramong26으로 되어 있는데, author 필드와 패키지 이름을 보면 ramong23이 맞는 것 같습니다. 일관성을 위해 수정하는 것을 권장합니다.
"repository": {
"type": "git",
"url": "https://github.com/ramong23/xp-components.git"
},
"homepage": "https://github.com/ramong23/xp-components",
"bugs": {
"url": "https://github.com/ramong23/xp-components/issues"
}| expect(screen.getByRole('heading', { name: /Slide 1/i })).toBeInTheDocument(); | ||
| await userEvent.click(screen.getByRole('heading', { name: /Slide 1/i })); | ||
| expect(items[0].onClick).toHaveBeenCalled(); | ||
| await userEvent.click(slide2); | ||
|
|
||
| await userEvent.click(indicators[1]); | ||
| expect(screen.getByRole('heading', { name: /Slide 2/i })).toBeInTheDocument(); | ||
| await userEvent.click(screen.getByRole('heading', { name: /Slide 2/i })); | ||
| expect(items[1].onClick).toHaveBeenCalled(); | ||
| await userEvent.click(slide3); | ||
|
|
||
| await userEvent.click(indicators[2]); | ||
| expect(screen.getByRole('heading', { name: /Slide 3/i })).toBeInTheDocument(); | ||
| await userEvent.click(screen.getByRole('heading', { name: /Slide 3/i })); | ||
| expect(items[2].onClick).toHaveBeenCalled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 테스트 케이스의 로직이 여러 번 반복되고 있습니다. 각 슬라이드에 대한 확인 및 클릭 로직을 루프로 만들어 코드를 더 간결하고 유지보수하기 쉽게 만들 수 있습니다. 이렇게 하면 캐러셀 아이템이 추가되거나 변경될 때 테스트 코드를 더 쉽게 확장할 수 있습니다.
| expect(screen.getByRole('heading', { name: /Slide 1/i })).toBeInTheDocument(); | |
| await userEvent.click(screen.getByRole('heading', { name: /Slide 1/i })); | |
| expect(items[0].onClick).toHaveBeenCalled(); | |
| await userEvent.click(slide2); | |
| await userEvent.click(indicators[1]); | |
| expect(screen.getByRole('heading', { name: /Slide 2/i })).toBeInTheDocument(); | |
| await userEvent.click(screen.getByRole('heading', { name: /Slide 2/i })); | |
| expect(items[1].onClick).toHaveBeenCalled(); | |
| await userEvent.click(slide3); | |
| await userEvent.click(indicators[2]); | |
| expect(screen.getByRole('heading', { name: /Slide 3/i })).toBeInTheDocument(); | |
| await userEvent.click(screen.getByRole('heading', { name: /Slide 3/i })); | |
| expect(items[2].onClick).toHaveBeenCalled(); | |
| for (const [index, item] of items.entries()) { | |
| if (index > 0) { | |
| await userEvent.click(indicators[index]); | |
| } | |
| const slide = screen.getByRole('heading', { name: new RegExp(item.title, 'i') }); | |
| expect(slide).toBeInTheDocument(); | |
| await userEvent.click(slide); | |
| expect(item.onClick).toHaveBeenCalled(); | |
| } |
| await act(async () => { | ||
| vi.advanceTimersByTime(1000); | ||
| }); | ||
|
|
||
| expect(indicators[0]).not.toHaveClass('active'); | ||
| expect(indicators[1]).toHaveClass('active'); | ||
|
|
||
| vi.advanceTimersByTime(1000); | ||
| await act(async () => { | ||
| vi.advanceTimersByTime(1000); | ||
| }); | ||
|
|
||
| expect(indicators[1]).not.toHaveClass('active'); | ||
| expect(indicators[2]).toHaveClass('active'); | ||
|
|
||
| vi.advanceTimersByTime(1000); | ||
| await act(async () => { | ||
| vi.advanceTimersByTime(1000); | ||
| }); | ||
|
|
||
| expect(indicators[2]).not.toHaveClass('active'); | ||
| expect(indicators[0]).toHaveClass('active'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
자동 슬라이드 동작을 검증하는 테스트 코드에 반복되는 로직이 있습니다. act와 expect 호출이 여러 번 반복되는데, 이를 루프로 리팩토링하면 코드가 더 간결해지고 유지보수하기 쉬워집니다. 예를 들어, 캐러셀 아이템 개수가 변경되어도 테스트 코드를 수정할 필요가 없어집니다.
| await act(async () => { | |
| vi.advanceTimersByTime(1000); | |
| }); | |
| expect(indicators[0]).not.toHaveClass('active'); | |
| expect(indicators[1]).toHaveClass('active'); | |
| vi.advanceTimersByTime(1000); | |
| await act(async () => { | |
| vi.advanceTimersByTime(1000); | |
| }); | |
| expect(indicators[1]).not.toHaveClass('active'); | |
| expect(indicators[2]).toHaveClass('active'); | |
| vi.advanceTimersByTime(1000); | |
| await act(async () => { | |
| vi.advanceTimersByTime(1000); | |
| }); | |
| expect(indicators[2]).not.toHaveClass('active'); | |
| expect(indicators[0]).toHaveClass('active'); | |
| for (let i = 0; i < items.length; i++) { | |
| const currentIndex = i; | |
| const nextIndex = (i + 1) % items.length; | |
| await act(async () => { | |
| vi.advanceTimersByTime(1000); | |
| }); | |
| expect(indicators[currentIndex]).not.toHaveClass('active'); | |
| expect(indicators[nextIndex]).toHaveClass('active'); | |
| } |
📝 PR 제목
1차 배포 테스트 pr
🛠 변경 내용
🎯 목적 / 이유
✅ 확인 사항