getporter / porter

Porter enables you to package your application artifact, client tools, configuration and deployment logic together as an installer that you can distribute, and install with a single command.
https://porter.sh
Apache License 2.0
1.23k stars 204 forks source link

Specifying version of mixin in porter.yaml #3136

Open KurtSchenk opened 4 months ago

KurtSchenk commented 4 months ago

Is your feature request related to a problem? Please describe. Porter has mixins which are similar to plugins or packages that are listed in the porter.yaml file. However, the specific version of the mixin to install can only be provided in the Porter command. As a developer who has experience working with npm, NuGet modules, I find this limitation to be problematic.

Describe the solution you'd like It would be more efficient to track mixin versions in the yaml file, as it is done in files like package.json and csproj, especially when it comes to debugging and dealing with broken CI. When it is in the porter.yaml, you can be sure the right version of the mixin matches what you have tested: the package behaves the same all through the development and deployment lifecycle.

Describe alternatives you've considered N/A

Additional context N/A

schristoff commented 4 months ago

Hey! To add clarification for future me and the community: Right now Mixins allow for clientVersion which is the version of the tool we download in the mixin. Ex: In the Terraform Mixin if we set ClientVersion to 1.1.0, then we are downloading Terraform 1.1.0 - but this is not the version of the mixin itself What is being proposed is to specify the mixin version, so for instance:

mixin:
    terraform: 
     clientVersion: 1.1.0
     version: 1.0

As discussed this would be a schema change. We will have to add a function that checks what mixins are installed and if the version we want is installed. We currently have this function which we may be able to dive into and extend

dgannon991 commented 1 week ago

Can we close this issue now? I know there was talk of maybe having it auto download the right version, or maybe having many installed at the same time and selected the right one?

kichristensen commented 1 week ago

@KurtSchenk @dgannon991 implemented syntax implemented for specifying that a specific version of a mixin have to be installed when building the bundle. The version of the bundle can be specified using the following syntax:

mixins:
  terraform@v1.0.0:
    clientVersion: 1.1.0

The correct version of the mixin have to be installed manually, but if you don't have the correct version installed, linting will fail.

Do you believe it solves you request?