Skip to content
Open
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
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
# Run checks
- run: cargo check
- run: cargo fmt -- --check
- run: cargo clippy -- -D warnings
- run: cargo build --release
- run: cargo test --release
- run: |
Expand Down Expand Up @@ -108,6 +109,7 @@ jobs:
$env:PATH = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\ARM64\bin;" + $env:PATH;
# Run checks
- run: $env:PATH = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\ARM64\bin;" + $env:PATH; Invoke-Expression '& "$env:USERPROFILE\.cargo\bin\cargo" check'
- run: $env:PATH = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\ARM64\bin;" + $env:PATH; Invoke-Expression '& "$env:USERPROFILE\.cargo\bin\cargo" clippy -- -D warnings'
- run: git config --global --unset url.ssh://git@github.com.insteadOf
- run: git config --global url.ssh://git@github.com.insteadOf https://github.com/
- run: $env:PATH = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\ARM64\bin;" + $env:PATH; Invoke-Expression '& "$env:USERPROFILE\.cargo\bin\cargo" build --release'
Expand Down Expand Up @@ -193,6 +195,7 @@ jobs:
- run: . "$HOME/.cargo/env"; rustup target add x86_64-unknown-linux-musl
# Run checks
- run: cargo check
- run: cargo clippy -- -D warnings
- run: . "$HOME/.cargo/env"; cargo build --target=x86_64-unknown-linux-musl --release
- run: . "$HOME/.cargo/env"; cargo test --release
- run: strip ./target/x86_64-unknown-linux-musl/release/openaev-agent
Expand Down Expand Up @@ -253,6 +256,7 @@ jobs:
- run: . "$HOME/.cargo/env"; rustup target add aarch64-unknown-linux-musl
# Run checks
- run: cargo check
- run: cargo clippy -- -D warnings
- run: . "$HOME/.cargo/env"; cargo build --target=aarch64-unknown-linux-musl --release
- run: . "$HOME/.cargo/env"; cargo test --release
- run: strip ./target/aarch64-unknown-linux-musl/release/openaev-agent
Expand Down Expand Up @@ -311,6 +315,7 @@ jobs:
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y
# Run checks
- run: cargo check
- run: cargo clippy -- -D warnings
- run: . "$HOME/.cargo/env"; cargo build --release
- run: . "$HOME/.cargo/env"; cargo test --release
- run: strip ./target/release/openaev-agent
Expand Down Expand Up @@ -372,6 +377,9 @@ jobs:
cargo install cargo-audit
# Run checks
- run: cargo check
- run: cargo fmt -- --check
- run: cargo clippy -- -D warnings
- run: cargo audit
- run: . "$HOME/.cargo/env"; cargo build --release
- run: . "$HOME/.cargo/env"; cargo test --release
- run: strip ./target/release/openaev-agent
Expand Down
4 changes: 2 additions & 2 deletions src/api/manage_jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl Client {
}
}
Err(err) => {
error!("Error API list_jobs {}", err.to_string());
error!("Error API list_jobs {}", err);
Err(Error::Internal(err.to_string()))
}
}
Expand All @@ -62,7 +62,7 @@ impl Client {
}
}
Err(err) => {
error!("Error API clean_job {}", err.to_string());
error!("Error API clean_job {}", err);
Err(Error::Internal(err.to_string()))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/register_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl Client {
}
}
Err(err) => {
error!("Error API register_agent {}", err.to_string());
error!("Error API register_agent {}", err);
Err(Error::Internal(err.to_string()))
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/process/agent_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub fn listen(
execution_details.is_elevated,
execution_details.executed_by_user.clone(),
);
if jobs.is_ok() {
if let Ok(jobs) = jobs {
match jobs {
Ok(jobs) => {
jobs.iter().for_each(|j| {
info!("Start handling inject: {:?}", j.asset_agent_inject);
// 01. Remove the execution job
Expand All @@ -43,8 +43,9 @@ pub fn listen(
info!("Done handling inject: {:?}", j.asset_agent_inject);
});
}
} else {
error!("Fail getting jobs {}", jobs.unwrap_err())
Err(err) => {
error!("Fail getting jobs {}", err)
}
}
// Wait for the next ping (30 secs)
sleep(Duration::from_secs(30));
Expand Down
4 changes: 2 additions & 2 deletions src/process/keep_alive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ pub fn ping(
installation_mode.clone(),
service_name.clone(),
);
if register.is_err() {
error!("Fail registering the agent {}", register.unwrap_err())
if let Err(err) = register {
error!("Fail registering the agent {}", err)
}
// Wait for the next ping (2 minutes)
sleep(Duration::from_secs(120));
Expand Down