Skip to content

fix(cli/market): allow same-version upgrade for the upload source#3439

Merged
pengpeng merged 1 commit into
mainfrom
fix/cli-market-upload-same-version-upgrade
Jun 21, 2026
Merged

fix(cli/market): allow same-version upgrade for the upload source#3439
pengpeng merged 1 commit into
mainfrom
fix/cli-market-upload-same-version-upgrade

Conversation

@pengpeng

Copy link
Copy Markdown
Member

Summary

  • olares-cli market upgrade pre-flight gate 3 rejected target == installed as a no-op for every source. For the upload bucket this is wrong: re-uploading the same version overwrites the stored chart in place, and app-service permits a same-version upgrade (it gates on >= deployed, not strictly greater — framework/app-service/pkg/appstate/upgrading_app.go).
  • Net effect for an already-installed upload app (running / upgradeFailed / ...): install is rejected by app-service (InstallOp not allowed from those states), while the only sanctioned re-apply / recovery path — upgrade to the same version — was blocked by the CLI itself. This is the wedge seen in the psitransfer recovery flow.
  • Fix: relax gate 3 to allow cmp == 0 only when source == upload. A true downgrade (cmp < 0) is still rejected for every source (app-service rejects it too). Backend is unchanged — market only forwards, and app-service already accepts same-version.

Changes

  • cli/cmd/ctl/market/preflight.gopreflightUpgrade gate 3 upload carve-out + doc comment.
  • cli/cmd/ctl/market/upgrade.goLong help text + inline comment reflect the upload same-version exception.
  • cli/cmd/ctl/market/preflight_test.go — new cases: upload same-version → allowed; upload downgrade → still rejected (non-upload same-version no-op already covered).
  • cli/skills/olares-market/references/olares-market-lifecycle.md — gate 3 exception, error-table note, "re-apply an upload chart" guidance.
  • cli/skills/olares-chart/references/olares-chart-deploy.md — iterate/recovery loop branches install (first deploy / installFailed / uninstalled) vs upgrade -s upload --version <same> (app already exists); §4b upgradeFailed recovery note.

Test plan

  • go build ./... (cli)
  • go test ./cmd/ctl/market/... — all pass, incl. the two new upload pre-flight cases
  • Manual: market upgrade <app> -s upload --version <same> re-applies an edited chart and recovers an upgradeFailed upload app

Made with Cursor

The upgrade pre-flight (gate 3) rejected target == installed as a
no-op for every source. But the `upload` bucket overwrites the stored
chart in place when the same version is re-uploaded, and app-service
permits a same-version upgrade (it gates on `>= deployed`, not strictly
greater). So for an already-installed upload app (running /
upgradeFailed / ...), re-running `install` is rejected by app-service
while the only sanctioned re-apply / recovery path — `upgrade` to the
same version — was blocked by the CLI itself.

Relax gate 3 to allow cmp == 0 when source == upload; a true downgrade
(cmp < 0) is still rejected for every source. Update the gate-3 docs in
preflight.go / upgrade.go and add pre-flight tests for the upload
same-version (allowed) and upload downgrade (still rejected) paths.

Align the skills: olares-market-lifecycle documents the upload gate-3
exception, and olares-chart-deploy's iterate/recovery loop now branches
install (first deploy / installFailed / uninstalled) vs
`upgrade -s upload --version <same>` (app already exists).

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
olares Ready Ready Preview, Comment Jun 21, 2026 1:22pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
olares-docs Ignored Ignored Jun 21, 2026 1:22pm

@pengpeng pengpeng merged commit 339a20f into main Jun 21, 2026
11 checks passed
eball added a commit that referenced this pull request Jun 22, 2026
)

The upgrade pre-flight (gate 3) rejected target == installed as a
no-op for every source. But the `upload` bucket overwrites the stored
chart in place when the same version is re-uploaded, and app-service
permits a same-version upgrade (it gates on `>= deployed`, not strictly
greater). So for an already-installed upload app (running /
upgradeFailed / ...), re-running `install` is rejected by app-service
while the only sanctioned re-apply / recovery path — `upgrade` to the
same version — was blocked by the CLI itself.

Relax gate 3 to allow cmp == 0 when source == upload; a true downgrade
(cmp < 0) is still rejected for every source. Update the gate-3 docs in
preflight.go / upgrade.go and add pre-flight tests for the upload
same-version (allowed) and upload downgrade (still rejected) paths.

Align the skills: olares-market-lifecycle documents the upload gate-3
exception, and olares-chart-deploy's iterate/recovery loop now branches
install (first deploy / installFailed / uninstalled) vs
`upgrade -s upload --version <same>` (app already exists).

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant