Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractFolder.reloadThis & .addLoadedChild #378

Merged
merged 1 commit into from Feb 26, 2024

Conversation

jglick
Copy link
Member

@jglick jglick commented Feb 21, 2024

In CloudBees CI running in high availability mode we need to synchronize various Items from disk. Handling simple items like Jobs is straightforward enough: when config.xml changes on disk, reload it. (jenkinsci/jenkins#8544 makes this cleaner and more explicit.) But folders are more complicated:

  • If an item inside the folder is updated, fine—just reload it. (Same as an item at top level.)
  • If an item inside the folder is removed, just delete it.
  • If an item inside a plain Folder is created, there is an existing method to add it in memory.
  • If an item inside a ComputedFolder is created, there was no way to insert it into the child list in memory.
  • If the folder itself is modified, it was possible to reload the folder but this would also reload all the children, which was very wasteful.

Both new methods are exercised by functional tests in CloudBees CI. I am not sure if some OSS tools would find these useful. JCasC does not cover Items. job-dsl does, but does not deal with configuration on disk. The relevant scenario is that a tool creates, modifies, and deletes $JENKINS_HOME/jobs/**/config.xml and then tries to reflect those changes in a running controller process with minimal disruption and overhead.

@jglick jglick requested a review from a team as a code owner February 21, 2024 16:42
@jglick jglick requested a review from timja February 26, 2024 12:03
@jglick jglick merged commit 7c78021 into jenkinsci:master Feb 26, 2024
15 checks passed
@jglick jglick deleted the AbstractFolder branch February 26, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants