Issue
Configuration as Code (CasC) bundle validation logs are stored on disk (JENKINS_HOME/cb-casc-bundles-store-log
) and are used to display the history of different versions along with the validations performed on them.
Prior to branch support (CloudBees CasC Server plugin versions before 2.0) this data was organized by bundle name, with one folder per bundle. Inside this folder there are additional folders, one per version of the bundle.
With CloudBees CasC Server plugin version 2.0, the organization of this folder has changed with the introduction of branch support.
The folder is now organized by <branchOrTag>/<bundle name>
, and the migrated bundles will only have one entry in their version history.
Customers wanting to preserve the local version history from before the migration will need to manually copy the old history to the corresponding new location.
Resolution
To manually migrate bundle update logs, perform the following commands on the instance where your Operations Center is running:
-
Change to the bundle version log storage directory:
cd "${JENKINS_HOME}"/cb-casc-bundles-store-log
-
Identify the bundles whose history you want to preserve. Non-migrated bundle logs can be identified by executing the following command:
du -d3 -h
This will produce output similar to the following: (line breaks and comments added for clarity):
>$ du -d3 -h | sort 116K ./development 28K ./development/bundle-1 24K ./development/bundle-1/20230324_00001 28K ./development/bundle-2 24K ./development/bundle-2/20230324_00001 28K ./development/bundle-3 24K ./development/bundle-3/20230324_00001 28K ./development/bundle-4 24K ./development/bundle-4/20230324_00001 32K ./local-bundles 28K ./local-bundles/local-folder-bundle 24K ./local-bundles/local-folder-bundle/20230324_00001 32K ./main 28K ./main/remote-gh-bundle 24K ./main/remote-gh-bundle/20230324_00001 # ## not-migrated (hint the only ones that list “raw” folders) # 124K ./local-folder-bundle 24K ./local-folder-bundle/20230324_00001 8.0K ./local-folder-bundle/20230324_00001/raw 24K ./local-folder-bundle/20230324_00002 8.0K ./local-folder-bundle/20230324_00002/raw 24K ./local-folder-bundle/20230324_00003 8.0K ./local-folder-bundle/20230324_00003/raw 24K ./local-folder-bundle/20230324_00004 8.0K ./local-folder-bundle/20230324_00004/raw 24K ./local-folder-bundle/20230324_00005 8.0K ./local-folder-bundle/20230324_00005/raw 76K ./remote-gh-bundle 24K ./remote-gh-bundle/20230324_00001 8.0K ./remote-gh-bundle/20230324_00001/raw 24K ./remote-gh-bundle/20230324_00002 8.0K ./remote-gh-bundle/20230324_00002/raw 24K ./remote-gh-bundle/20230324_00003 8.0K ./remote-gh-bundle/20230324_00003/raw
The folders containing the non-migrated logs can be identified easily as they will be the ones showing a “raw” folder when using the “du -d3 -h” command (for example, ./local-folder-bundle/20230324_00001/raw).
-
Identify the new folder where the bundle update logs will need to be moved. For remote bundles, the parent folder is typically the default branch specified in the global CasC configuration. For bundles in a local bundle store, the parent folder is the name given to the CasC remote in the global CasC configuration. In the example below, the corresponding new location would be ./main/
-
Copy the bundle update logs to the new location:
cp -R remote-gh-bundle main
-
Remove the old update logs (optional):
rm -rf remote-gh-bundle
-
Verify that the logs are now visible in the UI
Repeat steps 3-6 for each bundle for which you want to migrate the history.
Tested product/plugin versions
-
CloudBees CI on modern cloud platforms - managed controller version 2.387.2.3
-
CloudBees CasC Server plugin version 2.0