INTERNAL Fix CI pipeline: run lint and phpstan without the private workspace repo - #341
Merged
TLabutis merged 1 commit intoJul 29, 2026
Conversation
The pipeline had been failing at "Set up workspace" since around May 2026 with "ERROR: Repository not found" while cloning Invertus/ps-module-workspace. The SSH key in PS_MODULE_WORKSPACE_SAFERPAY_PRIVATE_KEY loads fine but belongs to a personal account that no longer has access to that repository, so lint and phpstan have not run on this module for months. lint and phpstan need the PrestaShop sources and the matching PHP version, not a running shop, so the public prestashop/prestashop image is now started idle with the checked-out module mounted in place. No private repository, no SSH secret, no database and no healthcheck. Also fixes the two findings this exposed: three unused imports in SaferPayOrderStatusService and the missing return in the settings controller postProcess(). Sets fail-fast to false so one red matrix leg no longer hides the other.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-Checks
JIRA task link
SL-382
Summary
The CI/CD pipeline has been dead since around May 2026, so lint and phpstan have not run on this module for months while the admin redesign landed. This makes them run again without depending on the private
ps-module-workspacerepository, and fixes the two findings that turning them back on exposed.QA Checklist Labels
QA Checklist
Blocks the 2.1.0 release together with #330 (React bundle built in CI) and #339 (Composer advisory release-build fix).
Additional Context
Root cause
Every run died in the very first real step:
ssh-addsucceeds, so the secretPS_MODULE_WORKSPACE_SAFERPAY_PRIVATE_KEYis intact. The key is a personal key (note the identity comment) and the account it belongs to is no longer on the collaborator list ofInvertus/ps-module-workspace, so GitHub authenticates the key and then reports the private repo as not found. Last green run was 2025-11-21; failures start 2026-05-08.Restoring a credential would mean either a read-only deploy key on
ps-module-workspace(needs admin on that repo) or another personal token with the same expiry and offboarding fragility. So the dependency is removed instead.What changed
lintandphpstanneed the PrestaShop sources on disk and the matching PHP version. They do not need a running shop, a database or a healthcheck. The publicprestashop/prestashop:1.7.8-7.4image already ships the sources, so it is now started idle with the checked-out module mounted in place:That drops seven steps: the workspace clone,
docker compose up, the healthcheck, the swap-space allocation, and the in-containergit cloneplus branch checkout of this module. As a side effect the job now tests the actual checked-out code instead of re-cloning the branch from GitHub inside the container, which also means it works for pull requests from forks.gitandcomposerare installed into the container since the base image ships neither.fail-fast: falseadded on the matrix, so a redlintleg no longer cancelsphpstan.Findings this exposed, both fixed here
src/Service/SaferPayOrderStatusService.php- three unused imports (Customer,PendingNotification,ControllerName), each referenced nowhere but its ownuseline. php-cs-fixer error 8.controllers/admin/AdminSaferPayOfficialSettingsController.php-postProcess()had barereturn;statements and no return at the end, while the inherited signature isbool|ObjectModel. Now returnsfalseon each rejected request andtrueafter dispatching. Behaviour is unchanged:ajaxResponse()ends insendJsonResponse()which callsdie(), so those returns are unreachable defensive paths.Verification
Ran the exact steps of the new workflow locally against
prestashop/prestashop:1.7.8-7.4on a clean clone of the release branch.Before the fixes, both suites reported real failures, which is the proof they had genuinely stopped running:
After:
composer installand the on-the-flycomposer require phpstan/phpstanboth succeeded, which incidentally re-confirms the advisory policy fix from #339 works during dependency resolution.Follow-up worth considering
Other Invertus modules use the same
ps-module-workspaceharness with their own personal-key secrets, so they will break the same way whenever those accounts are offboarded. Either move them to read-only deploy keys, or apply this self-contained pattern.Frontend Changes
None.