-
Notifications
You must be signed in to change notification settings - Fork 68
initial attempt to ensure that product is properly selected when needed #2570
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imobachgs
reviewed
Jul 17, 2025
rust/agama-lib/src/store.rs
Outdated
| Ok(!product.is_empty()) | ||
| } | ||
|
|
||
| fn check_selected_product(selected: bool) -> Result<(), StoreError> { |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer ensure_selected_product because it communicates better the intention.
rust/agama-lib/src/store.rs
Outdated
| #[error("Could not calculate the context")] | ||
| InvalidStoreContext, | ||
| #[error("Cannot proceed with profile without specified product")] | ||
| ProductMissing, |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np: MissingProduct (as InvalidStoreContext, MissingDevice, etc.).
Co-authored-by: Imobach González Sosa <[email protected]>
imobachgs
approved these changes
Jul 17, 2025
Merged
imobachgs
added a commit
that referenced
this pull request
Jul 21, 2025
Prepare to release Agama 17: * #2459 * #2492 * #2526 * #2527 * #2528 * #2529 * #2530 * #2531 * #2532 * #2533 * #2534 * #2536 * #2537 * #2538 * #2540 * #2541 * #2542 * #2543 * #2544 * #2545 * #2546 * #2547 * #2548 * #2550 * #2551 * #2553 * #2554 * #2555 * #2556 * #2557 * #2558 * #2559 * #2560 * #2561 * #2562 * #2563 * #2564 * #2565 * #2566 * #2567 * #2568 * #2570 * #2571 * #2572 * #2575 * #2576 * #2577 * #2579 * #2580 * #2583 * #2584 * #2585 * #2586 * #2587 * #2588 * #2589 * #2591
imobachgs
added a commit
that referenced
this pull request
Jul 29, 2025
…2623) ## Problem #2570 introduced a check to make sure that a product is selected in some cases when the user tries to load a configuration that contains some specific sections (basically software and storage-related ones). However, `agama config load` now complains *always*. ## Solution The root cause is that, when deserializing the settings, a users section is *always* present (due to the use of `flatten` and optional fields). However, the users section does not require the product anymore. ## Testing - Tested manually
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
It is possible to not specify product in agama profile and it can lead to crash in ruby code or unexpected results.
bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1246601
Solution
For parts that needs product to be already selected add check and report error if it is not the case.
Testing
Screenshots
output before:
and output with fix: