From 2b2ef0fc867fa7567a79caec2f21cfba1db2948c Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 14:02:42 -0800 Subject: [PATCH 01/10] Retry build files. --- Build/cg/cg.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 83c94364a..6101b358c 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -98,9 +98,27 @@ extends: - script: mkdir $(Build.ArtifactStagingDirectory)\Extension displayName: Create Extension Staging Directory - - script: yarn run vsix-prepublish + - bash: | + TRY_COUNT=3 + EXIT_CODE=1 + for attempt in $(seq 1 $TRY_COUNT); do + yarn run vsix-prepublish + EXIT_CODE=$? + if [ $EXIT_CODE -eq 0 ]; then + break + fi + if [ $attempt -lt $TRY_COUNT ]; then + echo "Attempt $attempt/$TRY_COUNT failed, retrying in 10s..." + sleep 10 + fi + done + # Check if the last command succeeded + if [ $EXIT_CODE -ne 0 ]; then + echo "vsix-prepublish failed after $TRY_COUNT attempts." + exit 1 + fi displayName: Build files - workingDirectory: $(Build.SourcesDirectory)\Extension + workingDirectory: $(Build.SourcesDirectory)/Extension - script: | cd $(Build.SourcesDirectory)\Extension From c2855c9fe90d8393f0173b486919cbd9bd23115e Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 15:38:52 -0800 Subject: [PATCH 02/10] Switch to Bash@3, retryCountOnTaskFailure. --- Build/cg/cg.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 6101b358c..1dca44e58 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -98,26 +98,13 @@ extends: - script: mkdir $(Build.ArtifactStagingDirectory)\Extension displayName: Create Extension Staging Directory - - bash: | - TRY_COUNT=3 - EXIT_CODE=1 - for attempt in $(seq 1 $TRY_COUNT); do - yarn run vsix-prepublish - EXIT_CODE=$? - if [ $EXIT_CODE -eq 0 ]; then - break - fi - if [ $attempt -lt $TRY_COUNT ]; then - echo "Attempt $attempt/$TRY_COUNT failed, retrying in 10s..." - sleep 10 - fi - done - # Check if the last command succeeded - if [ $EXIT_CODE -ne 0 ]; then - echo "vsix-prepublish failed after $TRY_COUNT attempts." - exit 1 - fi + - task: Bash@3 displayName: Build files + inputs: + targetType: 'inline' + script: | + yarn run vsix-prepublish + retryCountOnTaskFailure: 3 workingDirectory: $(Build.SourcesDirectory)/Extension - script: | From 47072636f3fa5bcf4063d11abb0b5db7ddcc9621 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 15:41:49 -0800 Subject: [PATCH 03/10] Fix. --- Build/cg/cg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 1dca44e58..27a1fa48f 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -103,9 +103,9 @@ extends: inputs: targetType: 'inline' script: | + cd $(Build.SourcesDirectory)/Extension yarn run vsix-prepublish retryCountOnTaskFailure: 3 - workingDirectory: $(Build.SourcesDirectory)/Extension - script: | cd $(Build.SourcesDirectory)\Extension From 65cdcbd0f2d0da075b2f0354dbd673816aa37b9b Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 15:46:48 -0800 Subject: [PATCH 04/10] Fix backslash. --- Build/cg/cg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 27a1fa48f..aaed0cae1 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -103,7 +103,7 @@ extends: inputs: targetType: 'inline' script: | - cd $(Build.SourcesDirectory)/Extension + cd $(Build.SourcesDirectory)\Extension yarn run vsix-prepublish retryCountOnTaskFailure: 3 From 807082b5b0d3f3650fdfa919b62efde9cc40ab72 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 15:49:07 -0800 Subject: [PATCH 05/10] Undo the last change. --- Build/cg/cg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index aaed0cae1..27a1fa48f 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -103,7 +103,7 @@ extends: inputs: targetType: 'inline' script: | - cd $(Build.SourcesDirectory)\Extension + cd $(Build.SourcesDirectory)/Extension yarn run vsix-prepublish retryCountOnTaskFailure: 3 From 702da58bd9976efd81e504db0f268ac8147ee766 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 16:00:23 -0800 Subject: [PATCH 06/10] Switch back to the script. --- Build/cg/cg.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 27a1fa48f..460416a0c 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -98,14 +98,27 @@ extends: - script: mkdir $(Build.ArtifactStagingDirectory)\Extension displayName: Create Extension Staging Directory - - task: Bash@3 - displayName: Build files - inputs: - targetType: 'inline' - script: | - cd $(Build.SourcesDirectory)/Extension + - bash: | + TRY_COUNT=3 + EXIT_CODE=1 + for attempt in $(seq 1 $TRY_COUNT); do yarn run vsix-prepublish - retryCountOnTaskFailure: 3 + EXIT_CODE=$? + if [ $EXIT_CODE -eq 0 ]; then + break + fi + if [ $attempt -lt $TRY_COUNT ]; then + echo "Attempt $attempt/$TRY_COUNT failed, retrying in 30s..." + sleep 30 + fi + done + # Check if the last command succeeded + if [ $EXIT_CODE -ne 0 ]; then + echo "vsix-prepublish failed after $TRY_COUNT attempts." + exit 1 + fi + displayName: Build files + workingDirectory: $(Build.SourcesDirectory)\Extension - script: | cd $(Build.SourcesDirectory)\Extension From 7ada5475ff4e19a917a1913502d6a2572e269f2e Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 16:01:19 -0800 Subject: [PATCH 07/10] Add a comment. --- Build/cg/cg.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 460416a0c..4f2f2f422 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -119,6 +119,7 @@ extends: fi displayName: Build files workingDirectory: $(Build.SourcesDirectory)\Extension + # retryCountOnTaskFailure doesn't sleep and may fail repeatedly. - script: | cd $(Build.SourcesDirectory)\Extension From f92dbd81948f212eddeda8a15da6a0ab79db515f Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 17:08:35 -0800 Subject: [PATCH 08/10] Try another approach. --- Build/cg/cg.yml | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 4f2f2f422..80da97d96 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -98,28 +98,19 @@ extends: - script: mkdir $(Build.ArtifactStagingDirectory)\Extension displayName: Create Extension Staging Directory - - bash: | - TRY_COUNT=3 - EXIT_CODE=1 - for attempt in $(seq 1 $TRY_COUNT); do + - task: Bash@3 + displayName: Build files + inputs: + targetType: 'inline' + script: | + cd $(Build.SourcesDirectory)\Extension yarn run vsix-prepublish - EXIT_CODE=$? - if [ $EXIT_CODE -eq 0 ]; then - break - fi - if [ $attempt -lt $TRY_COUNT ]; then - echo "Attempt $attempt/$TRY_COUNT failed, retrying in 30s..." + if [ $? -ne 0 ]; then + echo "yarn run vsix-prepublish failed, sleeping for 30s before retrying..." sleep 30 + exit 1 fi - done - # Check if the last command succeeded - if [ $EXIT_CODE -ne 0 ]; then - echo "vsix-prepublish failed after $TRY_COUNT attempts." - exit 1 - fi - displayName: Build files - workingDirectory: $(Build.SourcesDirectory)\Extension - # retryCountOnTaskFailure doesn't sleep and may fail repeatedly. + retryCountOnTaskFailure: 3 - script: | cd $(Build.SourcesDirectory)\Extension From cee877d5982808fb8938b4214cc69315e7c3a9e0 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 17:25:10 -0800 Subject: [PATCH 09/10] Try with / --- Build/cg/cg.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 80da97d96..08b77b33e 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -103,7 +103,7 @@ extends: inputs: targetType: 'inline' script: | - cd $(Build.SourcesDirectory)\Extension + cd $(Build.SourcesDirectory)/Extension yarn run vsix-prepublish if [ $? -ne 0 ]; then echo "yarn run vsix-prepublish failed, sleeping for 30s before retrying..." From a8f1677a180467444b305122d6ec3c14c8f6e07c Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Wed, 12 Nov 2025 17:53:09 -0800 Subject: [PATCH 10/10] Try a fix. --- Build/cg/cg.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index 08b77b33e..7a16e8f27 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -103,7 +103,8 @@ extends: inputs: targetType: 'inline' script: | - cd $(Build.SourcesDirectory)/Extension + export SRC_DIR=$(echo $BUILD_SOURCESDIRECTORY | sed 's|\\|/|g') + cd "$SRC_DIR/Extension" yarn run vsix-prepublish if [ $? -ne 0 ]; then echo "yarn run vsix-prepublish failed, sleeping for 30s before retrying..."