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-73760] Updates fail due to invalid JSON from HTTP Update Center #9760

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

basil
Copy link
Member

@basil basil commented Sep 19, 2024

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

@basil basil added the bug For changelog: Minor bug. Will be listed after features label Sep 19, 2024
Comment on lines -541 to -542
* @deprecated
* Will be removed, currently returns always false.
Copy link
Member Author

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.

Comment on lines -543 to +541
* @since 2.343
* @since 1.357
Copy link
Member Author

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
Copy link
Member Author

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.

Comment on lines +548 to +551
private boolean isJenkinsCI() {
return url != null
&& UpdateCenter.PREDEFINED_UPDATE_SITE_ID.equals(id)
&& url.startsWith("http://updates.jenkins-ci.org/");
Copy link
Member Author

@basil basil Sep 19, 2024

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
Copy link
Member Author

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.

Comment on lines +209 to +221
@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());
}

Copy link
Member Author

@basil basil Sep 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For changelog: Minor bug. Will be listed after features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant