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

Merged
merged 1 commit into from
Oct 2, 2024

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

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

Thanks!

@timja
Copy link
Member

timja commented Sep 22, 2024

/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!

@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 Sep 22, 2024
@MarkEWaite MarkEWaite merged commit 47a212a into jenkinsci:master Oct 2, 2024
15 checks passed
MarkEWaite pushed a commit to MarkEWaite/jenkins that referenced this pull request Oct 5, 2024
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 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