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

agama config load/store for "storage" uses the HTTP API #1600

Merged
merged 6 commits into from
Sep 18, 2024

Conversation

mvidner
Copy link
Contributor

@mvidner mvidner commented Sep 13, 2024

Problem

To recap:

When moving to the new HTTP-based architecture, we took some shortcuts. One of them was not using HTTP clients in the command-line interface.

Solution

  • Add StorageHTTPClient
  • This 🛑 ends D-Bus 🛑 usage from SettingsStore ✔️

Testing

  • Added a new unit test
  • Tested manually: note that it is easy to pass invalid Storage config in this way which will confuse the UI to the point of not rendering the storage parts at all.

Screenshots

No

@coveralls
Copy link

coveralls commented Sep 13, 2024

Coverage Status

coverage: 72.447% (-0.007%) from 72.454%
when pulling dbeb055 on http-client-storage
into bc057f4 on master.

@mvidner
Copy link
Contributor Author

mvidner commented Sep 13, 2024

Hmm, after load worked on the first try I wondered how store would work. And it does! ... by not validating anything? Is that right?

# echo '{"storage":{"bogus": "validate much?"}}' | agama config load
# agama config show
{
  "user": {
    "...": "...".
  },
  "storage": {
    "bogus": "validate much?"
  }
}

TODO: Is StorageSettings (un)escaped right??
this completes the elimination of D-Bus clients from the CLI use case
for consistency with other FooStore structs
@mvidner mvidner force-pushed the http-client-storage branch from b7ba82a to 1d92587 Compare September 18, 2024 08:30
@mvidner mvidner marked this pull request as ready for review September 18, 2024 08:36
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.

Congrats! I have added just a minor comment but, otherwise, it LGTM.

rust/agama-server/src/storage/web.rs Outdated Show resolved Hide resolved
Co-authored-by: Imobach González Sosa <igonzalezsosa@suse.com>
@mvidner mvidner force-pushed the http-client-storage branch from 4157b57 to dbeb055 Compare September 18, 2024 08:53
@mvidner mvidner merged commit eb86857 into master Sep 18, 2024
2 checks passed
@mvidner mvidner deleted the http-client-storage branch September 18, 2024 09:03
@imobachgs imobachgs mentioned this pull request Sep 20, 2024
imobachgs added a commit that referenced this pull request Sep 20, 2024
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Sep 23, 2024
https://build.opensuse.org/request/show/1202589
by user IGonzalezSosa + anag+factory
- Version 10

- Change the license to GPL-2.0-or-later (gh#agama-project/agama#1621).

- Expose the zFCP D-Bus API through HTTP (gh#agama-project/agama#1570).

- For CLI, use HTTP clients instead of D-Bus clients,
  final piece: Storage (gh#agama-project/agama#1600)
  - added StorageHTTPClient

- Add additional wireless settings (gh#agama-project/agama#1602).
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