Skip to content

Conversation

@lslezak
Copy link
Contributor

@lslezak lslezak commented Apr 1, 2025

Problem

  • The addon version is required in the autoinstallation profile, i.e. you have to pass
    {
      "id": "sle-ha",
      "version": "16.0",
      "registrationCode": "<CODE>"
    }
  • For most addons from SCC the version is bound to the SP release, e.g. in SP1 the version will be "16.1", in SP2 "16.2", etc...
  • That means you have to update the profile for each SP release and you cannot use the same profile for multiple SP releases. That's quite annoying.

Solution

  • Make the version attribute optional, allow it to be missing.
  • If the version is missing query the available addons and find the version to register automatically from the list.
  • If multiple versions are found report an error, in that case the version needs to be specified explicitly in the profile.
  • So now you can just write:
    {
      "id": "sle-ha",
      "registrationCode": "<CODE>"
    }
    For free extensions you will only need the id value.

Notes

  • The installer remembers whether a specific version was requested or it was found automatically.
  • It uses this information when exporting the current configuration. When the version was specified at import it will be specified in the export, if it was missing at import it will be missing in export as well.
  • That means at export you should get the same imported data.

Testing

  • Added a new unit test
  • Tested manually

Find the version automatically from the list of available addons.

This allows using the same autoinstallation profile for the GA,
SP1, SP2, etc... releases.
.map(|(id, version, code)| AddonParams {
id,
version,
version: if version.is_empty() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function could be useful in this case. However, it is not included yet.

.register_addon(
&addon.id,
&addon.version,
&addon.version.clone().unwrap_or_default(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would an empty version work?

Copy link
Contributor Author

@lslezak lslezak Apr 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the end the backend receives empty version because nil cannot be sent over DBus. So omitting the version is the same as using empty string.

And if SCC really uses an empty version then it will work too, just using a slightly more complicated path in the code.

@lslezak lslezak merged commit a4e4169 into master Apr 1, 2025
14 checks passed
@lslezak lslezak deleted the optional_addon_version branch April 1, 2025 14:11
@imobachgs imobachgs mentioned this pull request Apr 22, 2025
imobachgs added a commit that referenced this pull request Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants