-
Notifications
You must be signed in to change notification settings - Fork 18
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: use customizable message templates for PR comments #175
Conversation
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.
Thanks, great idea 👍
Could you please also update the docs? (https://github.com/baloise/gitopscli/blob/master/docs/includes/preview-configuration.md)
gitopscli/gitops_config.py
Outdated
@@ -358,6 +407,18 @@ def __parse_v2(self) -> GitOpsConfig: | |||
return GitOpsConfig( | |||
api_version=2, | |||
application_name=self.__get_string_value("applicationName"), | |||
messages_created_template=self.__get_string_value_or_default( | |||
"messages.created", |
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.
Maybe previewConfig.messages.created
would be a better place in the yaml structure? https://baloise.github.io/gitopscli/commands/create-pr-preview/#gitopsconfigyaml
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.
For me the previewConfig.*
path looked more like technical configuration of the preview environment whereas the messages are rather general information for the GitOps Bot, thus I thought a different path would be suitable
However I do not have a strong opinion on this, we can also move to previewConfig
if this suits better
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.
If it's in a general section it should at least have a more specific name like messages.prPreviewCreated
.
@niiku Any opinion on this?
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.
For me, the general section would make sene - as it is not related to a specific preview. Even though the message content at the end is.
I like the approach from @christiansiegel with a structure for messages and descriptive props, example:
- messages.previewEnvUpdated
- messages.previewEnvAlreadyUpToDate
- messages.previewEnvCreated
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.
I updated documentation and configuration path according to your suggestions.
(BTW: I see you're working @baloise. You can become a member of the github organization by adding your handle to the org repo 😉 Example: baloise/org#43) |
FYI: The build currently fails due to a general issue. Will be fixed with #176 |
d65aedf
to
93b51d8
Compare
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.
looks good to me ✔️
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.
lgtm. Thank you very much for your contribution!
🎉 This PR is included in version 5.2.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Allows one to define custom message templates in the .gitops.config.yml which are used for the PR comments
If no templates are specified, default messages are used
Example .gitops.config.yml