Skip to content

final changes#114

Merged
robmck1995 merged 5 commits intomainfrom
rob
Jan 16, 2025
Merged

final changes#114
robmck1995 merged 5 commits intomainfrom
rob

Conversation

@robmck1995
Copy link
Copy Markdown
Contributor

@robmck1995 robmck1995 commented Jan 16, 2025

Description

  • Added a new script build-and-extract.sh to build a Docker image and extract a binary to /tmp.
  • Updated the PHPActor installation method in install-lsproxy.sh to match the Dockerfile, installing from source and adding it to the PATH.
  • Bumped lsproxy version to 0.3.1 in Cargo.toml.

Changes walkthrough

Relevant files
Enhancement
build-and-extract.sh
Add script to build Docker image and extract binary                       

release/build-and-extract.sh

  • Added a script to build a Docker image.
  • Extracts a binary to the /tmp directory.
  • Includes cleanup of temporary Docker containers.
  • +19/-0   
    Bug fix
    install-lsproxy.sh
    Update PHPActor installation method and version                               

    release/install-lsproxy.sh

  • Updated LSPROXY_VERSION to 0.3.1.
  • Changed PHPActor installation method to use source.
  • Added PHPActor to the system PATH.
  • +9/-7     
    Versioning
    Cargo.toml
    Bump lsproxy version to 0.3.1                                                                   

    lsproxy/Cargo.toml

    • Updated lsproxy version to 0.3.1.
    +1/-1     
    💡 Usage Guide

    Checking Your Pull Request

    Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

    Talking to CodeAnt AI

    Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

    @codeant-ai ask: Your question here
    

    This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

    Retrigger review

    Ask CodeAnt AI to review the PR again, by typing:

    @codeant-ai: review
    

    Check Your Repository Health

    To analyze the health of your code repository, visit our dashboard at app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

    @codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Jan 16, 2025
    @codeant-ai
    Copy link
    Copy Markdown
    Contributor

    codeant-ai Bot commented Jan 16, 2025

    Pull Request Feedback 🔍

    🔒 No security issues identified
    ⚡ Recommended areas for review

    Code Smell
    The script uses hardcoded paths and names, such as /tmp/lsproxy and lsproxy-builder. Consider making these configurable to improve flexibility and maintainability.

    Code Smell
    The script appends to /etc/profile.d/phpactor.sh to add PHPActor to the PATH. This approach may not be suitable for all environments, especially if the script is run multiple times. Consider checking if the entry already exists before appending.


    # Copy the binary from the container to /tmp
    echo "Extracting binary to /tmp..."
    docker cp $CONTAINER_ID:/usr/local/bin/lsproxy-bin /tmp/lsproxy
    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

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

    Suggestion: Use double quotes around variable references to prevent word splitting and globbing issues. [best practice]

    Suggested change
    docker cp $CONTAINER_ID:/usr/local/bin/lsproxy-bin /tmp/lsproxy
    docker cp "$CONTAINER_ID:/usr/local/bin/lsproxy-bin" "/tmp/lsproxy"

    Comment on lines +104 to +107
    cd /usr/src && \
    git clone https://github.com/phpactor/phpactor.git && \
    cd /usr/src/phpactor && \
    composer install
    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

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

    Suggestion: Ensure the git and composer commands are available before attempting to clone and install PHPActor. [possible issue]

    Suggested change
    cd /usr/src && \
    git clone https://github.com/phpactor/phpactor.git && \
    cd /usr/src/phpactor && \
    composer install
    command -v git >/dev/null 2>&1 || { echo >&2 "git is required but it's not installed. Aborting."; exit 1; }
    command -v composer >/dev/null 2>&1 || { echo >&2 "composer is required but it's not installed. Aborting."; exit 1; }
    git clone https://github.com/phpactor/phpactor.git && \
    cd /usr/src/phpactor && \
    composer install

    composer install

    # Add phpactor to PATH
    echo 'export PATH="/usr/src/phpactor/bin:${PATH}"' >> /etc/profile.d/phpactor.sh
    Copy link
    Copy Markdown
    Contributor

    Choose a reason for hiding this comment

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

    Suggestion: Use a more secure method to append to the PATH by ensuring the script is executed with appropriate permissions. [security]

    Suggested change
    echo 'export PATH="/usr/src/phpactor/bin:${PATH}"' >> /etc/profile.d/phpactor.sh
    echo 'export PATH="/usr/src/phpactor/bin:${PATH}"' | sudo tee /etc/profile.d/phpactor.sh > /dev/null

    @robmck1995 robmck1995 merged commit e48fa45 into main Jan 16, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    size:S This PR changes 10-29 lines, ignoring generated files

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants