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: add ability to configure custom pull request title/commit message/etc... #2047

Closed
3 tasks done
akolacz opened this issue May 21, 2024 · 7 comments
Closed
3 tasks done

Comments

@akolacz
Copy link
Contributor

akolacz commented May 21, 2024

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.
  • I've pasted logs, if applicable.

Proposed Feature

I would like to configure the pull request title and commit message to respect the git conventional commit, and also have the possibility to set a custom pull request title.

What we currently have :

updated env/eph-test/app/values.yaml to use image europe-docker.pkg.dev/xxxxxxxx/registry-docker-europe/app:c07b9312deee51eb305abce7cbd52d02c6f50e20 #44

What we want :

chore(deps): update image with <new_version> for project: <project> on stage: <stage>

Motivation

Respect git conventional commit and have a cleaner pull request name.

Suggested Implementation

Maybe inside the pull request field into stages ressources we can add a field to specify the message for the stage, or maybe a global configuration for git conventional commit for whole Kargo.

We can help to code the feature if needed, just let us know how you think this should be implemented.

@krancour
Copy link
Member

Hi @akolacz. My first thought it that the level of customization you want seems to hint that some sort of expression language for defining the message format would be useful. Of course, defining one's own expression language is frequently a fool's errand...

What would you think about allowing the commit messages and/or PR titles to be defined using a string that is just a short Go text template and if it's defined, we make some well known things like .Project and .Stage available to it. (.Freight would be good, too, but that's probably an object containing structured data.)

wdyt?

@akolacz
Copy link
Contributor Author

akolacz commented May 22, 2024

Yes I agree with that, I think it's a good proposal.
How can I help you on this ?

@krancour
Copy link
Member

Let's try to agree on some rough requirements.

I'm going back and forth on whether this is best considered a system-level setting (e.g. configured globally when installing the Kargo chart) or whether it's something best managed at the Project or Stage level...

Probably the answer is that many orgs are going to have an org-wide PR/commit title format they want to use and equally likely that there are going to be cases where it needs to be set (or overridden) at a lower level to address the requirements of a specific team or application.

So let's approach this in phases maybe...

Why don't we start with allowing PR title to be configured at the system level in the chart, since this looks the easiest. This format string would have to carry through to an environment variable that becomes the value of a new field in the Promotions reconciler's config object.

You'd have to propagate this information down to a function called reconcilePullRequest and use it to set the title differently than it's set now. Currently it is set to the title of the last commit.

@akolacz
Copy link
Contributor Author

akolacz commented May 31, 2024

I agree, we can implement this at the system level to have an org-wide PR/commit title format.

I will have a look next week, I'll come back to you as soon as I have something.

Copy link

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 Nov 18, 2024
@Historyman
Copy link
Contributor

Historyman commented Nov 19, 2024

This would be very helpful to our use case as well, the helm-update-image message is pretty good but in our situation the file edited is deep in a folder structure and it would be nice to make it simpler

@github-actions github-actions bot removed the stale label Nov 20, 2024
@krancour
Copy link
Member

krancour commented Dec 9, 2024

Commit messages have been configurable since v0.9.0.

#3063 is tracking custom PR titles.

@krancour krancour closed this as completed Dec 9, 2024
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