-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
Omnipresent VersionedOverrideTransformers #1684
Conversation
Puts VersionedOverrideTransformers between every transformer and adds the ability to specify which VersionedOverrideTransformer should execute an override by the use of "before" or "after" properties.
From your opening explanation I take it you guys need to support multiple I'm afraid the whole *Transformers/pipeline business is a bit over my head... so in the example you gave, the >=v1.3.0 override is applied before KSP-AVC is invoked. Is that chosen based on the version number from SpaceDock? Should I (as a user, not a CKAN insider) think of If you're concerned about exposing implementation details, perhaps you can trim the list of allowed values a bit. I certainly can't guess what all of them mean off the top of my head... (but I'll bite: is there actually an |
Yes, there is an easter egg which triggers an Optimus Prime quote ;) |
It's necessary because a lot of mods distribute their dependencies in their own archive (bleh), meaning we need some mechanism to decide which of multiple possible
NetKAN works by applying a series of transformations on its input metadata. This series of transformations is the "pipeline". The metadata at the start of the pipeline should be a valid One of these transformations is applied by the So what
I'm not too concerned, like I said in the documentation update in this PR, the vast vast majority of overrides should never have to use a
Isn't there a little bit of Optimus Prime everywhere? |
I've had a good read over this and it looks really good. I've also tested across all our NetKANs and tested with the example NetKAN. The indexer will pickup the new version on the next run. Autobots roll out! |
@pjf @Starstrider42 @Dazpoet
Prompted by #1674. The issue was that the
x_netkan_override
was overriding theinstall
stanza. However, theAvcTransformer
uses theinstall
stanza to determine which files in an archive will be installed so that it can pick the correct.version
file to use. The problem was that theAvcTransformer
executes before theVersionedOverrideTransformer
so theAvcTransformer
didn't think any files would be installed because the appropriate override hadn't occurred yet.What this PR does is basically allow you specify when an override should execute, through the use of
before
andafter
properties in the override.To accomplish this there are three main changes:
ITransformer
must have a name which identifies it uniquely.VersionedOverrideTransformer
takes a list of names ofITransformer
implementations that it executes directly before and executes directly after.NetkanTransformer
has been modified to inject an instance ofVersionedOverrideTransformer
before and after every otherITransformer
.So now the transformation pipeline looks like:
There are also two "psuedo-transformers",
$none
and$all
(should be self-explanatory) so the pipeline really looks like:How does this fix #1674?
Well given this
.netkan
(@Starstrider42 changed the archive to workaround the issue in NetKAN#3691 so to make it reproducable I modified from the one given in #1674 by inverting the install stanzas and override condition).NetKAN compalains:
However using this
.netkan
(notice the addition of"before": "avc"
)NetKAN successfully produces the following
.ckan
:To remain backwards compatible with existing overrides, there is a hardcoded
VersionedOverrideTransformer
that occursbefore
andafter
null
.The following is the list of all possible values of
before
andafter
. It exposes some of the internal architecture of NetKAN, but I think this is the best possible compromise to solve this particular issue.