netguru / bitrise-step-slack

A next-gen Slack webhook step for Bitrise
https://netguru.co/opensource
MIT License
3 stars 0 forks source link

Step fails when using is always run and run if #10

Open mleatherb opened 8 years ago

mleatherb commented 8 years ago

today I tried using the is_always_run: true and run_if: IsBuildFailed and the step fails to run with the following error.

WARN[11:55:23] Step (slack) failed, but was marked as skippable

akashivskyy commented 8 years ago

Are you sure both webhook_url and channel inputs are passed? Do you see any Ruby error logs?

mleatherb commented 8 years ago

Yes, both are passed

I also modified a working step in one of my workflows with your step and get the same results

akashivskyy commented 8 years ago

Can you share the part of your bitrise.yml where you reference bitrise-step-slack?

brianjd commented 8 years ago

@akashivskyy I experienced the same, my config looked like this:

The config:

steps:
  - git::https://github.com/netguru/bitrise-step-slack.git@master:
      is_always_run: true
      title: slack
      inputs:
        - webhook_url: https://my.webhook.url/
        - channel: "#general"

The output at the end is the same as @mleatherb, but here are the details from execution:

Cloning into '/tmp/bitrise7511237610/step_src'...
+------------------------------------------------------------------------------+
| (5) git::https://github.com/netguru/bitrise-step-slack.git@master            |
+------------------------------------------------------------------------------+
| id: https://github.com/netguru/bitrise-step-slack.git                        |
| version: master                                                              |
| collection: git                                                              |
| toolkit: bash                                                                |
| time: 2016-09-25T21:14:27Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
bundler: failed to load command: ./bin/slack-step (./bin/slack-step)
NoMethodError: undefined method `request_uri' for #<URI::Generic >
Did you mean?  require
  /usr/local/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier/default_http_client.rb:27:in `request_obj'
  /usr/local/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier/default_http_client.rb:21:in `call'
  /usr/local/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier/default_http_client.rb:8:in `post'
  /usr/local/lib/ruby/gems/2.3.0/gems/slack-notifier-1.5.1/lib/slack-notifier.rb:41:in `ping'
  /tmp/bitrise7511237610/step_src/lib/slack-step/client.rb:16:in `send'
  /tmp/bitrise7511237610/step_src/lib/slack-step/application.rb:16:in `run'
  /tmp/bitrise7511237610/step_src/bin/slack-step:10:in `<top (required)>'
|                                                                              |
+----+--------------------------------------------------------------+----------+
| ⚠️  | git::https://github.com/netguru/bitrise-ste... (exit code: 1)| 4.7 sec  |
+----+--------------------------------------------------------------+----------+
| Issue tracker: Not provided                                                  |
| Source: Not provided                                                         |
+----+--------------------------------------------------------------+----------+

Removing is_always_run resolves it, but you will not catch failed builds?

akashivskyy commented 8 years ago

This is very strange behavior and seems to be related with Bitrise CLI, not with the step itself. I'll talk with Bitrise folks on their Slack and see what we come up with.

Removing is_always_run resolves it, but you will not catch failed builds?

Yes it will, because this step has is_always_run: true set by default.