Skip to content

Conversation

michalvavrik
Copy link
Contributor

closes: #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

How I tested that the feature opens GitHub PR:

  1. used GH CLI to authentication and get token
  2. set GITHUB_TOKEN
  3. created directory with git repository that cloned https://github.com/michalvavrik/camel-k-gitops-pr-creation-test
  4. run the promote command (frankly I tweaked test to create the command for me and used the test to run it)
  5. result:

Release Note

NONE

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
@michalvavrik
Copy link
Contributor Author

\cc @squakez

@squakez
Copy link
Contributor

squakez commented Sep 17, 2025

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?

Copy link
Contributor

✔️ Unit test coverage report - coverage increased from 51.1% to 51.3% (+0.2%)

@michalvavrik
Copy link
Contributor Author

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?

2.9 is fine. Thanks

Copy link
Contributor

@squakez squakez left a 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.

@michalvavrik
Copy link
Contributor Author

I'll implement what you instead of this promote --push-gitops-dir. I can see that the issue description says the operator creates a PR with something like a base overlay.

@michalvavrik michalvavrik marked this pull request as draft September 17, 2025 14:37
@squakez
Copy link
Contributor

squakez commented Sep 17, 2025

I'll implement what you instead of this promote --push-gitops-dir. I can see that the issue description says the operator creates a PR with something like a base overlay.

Thanks. Feel free to ask if you have any doubt or you hit some blocker.

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.

Integration git, create a PR with integration yaml result after build
2 participants