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

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

Open
godber opened this issue Jul 16, 2024 · 4 comments
Open

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

godber opened this issue Jul 16, 2024 · 4 comments

Comments

@godber
Copy link
Member

godber commented Jul 16, 2024

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:

  • Should the output of /txt/assets change (show incompatible versions)
  • We could publish an asset registry as a json file in our docs and use it to render a compatibility chart
@kstaken
Copy link
Member

kstaken commented Jul 19, 2024

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
Copy link
Member Author

godber commented Jul 19, 2024

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:

  • What should we name the Teraslice version requirement property in the asset?
  • Is there some reason we should mimic npm or even better, are there any arguments for not mimicking it?

@kstaken
Copy link
Member

kstaken commented Jul 19, 2024

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
Copy link
Contributor

busma13 commented Jul 25, 2024

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"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants