Repository navigation
feat(cli): syspi update moves a usage to the highest version its constraint allows; outdated reports what it would move - #15
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
…t version their constraints allow; outdated reports what it would move Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…tdated and lock see the collision install refuses Two packages that would install under one name with different contents were refused only when installing; the dry run of outdated and lock itself passed them. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…d tag When update finds the locked version is the highest allowed but another tag names the same version, the locked tag is used rather than the other spelling, so the revision check cannot fail against an unchanged entry. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…helper changes() used the resolver's lockKey; repositoryKey in update.go does the same so the branch does not depend on that helper's presence. Co-Authored-By: jason.han <hanhuijun@gmail.com>
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.
Summary
syspi update [-C dir] [-offline] [<resource>...]andsyspi outdated [-json] [<resource>...]— the last of the commands 0.1.0 lacks.Stacked on #10 (
remove), basefeat/remove: moving a lock entry leaves the previous version's copy underlib/, andupdateremoves it through the pruning #10 adds (Options.Prune,libPath). Once #10 merges, this PR rebases ontodevelopwith no change. The diff here is only the update/outdated commits.updateis the one command that moves a lock entry; everywhere else a lock entry that satisfies its constraint wins (README anddocs/packages.mdnow say so).install/lockafter loosening a constraint keep the locked version — tested.Options.Update(repository keys) /Options.UpdateAllmakeresolveVCSlook at the repository first for those usages —latestlists the tags andvcs.Selects the highest satisfying the constraint — and treat the lock entry as absent only when that version differs; an entry already at the top is reused as before (nothing re-exported).Options.DryRunresolves asLockOnlyand returns without writing.Result.Changes(changes(old, fresh), by repository key) lists every entry moved, added or dropped, in resource order.install.Update(ctx, opts, resources): resources name usages of.project.jsonby canonical identity (asadd/removematch); none means every repository of the closure. A usage that is not a repository (archive, local directory, standard library) has no versions to choose from and is refused by name;updateleaves such entries alone. ThenRunwithPrune, so the moved-away copy goes (removed lib/base_2.0.0).install.Outdatedis the same resolution withDryRun:name old -> newlines (or-json), nothing written, nothing installed. Both need the repository, so-offlineis refused with a message.widgets 1.1.0needsbase ^2.1.0andbaseis locked at2.0.0,update widgetsreports the conflict (… already resolved to 2.0.0) instead of silently movingbase;update widgets baseorupdatemoves both — tested.Tests:
internal/install/update_test.go(lock wins forinstall;outdatedwrites nothing; named vs all; prune of the old copy; refusals; new/dropped entries) andtests/e2e/update_test.go(git flow with-json,-offlinerefusal, nothing to move; the git/hg/svn fixtures). Docs: README "Commands" and the lock paragraph,docs/packages.md"Lock file",changes/unreleased/update.added.md.Proved on a real project (
MBSE4U/sysmod-sysmlv2locked at 5.1.5 with constraint>=5.1.0 <5.1.8,Open-MBEE/OpenSysML-Extensions-Library@1.0.0):syspi installkeeps 5.1.5,syspi outdatedprintssysmod 5.1.5 -> 5.1.6,syspi updateinstallslib/mbse4u-sysmod_5.1.6and removeslib/mbse4u-sysmod_5.1.5, OpenSysMLsysml -validateon a model importingSYSMOD::*andOOSEM::*passes before and after. With^5.1.0the highest tag is 5.1.8, whose.project.jsonsays5.1.7; SysPI refuses it as it always has (the tag must equal the version) — an upstream defect, not a lax mode to add.Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/888897f71c264c89a8abc11e9a432241
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/888897f71c264c89a8abc11e9a432241?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings · Follow Devin's work