Skip to content

feat(definition,template): add and remove charts, check-upgrade, upgrade, link-template (#157, #158) - #166

Merged
omattsson merged 1 commit into
mainfrom
feat/157-158-charts-upgrade-link
Oct 19, 2026
Merged

omattsson merged 1 commit into
mainfrom
feat/157-158-charts-upgrade-link

Conversation

@omattsson

Copy link
Copy Markdown
Owner

Summary

Definition commands (#157):

  • definition add-chart <definition> --name <chart> [--repository-url] [--chart-path] [--chart-version] [--source-repo-url] [--build-pipeline-id] [--deploy-order] [--file] (devops or admin).
  • definition remove-chart <definition> <chart>: chart name or ID; asks for confirmation unless --yes. A linked definition cannot lose a chart that the template requires (409).
  • definition check-upgrade <definition>: the version change and a CHART / CHANGE table. -q prints yes or no. -o json|yaml includes chart_diffs with the values of both sides.
  • definition upgrade <definition> [--yes]: shows the check on stderr, warns that the template values replace the definition values, asks, then upgrades.
  • definition link-template <definition> --template <name|id> [--version <v>] or --unlink (server v0.11.0 or later; a missing route gives an upgrade hint).

Template commands (#158):

  • template add-chart <template> --name <chart> ... [--locked-file] [--required] and template remove-chart <template> <chart> [--yes]. Both change the working copy and write a note to stderr: publish with a new --version.

Notes

  • The flag names follow the existing update-chart commands (--repository-url, --chart-path, --chart-version, --file), not --repo, --path, --version and --values-file from the issue text. --version already has another meaning in link-template and template publish.
  • Without an upgrade, the server sends only {"upgrade_available": false} (no source template, unpublished template, or latest version). The command reads the definition to say which case applies.
  • The server marks a chart modified only for other default values or another repository URL. The table also shows a chart as modified when its chart_diffs entry has has_differences (for example another chart version).
  • The vendored swagger.json is refreshed from k8s-stack-manager main (refresh-swagger.sh). The path contract test checks the new template-link path.

Tests

  • go test ./... passes, also go test -shuffle=on ./cmd. staticcheck (latest) has no findings.
  • New tests: cli/cmd/chart_changes_test.go (request bodies, usage errors, confirmation, no-upgrade reasons, 403 and 409, output modes) and cli/pkg/client/definition_charts_test.go.

Closes #157
Closes #158

🤖 Generated with Claude Code

…ade, link-template (#157, #158)

- definition add-chart and remove-chart (devops or admin). remove-chart
  takes a chart name or ID and asks for confirmation unless --yes.
- definition check-upgrade: the version change and a CHART/CHANGE table.
  Without an upgrade the server sends no reason; the command reads the
  template link of the definition. A chart with differences in
  chart_diffs (for example another chart version) shows as modified.
  -q prints yes or no.
- definition upgrade: shows the check on stderr, warns that the template
  values replace the definition values, and asks unless --yes.
- definition link-template --template <name|id> [--version] or --unlink
  (server v0.11.0 or later; a missing route gives an upgrade hint).
- template add-chart and remove-chart change the working copy and write a
  note to publish with a new --version.
- Flag names follow update-chart (--name, --repository-url, --chart-path,
  --chart-version, --file, --locked-file, --required, --deploy-order).
- Refresh the vendored swagger.json (the contract test checks the new
  template-link path).

Closes #157
Closes #158

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: omattsson/stackctl/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1adf33f5-9266-4cb9-a266-135b837033ea
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@omattsson
omattsson merged commit 6ad6fbb into main Oct 19, 2026
8 checks passed
@omattsson
omattsson deleted the feat/157-158-charts-upgrade-link branch October 19, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant