Skip to content

Conversation

@ma-04
Copy link
Member

@ma-04 ma-04 commented Jan 22, 2026

Fix CI build failures for PHP builds.

Main cause

The issue was caused by the following line. Where, when wp-cli is trying to install the package through git & ssh. But the Alpine image did not have the git/ssh package installed.

&& wp package install wp-cli/doctor-command:@stable --allow-root \

Error log

 > [linux/arm64 wpcli_builder 2/2] RUN apk add --no-cache curl     && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar     && chmod +x wp-cli.phar     && mv wp-cli.phar /usr/local/bin/wp     && wp package install wp-cli/doctor-command:@stable --allow-root     && mkdir -p /home/www-data/.wp-cli     && mv ~/.wp-cli/packages /home/www-data/.wp-cli/     && chown -R www-data:www-data /home/www-data/.wp-cli     && rm -rf /var/cache/apk/*:
8.462 Using Composer to install the package...
8.462 ---
8.478 Loading composer repositories with package information
9.032 ---
9.032 Warning: Failed to clone git@github.com:wp-cli/doctor-command.git, git was not found, check that it is installed and in your PATH env.
9.032 
9.032 sh: git: not found
9.032 
9.034 Error: Package installation failed.
9.036 Reverted composer.json.

Extra

  • Using continue-on-error: true as a temporary measure to check which php version is failing more often
  • Moved to docker/build-push-action@v6

Summary by CodeRabbit

  • Chores
    • Enhanced deployment workflow with resilient error handling, enabling continued processing when specific build stages encounter issues
    • Updated Docker containerization and build tools to the latest version for improved build performance, security, and overall compatibility
    • Refined WP-CLI dependency installation process using updated methods for better long-term maintainability and consistency

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

Walkthrough

Changes update GitHub workflows by adding error tolerance to the build-php job, upgrading docker/build-push-action from v5 to v6, and modifying the WP-CLI Docker build stage to install doctor-command via git URL instead of the published package.

Changes

Cohort / File(s) Change Summary
GitHub Workflows
.github/workflows/deploy.yml, .github/workflows/test.yml
deploy.yml: Add continue-on-error: true to build-php job. test.yml: Upgrade docker/build-push-action from v5 to v6 in two build steps.
Docker Configuration
php/Dockerfile
WP-CLI build stage: Add git dependency installation and replace published doctor-command package with git URL-based installation via wp --allow-root package install.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

hacktoberfest-accepted

Suggested reviewers

  • alaminfirdows

Poem

🐰 Continue-on-error hops through the build,
Version six upgrades, our actions refilled,
doctor-command now cloned straight from git,
Workflows and dockers, perfectly knit!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: ci build failures php containers' directly addresses the main objective of fixing CI build failures for PHP Docker containers, matching the primary change in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ma-04

This comment was marked as off-topic.

@ma-04 ma-04 changed the title Fix/build failures fix: build failures Jan 22, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ma-04 ma-04 changed the title fix: build failures fix: ci build failures php containers Jan 22, 2026
@ma-04
Copy link
Member Author

ma-04 commented Jan 22, 2026

Current issue;

CI is passing for certain php versions only.
image

Reason for failures

When Git is installed, composer is trying to use Packagist repo (git ssh) instead of the given http git repo.

Log

 > [linux/arm64 wpcli_builder 2/2] RUN apk add --no-cache curl git     && curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar     && chmod +x wp-cli.phar     && mv wp-cli.phar /usr/local/bin/wp     && mkdir -p /home/www-data/.wp-cli     && wp --allow-root package install https://github.com/wp-cli/doctor-command.git     && mv ~/.wp-cli/packages /home/www-data/.wp-cli/     && chown -R www-data:www-data /home/www-data/.wp-cli     && rm -rf /var/cache/apk/*:
7.444 Registering https://github.com/wp-cli/doctor-command.git as a VCS repository...
7.947 Using Composer to install the package...
7.947 ---
7.955 Loading composer repositories with package information
9.099 
9.099 Deprecated: Return type of Symfony\Component\Process\Process::getIterator($flags = 0) should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/process/Process.php on line 598
9.184 Warning: Could not authenticate against github.com
9.185 ---
9.185 Error: Package installation failed.
9.188 Reverted composer.json.
------
Dockerfile:12

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/deploy.yml (1)

39-39: Version mismatch: test.yml uses docker/build-push-action@v6 but deploy.yml still uses v5.

The test workflow was upgraded to v6 (lines 35, 80 in test.yml), but the deploy workflow remains on v5. This inconsistency means tests run with different action behavior than production deployments. Align both workflows to the same version.

Suggested fix
       - name: Build PHP Docker image
-        uses: docker/build-push-action@v5
+        uses: docker/build-push-action@v6
         with:
       - name: Push PHP Docker image
         if: success()
-        uses: docker/build-push-action@v5
+        uses: docker/build-push-action@v6
         with:

Same change needed for lines 105 and 133 (OpenLiteSpeed builds).

Also applies to: 66-66

🤖 Fix all issues with AI agents
In @.github/workflows/deploy.yml:
- Line 22: The workflow currently sets continue-on-error: true which should only
be temporary; change the key (continue-on-error) back to false (or remove it) so
failed PHP-version jobs will fail the deployment, and add a TODO comment
referencing a tracking issue or ticket ID to remove the temporary allowance once
the root cause is fixed; update the deploy.yml entry that defines
continue-on-error to reflect this and include the TODO/issue reference in the
comment.
🧹 Nitpick comments (2)
.github/workflows/deploy.yml (1)

25-25: Remove or uncomment the dead configuration.

The commented #fail-fast: false serves no purpose. Either uncomment it if you want matrix jobs to continue independently, or remove the line entirely.

Suggested fix
     strategy:
-      `#fail-fast`: false
+      fail-fast: false
       matrix:
php/Dockerfile (1)

17-17: Consider using a package name reference instead of a raw Git URL to enable version pinning.

The raw Git URL https://github.com/wp-cli/doctor-command.git fetches the latest commit and cannot be pinned to a specific version using inline syntax (:@stable`` or #v0.12.1 do not work with Git URLs in wp-cli package install).

Use the package name format instead:

Suggested fix
-    && wp --allow-root package install https://github.com/wp-cli/doctor-command.git \
+    && wp --allow-root package install wp-cli/doctor-command:`@stable` \

Or pin to a specific version tag:

-    && wp --allow-root package install https://github.com/wp-cli/doctor-command.git \
+    && wp --allow-root package install wp-cli/doctor-command:v0.12.1 \


jobs:
build-php:
continue-on-error: true
Copy link

@coderabbitai coderabbitai bot Jan 22, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

continue-on-error: true should be temporary.

This allows broken PHP version builds to be silently ignored in production deployments. While useful for debugging which versions fail, leaving this permanently risks pushing incomplete image sets. Consider adding a TODO comment or tracking issue to remove this once the root cause is fixed.

🤖 Prompt for AI Agents
In @.github/workflows/deploy.yml at line 22, The workflow currently sets
continue-on-error: true which should only be temporary; change the key
(continue-on-error) back to false (or remove it) so failed PHP-version jobs will
fail the deployment, and add a TODO comment referencing a tracking issue or
ticket ID to remove the temporary allowance once the root cause is fixed; update
the deploy.yml entry that defines continue-on-error to reflect this and include
the TODO/issue reference in the comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

to be resolved while merging. Currently there for debugging

Copy link

Choose a reason for hiding this comment

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

@ma-04, thanks for the clarification! That makes perfect sense for debugging purposes. I appreciate you planning to address this before merging. If you'd like, adding a TODO comment in the workflow file itself could serve as a helpful reminder during the merge process.

Looking forward to seeing the final fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant