-
Notifications
You must be signed in to change notification settings - Fork 6
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
Send HighestVersion attribute to Inflator #102
Send HighestVersion attribute to Inflator #102
Conversation
7e45b46
to
38a1f58
Compare
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.
This technically isn't related to the scheduling component, but what's this going to look like on the indexing side of things? I'll refresh myself with the other PR.
The Indexer will not need any changes for this; it's solely a Scheduler+Inflator change. |
Yep, after refreshing myself I realised we could re-utilise the staging logic without any changes to the indexer. Which is rather neat. |
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.
Awesome. Love your work!
Motivation
Now that #101 has given us the ability to compare module versions in Python the same as in CKAN-Core, this is the Scheduler + Webhook part of KSP-CKAN/CKAN#2824, which aims to reduce the need for manual maintenance of
x_netkan_epoch
properties.Changes
A new
CkanGroup
class represents all of a given module's .ckan files in a CKAN-meta repo. This class provides ahighest_version
function that parses the .ckan files and compares theirversion
properties to find the highest one, and returns it.The
Ckan.sqs_message
function now accepts aCkanGroup
parameter and passes it to a newsqs_message_attribs
function to generate theMessageAttributes
property of the message. Naturally, this usesCkanGroup.highest_version
to setHighestVersion
.If
x_netkan_allow_out_of_order
is set totrue
in a netkan, this means auto-epoching is turned off, so theHighestVersion
property will not be set and its .ckan files will not be parsed.The Scheduler now checks out CKAN-meta and uses it to pass
CkanGroup
objects toCkan.sqs_message
. The Webhooks also passCkanGroup
objects toCkan.sqs_message
.Fixes #7.