From 7a1a311c7898faf9cd633b43da4bd114e1c1d826 Mon Sep 17 00:00:00 2001 From: Mohamed Mansour Date: Fri, 30 Oct 2026 22:44:08 -0700 Subject: [PATCH 1/2] fix: allow registry-only release recovery --- .ado/pipelines/azure-pipelines-cd.yml | 7 +++++++ xtask/src/hotfix.rs | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.ado/pipelines/azure-pipelines-cd.yml b/.ado/pipelines/azure-pipelines-cd.yml index f5fb82b8f..eb4e70f39 100644 --- a/.ado/pipelines/azure-pipelines-cd.yml +++ b/.ado/pipelines/azure-pipelines-cd.yml @@ -10,6 +10,12 @@ parameters: values: - 'false' - 'true' +- name: publishGitHub + displayName: Publish GitHub release (disable for registry-only recovery) + type: boolean + default: true + # For recovery, start a new CD run and select the original releaseBuild run + # under Resources. Disabling this leaves npm and Rust publication enabled. resources: pipelines: @@ -309,6 +315,7 @@ extends: jobs: - job: PublishGitHub displayName: Publish GitHub Release + condition: and(succeeded(), ${{ eq(parameters.publishGitHub, true) }}) templateContext: type: releaseJob isProduction: true diff --git a/xtask/src/hotfix.rs b/xtask/src/hotfix.rs index 390a6167b..94974b646 100644 --- a/xtask/src/hotfix.rs +++ b/xtask/src/hotfix.rs @@ -713,6 +713,28 @@ mod tests { })); } + #[test] + fn release_pipeline_can_skip_github_without_skipping_registries() { + let cd = include_str!("../../.ado/pipelines/azure-pipelines-cd.yml"); + let parameter = cd + .split_once("- name: publishGitHub\n") + .map(|(_, rest)| rest.split("\nresources:").next().unwrap_or(rest)); + assert!(parameter.is_some_and(|parameter| { + parameter.contains(" type: boolean\n") && parameter.contains(" default: true\n") + })); + + let github = cd + .split_once("- job: PublishGitHub\n") + .and_then(|(_, rest)| rest.split_once("- job: PublishNpm\n")); + assert!(github.is_some_and(|(github, registries)| { + github + .contains("condition: and(succeeded(), ${{ eq(parameters.publishGitHub, true) }})") + && github.contains("task: GitHubRelease@1") + && registries.contains("- job: PublishCrates") + && !registries.contains("parameters.publishGitHub") + })); + } + #[test] fn release_pipelines_parallelize_release_work() { let build = include_str!("../../.ado/pipelines/azure-pipelines-build.yml"); From 50b7e6f447c426e897f245370207b2b27d2e60f1 Mon Sep 17 00:00:00 2001 From: Mohamed Mansour Date: Fri, 30 Oct 2026 22:56:31 -0700 Subject: [PATCH 2/2] test: remove registry recovery pipeline test --- xtask/src/hotfix.rs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/xtask/src/hotfix.rs b/xtask/src/hotfix.rs index 94974b646..390a6167b 100644 --- a/xtask/src/hotfix.rs +++ b/xtask/src/hotfix.rs @@ -713,28 +713,6 @@ mod tests { })); } - #[test] - fn release_pipeline_can_skip_github_without_skipping_registries() { - let cd = include_str!("../../.ado/pipelines/azure-pipelines-cd.yml"); - let parameter = cd - .split_once("- name: publishGitHub\n") - .map(|(_, rest)| rest.split("\nresources:").next().unwrap_or(rest)); - assert!(parameter.is_some_and(|parameter| { - parameter.contains(" type: boolean\n") && parameter.contains(" default: true\n") - })); - - let github = cd - .split_once("- job: PublishGitHub\n") - .and_then(|(_, rest)| rest.split_once("- job: PublishNpm\n")); - assert!(github.is_some_and(|(github, registries)| { - github - .contains("condition: and(succeeded(), ${{ eq(parameters.publishGitHub, true) }})") - && github.contains("task: GitHubRelease@1") - && registries.contains("- job: PublishCrates") - && !registries.contains("parameters.publishGitHub") - })); - } - #[test] fn release_pipelines_parallelize_release_work() { let build = include_str!("../../.ado/pipelines/azure-pipelines-build.yml");