Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ci): add handoff artifact verification and sticky-disk visibility buffer (#3999)

teo54aedeb41916
diff --git a/.github/actions/deploy-cloud-storage-pulumi/action.yml b/.github/actions/deploy-cloud-storage-pulumi/action.yml
index 8c261793b0..a9ddb6c215 100644
--- a/.github/actions/deploy-cloud-storage-pulumi/action.yml
+++ b/.github/actions/deploy-cloud-storage-pulumi/action.yml
@@ -101,6 +101,13 @@ runs:
mkdir -p rust/cloud-storage/prebuilt
# Prefer an on-disk tar (sticky-disk handoff); fall back to the downloaded artifact.
src="${TAR_PATH:-rust/cloud-storage/prebuilt-artifact/prebuilt-binaries.tar.gz}"
+ if [[ ! -f "$src" ]]; then
+ echo "::error::prebuilt binaries tar missing at $src — the handoff sticky disk cloned without the build job's snapshot. Re-run this deploy job (a fresh clone usually resolves it); if it persists, re-run the service's build job too."
+ echo "--- $(dirname "$src") contents ---"; ls -la "$(dirname "$src")" || true
+ echo "--- handoff mounts ---"; mount | grep -i handoff || true
+ exit 1
+ fi
+ echo "handoff receipt: $(sha256sum "$src" | cut -d' ' -f1) ($(stat -c%s "$src") bytes)"
tar -xzf "$src" -C rust/cloud-storage/prebuilt
- name: Download Lambda artifacts
@@ -119,6 +126,13 @@ runs:
set -euo pipefail
# Prefer an on-disk tar (sticky-disk handoff); fall back to the downloaded artifact.
src="${TAR_PATH:-rust/cloud-storage/lambda-artifact/lambda-artifacts.tar.gz}"
+ if [[ ! -f "$src" ]]; then
+ echo "::error::lambda artifacts tar missing at $src — the handoff sticky disk cloned without the build job's snapshot. Re-run this deploy job (a fresh clone usually resolves it); if it persists, re-run the service's build job too."
+ echo "--- $(dirname "$src") contents ---"; ls -la "$(dirname "$src")" || true
+ echo "--- handoff mounts ---"; mount | grep -i handoff || true
+ exit 1
+ fi
+ echo "handoff receipt: $(sha256sum "$src" | cut -d' ' -f1) ($(stat -c%s "$src") bytes)"
tar -xzf "$src" -C rust/cloud-storage
- name: Check Lambda config for inline build
diff --git a/.github/workflows/deploy-all-services.yml b/.github/workflows/deploy-all-services.yml
index 6a3412f5ba..8da268d4df 100644
--- a/.github/workflows/deploy-all-services.yml
+++ b/.github/workflows/deploy-all-services.yml
@@ -83,7 +83,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Mount Nix store sticky disk
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-nix-store
path: /nix
@@ -123,7 +123,7 @@ jobs:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Mount lambda Nix store sticky disk
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-nix-lambdas
path: /nix
@@ -172,7 +172,7 @@ jobs:
clean: false
- name: Mount Nix store sticky disk (clones warmed snapshot)
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-nix-store
path: /nix
@@ -187,7 +187,7 @@ jobs:
# different SHAs get distinct keys, and unused snapshots auto-evict after
# 7 days of inactivity.
- name: Mount binaries handoff sticky disk
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-handoff-binaries-${{ matrix.service }}-${{ github.sha }}
path: /handoff-binaries
@@ -238,6 +238,11 @@ jobs:
touch prebuilt/.keep
# Write straight onto the handoff sticky disk; deploy-services reads it.
tar -C prebuilt -czf /handoff-binaries/prebuilt-binaries.tar.gz .
+ # Receipt + flush: prove the handoff snapshot's contents in this
+ # job's log (the deploy job logs the same hash on read) and make
+ # sure bytes are on disk before the post-step commits the snapshot.
+ sync /handoff-binaries/prebuilt-binaries.tar.gz
+ echo "handoff receipt: $(sha256sum /handoff-binaries/prebuilt-binaries.tar.gz | cut -d' ' -f1) ($(stat -c%s /handoff-binaries/prebuilt-binaries.tar.gz) bytes)"
- name: Teardown Nix (free sticky disk for commit)
if: always()
@@ -264,7 +269,7 @@ jobs:
clean: false
- name: Mount lambda Nix store sticky disk (clones warmed closure)
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-nix-lambdas
path: /nix
@@ -272,7 +277,7 @@ jobs:
# Hand the Lambda bundle to the matching deploy job over a sticky disk
# instead of GitHub artifacts (see build-service-binaries for rationale).
- name: Mount lambdas handoff sticky disk
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-handoff-lambdas-${{ matrix.service }}-${{ github.sha }}
path: /handoff-lambdas
@@ -305,6 +310,9 @@ jobs:
set -euo pipefail
# The build script writes lambda-artifacts.tar.gz to the workspace root.
cp lambda-artifacts.tar.gz /handoff-lambdas/lambda-artifacts.tar.gz
+ # Receipt + flush (see binaries handoff for rationale).
+ sync /handoff-lambdas/lambda-artifacts.tar.gz
+ echo "handoff receipt: $(sha256sum /handoff-lambdas/lambda-artifacts.tar.gz | cut -d' ' -f1) ($(stat -c%s /handoff-lambdas/lambda-artifacts.tar.gz) bytes)"
- name: Teardown Nix (free sticky disk for commit)
if: always()
@@ -367,14 +375,14 @@ jobs:
# mount an empty disk.
- name: Mount binaries handoff sticky disk
if: ${{ steps.check-artifacts.outputs.has_binaries == 'true' }}
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-handoff-binaries-${{ matrix.service }}-${{ github.sha }}
path: /handoff-binaries
- name: Mount lambdas handoff sticky disk
if: ${{ steps.check-artifacts.outputs.has_lambdas == 'true' }}
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-handoff-lambdas-${{ matrix.service }}-${{ github.sha }}
path: /handoff-lambdas
@@ -384,7 +392,7 @@ jobs:
# single stable-keyed disk is shared by every deploy job: the first run
# downloads + commits, later runs clone it warm and skip the ~45s pull.
- name: Cache Pulumi plugins (sticky disk)
- uses: useblacksmith/stickydisk@v1
+ uses: useblacksmith/stickydisk@13af8883542ca949a717e70fef89d15edbb29d88 # v1 before PR #58 (2b7a836c): empty-clone regression suspect
with:
key: ${{ github.repository }}-pulumi-plugins
path: /pulumi/plugins