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 as a Netkan "source" #2613

Merged
merged 1 commit into from
Dec 26, 2018
Merged

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Dec 17, 2018

Background

The Netkan transformers for GitHub, SpaceDock, and Curse are implemented as "sources":

  • an interface defining an API
  • a class implementing that interface
  • classes defining objects returned by the API

See https://github.com/KSP-CKAN/CKAN/tree/master/Netkan/Sources

This provides a common, test-friendly structure for these $krefs.

Motivation

Currently Jenkins, the $kref method for all of (and only) @sarbian's mods, doesn't work this way.

  • It's a single monolithic class with all of the logic in the Transform method
  • It has no tests

It also makes twice as many calls to the server as strictly necessary: one to get overall info about the job, and one to get the latest build using its build number.

Changes

Now Jenkins is implemented as a source like the others.

Now there are tests for Jenkins!

Now we get the latest build in one step using the URL for that:

@HebaruSan HebaruSan added Pull request Netkan Issues affecting the netkan data Tests Issues affecting the internal tests Network Issues affecting internet connections of CKAN labels Dec 17, 2018
@politas politas merged commit 28d8777 into KSP-CKAN:master Dec 26, 2018
politas added a commit that referenced this pull request Dec 26, 2018
@HebaruSan HebaruSan deleted the fix/jenkins-source branch December 26, 2018 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Netkan Issues affecting the netkan data Network Issues affecting internet connections of CKAN Tests Issues affecting the internal tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants