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(rust): implement a new software service in Rust #1829

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jobs:

- name: Git Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Configure and refresh repositories
# disable unused repositories to have faster refresh
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "rust/zypp-c-api"]
path = rust/zypp-c-api
url = [email protected]:agama-project/zypp-c-api.git
93 changes: 63 additions & 30 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions rust/agama-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mod progress;
mod questions;

use crate::error::CliError;
use agama_lib::base_http_client::BaseHTTPClient;
use agama_lib::base_http_client::{BaseHTTPClient, BaseHTTPClientError};
use agama_lib::{
error::ServiceError, manager::ManagerClient, progress::ProgressMonitor, transfer::Transfer,
};
Expand Down Expand Up @@ -167,12 +167,12 @@ async fn allowed_insecure_api(use_insecure: bool, api_url: String) -> Result<boo
// decide whether access to remote site has to be insecure (self-signed certificate or not)
match ping_client.get::<HashMap<String, String>>("/ping").await {
// Problem with http remote API reachability
Err(ServiceError::HTTPError(_)) => Ok(use_insecure || Confirm::new("There was a problem with the remote API and it is treated as insecure. Do you want to continue?")
Err(BaseHTTPClientError::HTTPError(_)) => Ok(use_insecure || Confirm::new("There was a problem with the remote API and it is treated as insecure. Do you want to continue?")
.with_default(false)
.prompt()
.unwrap_or(false)),
// another error
Err(e) => Err(e),
Err(e) => Err(ServiceError::HTTPClientError(e)),
// success doesn't bother us here
Ok(_) => Ok(false)
}
Expand Down
Loading
Loading