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

Plugin does not play nicely with post-build actions inherited from another job #125

Closed
ntamas opened this issue Aug 28, 2015 · 9 comments
Closed

Comments

@ntamas
Copy link

ntamas commented Aug 28, 2015

The development version of the plugin does not seem to work correctly when its post-build action is added to a "job template" (i.e. another job) and the actual job just inherits the post-build actions by a "Use publishers from another job" post-build action. I'm pretty sure that it's not a configuration issue because the plugin works fine if the post-build action is explicitly added to the end of the job.

Jenkins 1.624, Slack plugin 2.0-SNAPSHOT

For what it's worth, the HipChat plugin (from which the Slack plugin was forked) works fine in this setup as well, so it may be worth seeing where the two plugins differ. For instance, the publish method in SlackNotifier seems different (although I'm no Jenkins developer so it's just a stab in the dark).

@Brantone
Copy link
Contributor

I'm maintainer on template-project (https://github.com/jenkinsci/template-project-plugin) I thought there was a ticket lying around somewhere that mentioned this, but can't find it :(
Originally with release versions of both, the reason it wouldn't work is because the template-project doesn't pull in main job configs, just solely the post-build info ... With Slack's move to doing everything in post-build I'd hoped this would get solved, but haven't had time to test Slack's snapshot in conjunction template-project yet. Will keep an eye on this.

@ntamas
Copy link
Author

ntamas commented Aug 28, 2015

Yes, I'm using the snapshot version - actually, the very reason I updated the plugin to the snapshot version is because I needed all the configuration stuff to be present in the post-build step so I could use it with job templates.

@samrocketman
Copy link
Member

@ntamas by using the snapshot version of the plugin are you able to make use of this plugin with job templates?

@ntamas
Copy link
Author

ntamas commented Oct 27, 2015

No - I have just tested the snapshot version (based on 53b9a1a), but the symptoms are the same: the plugin works if I add the post-build action explicitly to the end of the job but it does not work if the post-build action is "inherited" by a "Use publishers from another job" post-build action. The template project plugin is also updated to the latest stable version.

@samrocketman
Copy link
Member

I welcome contributions to fix this issue. I don't actively develop this plugin. I only maintain pull requests and releases.

@razitz
Copy link

razitz commented May 3, 2016

+1

Jenkins 2.1, Slack plugin 2.0.1

@andrewbonney
Copy link
Contributor

I've added what I hope is a fix for this in #361. Feedback appreciated.

@adamerstelle
Copy link

Really wanting this to be available, when is 2.4 going to be released?

kmadel pushed a commit that referenced this issue Oct 7, 2018
…#361)

* Fix pre-build notifications for projects using nested publishers

* Fix post-build notifications for projects using nested publishers
@timja
Copy link
Member

timja commented Dec 15, 2018

Fixed in #361

@timja timja closed this as completed Dec 15, 2018
KreAch3R added a commit to KreAch3R/slack-plugin that referenced this issue Dec 24, 2018
Without this, Notifier#perform runs the Slack message publish code too early,
resulting in messages like this:
```
test - jenkinsci#68 Success after 6.9 sec and counting (Open)
```
`isBuilding()` should be true in this instance.

Instead, always run the plugin with `runAfterFinalised=true.`
This restores the older behavior, (before jenkinsci#361, jenkinsci#125) where SlackListener run
the publish code after `isBuilding()` was false and the end message was:
```
test - jenkinsci#80 Success after 6 sec (Open)
```
timja pushed a commit that referenced this issue Jan 3, 2019
Without this, Notifier#perform runs the Slack message publish code too early,
resulting in messages like this:
```
test - #68 Success after 6.9 sec and counting (Open)
```
`isBuilding()` should be true in this instance.

Instead, always run the plugin with `runAfterFinalised=true.`
This restores the older behavior, (before #361, #125) where SlackListener run
the publish code after `isBuilding()` was false and the end message was:
```
test - #80 Success after 6 sec (Open)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants