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

A new "allowBranches" regular expression to work with "NewestFromBranch" with git warehouse subscriptions #2907

Closed
3 tasks done
kennethleider opened this issue Nov 7, 2024 · 5 comments

Comments

@kennethleider
Copy link

Checklist

  • I've searched the issue queue to verify this is not a duplicate feature request.
  • I've pasted the output of kargo version, if applicable.
    • v1.0.3
  • I've pasted logs, if applicable.

Proposed Feature

I would like the "NewestFromBranch" commitSelectionStrategy to monitor more than just one branch

Motivation

We develop in feature branches, and I would like to be able to subscribe to freight in any active feature branch. Since we follow a naming convention for the branch, it would be fairly simple to detect changes in just these branches

Suggested Implementation

You could either modify "allowTags" to also evaluate against branch names when the commitSelectionStrategy is "NewestFromBranch", or add a new "allowBranches" that works the same way.

@kennethleider kennethleider changed the title A new "allowBranches" regular expression to work with "NewestFromBranch" win git warehouse subscriptions A new "allowBranches" regular expression to work with "NewestFromBranch" with git warehouse subscriptions Nov 7, 2024
@krancour
Copy link
Member

krancour commented Nov 7, 2024

Thank you for the suggestion @kennethleider.

Can you elaborate on how you see this working?

For image repos, the various selection strategies select A (singular) image version. For git repos, they select A (singular) commit.

Selecting one newest commit from n > 1 branches seems like it wouldn't be that useful. "Grab the latest commit from among these n branches?" It's a little bit of a crap-shoot as to what you're going to get...

So, reading between the lines, I can surmise that what you actually want is for n branches, you want to select up to n newest commits (not just one; i.e. newest previously undetected commit from each). Have I got that right?

This would amount to a much bigger change than just a few tweaks to a selection strategy.

As I'm having a difficult time imagining how a Freightline with manifests from many branches wouldn't promote some confusion that harms the overall UX, some more detail on how you would foresee yourself actually using this feature end-to-end would help a great deal.

@kennethleider
Copy link
Author

one newest commit from n > 1 branches

Nope this is exactly what I want. I think you are imaging that I have multiple active branches. It is more like I have a branch for each release of the product. Issues in the release are merged into the branch, at which point I want to be able to promote them. Once the release is done, it is merged back into main, and a new release branch is created the next time work needs to be done on the application.

It would not be a big deal to update the warehouse to have the name of the branch when ever we start a new release, but I would prefer that it just pick up any branch that matches a branch name pattern.

@Brightside56
Copy link
Contributor

I was planning to use commits from more than one branch in order to allow engineers to test changes from feature branches on certain stages

@krancour
Copy link
Member

krancour commented Nov 7, 2024

@kennethleider your explanation was very enlightening. Thank you!

I worry a little that selecting the newest commit from among multiple branches could lead to some surprises if something is pushed to a branch that matches the pattern but isn't the one you currently regard as the "active" branch.

It would not be a big deal to update the warehouse to have the name of the branch when ever we start a new release

For now, this would be my suggestion until/unless we are able to figure out the mechanics here that would make something like this work nicely while still safeguarding against the surprises/confusion I am concerned about.

Copy link

github-actions bot commented Feb 6, 2025

This issue has been automatically marked as stale because it had no activity for 90 days. It will be closed if no activity occurs in the next 30 days but can be reopened if it becomes relevant again.

@github-actions github-actions bot added the stale label Feb 6, 2025
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 10, 2025
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

3 participants