How to receive build configuration removed notification

I've a plugin the was originally developed against version 4.5 and used the buildTypeUnregistered method on BuildServerAdapter to remove any references to the build configuration from the plugin's configuration.

This worked well with 4.5 but after upgrading to 7.1 I've discovered that this method gets called when the server reloads it's main configuration, this results in my plugin's configuration being deleted incorrectly.

I tried using the buildTypeDeleted method but this method didn't get called when a build config was removed and looking at the javadoc suggests its related to cleanup.

There is the method serverConfigurationReloaded to indicate when the configuration has been reloaded but there is no method to indicate the start, so how can I handle build configuration removals?

Rod

2 comments
Comment actions Permalink

Hi Rod,

Could you pleae detail how do you want to process build configuratino removal?
Depending on the logic, it might be more appropriately to plugin into cleanup process which is processed at cleanup time in 24 hours after the actual deletion, which is buildTypeDeleted.
That might be better as a user may choose to restore the build configuration after accidential deletion.

0
Comment actions Permalink

Hi Yegor,

I was looking for the behaviour I had with version 4.5 where I just removed a build type id reference the my plugin maintained. But from what you're saying the buildTypeDeleted method will get called during cleanup for any deleted build within 24 hours of it being removed, I guess my plugin then needs to be aware that some build type ids may no longer exist and handle that case, I think this is an approach I will try.

I hadn't considered the build configuration being restored, I actually didn't know that could be done.

Rod

0

Please sign in to leave a comment.