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

add support for laravel 9 and 10 to V3 #90

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

jheusinger
Copy link
Contributor

@jheusinger jheusinger commented May 27, 2024

PR Type

enhancement, configuration changes


Description

  • Updated CI workflow to support PHP 8.1 and Laravel 9 and 10.
  • Excluded incompatible combinations of PHP and Laravel versions in the CI workflow.
  • Updated composer.json to support Laravel 9 and 10 for illuminate/support, laravel/framework, and laravel/sanctum.
  • Updated development dependencies to support multiple versions of orchestra/testbench and phpunit/phpunit.

Changes walkthrough 📝

Relevant files
Configuration changes
tests.yml
Update CI workflow to support Laravel 9 and 10                     

.github/workflows/tests.yml

  • Added support for PHP 8.1.
  • Added support for Laravel 9 and 10.
  • Excluded incompatible PHP and Laravel version combinations.
  • +7/-2     
    Enhancement
    composer.json
    Update dependencies to support Laravel 9 and 10                   

    composer.json

  • Updated illuminate/support, laravel/framework, and laravel/sanctum to
    support Laravel 9 and 10.
  • Updated orchestra/testbench and phpunit/phpunit to support multiple
    versions.
  • +5/-5     

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

    Copy link

    PR Review 🔍

    ⏱️ Estimated effort to review [1-5]

    2, because the changes are mostly configuration updates and version compatibility adjustments in the CI workflow and composer.json. These changes are straightforward and do not involve complex logic or new features.

    🧪 Relevant tests

    No

    ⚡ Possible issues

    Compatibility Issues: Ensure that the excluded combinations in the CI workflow are correct and that there are no edge cases where these exclusions might cause issues with other dependencies or configurations.

    🔒 Security concerns

    No

    Copy link

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Performance
    Add a max-parallel key to limit the number of concurrent jobs in the CI environment

    Consider adding a max-parallel key under the strategy section to limit the number of
    concurrent jobs, which can help manage resource usage and avoid overloading the CI
    environment.

    .github/workflows/tests.yml [15-25]

     strategy:
         fail-fast: true
    +    max-parallel: 2
         matrix:
             php: [ 8.1, 8.2, 8.3 ]
             laravel: [ 9.*, 10.*, 11.* ]
             dependency-version: [ prefer-stable ]
             exclude:
                 -   php: 8.3
                     laravel: 9.*
                 -   php: 8.1
                     laravel: 11.*
     
    Suggestion importance[1-10]: 7

    Why: Adding a max-parallel key can help manage CI resources better, although it's not a critical change.

    7
    Possible issue
    Verify that the version constraints for laravel/sanctum are compatible with the specified Laravel versions

    Ensure that the version constraints for laravel/sanctum are compatible with the Laravel
    versions specified, as there might be breaking changes between major versions.

    composer.json [33]

    +"laravel/sanctum": "^3.2|^4.0"
     
    -
    Suggestion importance[1-10]: 6

    Why: Ensuring compatibility is important to prevent runtime issues, though the suggestion lacks specific details on incompatibility.

    6
    Maintainability
    Sort the PHP and Laravel versions in ascending order within the matrix for better readability

    To improve readability and maintainability, consider sorting the PHP and Laravel versions
    in ascending order within the matrix.

    .github/workflows/tests.yml [18-19]

    +matrix:
    +    php: [ 8.1, 8.2, 8.3 ]
    +    laravel: [ 9.*, 10.*, 11.* ]
     
    -
    Suggestion importance[1-10]: 5

    Why: Sorting versions can improve readability but it's a minor improvement and does not impact functionality.

    5

    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    CI Failure Feedback 🧐

    Action: Setup testing environment and execute tests (8.1, 9., prefer-stable) / PHP 8.1 with Laravel 9. (prefer-stable)

    Failed stage: Install dependencies [❌]

    Failure summary:

    The action failed because the PHP version requirement specified in the composer.json file was not
    met. Specifically:

  • The composer.json file requires PHP version ^8.2.
  • The current PHP version is 8.1.28, which does not satisfy the requirement.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    285:  ##[endgroup]
    286:  laravel/framework is currently present in the require key and you ran the command with the --dev flag, which will move it to the require-dev key.
    287:  ./composer.json has been updated
    288:  Loading composer repositories with package information
    289:  Updating dependencies
    290:  Your requirements could not be resolved to an installable set of packages.
    291:  Problem 1
    292:  - Root composer.json requires php ^8.2 but your php version (8.1.28) does not satisfy that requirement.
    293:  ##[error]Your requirements could not be resolved to an installable set of packages.
    294:  
    295:    Problem 1
    296:      - Root composer.json requires php ^8.2 but your php version (8.1.28) does not satisfy that requirement.
    297:  
    298:  ##[error]Process completed with exit code 2.
    

    ✨ 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

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    CI Failure Feedback 🧐

    Action: Setup testing environment and execute tests (8.1, 10., prefer-stable) / PHP 8.1 with Laravel 10. (prefer-stable)

    Failed stage: Install dependencies [❌]

    Failure summary:

    The action failed because the PHP version requirement specified in the composer.json file is not
    met.

  • The composer.json file requires PHP version ^8.2.
  • The current PHP version is 8.1.28, which does not satisfy the requirement.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    283:  COMPOSER_NO_AUDIT: 1
    284:  ##[endgroup]
    285:  laravel/framework is currently present in the require key and you ran the command with the --dev flag, which will move it to the require-dev key.
    286:  ./composer.json has been updated
    287:  Loading composer repositories with package information
    288:  Updating dependencies
    289:  Your requirements could not be resolved to an installable set of packages.
    290:  Problem 1
    291:  ##[error]Your requirements could not be resolved to an installable set of packages.
    292:  
    293:    Problem 1
    294:      - Root composer.json requires php ^8.2 but your php version (8.1.28) does not satisfy that requirement.
    295:  
    296:  - Root composer.json requires php ^8.2 but your php version (8.1.28) does not satisfy that requirement.
    297:  ##[error]Process completed with exit code 2.
    

    ✨ 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.

    @jheusinger
    Copy link
    Contributor Author

    @gael-connan-cybex
    at least the currently supported laravel versions should be required.
    Laravel Releases

    while we could argue if 9.x as EOL need to be required, at least 10.x should be.

    Copy link
    Member

    @lupinitylabs lupinitylabs left a comment

    Choose a reason for hiding this comment

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

    Yeah, looks like there should be no reason not to do this...
    Sanctum v3 to v4 doesn't have an upgrade guide, and Laravel 9 already supports Sanctum v3...

    I say go!

    @lupinitylabs lupinitylabs merged commit 5334e34 into master Oct 31, 2024
    7 checks passed
    @lupinitylabs lupinitylabs deleted the feature/add-laravel-9-10-support branch October 31, 2024 14:41
    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