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

[JENKINS-72107] Introduce Loadable interface #8544

Merged
merged 5 commits into from
Oct 13, 2023

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Oct 2, 2023

CloudBees CI uses load() method to reload selectively parts of the Jenkins object model from disk, without reloading everything.

This formalizes the interface that gets used for this purpose, even if most of the Saveable implementations already had a load() method by convention.

I could not find any use case in the community that could rely on this mecanism. For example, configuration as code uses data binding from casc configuration to live objects, but doesn't need to interact with disk.

See JENKINS-72107.

Testing done

Proposed changelog entries

  • Developer: Formalize an interface for objects that can be loaded from disk.

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

CloudBees CI uses `load()` method to reload selectively parts of the Jenkins object model, without reloading everything.

This formalizes the interface that gets used for this purpose, even if most of the Saveable implementations were using a `load()` method by convention.
@@ -265,7 +266,8 @@ public void doDynamic(StaplerRequest req, StaplerResponse rsp) throws IOExceptio
*
* @since 1.245
*/
protected void load() throws IOException {
@Override
public void load() throws IOException {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this is opening up the load could it be the case that a plugin has made a previous assumption that this would only be called once at Jenkins startup. Also that it may not be thread safe?

Should this be synchronized or have you checked for classes that overload this, or made those synchronized where they need to be (there may be none, given this is deprecated)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NotMyFault NotMyFault added the developer Changes which impact plugin developers label Oct 4, 2023
@NotMyFault
Copy link
Member

/label ready-for-merge


This PR is now ready for merge. We will merge it after ~24 hours if there is no negative feedback.
Please see the merge process documentation for more information about the merge process.
Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Oct 9, 2023
@NotMyFault NotMyFault merged commit 3df097f into jenkinsci:master Oct 13, 2023
16 checks passed
@Vlatombe Vlatombe deleted the loadable branch October 18, 2023 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Changes which impact plugin developers ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants