jenkins-infra/plugin-modernizer-tool

HTTP client doesn't follow redirect

Closed this issue · 4 comments

Jenkins and plugins versions report

Fetching data from: https://updates.jenkins.io/current/plugin-versions.json 
io.jenkins.tools.pluginmodernizer.core.model.ModernizerException: Failed to get JSON data: 307
        at io.jenkins.tools.pluginmodernizer.core.utils.JsonUtils.fromUrl(JsonUtils.java:96)

What Operating System are you using (both controller, and any agents involved in the problem)?

All

Reproduction steps

Just start with a fresh cache

Expected Results

It works

Actual Results

It doesn't work and doesn't fetch data from update center

Anything else?

No response

Are you interested in contributing a fix?

Yes PR incoming

On my side the update center redirect me to https://westeurope.cloudflare.jenkins.io/current/update-center.actual.json

Hi @jonesbusy ! This unexpected behavior is definitively a consequence of the Update Center 24-hours Brownout currently in progress which introduces redirections to the mirror serving the expected data (close to your location).

Happy to see the issue has been resolved!

Note: we also had the problem (described in jenkins-infra/helpdesk#2649 (comment)) where the new Update Center responded with its own JSON API content when the client has an Accept Header set to "application/json" (which is .. expected for https://updates.jenkins.io/current/plugin-versions.json 😅) instead of being redirected to the expected file.
We fixed this behavior after your fixed your problem here. Mentioning just in case.

Thanks for the update! I don't mind keeping the default redirct on the HTTP client