Repository navigation
feat: nudge apps behind on Leaf majors after install/update - #25
Merged
Merged
Conversation
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.
After
leaf installorleaf updatesucceeds, the CLI now prints one plain line when the app is behind on Leaf majors:or, on Leaf 5 with an older module:
How it works (
src/Utils/Upgrade.php):leafs/leaffromcomposer.lockfirst. If it's below 5, it prints the line and doesn't touch the network.composer outdated --direct --major-only --format=json(30s timeout) and lists onlyleafs/*packages with a newer stable major. Dev branches are ignored.composer.jsonin the working directory, or when composer fails (offline, timeout, bad JSON). Any exception is swallowed, so an install never fails because of the nudge.I didn't suggest a command in the line on purpose.
leaf updateupdates the CLI itself, not the app, so the line points to the upgrade guide.Tests:
tests/upgrade.test.phpadds 6 cases (below 5, outdated module, current, offline, no project, dev branch). The full suite passes 28/28 and lint is clean.This changes CLI behaviour, so it needs a review before merge.