Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

An improvement to BuildListener #4562 ·

BuildListener is already very good with the current functions. But I want to add a few other things.

void buildFinished();
void buildRecommended();
void buildUnRecommended();


void buildFinished();
void buildRecommended();
void buildUnRecommended();
boolean recommendBuild();
boolean unRecommendBuild();

There are several things that need to be done at the same time when a build is recommended and unrecommended. i am using "void buildRecommended();" for that. However, it always returns void and when an error occurs, the build status is still changed to recommended while in fact the related tasks have failed.
@robinshen Can this be applied?

  • replies 5
  • views 341
  • stars 0
robinshen ADMIN ·

You may throw exception when there is something wrong and want to prevent build from being recommended/unrecommented. ·

Hello@robinshen ,
I threw an exception but it didn't prevent the build from being changed to recommended.
Please check

try {
	for (BuildListener listener: PluginManager.instance.getExtensions(BuildListener.class))
} finally {

Is it possible to add a catch block to revert build status when an exception occurs?

} catch (Exception e) {

How do you think?

robinshen ADMIN ·

Are you recommending via restful api. I just add a plugin contributing a BuildListener extension point throwing exception in buildRecommended method, and the restful api call will not change build status from successful to recommended, which is the expected behavior.

BTW: I am testing with QB14 ·

"the restful api call will not change build status from successful to recommended"
It doesn't work the same with buttons. Can you make the buttons work like this too?

robinshen ADMIN ·

I see. This will be addressed in next patch release.