Skip to content

chore: deprecate the scaling flags - #1061

Merged
ToreMerkely merged 5 commits into
mainfrom
6327-depricate-scaling
Jul 30, 2026
Merged

chore: deprecate the scaling flags#1061
ToreMerkely merged 5 commits into
mainfrom
6327-depricate-scaling

Conversation

@ToreMerkely

Copy link
Copy Markdown
Contributor

Marks --include-scaling and --exclude-scaling as deprecated on kosli create environment and on the kosli snapshot command group (where they apply to --auto-environment).

Scaling has no compliance value and is being ratcheted away server-side — see kosli-dev/server#6327. This is the CLI half of the signal: no new adoption, existing users grandfathered.

No behaviour change. Both flags still parse and still send include_scaling in the payload, and the mutual-exclusion check is untouched. What changes is that using either flag now prints a deprecation warning, and MarkDeprecated hides them from --help and the generated docs. The scaling paragraph was dropped from the create environment long description accordingly, since it documented flags that no longer appear.

The Helm chart change is a separate PR.

Checklist

🤖 Generated with Claude Code

ToreMerkely and others added 4 commits July 30, 2026 07:40
Scaling events no longer create environment snapshots, so --include-scaling
and --exclude-scaling are on their way out. Mark both deprecated and drop
the scaling paragraph from the long description, since MarkDeprecated also
hides the flags from help and generated docs.

See kosli-dev/server#6327

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mirror the deprecation on kosli create environment for the group-wide
--include-scaling and --exclude-scaling flags of the snapshot commands.

See kosli-dev/server#6327

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The message was sitting in root.go among the flag usage strings, which is
not what that block is for. Keep it local to each command instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ToreMerkely's task in 1m 55s —— View job


Review — PR #1061: deprecate the scaling flags

  • Gather context (diff, DeprecateFlags helper, payload wiring)
  • Static analysis
  • Review code quality, wording, edge cases, tests
  • Post review feedback

Static analysis: go build ./... ✅ · go vet ./cmd/kosli/... ✅ — both clean.

Summary

Clean, well-scoped change. The deprecation approach is idiomatic (MarkDeprecated both warns and hides the flags from --help/generated docs), the mutual-exclusion behaviour is correctly left untouched, and the dropped scaling paragraph in the create environment long description is the right call since those flags no longer surface. Tests were properly updated from golden to goldenRegex to absorb the new deprecation warning lines — including the both-flags-set case where two warnings now precede the mux error. Nice attention to that detail.

One point worth aligning (non-blocking)

Deprecation message vs. "no behaviour change." Posted inline on createEnvironment.go:100. The shared message "Scaling events do not trigger new snapshots" is a present-tense behaviour claim, but --include-scaling's purpose is precisely to make scaling events trigger snapshots, and the PR keeps sending include_scaling in the payload (createEnvironment.go:127-134). For a grandfathered --include-scaling user the statement reads as false. Suggest framing it as deprecation-of-the-flag ("...will be removed in a future version. Scaling events are being phased out and will no longer trigger new snapshots."). Same wording lives in snapshotAutoEnvironment.go:42, so keep the two in sync if you change it.

Minor / optional

  • Two ways to deprecate. createEnvironment.go uses the shared DeprecateFlags(cmd, map[...]) helper while snapshotAutoEnvironment.go hand-rolls a loop over PersistentFlags(). The divergence is justified (DeprecateFlags operates on cmd.Flags(), not persistent flags), but if you want the call sites to read identically, consider a DeprecatePersistentFlags variant or having the helper accept a *pflag.FlagSet. Optional. (Already raised in the prior review.)

Nothing blocking. The wording is the only thing I'd nudge before merge.

Comment thread cmd/kosli/snapshotAutoEnvironment.go Outdated
Comment thread cmd/kosli/snapshotAutoEnvironment.go
The old wording claimed scaling events no longer create environment
snapshots, which is not true for the grandfathered environments that still
capture scaling. State the plain fact instead: scaling events do not trigger
new snapshots.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment thread cmd/kosli/createEnvironment.go
@ToreMerkely
ToreMerkely merged commit e17d5ed into main Jul 30, 2026
20 checks passed
@ToreMerkely
ToreMerkely deleted the 6327-depricate-scaling branch July 30, 2026 08:40
@mbevc1 mbevc1 changed the title feat: deprecate the scaling flags chore: deprecate the scaling flags Jul 30, 2026
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.

2 participants