Add specific pr and branch templates for slack#125
Add specific pr and branch templates for slack#125sahilda wants to merge 2 commits intotravis-ci:masterfrom sahilda:fix/slack_templates
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.
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
| Array(template_from_config(:pr_template) || PULL_REQUEST_MESSAGE_TEMPLATE) | ||
| else | ||
| BRANCH_BUILD_MESSAGE_TEMPLATE | ||
| Array(template_from_config(:branch_template) || BRANCH_BUILD_MESSAGE_TEMPLATE) |
There was a problem hiding this comment.
branch_template seems to betray the meaning of the configuration. Perhaps branch_build_template.
Addresses: travis-ci/travis-ci#5871