Skip to content

feat(deploy): accept 'latest' as git commit id - #707

Open
Astach wants to merge 1 commit into
mainfrom
feat/deploy-latest-commit
Open

Astach wants to merge 1 commit into
mainfrom
feat/deploy-latest-commit

Conversation

@Astach

@Astach Astach commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

What:

  • latest reserved on every git commit input: --commit-id. CLI resolves newest commit of service branch, prints resolved SHA, deploys it.
  • application redeploy --commit-id honored. Flag declared but ignored before, redeploy always reused deployed commit.
  • environment deploy --helms fixed: passed helm name where helm id expected, so every call 404'd.

Why:

  • Only explicit SHA before. Omitted flag redeploys already-deployed commit. No way to say "ship tip of branch", so CI resolved SHA itself: local checkout or hand-rolled API call.

Notes:

  • Newest picked by created_at, not list position: API documents no order.
  • Resolution runs before any deploy request. Multi-service command with one unresolvable service aborts with nothing queued. DeployTerraforms non-batch path split into resolve pass then execute pass for same reason.
  • Image tags and chart versions never intercepted, latest stays verbatim.
  • latest rejected on --values_override_git_commit_id: no API lists commits of values-override repo.
  • environment deploy branches on source kind (GetJobDocker, GetGitSource), not on presence of a deployed commit, else never-deployed git service drops the version silently.

Summary by cubic

Adds latest as a reserved commit id everywhere service commit ids are accepted (--commit-id, helm's --chart_git_commit_id, and name:latest in environment deploy service lists), so those inputs now deploy the newest commit of the service branch. application redeploy --commit-id is now honored instead of ignored, and environment deploy --helms no longer 404s because it passed the helm name where the helm id was expected.

Behavior changes

  • latest picks the newest commit by created_at, not by list position, and prints the resolved SHA before deploying.
  • latest is rejected on --values_override_git_commit_id because the API exposes no commit list for values-override repositories.
  • Image tags and chart versions are never intercepted, so a literal latest tag or chart version is unaffected.

Deploy notes

  • Multi-service commands resolve all commit ids before queuing anything, so one unresolvable service aborts with no deployments queued.
  • environment deploy now checks job and helm source kind instead of whether a deployed commit exists, so never-deployed git services don't drop their version silently.

Written for commit 1166f85. Summary will update on new commits.

Review in cubic

What:
- `latest` reserved on every git commit input: `--commit-id` (application
  deploy/redeploy, lifecycle deploy, cronjob deploy, terraform
  plan/plan_and_apply/force_unlock/migrate_state), `--chart_git_commit_id`
  (helm deploy), and `name:latest` in `environment deploy`
  --applications/--lifecycles/--cronjobs/--helms. CLI resolves newest commit of
  service branch, prints resolved SHA, deploys it.
- `application redeploy --commit-id` honored. Flag declared but ignored before,
  redeploy always reused deployed commit.
- `environment deploy --helms` fixed: passed helm name where helm id expected,
  so every call 404'd.

Why:
- Only explicit SHA before. Omitted flag redeploys already-deployed commit. No
  way to say "ship tip of branch", so CI resolved SHA itself: local checkout or
  hand-rolled API call.

Notes:
- Newest picked by `created_at`, not list position: API documents no order.
- Resolution runs before any deploy request. Multi-service command with one
  unresolvable service aborts with nothing queued. `DeployTerraforms` non-batch
  path split into resolve pass then execute pass for same reason.
- Image tags and chart versions never intercepted, `latest` stays verbatim.
- `latest` rejected on `--values_override_git_commit_id`: no API lists commits
  of values-override repo.
- `environment deploy` branches on source kind (`GetJobDocker`, `GetGitSource`),
  not on presence of a deployed commit, else never-deployed git service drops
  the version silently.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 13 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

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