-
Notifications
You must be signed in to change notification settings - Fork 361
feat(cmd): kamel promote --push-gitops-dir #6290
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
base: main
Are you sure you want to change the base?
feat(cmd): kamel promote --push-gitops-dir #6290
Conversation
closes: apache#6137 Changes: - introduce `--push-gitops-dir` flag which tells the promote command to commit the base overlay to the gitops export dir, push it to the origin remote and open new GitHub PR
\cc @squakez |
Nice. I will have a look ASAP. Yesterday I started the release 2.8.0 process, I thought this feature was going to take longer. Is it okey if we slip this one into 2.9? |
✔️ Unit test coverage report - coverage increased from 51.1% to 51.3% (+0.2%) |
2.9 is fine. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, thanks for taking the time to work on this. Having this feature on the CLI is surely useful but it will be quite limited to whichever is the workflow of the user. I think I missed to provide a bit more of design context around the potential feature.
Originally I was thinking to have the Git PR on the operator side, not on the CLI as an additional step after the Integration was built (and executed). In fact, this feature makes sense when the user is building directly from GIT, in order to provide the source repository where the operator would close the cycle after performing a build and a container push to the registry.
In summary the use case could be like this:
- User creates an Integration with a git repository (ie,
kamel run --git
). - The operator performs the build and push the container to the registry as it happens normally
- The operator creates a structure overlay reusing the same code we have in
kamel promote --export-gitops-dir
. It could save the files in some/cicd/
directory for example. - The operator add and commit such
cicd
folder and creates a PR towards the same git repository/branch.
I expect this workflow to decouple the build part (on the operator side) from the promoting part (which could be performed by some CICD tool instead). Imagine an argoCD pipeline listening on the given repository in the proper Integration folder. Once the user merge the PR, the pipeline will take care to release in the upper environment.
Hope it makes sense.
I'll implement what you instead of this |
Thanks. Feel free to ask if you have any doubt or you hit some blocker. |
closes: #6137
Changes:
--push-gitops-dir
flag which tells the promote command to commit the base overlay to the gitops export dir, push it to the origin remote and open new GitHub PRHow I tested that the feature opens GitHub PR:
GITHUB_TOKEN
git@github.com:michalvavrik/camel-k-gitops-pr-creation-test.git
I got:https://github.com/michalvavrik/camel-k-gitops-pr-creation-test.git
I got:Release Note