Skip to content
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

chore: Updated GitHub Workflow for RC Versioning #134

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

seeratawan01
Copy link
Member

@seeratawan01 seeratawan01 commented Oct 23, 2024

PR Type

enhancement


Description

  • Enhanced the GitHub workflow by adding a build step using pnpm build.
  • Improved the versioning process by updating the SDK version separately before other packages.
  • Adjusted the loop to update specific packages (nextjs and react) and their workspace dependencies.

Changes walkthrough 📝

Relevant files
Enhancement
cd-develop.yml
Enhance GitHub Workflow for RC Versioning and Build Process

.github/workflows/cd-develop.yml

  • Added a step to build the project using pnpm build.
  • Updated the process for setting package versions, including the SDK
    version.
  • Modified the loop to update specific packages and their workspace
    dependencies.
  • +18/-5   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @seeratawan01 seeratawan01 merged commit 26daf4c into develop Oct 23, 2024
    1 check failed
    @github-actions github-actions bot added the enhancement New feature or request label Oct 23, 2024
    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    🏅 Score: 85
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Possible Bug
    The sed command used to update the workspace dependency might not correctly handle different version formats or pre-existing versions other than 'workspace:*'. This could lead to incorrect package.json configurations.

    Code feedback:
    relevant file.github/workflows/cd-develop.yml
    suggestion      

    Consider adding error handling or a verification step after running the pnpm build command to ensure the build was successful before proceeding with the workflow. This could prevent further steps from running if the build fails, thus avoiding potential deployment of broken code. [important]

    relevant linerun: pnpm build

    relevant file.github/workflows/cd-develop.yml
    suggestion      

    It's recommended to use a more specific tag than latest for the TypeScript dependency to ensure consistent builds across environments. Specifying a fixed version or a version range can prevent potential issues due to unexpected changes in new TypeScript releases. [important]

    relevant linerun: pnpm add typescript@latest -w

    relevant file.github/workflows/cd-develop.yml
    suggestion      

    To improve the maintainability of the script, consider abstracting the repeated logic of changing directories and updating versions into a function. This would make the script cleaner and reduce the risk of errors in future modifications. [medium]

    relevant linefor package in packages/nextjs packages/react; do

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Best practice
    Add error handling to cd commands to prevent running commands in an incorrect directory

    Add error handling for the cd commands to ensure that subsequent commands are not
    run in the wrong directory if the cd fails.

    .github/workflows/cd-develop.yml [76]

    -cd $package
    +cd $package || exit
    Suggestion importance[1-10]: 8

    Why: Adding error handling to cd commands is crucial for preventing subsequent commands from executing in the wrong directory, which could lead to significant workflow errors. This suggestion enhances the reliability of the script.

    8
    Enhancement
    Improve the robustness of the sed command to handle various formatting in package.json

    Ensure that the sed command used to update the workspace dependency in the
    package.json handles different variations of the dependency declaration format. This
    includes potential spaces and different quote characters that might be present in
    the file.

    .github/workflows/cd-develop.yml [82]

    -sed -i 's|"workspace:\*"|"'"$SDK_VERSION"'"|' package.json
    +sed -i 's|"workspace:[[:space:]]*\*"|"'"$SDK_VERSION"'"|g' package.json
    Suggestion importance[1-10]: 7

    Why: The suggestion enhances the robustness of the sed command by accounting for variations in whitespace, which could prevent potential errors in dependency updates. This is a practical improvement for maintaining consistency in package versioning.

    7

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    enhancement New feature or request
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant