Skip to content

feat(application): more precise plan upgrade/downgrade direction#226

Open
LorrisSaintGenez wants to merge 1 commit into
mainfrom
feat/directional-plan-change
Open

feat(application): more precise plan upgrade/downgrade direction#226
LorrisSaintGenez wants to merge 1 commit into
mainfrom
feat/directional-plan-change

Conversation

@LorrisSaintGenez
Copy link
Copy Markdown
Contributor

@LorrisSaintGenez LorrisSaintGenez commented Jun 2, 2026

What

  • application upgrade/downgrade now list only the plans relevant to the current plan, in the order returned by the plans endpoint (no hardcoding): upgrade shows higher tiers, downgrade shows lower tiers.
  • Read the current plan from the application data (attributes.plan.label) and match it to the self-serve list by label.
  • No-op with a message when already at the highest/lowest plan, or when the requested plan equals the current one.
  • Explicit --plan still overrides direction; unknown/legacy plans fall back to the full list.

Test

go run ./cmd/algolia application upgrade --dry-run     # higher tiers only / "nothing to upgrade to"
go run ./cmd/algolia application downgrade --dry-run   # lower tiers only
go run ./cmd/algolia application upgrade --plan <current-plan>  # "already on … no change needed"

GROUT-361

@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 32 complexity · 8 duplication

Metric Results
Complexity 32
Duplication 8

View in Codacy

TIP This summary will be updated as you push new changes.

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