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

Support new Curse URLs with non-numeric IDs #2464

Merged
merged 1 commit into from Jul 3, 2018

Conversation

@HebaruSan
Copy link
Member

commented Jun 28, 2018

Background

The format of Curse API URLs changed recently, but some old URLs are still supported; see the discussion in KSP-CKAN/NetKAN#6608 for details.

Old format:

New format:

Any old URL that had been accessed before March 2018 still works thanks to caching internal to the API, but any newly added mod must use the new format.

Problem

Netkan fails on mods added to curse after March 2018. See KSP-CKAN/NetKAN#6608 for an example; PhotonSailor can't be indexed without updating our Curse API logic.

(UPDATE: We switched that mod to SpaceDock instead, so the urgency is lower, but the problem would still affect future new mods hosted only on Curse.)

Changes

Now the id part of the #/ckan/curse/id kref string may contain either a number or a non-number. If it's a number, the old format URL is used for backwards compatibility with existing metadata. If it's not a number, then the new format is used.

In addition, the Netkan log message that prints the API URL being accessed is promoted from debug to info, so it can be seen when --verbose is enabled.

A test is added to exercise the new format.

@HebaruSan HebaruSan requested a review from Olympic1 Jun 29, 2018

@Olympic1
Copy link
Member

left a comment

LGTM, don't notice any problems

@politas politas merged commit 1790c6c into KSP-CKAN:master Jul 3, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
politas added a commit that referenced this pull request Jul 3, 2018

@HebaruSan HebaruSan deleted the HebaruSan:fix/new-curse-urls branch Jul 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.