wildfly-extras / prospero

Prospero is a tool combining Galleon feature packs and wildfly-channels to provision and update Wildfly server.
Apache License 2.0
9 stars 24 forks source link

Add ability to specify a "target" version for updates #754

Open jmesnil opened 1 month ago

jmesnil commented 1 month ago

This is related to https://github.com/wildfly/wildfly-proposals/pull/577 to be able to update WildFly installations coming from our zip and tgz archives.

We can add the channel metadata to these installations but they are "bound" to the manifest version that was used to generate them (as store in the .installation/installer_channels.yaml.

If we want to be able to update these installations to more recent manifest (eg I want to update my 33.0.0.Final zip installation to 33.0.1.Final), we need a way to specify the target version. It is possible to manually edit the .installation/installer_channels.yaml and change the version but that's not user-friendly and might be error-prone.

Instead, we could add a target-version to prospero update perform subcommand to override the value read from .installation/installer_channels.yaml before the update is performed. If the update is successful, then .installation/installer_channels.yaml would be persisted with that new version.

As the .installation/installer_channels.yaml can contain multiple channels, we need to specify the name of the channel as well as the version of the manifest. For https://github.com/wildfly/wildfly-proposals/pull/577, I'm planning to give simple name to our channels wildfly, wildfly-ee, wildly-preview.

With that change, the prospero update could be something like:

$ prospero channel list
# wildfly
  manifest: org.wildfly.channels:wildfly:33.0.0.Final
  repositories:
    id: jboss-public-repository-group
    url: https://repository.jboss.org/nexus/content/groups/public/
    id: central
    url: https://repo.maven.apache.org/maven2
    id: jboss-ga-repository
    url: https://maven.repository.redhat.com/ga/

$ prospero update perform
# No available updates, the installation is coming from the 33.0.0.Final zip

$ prospero update perform --target=wildfly:33.0.1.Final
=> Update the installation to 33.0.1.Final

$ prospero channel list
# wildfly
  manifest: org.wildfly.channels:wildfly:33.0.1.Final
  repositories:
    id: jboss-public-repository-group
    url: https://repository.jboss.org/nexus/content/groups/public/
    id: central
    url: https://repo.maven.apache.org/maven2
    id: jboss-ga-repository
    url: https://maven.repository.redhat.com/ga/
-------

=> The installation is not bound to WildFly 33.0.1.Final
spyrkob commented 3 days ago

Note, that for multiple channels, user would be responsible for ensuring that the manifest versions are compatible. Wildfly-channels do not provide ability to enforce version requirements between channels