Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Warehouse): Subscribe to Git tags #2955

Closed
asolanki-mgni opened this issue Nov 18, 2024 · 1 comment
Closed

feat(Warehouse): Subscribe to Git tags #2955

asolanki-mgni opened this issue Nov 18, 2024 · 1 comment

Comments

@asolanki-mgni
Copy link

Proposed Feature

I would like to have the ability to have a Warehouse subscribe to git tags within a repo. When a new git tag is created I would like Kargo to create a freight so I can progress the freight to the different stages.

A promotionMechanism should also be created so I can update a values file with the newly created tag.

Motivation

We currently follow the apps of apps pattern in ArgoCD. We have helm--parent which sources multiple child apps. In the child apps, the devs can make the needed code changes (helm or image) and when changes are ready they will commit, merge and finally tag.

In the helm--parent repo, we manage the clusters that the child apps are deployed to with their specific version tags in different values files.

I would like to subscribe to a repo's git tags and when a new tag is created be able to have a promotionMechanism to update a values file with the new tag value.

Suggested Implementation

Warehouse:

apiVersion: kargo.akuity.io/v1alpha1
kind: Warehouse
metadata:
  name: git-tag-warehouse
spec:
  subscriptions:
  - git:
      repoURL: <git repo url>
      tag: <git tag regex>

Stage:

apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
...
spec:
...
  promotionMechanisms:
    gitTagUpdates:
    - repoURL: <git repo url>
      writeBranch: <branch name>
      readBranch: <branch name>
      value: <tag value name>
      valuesFilePath: <values file path>
@krancour
Copy link
Member

I would like to have the ability to have a Warehouse subscribe to git tags within a repo.

These features already exist.

You can set commitSelectionStrategy to Lexical, NewestTag, or SemVer. (The default is NewestFromBranch.)

It is a recently discovered oversight that for any fields constrained to specific enumerated values, the possible values are not surfacing in these generated docs:

https://doc.crds.dev/github.com/akuity/kargo/kargo.akuity.io/Warehouse/[email protected]#spec-subscriptions-git-commitSelectionStrategy

These is an issue already open to fix the same problem for imageSelectionStrategy.

#2880

I will expand that issue to include this.

A promotionMechanism should also be created so I can update a values file with the newly created tag.

fwiw, "promotion mechanisms" are legacy and were removed in 1.0.0.

1.0.0+ rely on promotion templates instead, which are enumerated, more finely-grained steps, so they allow more flexibility.

One of the steps added in 1.1 (to be released this week or next) is a generic YAML update. "Edge docs" here:

https://main.docs.kargo.io/references/promotion-steps#yaml-update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants