Skip to content

fix: remove checkout:self to fix OneBranch signing (FileWatcher .pid deletion) - #58

Merged
msftsiwei merged 2 commits into
mainfrom
fix/remove-checkout-self-signing
Apr 20, 2026
Merged

fix: remove checkout:self to fix OneBranch signing (FileWatcher .pid deletion)#58
msftsiwei merged 2 commits into
mainfrom
fix/remove-checkout-self-signing

Conversation

@msftsiwei

Copy link
Copy Markdown
Member

Problem

The checkout: self step in the user yaml runs after OneBranch's 🔒 Setup Signing step. This causes the .pid file (created by Setup Signing in the repo root) to be deleted when the checkout step moves/recreates the repo folder. FileWatcher detects the .pid file deletion and terminates, breaking the signing process.

Root Cause

From OneBranch Signing FileWatcher FAQ:

"One particular accidental delete is if the build job includes the -checkout build step to reassign the source of the repo to another folder. That build task will move the folder that is the root of the repo, which causes the .pid file that is in the root of the repo to be deleted."
"The solution is to remove the -checkout step."

Evidence

Reference projects that sign successfully from GitHub repos:

  • vscode-powershell (GitHub → OneBranch signing ✅): no checkout: self
  • vscode-cosmosdb (GitHub → OneBranch signing ✅): no checkout: self

OneBranch handles the checkout automatically - no need to specify it explicitly.

Fix

Remove the explicit checkout: self step (4 lines). OneBranch will checkout the repo automatically before user steps run.

…deletion)

The checkout:self step runs AFTER OneBranch Setup Signing, deleting the .pid file.
FileWatcher detects this and terminates, breaking signing.
Fix: remove explicit checkout:self - OneBranch handles checkout automatically.
Ref: https://eng.ms/docs/products/onebranch/faqs/signingfaq/filewatcher
Copilot AI review requested due to automatic review settings April 20, 2026 04:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the OneBranch “sign-and-release” pipeline YAML to avoid OneBranch signing failures caused by FileWatcher .pid deletion when an explicit checkout step moves/recreates the repo folder.

Changes:

  • Removes an explicit checkout: self step from the Windows x64 job.
  • Updates featureFlags.WindowsHostVersion parameter structure.
  • Removes the ENABLE_PRS_DELAYSIGN pipeline variable.
Show a summary per file
File Description
.github/workflows/sign-and-release.yml Adjusts OneBranch pipeline configuration/steps intended to prevent signing FileWatcher termination.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (1)

.github/workflows/sign-and-release.yml:107

  • After removing the checkout step, the step header comments are now inconsistent: this block says "Step 1" but later steps still start at "Step 3" (skipping Step 2). Please renumber the subsequent step header comments so they stay accurate for troubleshooting and future edits.
              # Step 1: Install Rust toolchain via RustInstaller@1
              # Uses the official Microsoft Rust installer task (MSRustup).
              # toolchainFeed: dedicated Rust NuGet feed (contains rust.msrustup-* packages).
              # Reference: rust.msrustup/.pipelines/build.yml, ripgrep-prebuilt pipeline
              # ---------------------------------------------------------------
  • Files reviewed: 1/1 changed files
  • Comments generated: 3

Comment on lines 101 to 106
steps:
# ---------------------------------------------------------------
# Step 1: Checkout tgrep source code
# OneBranch checks out the repo containing this YAML (microsoft/tgrep)
# into $(Build.SourcesDirectory)\s (OneBranch single-repo convention).
# ---------------------------------------------------------------
- checkout: self
fetchDepth: 1
fetchTags: false
displayName: 'Checkout microsoft/tgrep'

# ---------------------------------------------------------------
# Step 2: Install Rust toolchain via RustInstaller@1
# Step 1: Install Rust toolchain via RustInstaller@1
# Uses the official Microsoft Rust installer task (MSRustup).
# toolchainFeed: dedicated Rust NuGet feed (contains rust.msrustup-* packages).
# Reference: rust.msrustup/.pipelines/build.yml, ripgrep-prebuilt pipeline

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says the fix is to remove the explicit checkout: self, but this file still has another - checkout: self in the Job 2 (Windows arm64) steps (around line 254 in the current file). That remaining checkout can still trigger the OneBranch FileWatcher .pid deletion issue and break signing for the arm64 job; remove that checkout as well (or otherwise ensure no post-signing checkout runs).

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/sign-and-release.yml Outdated
Comment on lines +60 to +62
featureFlags:
WindowsHostVersion: '1ESWindows2022'
WindowsHostVersion:
Version: 2022

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR also changes the OneBranch template parameter shape for featureFlags.WindowsHostVersion (from a single string value to an object with Version: 2022), but the PR description only discusses removing checkout: self. Please either (a) justify this change in the PR description and link to the template schema/docs that require it, or (b) revert it to avoid an unrelated pipeline behavior change.

Copilot uses AI. Check for mistakes.
Comment on lines 44 to 47
variables:
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
system.debug: ${{ parameters.debug }}
ENABLE_PRS_DELAYSIGN: 0 # Disable PRS delay signing; sign directly in container (0=direct, 1=requires host watcher agent)
TGREP_TAG: ${{ parameters.ReleaseTag }}

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable ENABLE_PRS_DELAYSIGN was removed from the pipeline variables, but the PR description claims only the checkout step was removed. If this variable is still needed to force direct signing behavior, dropping it could change signing mode or reintroduce the host FileWatcher dependency. Please confirm it’s safe to remove (and document why), or restore it.

Copilot uses AI. Check for mistakes.
Only change: remove the explicit `checkout: self` steps from Job 1 (x64)
and Job 2 (arm64). All other settings (WindowsHostVersion, ENABLE_PRS_DELAYSIGN,
etc.) are unchanged from main.

Root cause: checkout:self runs AFTER OneBranch Setup Signing, deleting the
.pid file. FileWatcher terminates, breaking signing.
Ref: https://eng.ms/docs/products/onebranch/faqs/signingfaq/filewatcher
@msftsiwei

Copy link
Copy Markdown
Member Author

Addressing all three Copilot review comments:

  1. arm64 job still has checkout: self — Fixed. The latest commit removes checkout: self from both Job 1 (x64) and Job 2 (arm64).

  2. WindowsHostVersion format changed — Fixed. The latest commit keeps the original WindowsHostVersion: '1ESWindows2022' string format, unchanged from main.

  3. ENABLE_PRS_DELAYSIGN removed — Fixed. The latest commit keeps ENABLE_PRS_DELAYSIGN: 0 as-is from main.

The PR now has a minimal diff: only the two checkout: self blocks are removed. All other settings are identical to main.

@msftsiwei
msftsiwei merged commit e3a7d96 into main Apr 20, 2026
9 of 10 checks passed
@msftsiwei
msftsiwei deleted the fix/remove-checkout-self-signing branch April 20, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants