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

feat: added support for pnpm #28

Merged
merged 4 commits into from
Jun 28, 2024
Merged

feat: added support for pnpm #28

merged 4 commits into from
Jun 28, 2024

Conversation

dbarrosop
Copy link
Member

@dbarrosop dbarrosop commented Jun 27, 2024

PR Type

Enhancement, Configuration changes


Description

  • Added support for pnpm in start.sh by checking for pnpm-lock.yaml file and updating the error message.
  • Updated GitHub Actions workflow in .github/workflows/publish.yml:
    • Added a step to set a tag variable based on the event type.
    • Modified Docker build and publish steps to use the new tag variable.
    • Changed the condition to push Docker images only on release events.

Changes walkthrough 📝

Relevant files
Enhancement
start.sh
Add pnpm support in start script                                                 

start.sh

  • Added support for pnpm by checking for pnpm-lock.yaml file.
  • Updated error message to include pnpm.
  • +3/-3     
    Configuration changes
    publish.yml
    Update Docker publish workflow with tag handling                 

    .github/workflows/publish.yml

  • Added step to set tag variable based on event type.
  • Updated Docker build and publish steps to use the new tag variable.
  • Changed condition to push images only on release events.
  • +8/-4     

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

    @codiumai-pr-agent-pro codiumai-pr-agent-pro bot added the enhancement New feature or request label Jun 27, 2024
    Copy link

    codiumai-pr-agent-pro bot commented Jun 27, 2024

    PR Reviewer Guide 🔍

    (Review updated until commit c0a93fa)

    ⏱️ Estimated effort to review [1-5] 2
    🧪 Relevant tests No
    🔒 Security concerns No
    ⚡ Key issues to review Possible Bug:
    The condition for checking lock files in start.sh has been updated to include pnpm-lock.yaml. Ensure that this logic correctly identifies the presence of any of the three lock files without falsely exiting the script when one is present.
    Docker Tag Consistency:
    The Docker tag logic in .github/workflows/publish.yml now depends on the event type. Verify that the tag is correctly set for both release and non-release events to avoid deployment issues.

    Copy link

    CI Failure Feedback 🧐

    Action: build-push

    Failed stage: Build and publish to Docker Hub [❌]

    Failure summary:

    The action failed because the Docker build command encountered an error due to an invalid tag
    format.

  • The tag nhost/functions:18-28/merge is not in a valid reference format.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    679:  Experimental: false
    680:  Insecure Registries:
    681:  127.0.0.0/8
    682:  Live Restore Enabled: false
    683:  ##[endgroup]
    684:  ##[warning]The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
    685:  [command]/usr/bin/docker buildx build --file 18.Dockerfile --iidfile /tmp/docker-build-push-a5aIOi/iidfile --platform linux/amd64,linux/arm64 --tag nhost/functions:18-28/merge --metadata-file /tmp/docker-build-push-a5aIOi/metadata-file .
    686:  WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
    687:  ERROR: invalid tag "nhost/functions:18-28/merge": invalid reference format
    688:  ##[error]buildx failed with: ERROR: invalid tag "nhost/functions:18-28/merge": invalid reference format
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    Copy link

    codiumai-pr-agent-pro bot commented Jun 27, 2024

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    ✅ Add the missing logical operator '&&' to correct the if statement
    Suggestion Impact:The suggestion corrected the if statement by adding the missing logical operator '&&' between the conditions, ensuring proper logical evaluation.

    code diff:

    -if [ ! -f "$FUNCTIONS_WORKING_DIR/package-lock.json" ] && [ ! -f "$FUNCTIONS_WORKING_DIR/yarn.lock" ] [ ! -f "$FUNCTIONS_WORKING_DIR/pnpm-lock.yaml" ]; then
    -    echo "No lock file found. Please commit your lock file for npm or yarn"
    +if [ ! -f "$FUNCTIONS_WORKING_DIR/package-lock.json" ] && [ ! -f "$FUNCTIONS_WORKING_DIR/yarn.lock" ] && [ ! -f "$FUNCTIONS_WORKING_DIR/pnpm-lock.yaml" ]; then

    Add the missing logical operator '&&' between the conditions in the if statement to ensure
    proper logical evaluation.

    start.sh [30]

    -if [ ! -f "$FUNCTIONS_WORKING_DIR/package-lock.json" ] && [ ! -f "$FUNCTIONS_WORKING_DIR/yarn.lock" ] [ ! -f "$FUNCTIONS_WORKING_DIR/pnpm-lock.yaml" ]; then
    +if [ ! -f "$FUNCTIONS_WORKING_DIR/package-lock.json" ] && [ ! -f "$FUNCTIONS_WORKING_DIR/yarn.lock" ] && [ ! -f "$FUNCTIONS_WORKING_DIR/pnpm-lock.yaml" ]; then
     
    • Apply this suggestion
    Suggestion importance[1-10]: 10

    Why: The suggestion correctly identifies a missing logical operator '&&' in the if statement, which is crucial for proper logical evaluation and preventing potential script errors.

    10

    start.sh Outdated Show resolved Hide resolved
    Co-authored-by: Nuno Pato <[email protected]>
    @dbarrosop dbarrosop merged commit ac4f724 into main Jun 28, 2024
    1 check passed
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants