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

Upgrade PHPLint to v9 #2483

Closed
llaville opened this issue Mar 27, 2023 · 6 comments · Fixed by #2638
Closed

Upgrade PHPLint to v9 #2483

llaville opened this issue Mar 27, 2023 · 6 comments · Fixed by #2638
Labels
enhancement New feature or request nostale This issue or pull request is not stale, keep it open

Comments

@llaville
Copy link
Collaborator

I think now we have PHP 8.1 as base version of MegaLinter v6, it's time to upgrade PHPLint from version 5.5 to 9.0

As I'm author of refactoring code to major version v9 of PHPLint, I wanted to said :

  • previous versions will be not supported in future months
  • latest version 9.0.4 is now stable since at least one month

Now about MegaLinter v6.

I've tried the recent version 6.21.0

 ----------------------------------------------------------------------------------------------------
------------------------------------ MegaLinter, by OX Security ------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 2023-03-26T14:04:33Z
 - Image Revision: 66108018d9c2160896d8cf34d56f341592d23ffd
 - Image Version: 66108018d9c2160896d8cf34d56f341592d23ffd
----------------------------------------------------------------------------------------------------
The MegaLinter documentation can be found at:
 - https://megalinter.io/66108018d9c2160896d8cf34d56f341592d23ffd

And still have wrong links (that lead to 404) in Console Reporter on each linter
E.g: chunk of screenshot
megalinter-v621

Strange because, when I rebuilt locally the PHP flavor, I've no such results. See in chunk of screenshot
megalinter-v6_phplint-v9

My local command was :

docker build -f flavors/php/Dockerfile --secret id=GITHUB_TOKEN,env=GITHUB_TOKEN .

With: Docker version 23.0.1, build a5ee5b1 (docker buildkit enabled)

About MegaLinter v6 upgrade it will be more simple now, we previously used Composer only for PHPLint installation.
We can now remove it because it's no more necessary : PHIVE is able to install PHPLint v9

And PHIVE installation is much easier
Replace
https://github.com/oxsecurity/megalinter/blob/v6.21.0/megalinter/descriptors/php.megalinter-descriptor.yml#L38
By

    install:
      dockerfile:
        - |
          RUN GITHUB_AUTH_TOKEN="$(cat /run/secrets/GITHUB_TOKEN)" && export GITHUB_AUTH_TOKEN && phive --no-progress install overtrue/phplint --force-accept-unsigned -g 
@llaville llaville added the enhancement New feature or request label Mar 27, 2023
@llaville
Copy link
Collaborator Author

FYI: When I've rebuild PHP flavor locally, I got this final results (with warnings)

warnings

@nvuillam
Copy link
Member

@llaville thanks a lot for the initiative :)

About the wrong links, it's only during dev branch build, not beta or release, right ?

About the warnings: it's because we join the RUN instructions and add comments within the Dockerfile and it seems it's forbidden... we should replace them by "echo" someday :)

@llaville
Copy link
Collaborator Author

llaville commented Mar 27, 2023

About the wrong links, it's only during dev branch build, not beta or release, right ?

It's about official (suppose stable) release 6.21.0

For docker image oxsecurity/megalinter-php:v6, digest sha256:22508bb3ed78acc790ee9b3c7009ae119ee095b339fa45c9ca0a529e115150c0

@nvuillam
Copy link
Member

https://github.com/hardisgroupcom/sfdx-hardis/actions/runs/4529862900/jobs/7978081998

Ouch indeed that's ugly :o :o

Seems like a regression, I'll check that tonight

@llaville
Copy link
Collaborator Author

Seems like a regression, I'll check that tonight

Exists since 6.20.0 (see #2425)

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity.
It will be closed in 14 days if no further activity occurs.
Thank you for your contributions.

If you think this issue should stay open, please remove the O: stale 🤖 label or comment on the issue.

@github-actions github-actions bot added the O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity label Apr 27, 2023
@bdovaz bdovaz added nostale This issue or pull request is not stale, keep it open and removed O: stale 🤖 This issue or pull request is stale, it will be closed if there is no activity labels Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nostale This issue or pull request is not stale, keep it open
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants