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

feat(storage): API support for storage settings #1471

Merged

Conversation

joseivanlopez
Copy link
Contributor

@joseivanlopez joseivanlopez commented Jul 16, 2024

A JSON schema for the storage config is defined by #1455. This PR adds support to the D-Bus API to allow setting a JSON config following that new JSON schema:

org.opensuse.Agama.Storage1
  #SetConfig s
  #GetConfig s

#SetConfig

For now, the #SetConfig D-Bus method admits 3 different JSON formats for the given JSON config:

  • Guided config
{ "storage": { "guided": ... } }
  • New storage config
{ "storage": { ... } }
  • Legacy AutoYaST config
{ "legacyAutoyastStorage": [ ... ] }

The plan is to make #SetConfig and #GetConfig only to work with a storage config or a legacy AutoYaST config. The guided config is still accepted by #SetConfig because the new storage config does not offer all the options offered by guided config yet.

In the future, the guided config will be neither accepted nor reported by #SetConfig and #GetConfig respectively. Nevertheless, a D-Bus method accepting the guided config will still be offered as a simplification of the storage settings to make easier to work with the use cases supported by the web UI.

#GetConfig

Currently, #GetConfig reports different config formats depending on how the proposal was calculated:

  • For the initial proposal: reports the guided config.
  • If #SetConfig was called with guided config: reports guided config (extended with mandatory volumes, etc).
  • If #SetConfig was called with storage config: reports exactly the given storage config.
  • If #SetConfig was called with legacy AutoYaST config: reports exactly the given legacy AutoYaST config.
  • If Storage1.Proposal#Calculate was called: reports the guided config (extended with mandatory volumes, etc).

In the future, #GetConfig will only report either the storage config or the legacy AutoYaST config.

@joseivanlopez joseivanlopez changed the title feat(storage): basic support for storage settings feat(storage): API support for storage settings Jul 17, 2024
@coveralls
Copy link

coveralls commented Aug 21, 2024

Coverage Status

coverage: 71.68% (+8.3%) from 63.343%
when pulling 3e1c2ee on joseivanlopez:api-storage-settings
into 10093da on openSUSE:master.

ancorgs

This comment was marked as resolved.

Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

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

Re-approved after changelog fix.

@joseivanlopez joseivanlopez merged commit d1a0e5a into agama-project:master Aug 27, 2024
3 checks passed
@imobachgs imobachgs mentioned this pull request Sep 20, 2024
imobachgs added a commit that referenced this pull request Sep 20, 2024
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