terascope / teraslice

Scalable data processing pipelines in JavaScript
https://terascope.github.io/teraslice/
Apache License 2.0
50 stars 13 forks source link

Add Asset/Teraslice Version Dependency Check on Asset Load #3685

Open godber opened 1 month ago

godber commented 1 month ago

Add the ability for an asset to state what versions of Teraslice it requires and Teraslice should use this to validate the asset against it's current version at the time the asset is uploaded.

Right now the asset.json file looks like this:

{
    "name": "elasticsearch",
    "version": "4.0.0"
}

I propose we extend it with a dependencies property, like the package.json

{
    "name": "elasticsearch",
    "version": "4.0.0"
    "dependencies": {
        "teraslice": "^2.0.0"
   }
}

Other things to consider:

kstaken commented 1 month ago

This seems more akin to the engines setting in package.json rather than dependencies. You're defining what the minimum runtime environment needs to be which is more of an execution time dependency rather than a build time dependency.

godber commented 1 month ago

This seems more akin to the engines setting in package.json rather than dependencies. You're defining what the minimum runtime environment needs to be which is more of an execution time dependency rather than a build time dependency.

Yeah, excellent observation. I have no strong opinions on how the key is named and had only decided to mimic npm because I wanted to avoid inventing my own thing. These are still things I consider open questions:

kstaken commented 1 month ago

I don't think there's any reason to mimic npm as far as key names go and I would only do that if you definitely want to accept the implied semantics that would come from it. In this case the implied semantics may just be confusing so it's probably best to just use a unique key.

busma13 commented 1 month ago

Possible keys:

{
    "name": "elasticsearch",
    "version": "4.0.0",
    "needs": {
        "teraslice": "^2.0.0"
    },
    "requires": {
        "teraslice": "^2.0.0"
    },
    "minimum-versions": {
        "teraslice": "^2.0.0"
    },
    "minimum-teraslice-version": "^2.0.0"
}