From 17ed45e2f91c96223e99341f478dafa8ed38a35d Mon Sep 17 00:00:00 2001 From: Walter Lozano Date: Fri, 8 May 2026 13:43:25 -0300 Subject: [PATCH 1/2] Add support to exclude architectures In some use cases there is no point in monitoring for architectures as the build status should not block a pipeline. To support these scenarios implement a new argument for dput to exclude architectures. Signed-off-by: Walter Lozano --- README.md | 1 + obo-core/src/actions.rs | 4 ++++ obo-core/src/build_meta.rs | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a96d424..f49902b 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,7 @@ dput PROJECT DSC_FILE [--build-info-out BUILD_INFO_FILE=build-info.json] [--message MESSAGE] [--rebuild-if-unchanged] + [--exclude-arch EXCLUDED_ARCH] ``` This will upload the given .dsc file, as well as any files referenced by it, to diff --git a/obo-core/src/actions.rs b/obo-core/src/actions.rs index 13ccb71..95ff873 100644 --- a/obo-core/src/actions.rs +++ b/obo-core/src/actions.rs @@ -72,6 +72,8 @@ pub struct DputAction { pub rebuild_if_unchanged: bool, #[clap(long, default_value = "")] pub message: String, + #[clap(long)] + pub exclude_arch: Vec, } #[derive(Parser, Debug)] @@ -233,6 +235,7 @@ impl Actions { // Getting disabled repos has to happen *after* the upload, // since the new version can change the supported architectures. disabled_repos: DisabledRepos::Keep, + exclude_arch: args.exclude_arch.clone(), }, ) .await?; @@ -264,6 +267,7 @@ impl Actions { disabled_repos: DisabledRepos::Skip { wait_options: Default::default(), }, + exclude_arch: args.exclude_arch, }, ) .await? diff --git a/obo-core/src/build_meta.rs b/obo-core/src/build_meta.rs index ba7142b..ca437cd 100644 --- a/obo-core/src/build_meta.rs +++ b/obo-core/src/build_meta.rs @@ -57,6 +57,7 @@ pub enum DisabledRepos { pub struct BuildMetaOptions { pub history_retrieval: BuildHistoryRetrieval, pub disabled_repos: DisabledRepos, + pub exclude_arch: Vec, } #[instrument(skip(client))] @@ -157,6 +158,11 @@ impl BuildMeta { for repo_meta in project_meta.repositories { for arch in repo_meta.arches { + if options.exclude_arch.contains(&arch) { + debug!(repo = %repo_meta.name, %arch, "Excluded by options"); + continue; + } + if let DisabledRepos::Skip { wait_options } = &options.disabled_repos { let status = get_status_when_ready( &client, @@ -343,6 +349,7 @@ mod tests { disabled_repos: DisabledRepos::Skip { wait_options: Default::default() }, + exclude_arch: vec![], } ) .await @@ -359,6 +366,24 @@ mod tests { let arch_2 = assert_some!(build_info.iter().find(|e| e.repo_arch == repo_arch_2)); assert_none!(arch_2.prev_endtime_for_commit); + let meta = assert_ok!( + BuildMeta::get( + client.clone(), + TEST_PROJECT.to_owned(), + TEST_PACKAGE_1.to_owned(), + &BuildMetaOptions { + history_retrieval: BuildHistoryRetrieval::Full, + disabled_repos: DisabledRepos::Skip { + wait_options: Default::default() + }, + exclude_arch: vec![TEST_ARCH_1.to_string()], + } + ) + .await + ); + assert_eq!(meta.repos.len(), 1); + assert!(meta.repos.contains_key(&repo_arch_2)); + let meta = assert_ok!( BuildMeta::get( client.clone(), @@ -369,6 +394,7 @@ mod tests { disabled_repos: DisabledRepos::Skip { wait_options: Default::default() }, + exclude_arch: vec![], } ) .await @@ -416,6 +442,7 @@ mod tests { disabled_repos: DisabledRepos::Skip { wait_options: Default::default() }, + exclude_arch: vec![], } ) .await @@ -450,6 +477,7 @@ mod tests { disabled_repos: DisabledRepos::Skip { wait_options: Default::default() }, + exclude_arch: vec![], } ) .await @@ -485,6 +513,7 @@ mod tests { disabled_repos: DisabledRepos::Skip { wait_options: Default::default() }, + exclude_arch: vec![], } ) .await @@ -499,6 +528,7 @@ mod tests { &BuildMetaOptions { history_retrieval: BuildHistoryRetrieval::Full, disabled_repos: DisabledRepos::Keep, + exclude_arch: vec![], } ) .await @@ -556,7 +586,8 @@ mod tests { history_retrieval: BuildHistoryRetrieval::Full, disabled_repos: DisabledRepos::Skip { wait_options: Default::default() - } + }, + exclude_arch: vec![], } ) .await @@ -611,6 +642,7 @@ mod tests { } else { DisabledRepos::Keep }, + exclude_arch: vec![], } ) .await From e18a56ce96e27578dca547f5c57d531904bacf7a Mon Sep 17 00:00:00 2001 From: Walter Lozano Date: Fri, 8 May 2026 13:52:16 -0300 Subject: [PATCH 2/2] Add support to exclude repositories In some use cases there is no point in monitoring for repositories as the build status should not block a pipeline. To support these scenarios implement a new argument for dput to exclude repos. Signed-off-by: Walter Lozano --- README.md | 1 + obo-core/src/actions.rs | 4 ++ obo-core/src/build_meta.rs | 77 +++++++++++++++++++++++++++++++++++++ obo-test-support/src/lib.rs | 1 + 4 files changed, 83 insertions(+) diff --git a/README.md b/README.md index f49902b..d9bd43d 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ dput PROJECT DSC_FILE [--message MESSAGE] [--rebuild-if-unchanged] [--exclude-arch EXCLUDED_ARCH] + [--exclude-repo EXCLUDED_REPO] ``` This will upload the given .dsc file, as well as any files referenced by it, to diff --git a/obo-core/src/actions.rs b/obo-core/src/actions.rs index 95ff873..e2cedee 100644 --- a/obo-core/src/actions.rs +++ b/obo-core/src/actions.rs @@ -74,6 +74,8 @@ pub struct DputAction { pub message: String, #[clap(long)] pub exclude_arch: Vec, + #[clap(long)] + pub exclude_repo: Vec, } #[derive(Parser, Debug)] @@ -236,6 +238,7 @@ impl Actions { // since the new version can change the supported architectures. disabled_repos: DisabledRepos::Keep, exclude_arch: args.exclude_arch.clone(), + exclude_repo: args.exclude_repo.clone(), }, ) .await?; @@ -268,6 +271,7 @@ impl Actions { wait_options: Default::default(), }, exclude_arch: args.exclude_arch, + exclude_repo: args.exclude_repo, }, ) .await? diff --git a/obo-core/src/build_meta.rs b/obo-core/src/build_meta.rs index ca437cd..c55f112 100644 --- a/obo-core/src/build_meta.rs +++ b/obo-core/src/build_meta.rs @@ -58,6 +58,7 @@ pub struct BuildMetaOptions { pub history_retrieval: BuildHistoryRetrieval, pub disabled_repos: DisabledRepos, pub exclude_arch: Vec, + pub exclude_repo: Vec, } #[instrument(skip(client))] @@ -157,6 +158,11 @@ impl BuildMeta { let mut repos = HashMap::new(); for repo_meta in project_meta.repositories { + if options.exclude_repo.contains(&repo_meta.name) { + debug!(repo = %repo_meta.name, "Excluded by options"); + continue; + } + for arch in repo_meta.arches { if options.exclude_arch.contains(&arch) { debug!(repo = %repo_meta.name, %arch, "Excluded by options"); @@ -350,6 +356,7 @@ mod tests { wait_options: Default::default() }, exclude_arch: vec![], + exclude_repo: vec![], } ) .await @@ -377,6 +384,7 @@ mod tests { wait_options: Default::default() }, exclude_arch: vec![TEST_ARCH_1.to_string()], + exclude_repo: vec![], } ) .await @@ -395,6 +403,7 @@ mod tests { wait_options: Default::default() }, exclude_arch: vec![], + exclude_repo: vec![], } ) .await @@ -443,6 +452,7 @@ mod tests { wait_options: Default::default() }, exclude_arch: vec![], + exclude_repo: vec![], } ) .await @@ -478,6 +488,7 @@ mod tests { wait_options: Default::default() }, exclude_arch: vec![], + exclude_repo: vec![], } ) .await @@ -514,6 +525,7 @@ mod tests { wait_options: Default::default() }, exclude_arch: vec![], + exclude_repo: vec![], } ) .await @@ -529,6 +541,7 @@ mod tests { history_retrieval: BuildHistoryRetrieval::Full, disabled_repos: DisabledRepos::Keep, exclude_arch: vec![], + exclude_repo: vec![], } ) .await @@ -537,6 +550,68 @@ mod tests { assert_ok!(meta.remove_disabled_repos(&Default::default()).await); assert_eq!(meta.repos.len(), 0); + + mock.add_or_update_repository( + TEST_PROJECT, + TEST_REPO.to_owned(), + TEST_ARCH_1.to_owned(), + MockRepositoryCode::Finished, + ); + + mock.add_or_update_repository( + TEST_PROJECT, + TEST_REPO.to_owned(), + TEST_ARCH_2.to_owned(), + MockRepositoryCode::Finished, + ); + + mock.add_or_update_repository( + TEST_PROJECT, + TEST_REPO_EXTRA.to_owned(), + TEST_ARCH_1.to_owned(), + MockRepositoryCode::Finished, + ); + + mock.add_or_update_repository( + TEST_PROJECT, + TEST_REPO_EXTRA.to_owned(), + TEST_ARCH_2.to_owned(), + MockRepositoryCode::Finished, + ); + + let meta = assert_ok!( + BuildMeta::get( + client.clone(), + TEST_PROJECT.to_owned(), + TEST_PACKAGE_1.to_owned(), + &BuildMetaOptions { + history_retrieval: BuildHistoryRetrieval::Full, + disabled_repos: DisabledRepos::Keep, + exclude_arch: vec![], + exclude_repo: vec![], + } + ) + .await + ); + assert_eq!(meta.repos.len(), 4); + + let meta = assert_ok!( + BuildMeta::get( + client.clone(), + TEST_PROJECT.to_owned(), + TEST_PACKAGE_1.to_owned(), + &BuildMetaOptions { + history_retrieval: BuildHistoryRetrieval::Full, + disabled_repos: DisabledRepos::Keep, + exclude_arch: vec![], + exclude_repo: vec![TEST_REPO_EXTRA.to_owned()], + } + ) + .await + ); + assert_eq!(meta.repos.len(), 2); + assert!(meta.repos.contains_key(&repo_arch_1)); + assert!(meta.repos.contains_key(&repo_arch_2)); } #[rstest] @@ -588,6 +663,7 @@ mod tests { wait_options: Default::default() }, exclude_arch: vec![], + exclude_repo: vec![], } ) .await @@ -643,6 +719,7 @@ mod tests { DisabledRepos::Keep }, exclude_arch: vec![], + exclude_repo: vec![], } ) .await diff --git a/obo-test-support/src/lib.rs b/obo-test-support/src/lib.rs index 809b3bc..7ef229f 100644 --- a/obo-test-support/src/lib.rs +++ b/obo-test-support/src/lib.rs @@ -8,6 +8,7 @@ pub const TEST_PROJECT: &str = "foo"; pub const TEST_PACKAGE_1: &str = "bar"; pub const TEST_PACKAGE_2: &str = "baz"; pub const TEST_REPO: &str = "repo"; +pub const TEST_REPO_EXTRA: &str = "repo_extra"; pub const TEST_ARCH_1: &str = "aarch64"; pub const TEST_ARCH_2: &str = "x86_64";