-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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-73760] Updates fail due to invalid JSON from HTTP Update Center #9760
Conversation
* @deprecated | ||
* Will be removed, currently returns always false. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting this hunk of #6116, since this functionality is useful and should not be deprecated.
* @since 2.343 | ||
* @since 1.357 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just wrong. This method was introduced in 1.357.
*/ | ||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverting this hunk of #6116, since this functionality is useful and should not be deprecated.
private boolean isJenkinsCI() { | ||
return url != null | ||
&& UpdateCenter.PREDEFINED_UPDATE_SITE_ID.equals(id) | ||
&& url.startsWith("http://updates.jenkins-ci.org/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapting the pre-#6116 code to handle the migration from http://updates.jenkins-ci.org to https://updates.jenkins.io rather than the migration from http://hudson-ci.org to http://updates.jenkins-ci.org
}; | ||
|
||
@Issue("JENKINS-73760") | ||
@LocalData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hudson.model.UpdateCenter.xml
taken from a stock 2.76 installation.
@Issue("JENKINS-73760") | ||
@Test | ||
public void isLegacyDefault() { | ||
assertFalse("isLegacyDefault should be false with null id", new UpdateSite(null, "url").isLegacyDefault()); | ||
assertFalse( | ||
"isLegacyDefault should be false when id is not default and url is http://updates.jenkins-ci.org/", | ||
new UpdateSite("dummy", "http://updates.jenkins-ci.org/").isLegacyDefault()); | ||
assertTrue( | ||
"isLegacyDefault should be true when id is default and url is http://updates.jenkins-ci.org/", | ||
new UpdateSite(UpdateCenter.PREDEFINED_UPDATE_SITE_ID, "http://updates.jenkins-ci.org/").isLegacyDefault()); | ||
assertFalse("isLegacyDefault should be false with null url", new UpdateSite(null, null).isLegacyDefault()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapting the pre-#6116 code to handle the migration from http://updates.jenkins-ci.org to https://updates.jenkins.io rather than the migration from http://hudson-ci.org to http://updates.jenkins-ci.org
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/label ready-for-merge This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback. Thanks! |
…ter (jenkinsci#9760) (cherry picked from commit 47a212a)
See JENKINS-73760. Partial revert of #6116, which deprecated/removed useful functionality (the ability to migrate old update sites to new ones). #2996 should have used this subsystem but did not, resulting in JENKINS-73760. This PR restores the subsystem and correctly applies it to #2996 to complete the migration from http://updates.jenkins-ci.org to https://updates.jenkins.io which was begun in 2017.
Testing done
New unit tests.
Proposed changelog entries
Migrate from http://updates.jenkins-ci.org to https://updates.jenkins.io when the initial installation version was 2.76 or older.
Proposed upgrade guidelines
N/A
Submitter checklist
Desired reviewers
@mention
Before the changes are marked as
ready-for-merge
:Maintainer checklist