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

Slack notifications not passing on commit details #97

Open
imclean557 opened this issue Nov 8, 2016 · 5 comments
Open

Slack notifications not passing on commit details #97

imclean557 opened this issue Nov 8, 2016 · 5 comments

Comments

@imclean557
Copy link

imclean557 commented Nov 8, 2016

Using the example slack_notifications.php, the commit ID and message weren't being passed on to Slack. It looks like $fields array wasn't merged properly. To resolve, I changed the following from line 78:

    $fields += array(
      array(
        'title' => 'Commit',
        'value' => rtrim($hash),
        'short' => 'true'
      ),
      array(
        'title' => 'Commit Message',
        'value' => $message,
        'short' => 'false'
      )
    );

To this:

    $fields[] = array(
      'title' => 'Commit',
      'value' => rtrim($hash),
      'short' => 'true'
    );
    $fields[] = array(
      'title' => 'Commit Message',
      'value' => $message,
      'short' => 'false'     
    );

Possibly the numeric keys generated by PHP for the second array start at 0 so are ignored when using +=.

@ccharlton
Copy link
Collaborator

Confirmed. After making this change, I now see commit messages in my Slack quicksilver notifications.

@jordan8037310
Copy link
Contributor

Pull request with a fix for this wrapped into #101

@imclean557
Copy link
Author

This is still an issue and one I'd regard as fairly major. It prevents both the commit ID and message from ever being displayed in Slack. Could this be separated from the more complicated #101 which appears to have stalled?

@jordan8037310
Copy link
Contributor

Looks like my PR now has conflicts. Unfortunately I don't have time to resolve those directly so perhaps a new PR can be opened to solve this specific issue.

@imclean557
Copy link
Author

There were a number of other changes I wanted to make for our usage so I created a new repository. https://github.com/imclean557/slack-pantheon

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

No branches or pull requests

3 participants