aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/patch_sync/src/main.rs
diff options
context:
space:
mode:
authorJordan R Abrahams <ajordanr@google.com>2022-02-09 20:41:54 +0000
committerCommit Bot <commit-bot@chromium.org>2022-02-10 04:59:59 +0000
commit76d717633c0aa3371a3f9c28fdbf7092af81d9a0 (patch)
treec189d6f1a9b4048de686a718fde29fe707d1fd12 /llvm_tools/patch_sync/src/main.rs
parent3527566c2b13b4977e10281a1cf62b07f1242be0 (diff)
downloadtoolchain-utils-76d717633c0aa3371a3f9c28fdbf7092af81d9a0.tar.gz
patch_sync: Toggle CQ for CrOS, Android
Currently, patch sync will always run CQ for CrOS, but never for Android. This was because the chrotomation bot didn't have the proper permissions to run the needed Presubmit-Ready checks. Now the bot does in fact have permission to enable the Presubmit check on Android, but some users may not have this permission when running locally. This commit introduces the ability to toggle running the presubmit/CQ checks early through the --disable-cq flags (by default it's assumed that running these checks is desirable). BUG=None TEST=patch_sync transpose --disable-cq <...> TEST=patch_sync transpose <...> Change-Id: I6185b98aa4394ba22f8433541885a450855cfbb4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3451037 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Diffstat (limited to 'llvm_tools/patch_sync/src/main.rs')
-rw-r--r--llvm_tools/patch_sync/src/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm_tools/patch_sync/src/main.rs b/llvm_tools/patch_sync/src/main.rs
index 58276151..b7967c31 100644
--- a/llvm_tools/patch_sync/src/main.rs
+++ b/llvm_tools/patch_sync/src/main.rs
@@ -37,6 +37,7 @@ fn main() -> Result<()> {
dry_run,
no_commit,
wip,
+ disable_cq,
} => transpose_subcmd(TransposeOpt {
cros_checkout_path,
cros_reviewers: cros_reviewers
@@ -53,6 +54,7 @@ fn main() -> Result<()> {
dry_run,
no_commit,
wip,
+ disable_cq,
}),
}
}
@@ -75,7 +77,8 @@ fn show_subcmd(args: ShowOpt) -> Result<()> {
cros_checkout: cros_checkout_path,
android_checkout: android_checkout_path,
sync_before: sync,
- wip_mode: true,
+ wip_mode: true, // Has no effect, as we're not making changes
+ enable_cq: false, // Has no effect, as we're not uploading anything
};
ctx.setup()?;
let make_collection = |platform: &str, patches_fp: &Path| -> Result<PatchCollection> {
@@ -114,6 +117,7 @@ struct TransposeOpt {
cros_reviewers: Vec<String>,
android_reviewers: Vec<String>,
wip: bool,
+ disable_cq: bool,
}
fn transpose_subcmd(args: TransposeOpt) -> Result<()> {
@@ -122,6 +126,7 @@ fn transpose_subcmd(args: TransposeOpt) -> Result<()> {
android_checkout: args.android_checkout_path,
sync_before: args.sync,
wip_mode: args.wip,
+ enable_cq: !args.disable_cq,
};
ctx.setup()?;
let cros_patches_path = ctx.cros_patches_path();
@@ -318,5 +323,9 @@ enum Opt {
/// emails.
#[structopt(long)]
wip: bool,
+
+ /// Don't run CQ if set. Only has an effect if uploading.
+ #[structopt(long)]
+ disable_cq: bool,
},
}