Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Add update center downloader #31

Merged
merged 3 commits into from
Jun 5, 2020
Merged

Conversation

sladyn98
Copy link
Contributor

@sladyn98 sladyn98 commented Jun 3, 2020

This PR downloads the actual-update-center.json file and stores it into resources.

@sladyn98 sladyn98 added the backend Related to the backend service label Jun 3, 2020
@sladyn98 sladyn98 added this to the [GSoC Phase 1] milestone Jun 3, 2020
@sladyn98 sladyn98 requested a review from a team as a code owner June 3, 2020 08:26
@@ -0,0 +1,27 @@
package com.org.jenkins.Custom.Jenkins.Distribution.Service;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess we can just ignore this for now. Because the changes have already been made in the other PR #28

@sladyn98 sladyn98 mentioned this pull request Jun 3, 2020
2 tasks
@sladyn98
Copy link
Contributor Author

sladyn98 commented Jun 3, 2020

The update center is too big to download and as @LinuxSuRen rightly pointed it will increase the size of the repo and more importantly it is updated every time, should we just call the function downloadUpdateCenter and return it as a JSONObject every time we need to use it ?
CC @kwhetstone

Copy link
Contributor

@kwhetstone kwhetstone left a comment

Choose a reason for hiding this comment

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

Yes, I think we should. There's a ticket for working with caching for later in the coding period. For now, let's just download every time.

Let's get the other PR merged before we come back to this. That will also give you the chance to move to using this file instead of the static update center. I think also when this class is ready to work into the main checker, you can write some tests to make sure this all works. You can use the modified/reduced update center in your tests.


private static final String UPDATE_CENTER_JSON_URL = "https://updates.jenkins.io/current/update-center.actual.json";

public void downloadUpdateCenterJSON() throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Eventually you might want to pull this out to a config file to make it customisable for someone who wants to run the tool against a custom update center. I'm fine with this being here now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I agree, so that the user can put in the customized url in a config file and then the file downloader can just use that url

@sladyn98 sladyn98 requested a review from kwhetstone June 4, 2020 17:24
Copy link
Contributor

@kwhetstone kwhetstone left a comment

Choose a reason for hiding this comment

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

Looks good!

@sladyn98 sladyn98 merged commit 231c37a into jenkinsci:master Jun 5, 2020
@sladyn98 sladyn98 added the feature A PR that adds a feature label Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend Related to the backend service feature A PR that adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants