Skip to content

Commit dbe9f31

Browse files
committed
Merge remote-tracking branch 'origin/master' into disable-remote-access
2 parents 5cc4f0f + ce27186 commit dbe9f31

File tree

22 files changed

+1328
-426
lines changed

22 files changed

+1328
-426
lines changed

.github/workflows/ci-rust.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
- name: Install required packages
8686
run: zypper --non-interactive install --allow-downgrade
8787
clang-devel
88+
findutils
8889
gcc-c++
8990
git
9091
libopenssl-3-devel
@@ -117,8 +118,13 @@ jobs:
117118
rust/target
118119
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}
119120

121+
- name: Run Clang Format check for the C/C++ zypp bindings
122+
run: make check
123+
working-directory: ./rust/zypp-agama/zypp-agama-sys/c-layer
124+
120125
- name: Run clippy linter
121-
run: cargo clippy
126+
# deny warnings: clippy or rustc warnings will fail the build
127+
run: cargo clippy -- -D warnings
122128
working-directory: ./rust
123129

124130
tests:

rust/agama-autoinstall/src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ use std::{process::exit, time::Duration};
2222

2323
use agama_autoinstall::{ConfigAutoLoader, ScriptsRunner};
2424
use agama_lib::{auth::AuthToken, http::BaseHTTPClient, manager::ManagerHTTPClient};
25-
use agama_utils::{api::status::Stage, kernel_cmdline::KernelCmdline};
25+
use agama_utils::{
26+
api::{status::Stage, FinishMethod},
27+
kernel_cmdline::KernelCmdline,
28+
};
2629
use anyhow::anyhow;
2730
use tokio::time::sleep;
2831

@@ -93,7 +96,8 @@ async fn main() -> anyhow::Result<()> {
9396
}
9497
}
9598

96-
manager_client.finish(None).await?;
99+
let method = FinishMethod::from_kernel_cmdline().unwrap_or(FinishMethod::Reboot);
100+
manager_client.finish(method).await?;
97101

98102
Ok(())
99103
}

rust/agama-cli/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ async fn finish(
147147
) -> anyhow::Result<()> {
148148
wait_until_idle(monitor.clone()).await?;
149149

150+
let method = method
151+
.unwrap_or_else(|| FinishMethod::from_kernel_cmdline().unwrap_or(FinishMethod::Reboot));
150152
manager.finish(method).await?;
151153
Ok(())
152154
}

rust/agama-lib/src/manager/http_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl ManagerHTTPClient {
6767
/// Finishes the installation.
6868
///
6969
/// * `method`: halt, reboot, stop or poweroff the system.
70-
pub async fn finish(&self, method: Option<FinishMethod>) -> Result<(), ManagerHTTPClientError> {
70+
pub async fn finish(&self, method: FinishMethod) -> Result<(), ManagerHTTPClientError> {
7171
let action = api::Action::Finish(method);
7272
self.client.post_void("/v2/action", &action).await?;
7373
Ok(())

0 commit comments

Comments
 (0)