r-sugi / nextjs-tdd-template

https://nextjs-tdd-templatestorybook-rsugis-projects.vercel.app
0 stars 0 forks source link

CI workflow pathsๆŒ‡ๅฎšใ™ใ‚‹ #187

Closed r-sugi closed 2 months ago

r-sugi commented 2 months ago

PR Type

enhancement, configuration changes


Description


Changes walkthrough ๐Ÿ“

Relevant files
Configuration changes
lint.yml
Update lint workflow configuration and job naming               

.github/workflows/lint.yml
  • Renamed workflow from Lint_Test to Lint.
  • Changed job name from lint_ut to Run-Lint.
  • Removed unit test step from the lint workflow.
  • +4/-7     
    review.yml
    Modify review workflow configuration and job naming           

    .github/workflows/review.yml
  • Renamed workflow from Agent Review to Agent-Review.
  • Changed job name from run-pr-agent to Run-PR-Agent.
  • Removed reopened type from pull request trigger.
  • +5/-3     
    storybook.yml
    Revise storybook workflow configuration and job naming     

    .github/workflows/storybook.yml
  • Renamed workflow from build-storybook to Build-Storybook.
  • Changed job name from build-storybook to Run-Build.
  • Updated pull request paths trigger.
  • +5/-4     
    Enhancement
    unit-test.yml
    Add new unit test workflow configuration                                 

    .github/workflows/unit-test.yml
  • Added new workflow for unit testing.
  • Configured to run on pull requests and pushes to main.
  • Includes steps for checking out code, setting up Node.js, and running
    tests.
  • +25/-0   

    ๐Ÿ’ก PR-Agent usage: Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    vercel[bot] commented 2 months ago

    The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

    Name Status Preview Comments Updated (UTC)
    nextjs-tdd-template_storybook โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Sep 10, 2024 2:18am
    github-actions[bot] commented 2 months ago

    PR Reviewer Guide ๐Ÿ”

    โฑ๏ธ Estimated effort to review: 2 ๐Ÿ”ต๐Ÿ”ตโšชโšชโšช
    ๐Ÿงช PR contains tests
    ๐Ÿ”’ No security concerns identified
    โšก No key issues to review
    github-actions[bot] commented 2 months ago

    PR Code Suggestions โœจ

    CategorySuggestion                                                                                                                                    Score
    Best practice
    node-versionใฎๆŒ‡ๅฎšใ‚’ๅ…ทไฝ“็š„ใชใƒใƒผใ‚ธใƒงใƒณใซๅค‰ๆ›ดใ™ใ‚‹ใ€‚ ___ **`node-version`ใฎๆŒ‡ๅฎšใŒ"^v18.19.0"ใจใชใฃใฆใ„ใพใ™ใŒใ€ไบ’ๆ›ๆ€งใฎๅ•้กŒใ‚’้ฟใ‘ใ‚‹ใŸใ‚ใซๅ…ทไฝ“็š„ใชใƒใƒผใ‚ธใƒงใƒณใ‚’ๆŒ‡ๅฎšใ™ใ‚‹ใ“ใจใ‚’ใŠๅ‹งใ‚ใ—ใพใ™ใ€‚** [.github/workflows/unit-test.yml [19]](https://github.com/r-sugi/nextjs-tdd-template/pull/187/files#diff-d4223b44df678cece85f2542c19b9cd060d43b22f753c25214d5942ef2ca5d18R19-R19) ```diff -node-version: "^v18.19.0" +node-version: "18.19.0" ```
    Suggestion importance[1-10]: 9 Why: Specifying an exact `node-version` helps avoid potential compatibility issues that can arise from using a range, ensuring a more stable and predictable environment for running tests.
    9
    Enhancement
    typesใฎๆŒ‡ๅฎšใซreopenedใ‚’่ฟฝๅŠ ใ™ใ‚‹ใ€‚ ___ **typesใฎๆŒ‡ๅฎšใ‹ใ‚‰reopenedใŒๅ‰Š้™คใ•ใ‚Œใฆใ„ใพใ™ใŒใ€ๅ†ใ‚ชใƒผใƒ—ใƒณใ•ใ‚ŒใŸใƒ—ใƒซใƒชใ‚ฏใ‚จใ‚นใƒˆใซๅฏพใ™ใ‚‹ๅ‡ฆ็†ใŒๅฟ…่ฆใชๅ ดๅˆใฏใ€reopenedใ‚’่ฟฝๅŠ ใ™ใ‚‹ใ“ใจใ‚’ใŠๅ‹งใ‚ใ—ใพใ™ใ€‚** [.github/workflows/review.yml [5]](https://github.com/r-sugi/nextjs-tdd-template/pull/187/files#diff-ebc21ccd816b27c07389e15ad88c9e74b71bde5e8e315e4e30902097d38386e5R5-R5) ```diff -types: [opened, synchronize] +types: [opened, reopened, synchronize] ```
    Suggestion importance[1-10]: 8 Why: Adding `reopened` to the `types` specification ensures that the workflow runs for pull requests that are reopened, which is important for maintaining consistent review processes.
    8
    branchesใฎๆŒ‡ๅฎšใซdevใƒ–ใƒฉใƒณใƒใ‚’่ฟฝๅŠ ใ™ใ‚‹ใ€‚ ___ **`branches`ใฎๆŒ‡ๅฎšใซ`main`ใฎใฟใ‚’ๅซใ‚ใ‚‹ใจใ€ไป–ใฎใƒ–ใƒฉใƒณใƒใงใฎๅค‰ๆ›ดใŒ็„ก่ฆ–ใ•ใ‚Œใ‚‹ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ใ€‚`dev`ใƒ–ใƒฉใƒณใƒใ‚‚ๅซใ‚ใ‚‹ใ“ใจใ‚’ๆคœ่จŽใ—ใฆใใ ใ•ใ„ใ€‚** [.github/workflows/lint.yml [7]](https://github.com/r-sugi/nextjs-tdd-template/pull/187/files#diff-107e910e9f2ebfb9a741fa10b2aa7100cc1fc4f5f3aca2dfe78b905cbd73c0d2R7-R7) ```diff -branches: [main] +branches: [main, dev] ```
    Suggestion importance[1-10]: 7 Why: Including the `dev` branch in the `branches` specification can be beneficial for ensuring that changes in the development branch are also linted, which can help catch issues earlier in the development process.
    7
    pathsใฎๆŒ‡ๅฎšใ‚’ใ‚ˆใ‚Šๅ…ทไฝ“็š„ใซใ™ใ‚‹ใ€‚ ___ **`paths`ใฎๆŒ‡ๅฎšใŒใ‚ใ‚Šใพใ™ใŒใ€`**`ใ‚’ไฝฟ็”จใ—ใฆใ„ใ‚‹ใŸใ‚ใ€็‰นๅฎšใฎใƒ•ใ‚กใ‚คใƒซใ‚„ใƒ‡ใ‚ฃใƒฌใ‚ฏใƒˆใƒชใซ้™ๅฎšใ•ใ‚Œใฆใ„ใชใ„ๅฏ่ƒฝๆ€งใŒใ‚ใ‚Šใพใ™ใ€‚ใ‚ˆใ‚Šๅ…ทไฝ“็š„ใชใƒ‘ใ‚นๆŒ‡ๅฎšใ‚’ๆคœ่จŽใ—ใฆใใ ใ•ใ„ใ€‚** [.github/workflows/storybook.yml [5]](https://github.com/r-sugi/nextjs-tdd-template/pull/187/files#diff-97cca8fb169bc3951469886bf2f73b7bcc362a6b6da11325c7a617f69a797248R5-R5) ```diff -paths: [src/**, .storybook/**, package.json, package-lock.json, mocks/**] +paths: [src/components/**, .storybook/config/**, package.json, package-lock.json, mocks/data/**] ```
    Suggestion importance[1-10]: 6 Why: Making the `paths` specification more specific can help optimize the workflow by only triggering it for relevant changes, although the current specification is already functional.
    6