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 "software" uses the HTTP API #1548

Merged
merged 8 commits into from
Aug 27, 2024

Commits on Aug 20, 2024

  1. refactor(rust): make public agama_lib::software::model::SoftwareConfig

    to be used by SoftwareHTTPClient
    mvidner committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    68f7af5 View commit details
    Browse the repository at this point in the history
  2. feat(cli): agama config load/store for "software" uses the HTTP API

    with a new SoftwareHTTPClient.
    Underneath, the web service still uses the D-Bus SoftwareClient
    mvidner committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    e21574d View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2024

  1. Configuration menu
    Copy the full SHA
    f8b5a68 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2024

  1. test: SoftwareStore::store happy

    Note the `when.(...).body("{JSON object}")` part
    
    where the JSON must match what the client sends,
    otherwise the mock server will respond with a 404,
    and the test will rightly fail with:
    ```
    Error: BackendError(404, "{\"message\":\"Request did not match any route or mock\"}")
    ```
    
    The problem is that if you compose that JSON according to your best understanding of the client but make a typo, you are still left with that unhelpful 404.
    
    These 3 parts were all need to arrive at a working string:
    
    1. Enable httpmock logging by calling `env_logger::init();` at the start of the test function.
    2. Show the request, by enabling the logging at runtime, at the right level: (`test_setting_software` is a partial match on the test name).
    
    ```console
    (cd rust; RUST_LOG=httpmock=debug cargo test test_setting_software)
    ```
    
    If you don't like typing, the really important bits are these. httpmock will also log the more detailed Trace level but it does not get in the way
    ```console
    RUST_LOG=httpmock cargo test
    ```
    
    3. Unfortunately the request will be logged not as text but as an array of bytes shown numerically. [Process the output with this script to extract the text.][extract]
    
    [extract]: https://gist.github.com/mvidner/0e22ea82abecb44b469841929e5ec279#file-httpmock_body-rb
    mvidner committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    d3f2e0b View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

  1. running from the git checkout: fix service startup

    by starting NetworkManager before agama-web-server which depends on it
    mvidner committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    dff2aaa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c30c5d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9c6ec6b View commit details
    Browse the repository at this point in the history
  4. changelog

    mvidner committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    54d48ba View commit details
    Browse the repository at this point in the history