feat(php-hyperf): add arm-dev variant with per-entry platforms#3
Conversation
variants.yaml entries can now declare a 'platforms' field (string, defaults to linux/amd64). The build workflow sets up QEMU and passes the platform list to docker/build-push-action, enabling per-variant cross-builds without duplicating the manifest. validate.yml type-checks the new field.
|
Warning Review limit reached
More reviews will be available in 54 minutes and 54 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR extends the Docker image build pipeline to support cross-platform builds. The variant schema gains optional ChangesCross-platform Docker build support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/build-images.yml:
- Around line 162-163: The docker/setup-qemu-action step uses a mutable version
tag (`@v3`) which poses a security risk if the action's maintainer account is
compromised. Replace the mutable tag `@v3` with a full commit SHA in the uses
field of the Set up QEMU step to pin it to a specific, immutable version. Use
Dependabot or Renovate to automatically keep the pinned SHA updated to the
latest releases.
In @.github/workflows/validate.yml:
- Around line 77-82: The platforms validation check currently only verifies that
the platforms field is a string type but does not reject empty string values,
which later cause build failures. Update the jq filter in the bad_platforms
selection (the line starting with `jq -c`) to additionally reject entries where
platforms is an empty string by adding a condition that checks if the platforms
value is not empty in addition to the existing type check. This ensures that
both non-string values and empty strings are caught as validation errors.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1311ddbe-ed34-4f04-a19f-f2a3dcee849c
📒 Files selected for processing (3)
.github/workflows/build-images.yml.github/workflows/validate.ymlphp-hyperf/8.3/variants.yaml
Summary
arm-devvariant ofdevitools/php-hyperf:8.3so Apple Silicon dev environments can pull a native arm64 image instead of running the amd64:8.3-devunder Rosetta/QEMU emulation.variants.yamlschema with an optionalplatformsfield (string, defaults tolinux/amd64). Each entry can now opt into a different platform string (linux/arm64,linux/amd64,linux/arm64, etc.) without duplicating workflow logic.Why
quoteguide-functionshas acompose.override.ymlthat swaps the dev image for a hand-built arm tag (devitools/hyperf:8.3-arm-devpreviously pushed manually). Publishing it as a first-class variant means:Keeping arm-dev as a separate tag (rather than making
:8.3-devmulti-arch) was chosen because:variants.yaml change
Schema rule
platformsis optional. When omitted, the build defaults tolinux/amd64(current behavior — no change foraws-cli,node,quasar,vue, or any existing image without a manifest). When present, it must be a string.validate.ymlenforces the type at PR time.Tags produced from this PR (delta)
hyperfAPP_TARGET=devlinux/arm64devitools/php-hyperf:8.3-arm-devPlus the matching
devitools/php-hyperf:latest-arm-devvia thephp-hyperf/latestsymlink.Workflow changes
Set up QEMU(docker/setup-qemu-action@v3) registers binfmt handlers so the amd64 runner can cross-build forlinux/arm64.platforms(withlinux/amd64default) into each matrix entry.platforms: linux/amd64with${{ matrix.build.platforms }}.Local validation
yq + jqparser produces 5 matrix entries from the updated manifest (lean, dev, arm-dev, otel, google) with correctplatformsvalues.docker build --platform=linux/arm64 --target hyperf --build-arg APP_TARGET=devsucceeds natively on an Apple Silicon Mac.validate.yml's newplatformstype check accepts strings and rejects non-strings (smoke-tested with a fake numeric value).Test plan
validate.yml; passes (manifest is valid).build-images.ymlwith the matrix expanded to 5 builds forphp-hyperf/8.3+ 5 forphp-hyperf/latest.devitools/php-hyperf:8.3-arm-devpull on an Apple Silicon host showslinux/arm64(noamd64warning from Docker).devitools/php-hyperf:8.3-devpull on amd64 host still works (no regression).platforms:in their manifests continue to build aslinux/amd64.Summary by CodeRabbit
New Features
Infrastructure