[Maintenance][CI] Add monorepo split action#18749
Conversation
📝 WalkthroughWalkthroughIntroduces GitHub Actions infrastructure for automated package splitting. A new PHP script generates a matrix by scanning Sylius source subdirectories (components, bundles, abstractions) and mapping them to repository names. A new workflow orchestrates matrix generation and iteratively executes package splitting for each module via an external action. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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: 4
🤖 Fix all issues with AI agents
In @.github/scripts/generate-split-matrix.php:
- Around line 5-16: The docblock claims "Excludes Behat directory" but the
scanning logic that builds the matrix for "Component", "Bundle", and
"Abstraction" directories does not filter out Behat folders; update the
directory scanning loops that generate matrix entries (the loops that traverse
src/Sylius/Component, src/Sylius/Bundle, src/Sylius/Abstraction) to skip any
directory whose basename equals "Behat" (or whose path contains "/Behat/")
before adding it to the output, or alternatively remove/update the docblock to
match the current behavior if you prefer not to exclude Behat directories.
In @.github/workflows/packages_split.yaml:
- Around line 3-13: Add a validation step at the start of the prepare job that
checks the workflow_dispatch inputs branch and tag and fails early if both are
empty: inspect github.event.inputs.branch and github.event.inputs.tag and, if
both are unset/empty, echo a clear error and exit 1 (so the job fails fast).
Name the step something like "Validate inputs" and use an if-less run step or an
always-needed check in prepare to enforce this validation before any
checkout/split logic runs so you prevent silent/invalid runs when neither branch
nor tag is provided.
- Around line 19-25: The checkout step currently uses actions/checkout@v4
without specifying the target ref, so the repo is always checked out at the
default branch; update the checkout step (actions/checkout@v4) to include a ref
parameter that uses the workflow input or environment variable for the intended
branch or tag (the same value you pass to the generate-split-matrix.php run
step) so the script (generate-split-matrix.php) operates on the correct
commit/branch/tag; ensure the matrix step still reads that ref (via the existing
id "matrix" or workflow inputs) so the generated packages reflect the
checked-out ref.
- Around line 40-48: The workflow references an unverified action
SyliusLabs/SplitPackageAction@v1.0; confirm the action repository and ref are
correct and accessible (or replace with a verified marketplace action), and
ensure the inputs match the action's expected input names: directory,
repository, branch, tag, token; if the action is private, update the uses to the
correct owner/repo@ref and add authentication (appropriate PAT in secrets) with
required scopes and verify the secret name (SPLIT_TOKEN) matches the action's
token input.
🧹 Nitpick comments (1)
.github/scripts/generate-split-matrix.php (1)
21-21: Comment doesn't match implementation.The comment says
→ Sylius/{Name}but the repository field is set to just$name(e.g.,OrdernotSylius/Order). Similar mismatches exist on lines 37 and 53. Consider updating the comments to match the actual output format shown in the docblock.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.