-
Notifications
You must be signed in to change notification settings - Fork 11
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 Kolibri 0.16 tasks API #140
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The tasks in neither Kolibri 0.15 nor 0.16 marshal the `timeout` option. We don't actually need this, though, as the default timeout of 60 seconds is fine. If the server hasn't responded in 60 seconds, there's probably something wrong. The long timeout was added back in 32ed0f2 when we were using Fastly as a Kolibri CDN and I believed it wouldn't respond for a long time in our unusual configuration. https://phabricator.endlessm.com/T34697
`last_marker` will still be `None` if the first received status is `COMPLETED`. https://phabricator.endlessm.com/T34697
This will be used during testing to ensure seeding was not skipped. https://phabricator.endlessm.com/T34697
This is a bit nicer from an encapsulation standpoint, but it will primarily be used to handle different server versions more cleanly. https://phabricator.endlessm.com/T34697
The tasks API in Kolibri 0.16 is different than 0.15, so some version detection and version specific methods are needed to support it. One advantage of 0.16 is that there's a single `remoteimport` API that combines importing channel metadata and content as well as providing an `update` argument. https://phabricator.endlessm.com/T34697
Really this is just `pytest` right now (with `flake8` included for lack of a better location), but this provides a place to collect more test dependencies that's better than updating a bunch of adhoc instructions. https://phabricator.endlessm.com/T34697
Test the eibkolibri module to ensure it works with both Kolibri 0.15 and 0.16 servers. Server responses are mocked using `requests_mock` rather than trying to spin up either a real or fake Kolibri server. https://phabricator.endlessm.com/T34697
dbnicholson
force-pushed
the
T34697-kolibri-0.16-api
branch
from
December 8, 2023 22:54
3db917c
to
60c7192
Compare
wjt
approved these changes
Dec 11, 2023
Comment on lines
+36
to
+37
KOLIBRI_0_15 = enum.auto() | ||
KOLIBRI_0_16 = enum.auto() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A chaotic alternative would be:
KOLIBRI_0_15 = 0.15
KOLIBRI_0_16 = 0.16
I thought this would be rejected but actually it's completely legal and the Python documentation gives an example where enum values are tuples of floats.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Eventually we're going to want to update our content server to Kolibri 0.16 since it will soon be the new stable version and because it has lots of bug fixes in content handling. Unfortunately, the tasks API that's used when seeding content from the image builder changed.
Initially I changed it directly to just use the 0.16 API, but then I decided I didn't want to have a flag day. This makes the image builder support both series. In addition to some manual testing, I added some unit tests to prove it out to myself. That will let us land the necessary changes in the image builder and later update the server when we feel it's appropriate (like when 0.16.0 is finally released).
This is branched from eos5.1 to ease later backporting since we'll want to have this on all active branches.
https://phabricator.endlessm.com/T34697