Skip to content

Feat: add GitOps CLI module with complete functionalities.#59

Open
BlueLabelscotch wants to merge 11 commits into
mainfrom
Feat/gitops
Open

Feat: add GitOps CLI module with complete functionalities.#59
BlueLabelscotch wants to merge 11 commits into
mainfrom
Feat/gitops

Conversation

@BlueLabelscotch

@BlueLabelscotch BlueLabelscotch commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a new gitops module to the Harness CLI covering the five nouns from harness/cli#29.

Issue #29 verb matrix

Noun list get create update delete execute Status
gitops_agent x install Missing update
gitops_cluster -f Complete; --set deferred
gitops_repository -f / --set Complete
gitops_application -f / --set sync, refresh Complete
gitops_application_set -f / --set execute:sync

What this PR adds

Module & wiring

  • pkg/spec/gitops.spec.yaml — nouns, fields, 28 commands
  • modules/gitops/gitops.goexecute gitops_agent:install workflow (Helm/YAML artifact fetch)
  • Wired in cmd/harness/main-harness.go

CRUD (spec-only)

  • Cluster / repository / application / application_set — create, update, delete with -f YAML
  • ApplicationSet — scope-level API paths (/applicationset + agentIdentifier query param); server-assigned UUID
  • Application — sync/refresh execute commands; delete with propagation-policy / cascade flags
  • Repository — credential note in help; masked secrets excluded from --set round-trip

Update UX (--set / get-then-put)

  • update gitops_repository--set name, repo_url, type
  • update gitops_application--set target_revision, path, namespace, repo_url
  • update gitops_application_set--set name (separate get_path for GET vs PUT)
  • update gitops_cluster-f only; doc note that --set is unsupported

Engine fix

  • pkg/registry/endpoint.go — apply yaml_exclude during get-then-put so read-only GET fields (e.g. status, masked password) are not sent on PUT

Test plan

  • -f regression on all three update commands above
  • harness create/update/delete round-trip for cluster, repository, application_set
  • harness execute gitops_application:sync and :refresh
  • harness execute gitops_agent:install <id> --output_file install.yaml

Closes #29

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.

feat: Add Harness GitOps entity support

1 participant