jenkinsci / stashnotifier-plugin

A Jenkins Plugin to notify Atlassian Stash|Bitbucket of build results
https://plugins.jenkins.io/stashNotifier/
Other
163 stars 136 forks source link

Options to handle exception when notifying bitbucket #274

Open muchnik opened 2 years ago

muchnik commented 2 years ago

So we are heading with some network problems, that results in SocketException on notifying bitbucket and we can't really do anything about it, because notifyBitbucket() method always returns true and catches exception by itself.

What i suggest is to:

  1. Implement retries on notify for retryable errors
  2. Propagate actual job status (true or false) from method call, so clients can make retries themselves.
  3. Add option that enables exception propagation to client side
14:35:47 Notifying Stash at "<...>"
14:35:51 Caught exception while notifying Stash with id <...>
14:35:51 java.net.SocketException: Connection reset
muchnik commented 2 years ago

@scaytrase @gruetter Friedly reminder

scaytrase commented 2 years ago

hello @muchnik, sorry for no response. currently this plugin is not actively developed, but contributions are always welcome. Most of latest releases are pure community contributed.

Can you explain what you expect in (2) ? try..catch clause for Jenkins file pipeline?

muchnik commented 2 years ago

@scaytrase I have 3 suggestions to fix this problem: first is to make retries on plugin side for retriable exceptions, second is to return actual job status from notifyBitbucket() which is now always returns true -- this can break back compatibility, third is to add flag to configuration that allows exception propagation onto client side, so we can use try...catch in Jenkinsfile.

We can choose any -- and i`ll try to make a PR.

pav-alekseev commented 2 years ago

Hello @muchnik and @scaytrase. Is there any progress with that?