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

fix: better registration workflow #1938

Merged
merged 17 commits into from
Jan 24, 2025
Merged

fix: better registration workflow #1938

merged 17 commits into from
Jan 24, 2025

Conversation

imobachgs
Copy link
Contributor

@imobachgs imobachgs commented Jan 23, 2025

Problem

The registration workflow does not allow installing without registering the system, even if the repositories are offline or are specified through the install_url option. Thus, we need to make some changes to the current implementation.

Solution

Now Agama will complain if the following conditions are met:

  • The product can be registered (registration: true).
  • The base product is missing from the repositories.

If the product can be registered, but the base product is already in the repositories, Agama will not complain. However, you can register the product if you want to.

The new approach

Instead of exposing information about whether the system should be registered at the HTTP API level, we have decided to rely on installation issues. If the conditions are not met, Agama will set an issue.

@imobachgs imobachgs force-pushed the fix-registration-workflow branch from 756d36d to 4448ba3 Compare January 23, 2025 17:08
@imobachgs imobachgs marked this pull request as ready for review January 23, 2025 22:35
imobachgs and others added 3 commits January 24, 2025 06:47
The test for the product registration alert was removed since it’s
already covered in its own test file.

As with other page tests, mocking the ProductRegistrationAlert component
was necessary to prevent the suite from rendering nothing, due to the
component getting stuck in the useIssues hook request. An alternative
would be to mock the useIssues hook itself, but it requires more mocking
for the same result. This is something to improve globally, but outside
the scope of this commit.
@@ -589,6 +589,7 @@ def missing_product_issue
# @return [Agama::Issue]
def missing_registration_issue
Issue.new(_("Product must be registered"),
kind: :missing_registration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting that we need similar way in questions. At first it was just string and then we need to add "class" to quickly check what kind it is. 👍

@imobachgs imobachgs merged commit f21c18d into master Jan 24, 2025
14 checks passed
@imobachgs imobachgs deleted the fix-registration-workflow branch January 24, 2025 09:16
@imobachgs imobachgs mentioned this pull request Feb 26, 2025
imobachgs added a commit that referenced this pull request Feb 26, 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