-
Notifications
You must be signed in to change notification settings - Fork 742
Description
What feature do you want to see added?
Feature Request: Warn or Prevent Jenkins Restart When UI-Based Config Differs from CasC YAML
Describe the feature
We are using the Jenkins Configuration as Code (CasC) plugin to manage our Jenkins configuration via YAML files. Although the plugin allows exporting the current configuration, Jenkins still permits a restart even when configuration changes have been made directly through the UI and not yet synced back to the CasC YAML.
This behavior can result in accidental configuration loss, as Jenkins will reload only what's defined in the CasC file upon restart—discarding any UI-based updates.
Proposed enhancement
Introduce a mechanism in the CasC plugin to:
- Detect differences between the current live Jenkins configuration and the CasC YAML.
- Warn the user or block Jenkins restart if unsynced UI changes are detected.
- Optionally, display a diff or prompt users to export changes before proceeding.
Use case example
- A user modifies global configuration or credentials directly via the UI.
- Before exporting these changes back to YAML, Jenkins is restarted.
- The UI-based changes are lost because Jenkins reloads from the CasC-defined state.
Why this matters
- Helps prevent accidental loss of configuration.
- Encourages teams to maintain sync between UI changes and CasC YAML.
- Improves overall safety and predictability in hybrid CasC + UI usage workflows.
- Especially useful in environments where restarts are automated or frequent.
Additional context
Export functionality exists and works well, but there's currently no safeguard against restarts when unsynced changes are present. This feature would be a valuable enhancement for maintaining configuration integrity.
Upstream changes
No response