You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(build): add --branch option for partial updates of a single branch - #1231
Adds a --branch option to the build command that filters selected
packages to only versions matching a given branch name (e.g. dev-main)
or version constraint (e.g. 1.x). When combined with a package filter,
other packages and non-matching versions are preserved from the existing
repository dump, enabling fast partial rebuilds on branch push.
That was a leftover from an earlier approach where I tried a separate update-branch command extending BuildCommand and needed those methods accessible.
In the final implementation i've put everything directly into BuildCommand via --branch, subclass access isn't needed.
I've reverted all to private in the follow-up commit.
Adds --branch to Satis builds to support targeted branch or version-range updates while preserving existing repository content outside the requested scope.
Changes:
Adds branch matching and validation requiring package names and rejecting --repository-url.
Adjusts partial-update merging to retain existing versions.
Documents usage and adds command tests for filtering, preservation, and validation.
File
Description
tests/Console/Command/BuildCommandTest.php
Adds branch-update and option-validation tests.
src/Console/Command/BuildCommand.php
Implements the option, version matching, and merge changes.
docs/using.md
Documents branch and version-range update commands.
The reason will be displayed to describe this comment to others. Learn more.
Great job!
I'd maybe add a few tests with some weird branch names, like ones with special characters, to cover more edge cases, e.g. "feat/super-power-feature", "3.x" or "my.new-feat-&-power".
What do you think?
This assertion checks only the package name, so the test still passes if dev-feature-x or 1.0.0 is deleted or unexpectedly refreshed. Because both builds use identical metadata, it also cannot show that the requested branch was updated. Change the versions' source references between builds and inspect the generated version metadata, asserting that dev-main has the new reference while the other versions retain their old references.
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
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.
Adds a
--branchoption to thebuildcommand that filters selectedpackages to only versions matching a given branch name (e.g.
dev-main)or version constraint (e.g.
1.x). When combined with a package filter,other packages and non-matching versions are preserved from the existing
repository dump, enabling fast partial rebuilds on branch push.
Validation ensures --branch requires at least one package and is mutually
exclusive with --repository-url.