Skip to content

Register extensions (autoinstallation only)#2187

Merged
lslezak merged 7 commits intomasterfrom
register_addons
Mar 21, 2025
Merged

Register extensions (autoinstallation only)#2187
lslezak merged 7 commits intomasterfrom
register_addons

Conversation

@lslezak
Copy link
Contributor

@lslezak lslezak commented Mar 21, 2025

Problem

  • Extensions cannot be registered

Solution

  • Added full support for registering extensions from SCC
  • Updated the code to handle repeated registration during profile import, if the addon is already registered it does nothing. This allows running agama config edit several times without any errors or side effects.

Testing

  • Updated unit tests
  • Tested manually

Screenshots

After registering the HA extension the HA pattern is displayed in the software selection:

agama-ha-pattern

TODO

  • Changes
  • Select the product to install (will be solved separately, this PR is already quite big)

Copy link
Contributor

@imobachgs imobachgs left a comment

Choose a reason for hiding this comment

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

It is looking good, although I have a few comments (nothing critical).

)
.route("/registration/addons", post(register_addon))
.route(
"/registration/addons/registered",
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure about this organization of URLs and HTTP verbs. At first glance, I would expect POST /registration/addons to create a new addon, and that's not the intention.

I think will need a way to retrieve the list of addons when we work on the UI, right? So I would reserve /registration/addons for that.

  • GET /registration/addons for the list of addons (out of scope).
  • GET /registration/addons/registered for the list of registered addons. If both endpoints will use the same format, you could use GET /registration/addons?registered=true instead.
  • POST /registration/addons/register (or perhaps a better naming) for the registration.

Does it make sense?

Copy link
Contributor Author

@lslezak lslezak Mar 21, 2025

Choose a reason for hiding this comment

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

I already thought about /registration/addons?registered=true, but the problem is that for the CLI we only need very minimal data (name, version, reg. code), but for the full web UI we will need much more details, like description, if the extension is free or requires a registration code, license (optional), dependencies, whether it should be selected by default or not, if it is mirrored on the server (RMT only)... That's why it uses a different endpoint.

About POST /registration/addons/register, yes, that makes more sense, I'll update the path.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can also have a query argument, which allows you to switch between a full representation and a summary. But we can discuss this later, when we implement the /registration/addons for the UI.

if let Some(reg_code) = &settings.registration_code {
let email = settings.registration_email.as_deref().unwrap_or("");
self.product_client.register(reg_code, email).await?;
// TODO: avoid reprobing if the system has been already registered with the same code?
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

lslezak and others added 4 commits March 21, 2025 15:24
Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>
Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>
@lslezak lslezak merged commit b6734d7 into master Mar 21, 2025
16 checks passed
@lslezak lslezak deleted the register_addons branch March 21, 2025 16:56
@lslezak lslezak mentioned this pull request Mar 21, 2025
lslezak added a commit that referenced this pull request Mar 21, 2025
Related to #2187, missing changes for the product package.
@imobachgs imobachgs mentioned this pull request Mar 27, 2025
imobachgs added a commit that referenced this pull request Mar 27, 2025
@lslezak
Copy link
Contributor Author

lslezak commented Mar 27, 2025

The product installation was implemented in #2206

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.

2 participants