Repository navigation
fix(cli): upgrade outside a project names the project, not --from - #12448
josephfarina wants to merge 2 commits into
Conversation
Outside a project, `astryx upgrade` without `--from` asked for `--from`, and adding it got a second refusal. The message now says the folder is outside a project and to run upgrade with `--from <old version>` in the app's folder. The error code and JSON shape do not change.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes: the new error text and its tests are right, but the release note and one description claim misstate the before and after.
- The changeset says the message "now says that the folder is outside a project" and that before "it asked only for
--from", but the old message already said "This folder is outside a project", so reword it to say the message now leads with that reason instead of "Missing required --from" and adds where to run upgrade. - The description says
<old version>matches the placeholder that the agent docs and help print, butastryx upgrade --helpprints--from <version>, so say it matches the agent docs or drop "and help".
The error code, exit status and JSON shape stay the same, and both new tests fail on the old text and pass here. No code change is needed.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: outside a project, upgrade without
--fromnow says the folder is outside a project. False as a change: the old message already said it (old line 117 ofupgrade.mjs). - Changeset: it now says to run upgrade with
--from <old version>in the app's folder. Verified (upgrade.mjs:117,upgrade.test.mjs:553-560). - Changeset: before, it asked only for
--from. False: the old message also said the folder is outside a project. - Changeset: adding
--fromgot a second refusal. Verified (run/run.mjs:600-605,ERR_VERSION_DETECT). - Changeset: a patch
[fix]for the CLI. Verified: error prose is outside the CLI's compatibility contract. - Description: the before and after text and JSON. Verified by running the CLI in an empty folder on both revisions.
- Description: the cause is the outside-project branch keeping the in-project lead. Verified (old
upgrade.mjs:117). - Description: the code stays
ERR_INVALID_ARGUMENTand the JSON shape does not change. Verified (upgrade.test.mjs:556,commands/upgrade.test.mjs:142-147). - Description:
upgradedeclaresownoutside a project. Verified (commands/upgrade.doc.mjs:110). - Description: the message names no command because the app's folder is unknown. Verified (
upgrade.mjs:117). - Description:
<old version>matches the agent docs and help. True for the agent docs (agent-docs.mjs:743), false for help (commands/upgrade.doc.mjs:31). - Description: one string changes, and inside a project the message, code and printed command stay the same. Verified (
upgrade.mjs:118unchanged). - Description: no spec, doc page or API changes. Verified from the file list.
- Description: the in-project path still says "Missing required --from. Install the target version first…" and its tests pass. Verified (
upgrade.test.mjs:541-551,commands/upgrade.test.mjs:131-138). - Description: both new tests fail on the old text. Verified: each fails on the old code and passes here.
- Description: the three test files pass with 203 tests. Verified (23 + 18 + 162).
- Description: Prettier on the changed files. Verified for the added lines; the warning on
commands/upgrade.test.mjscomes from older lines, and the repository's formatting check does not cover.mjsfiles. - File
.changeset/upgrade-outside-project-names-project.md: finding (wording, above). - File
packages/cli/api/upgrade/upgrade.mjs: clear. - File
packages/cli/api/upgrade/upgrade.test.mjs: clear. - File
packages/cli/clients/cli/commands/upgrade.test.mjs: clear.
There was a problem hiding this comment.
Approved pending CI: CI has not run its build and tests on this head, because it found no room on the runners, so re-run all jobs.
The outside-project upgrade error now leads with the real reason and says where to run upgrade, with the same exit status, error code and JSON shape. Both earlier points are fixed: the changeset now says the message leads with that reason instead of "Missing required --from", and the description no longer says help prints <old version>. Nothing else is needed in the code or text.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Changeset: the message now leads with the reason, that the folder is outside a project. Verified (
upgrade.mjs:117; a run in an empty folder). - Changeset: it says to run upgrade with
--from <old version>in the app's folder. Verified (upgrade.mjs:117,upgrade.test.mjs:557-559). - Changeset: before, it led with "Missing required --from". Verified (old
upgrade.mjs:117; a run of the old code). - Changeset: adding
--fromin the same folder got a second refusal. Verified (run/run.mjs:599-606; a run with--from). - Changeset: a patch fix for the CLI. Verified: error wording is outside the CLI's compatibility contract.
- Description: the before and after text and JSON. Verified by runs in an empty folder on both revisions.
- Description: the cause is the outside-project branch keeping the in-project lead. Verified (old
upgrade.mjs:117). - Description: the fix rewrites only that message. Verified (one changed line in
upgrade.mjs). - Description: upgrade has its own outside-project behavior, keeps its refusal code, and the JSON shape does not change. Verified (
commands/upgrade.doc.mjs:110,upgrade.test.mjs:556,commands/upgrade.test.mjs:142-147). - Description: the message names no command because the app's folder is unknown. Verified (
upgrade.mjs:117). - Description:
<old version>matches the agent docs. Verified (foundation/agent-docs/agent-docs.mjs:743). - Description: inside a project the message, code and printed command stay the same. Verified (
upgrade.mjs:118unchanged;upgrade.test.mjs:541-551andcommands/upgrade.test.mjs:131-138pass). - Description: no spec, doc page or API changes. Verified from the file list.
- Description: both new tests fail on the old text. Verified: exactly those two fail with the old code.
- Description: the three test files pass with 203 tests. Verified (23 + 18 + 162).
- Description: Prettier on the changed files. Verified for the added lines; the remaining warning in
commands/upgrade.test.mjsis on older lines, and the old copy of that file fails the same way. - Description: one defect, no tagalong, no hidden API or interaction change, no internal context. Verified.
- File
.changeset/upgrade-outside-project-names-project.md: clear. - File
packages/cli/api/upgrade/upgrade.mjs: clear. - File
packages/cli/api/upgrade/upgrade.test.mjs: clear. - File
packages/cli/clients/cli/commands/upgrade.test.mjs: clear.
- #12252 docs(cli): agent docs name the prop names that differ from other libraries Author: Joey Farina <[email protected]> - #12154 fix(core): a numeric typography weight builds through an extended base's adaptation rules Author: Joey <[email protected]> - #12092 fix(cli): theme build reads the Core it builds with for variant declarations, and names the build command alone Author: Joey Farina <[email protected]> - #12316 fix(core): a shorthand never follows its own longhand in one style merge Author: josephfarina <[email protected]> - #12357 fix(core): a Table stays the scroll region when a host scrolls every table's parent Author: Joey Farina <[email protected]> - #12349 fix(core): end a mouse drag a sandboxed frame never saw released Author: josephfarina <[email protected]> - #12425 fix(cli): use a stored doc parse only with the zod release that made it Author: Joey <[email protected]> - #12396 fix(AppShell): with the standard width points, a server-rendered shell hides its inline side nav on a phone before its script runs Author: Joey <[email protected]> - #12438 fix(charts): end dots draw whole and a thinned axis keeps its last label Author: Joey Farina <[email protected]> - #12448 fix(cli): upgrade outside a project names the project, not --from Author: Joey Farina <[email protected]> - #12459 fix(templates): the dashboard scorecard fits a phone screen Author: Joey Farina <[email protected]> - #12428 fix(core): Field labels draw in a bolder face than their description Author: Joey Farina <[email protected]> - #12435 fix(theme-matcha): dark menus, popovers and muted fills take the theme's deep gray neutral Author: Joey <[email protected]> - #12432 fix(templates): dashboard chart labels show whole instead of clipped by the chart edge Author: Joey Farina <[email protected]> - #12441 fix(cli): mark icon-set generated calls pure so apps drop unused icons Author: Joey Farina <[email protected]> - #12472 fix(MetadataListItem): a value breaks only a word longer than its line Author: Joey <[email protected]>
|
Landed in #12718. |
User impact
A person or agent runs
astryx upgradein a folder that is outside a project, with no--from. The CLI said--fromwas missing. An agent that then adds--fromgets a second refusal, because the real problem is the folder: there is no app code to upgrade there. One extra failed run, and a misleading hint about what to fix.Before:
After:
Problem and solution fit
--fromcheck kept the in-project lead, "Missing required --from".--fromand fails again in the same folder.The fix rewrites only that message: it leads with the folder being outside a project, then says to run upgrade with
--from <old version>in the app's folder.Expected behavior and authority
spec:AST-081FR4 (current):upgradeisownoutside a project, and a released command keeps its refusal code. The code staysERR_INVALID_ARGUMENTand the JSON shape does not change.--from <old version>".<old version>matches the one the agent docs print.Smallest restoration
One string in
packages/cli/api/upgrade/upgrade.mjs. Inside a project, nothing changes: the message, code, and printed command stay the same. No spec, doc page, or API changes.Evidence
CI=1 node packages/cli/clients/cli/bin/astryx.mjs upgradeand... upgrade --jsonprint the "Missing required --from" text above.ERR_INVALID_ARGUMENT.upgradewithout--fromstill says "Missing required --from. Install the target version first, then run<command> upgrade --from <old-version>." The existing tests for that path pass unchanged.packages/cli/api/upgrade/upgrade.test.mjsasserts the exact outside-project message and code from the API;packages/cli/clients/cli/commands/upgrade.test.mjsasserts the exact--jsonenvelope. Both fail on the old text.Scope
Components: cli (upgrade)
Testing