Details
-
Type:
New Feature
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Won't Fix
-
Component/s: scm-sync-configuration-plugin
-
Labels:None
-
Similar Issues:
Description
The plugin should be able to synchronize the configuration in two directions. That means When changes are detected in the SCM, they should be applied to Hudson. In addition, there is the issue, that the config was changed in the file system, what should happen then?
config changed in SCM:
- when to detect?
- The plugin checks the scm periodically (configurable interval) or manually (button in "Manage Hudson")
- On Hudson start up
- When committing a new config
- What action when change detected (should be configurable)
- SCM always rules (update local config, trigger a reload of config). If a change requires a restart notify admin or display a message (automatically restart ??)
- local always rules -> Revert/update the scm
- notify admin or display a message in Hudson
config on disc changed:
- When to detect?
- NO periodic check required. Change would have needed to be manually loaded anyway (restart or load config).
- When reloading the config was triggered
- When Hudson starts up
- What action when change detected (should be configurable)
- SCM always rules (revert the local changes.
- local always rules (commit changes to SCM)
- newer copy rules (only one changed)
- newer copy rules (even if both changed)
- if scm & local changed - ask (email to admin or message in Hudson)
- always ask (email to admin or message in Hudson)
The nice-to-have bonus:
when both configs changed and asking whether to use local or scm config use
- local
- scm
- newest version (timestamp)
until the changes are confirmed.
If the local version changed and asking whether to accept the changes, use the scm config until the change is confirmed.
Attachments
Issue Links
- depends on
-
JENKINS-18129 Using credentials-plugin to authenticate against SCMs & getting rid of maven-scm-api
-
- Open
-
- is blocking
-
JENKINS-8204 scm-sync URL should be per job
-
- Closed
-
- is duplicated by
-
JENKINS-18207 scm-sync-configuration: Posibility to restore a configuration from a different repository location as the syncing location
-
- Closed
-
To begin, let's focus on "what is done" in the current version "0.0.3".
Once configured, SCM Sync configuration plugin will :
(A) Checkout files in the HUDSON_HOME/scm-sync-configuration/checkoutConfiguration folder.
(B) Then, to initialize the SCM repository, every sync'ed files will be copied from HUDSON_HOME/ hierarchy to HUDSON_HOME/scm-sync-configuration/checkoutConfiguration/ (we'll call it Hudson_SSC in the next occurences of this comment) and, if necessary (files doesn't exist / are different between HUDSON_HOME and Hudson_SSC), will be commited to the SCM.
Hence, here is my point of view for the 2 way synchronization.
I don't like the SCM => Hudson sync would be made "automatically".
Except for a "mirroring" Hudson instance, I think the SCM => Hudson should be made by hand, via the Hudson UI.
I was thinking it this way :
(1) Sync'ed : file in HUDSON_HOME/ and Hudson_SSC/ are the same. File in Hudson_SSC is up to date (last revision) => Administrator won't be able to do anything
(2) Not SCM up to date : file in HUDSON_HOME/ and Hudson_SSC/ are the same. But File in Hudson_SSC is not the last revision => Administrator will have a button allowing to "update configuration" (svn update will be performed, updated file will copied in HUDSON_HOME)
(3) Created on SCM : here, we must check if this created file on SCM doesn't exist on Hudson. If it doesn't exist on Hudson, allow to retrieve file from SCM and populate HUDSON_HOME with it. If file were already existing in Hudson, we should prompt the user if he prefers to overwrite SCM or Hudson file
(4) Deleted on SCM : we must see if this file exist on Hudson. If this is the case, we should allow the user to "delete the file on Hudson too". If file doesn't exist on Hudson, just ask the user to update Hudson_SSC.
So, it was the simpler part ... Now the harder one : files in HUDSON_HOME & Hudson_SSC differ.
(5) Synchronization not up to date : file in HUDSON_HOME differs from HUDSON_SSC, and HUDSON_SSC is svn up to date. This points a synchronization problem in the past (config file edited without being commited on SCM). We should prompt the user either to commit the change on the SCM, or retrieve the SCM file.
(6) Time failure : both file in HUDSON_HOME & Hudson_SSC differ AND file Hudson_SSC is not SCM up to date => we should prompt the user for a "update configuration without applying it in Hudson". Then SCM file will be up to date and we'll be either in configuration (1) or (5). This step could be done automatically (it will only alter Hudson_SSC and not HUDSON_HOME)
I hope I covered every possible cases..
To sum up, from a UI point of view, user will only have, for each file, following buttons :
Each time we'll have a difference, I planned to provide some nice UI comparison tool based on prettydiff (http://prettydiff.com/ – javascript based diff tool
We'll have to wonder about some things :