flavorjones / irc-notification-resource

Concourse CI resource for sending notifications to IRC.
Other
4 stars 2 forks source link

Not sending message to IRC channel #5

Open OvermindDL1 opened 5 years ago

OvermindDL1 commented 5 years ago

It's looking like it's not sending a message, after some checking it looks like it never even attempts to join a channel, and a channel won't accept a message from an unjoined (and sometimes even an unregistered) user. Looking into the irc library used by this repo shows that it never even attempts to join at all, so... unsure how this is supposed to work? Any help as I'm unable to find an option to change this, or even pre-existing code in the docker image to do so?

flavorjones commented 5 years ago

@OvermindDL1 sorry for my slow response; I didn't have notifications turned on and just saw your question now.

You're correct that this resource doesn't join the channel; as documented in the README it uses PRIVMSG which doesn't require joining so long as your channel allows messages of that kind. You may need to set your channel options to allow this behavior.

You should be able to test this against #random in Freenode which allows PRIVMSG last I checked (see the integration_test.sh script in this repository).

Does that help?

flavorjones commented 5 years ago

Also see https://github.com/flavorjones/irc-notification-resource/pull/4 which is a PR to add "join before sending" behavior. This may be what you need for your particular situation.

OvermindDL1 commented 5 years ago

Both Freenode and Esper recently have been heavily encouraged channels not to enable that option because of recent spam attacks, so #4 is what I would need on Esper. :-)

This is closed but I'm not seeing #4 merged yet if that will fix it? At this stage I'm not needing this further though as I wrote a replacement instead, but #4 is definitely needed for others to be able to use it.

flavorjones commented 5 years ago

Try the latest on DockerHub and let me know how it goes! Check out the README for guidance on joining the channel (which is not default behavior).

OvermindDL1 commented 5 years ago

Cool, I'll toss it into one of my notification pipelines as a test! :-)

OvermindDL1 commented 5 years ago

Still unsure how to get it working, it did complain about the password being blank (esper and other such IRC networks have no server password), I then tried logging into a server that 'does' require a password and it's user never successfully joined (yet it still prints out the resultant json like it succeeded even though no errors were printed on stdout, same as on esper, freenode, and gamesurge). Tried 4 networks so far, 1 requires a password, it's not working on any. If the user and password are to be used for nickserv/authserv/sasl then how does the irc client know which to access to give the information? How do you login to a server that requires a password to access?

OvermindDL1 commented 5 years ago

For note, it's metadata on output:

host: irc.esper.net:6697
channel: #overtest
user: overtest
usetls: true
join: true
message: This is a test of the notification broadcast system, this is only a test
dry_run: false

And there are no errors being displayed in the output.

flavorjones commented 5 years ago

Hi, thanks for persisting. I'll reopen this ticket.

Since this is working for me on freenode and I can't reproduce this issue without asking you to share credentials, I think the best next step is for me to add some debugging output to the resource so we have more information. I'll try to do that tonight.

OvermindDL1 commented 5 years ago

Since this is working for me on freenode and I can't reproduce this issue without asking you to share credentials, I think the best next step is for me to add some debugging output to the resource so we have more information. I'll try to do that tonight.

Ping me when ready and I'll give it a try. It definitely should error out if it's unable to send the message though, transparently failing without a successful notification means that the people viewing the pipeline would never know a failure happened, and if the pipeline author really wants to ignore the failure then Concourse has a config for that. :-)

OvermindDL1 commented 5 years ago

Perhaps a debug: true option (is what I usually do in my resources) to print out all information about what happens would be useful for debugging as well.

flavorjones commented 5 years ago

Yup, that sounds like a great idea and is what I'll do.

flavorjones commented 5 years ago

@OvermindDL1 v1.2.0 has shipped with debug option (be careful with it, it will log your IRC password). Hopefully it helps?