-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add specific pr and branch templates for slack #125
base: master
Are you sure you want to change the base?
Conversation
if pull_request? | ||
PULL_REQUEST_MESSAGE_TEMPLATE | ||
def notification_template | ||
if template_from_config(:template) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
The precedence of the various templates seems a little strange. I would expect the preference of more specific ones (pull_request_template
and branch_build_template
) to the general one (template
), but the current logic is the reverse.
Furthermore, while I neglected this PR, we added a couple of new event types (cron, api) that are on par with push and PR. It stands to reason that we support templates for these, too.
Hi @sahilda Sorry for the long wait for any reply from us. This looks pretty interesting. @BanzaiMan could you give this a code review? |
Add specific pr and branch templates for slack
lib/travis/addons/slack/task.rb
Outdated
else | ||
BRANCH_BUILD_MESSAGE_TEMPLATE | ||
Array(template_from_config(:branch_template) || BRANCH_BUILD_MESSAGE_TEMPLATE) |
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.
branch_template
seems to betray the meaning of the configuration. Perhaps branch_build_template
.
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.
Good call - variable updated.
Addresses: travis-ci/travis-ci#5871