Skip to content

feat(template): version list/get/diff #62

@omattsson

Description

@omattsson

Summary

  • GET /api/v1/templates/:id/versionsstackctl template versions list <id>
  • GET /api/v1/templates/:id/versions/:versionIdstackctl template versions get <id> <version>
  • GET /api/v1/templates/:id/versions/diff?from=&to=stackctl template versions diff <id> <v1> <v2>

Files to touch

  • cli/pkg/types/types.go — add TemplateVersion, TemplateVersionDiff.
  • cli/pkg/client/client.go — add three methods.
  • cli/cmd/template.go — add nested versions subcommand (mirror cluster shared-values pattern in cli/cmd/cluster.go).

Tests (all three layers required)

  • Unit: cli/cmd/template_test.go + cli/pkg/client/client_test.go — list/get/diff with all output modes; diff renders unified text in table mode and structured JSON in json/yaml.
  • Integration: cli/test/integration/template_definition_integration_test.go — Cobra in-process list+get+diff round-trip.
  • E2E: cli/test/e2e/cli_e2e_test.go — one happy-path scenario for template versions diff.

Acceptance

  • diff output: unified text (table mode) and structured JSON (json/yaml).

Tracks #59

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestphase-1Phase 1: Foundation + Core Lifecycle (MVP)templatesTemplate commands

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions