Skip to content

Commit 398d532

Browse files
committed
Refactor out the OBS interaction code into a new obs-commander crate
This is largely just a rename, as well as the slightly-silly `obs-commander-test-support` crate that exists to avoid making the primary `obs-commander` crate depend on testing dependencies.
1 parent 51f7eb7 commit 398d532

File tree

20 files changed

+176
-78
lines changed

20 files changed

+176
-78
lines changed

Cargo.lock

Lines changed: 40 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,29 @@
1-
[package]
2-
name = "obs-gitlab-runner"
3-
version = "0.1.8"
4-
edition = "2024"
5-
license = "MIT OR Apache-2.0"
1+
[workspace]
2+
resolver = "3"
3+
members = [
4+
"obs-commander",
5+
"obs-commander-test-support",
6+
"obs-gitlab-runner"
7+
]
68

7-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8-
9-
[dependencies]
9+
[workspace.dependencies]
1010
async-trait = "0.1"
11-
base16ct = { version = "0.2", features = ["std"] }
12-
bytes = "1.10"
1311
camino = "1.1"
12+
claims = "0.8"
1413
clap = { version = "4.5", features = ["default", "derive", "env"] }
1514
color-eyre = "0.6"
1615
derivative = "2.2"
1716
futures-util = "0.3"
18-
md-5 = "0.10"
19-
reqwest = "0.12"
20-
rfc822-like = "0.2"
17+
open-build-service-api = { git = "https://github.com/collabora/open-build-service-rs" }
18+
# open-build-service-api = { path = "../open-build-service-rs/open-build-service-api" }
19+
open-build-service-mock = { git = "https://github.com/collabora/open-build-service-rs" }
20+
# open-build-service-mock = { path = "../open-build-service-rs/open-build-service-api" }
21+
rstest = "0.26"
2122
serde = "1.0"
2223
serde_yaml = "0.9"
23-
shellexpand = "3.1"
24-
shell-words = "1.1"
25-
strum = { version = "0.27", features = ["derive"] }
2624
tempfile = "3.20"
25+
thiserror = "2.0"
2726
tokio = { version = "1.45", features = ["full"] }
28-
tokio-retry2 = { version = "0.5.7", features = ["jitter"] }
2927
tokio-util = { version = "0.7", features = ["full"] }
3028
tracing = "0.1"
31-
tracing-error = "0.2"
32-
tracing-subscriber = { version = "0.3", features = ["default", "json"] }
33-
url = "2.5"
34-
35-
gitlab-runner = "0.3.0-rc1"
36-
# gitlab-runner = { path = "../gitlab-runner-rs/gitlab-runner" }
37-
open-build-service-api = { git = "https://github.com/collabora/open-build-service-rs" }
38-
thiserror = "2.0.12"
39-
# open-build-service-api = { path = "../open-build-service-rs/open-build-service-api" }
40-
41-
[dev-dependencies]
42-
claims = "0.8"
43-
rstest = "0.26"
4429
wiremock = "0.6"
45-
zip = "4.1"
46-
47-
gitlab-runner-mock = "0.2.1"
48-
# gitlab-runner-mock = { path = "../gitlab-runner-rs/gitlab-runner-mock" }
49-
open-build-service-mock = { git = "https://github.com/collabora/open-build-service-rs" }
50-
# open-build-service-mock = { path = "../open-build-service-rs/open-build-service-mock" }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "obs-commander-test-support"
3+
version = "0.1.0"
4+
edition = "2024"
5+
license = "MIT OR Apache-2.0"
6+
7+
[dependencies]
8+
open-build-service-api.workspace = true
9+
open-build-service-mock.workspace = true
File renamed without changes.

obs-commander/Cargo.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[package]
2+
name = "obs-commander"
3+
version = "0.1.0"
4+
edition = "2024"
5+
license = "MIT OR Apache-2.0"
6+
7+
[dependencies]
8+
async-trait.workspace = true
9+
base16ct = { version = "0.2", features = ["std"] }
10+
bytes = "1.10"
11+
camino.workspace = true
12+
clap.workspace = true
13+
color-eyre.workspace = true
14+
derivative.workspace = true
15+
futures-util.workspace = true
16+
md-5 = "0.10"
17+
obs-commander-test-support = { path = "../obs-commander-test-support" }
18+
open-build-service-api.workspace = true
19+
reqwest = "0.12"
20+
rfc822-like = "0.2"
21+
serde.workspace = true
22+
serde_yaml.workspace = true
23+
tempfile.workspace = true
24+
thiserror.workspace = true
25+
tokio.workspace = true
26+
tokio-retry2 = { version = "0.5.7", features = ["jitter"] }
27+
tokio-util.workspace = true
28+
tracing.workspace = true
29+
30+
[dev-dependencies]
31+
claims.workspace = true
32+
rstest.workspace = true
33+
open-build-service-mock.workspace = true
34+
wiremock.workspace = true
35+
File renamed without changes.

src/artifacts.rs renamed to obs-commander/src/artifacts.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub trait ArtifactDirectory: Send + Sync {
9797
}
9898
}
9999

100-
#[cfg(test)]
101100
pub mod test_support {
102101
use std::collections::HashMap;
103102

src/binaries.rs renamed to obs-commander/src/binaries.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ mod tests {
7777
use std::time::SystemTime;
7878

7979
use claims::*;
80+
use obs_commander_test_support::*;
8081
use open_build_service_mock::*;
8182

82-
use crate::{artifacts::test_support::MockArtifactDirectory, test_support::*};
83+
use crate::artifacts::test_support::MockArtifactDirectory;
8384

8485
use super::*;
8586

src/build_meta.rs renamed to obs-commander/src/build_meta.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,10 @@ mod tests {
265265
use std::time::{Duration, SystemTime};
266266

267267
use claims::*;
268+
use obs_commander_test_support::*;
268269
use open_build_service_mock::*;
269270
use rstest::rstest;
270271

271-
use crate::test_support::*;
272-
273272
use super::*;
274273

275274
#[tokio::test]
File renamed without changes.

0 commit comments

Comments
 (0)