Closed proski closed 3 years ago
@proski You can configure this. :) Although I disagree with the option, removing a plugin should remind you that you have unused config. Perhaps setup a docker test instance for maintaining a working copy before applying changes?
Good to know. Then the issue is about poor defaults. I don't see a reasonable justification for the current default behavior.
I see no reason to change the default behavior. User is free to change them at anytime. You ought to have a test instance or a dev setup where you can apply changes before breaking the production setup. It is good practice to know the necessary steps ahead of time.
The way we use JCASC may be different but again JCASC is an opinionated way of how to run your Jenkins instance.
WDYT @oleg-nenashev @timja
It's hard to argue against the "opinionated", of course.
There are different use cases. In my case, Jenkins is used by a very small team (one developer and three observers who don't write code and don't touch Jenkins configuration), and the downtime is permissible. Having an extra server would add extra work for that small team for very little benefit.
It's a common situation that a plugin is updated and the new version cannot read some of the data created by the old version. Jenkins doesn't stop loading because of that.
It's a similar situation here. A plugin is removed. It could also be a plugin upgrade that changes one of the Jenkins-wide settings. I would expect a similar behavior. Instead, I'm left with a server that cannot even be rebooted over the web interface.
Also, the configuration-as-code
section doesn't appear in the downloaded configuration. It's hard to discover. I would have changed the default for my Jenkins server if I as aware of the settings.
No one said an extra server, spin your Jenkins instance into a container :)
I have an experimental Jenkins install in a container, but I don't want to do everything twice, especially routine plugin updates and cleanups. Anyway, we digress. My point is that Jenkins failing to load because an unused plugin has been removed is:
I support keeping the current default behavior as-is. System configuration may contain mission-critical bits, e.g. security settings. Skipping such settings may lead to instances not working as expected.
There is no way to distinguish critical and non-critical settings at the moment. XStream has such engine for serialization, but I doubt it can be reused in JCasC.
What we could do is improving developer tools so that users can verify configs before applying them
Also, it would be nice to make JCasC own settings discoverable. They are not part of the downloaded configuration even if they are set to non-default values.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Your checklist for this issue
Description
After I removed a plugin (Stash Pull Request Builder) and restarted Jenkins, the top level Jenkins URL showed a page with a stack trace:
I could upload the config without "stashBuildTrigger", but I had to log in to the Jenkins system to restart it. The URL with "/safeRestart" would just show the same stack trace.
I believe it would be much better if the Configuration ad Code Plugin would just record the issue and continue. There are other ways to alert the user of obsolete parts of the configuration. It's possible to log an error and show it in the administrative monitor.
The issue is not new, I hit it a few times in the past.
Removing plugins should not be a minefield. Jenkins itself is much more gracious when some code is missing to handle the a configuration file.