Skip to content

Commit eb4435a

Browse files
tonyxiaoclaude
andcommitted
Fix subprocess connector setup/teardown for connectors without those commands
The error check for "unknown command" was case-sensitive and expected quotes around the command name, but citty outputs "Unknown command setup" (capital U, no quotes). Use case-insensitive regex instead. This fixes Google Sheets (and any destination that doesn't implement setup/teardown) working via the engine's subprocess connector mode. Also enables Sheets sync in the e2e shell script (no longer gated behind SHEETS_ENABLED). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
1 parent 4daf845 commit eb4435a

3 files changed

Lines changed: 6 additions & 23 deletions

File tree

apps/engine/src/lib/destination-exec.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ export function createDestinationFromExec(cmd: string): Destination {
7474
JSON.stringify(params.catalog),
7575
])
7676
} catch (err) {
77-
if (String(err).includes("unknown command 'setup'")) {
78-
console.error('setup: not applicable')
79-
return
80-
}
77+
if (/unknown command.*setup/i.test(String(err))) return
8178
throw err
8279
}
8380
},
@@ -91,10 +88,7 @@ export function createDestinationFromExec(cmd: string): Destination {
9188
JSON.stringify(params.config),
9289
])
9390
} catch (err) {
94-
if (String(err).includes("unknown command 'teardown'")) {
95-
console.error('teardown: not applicable')
96-
return
97-
}
91+
if (/unknown command.*teardown/i.test(String(err))) return
9892
throw err
9993
}
10094
},

apps/engine/src/lib/source-exec.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ export function createSourceFromExec(cmd: string): Source {
9696
JSON.stringify(params.catalog),
9797
])
9898
} catch (err) {
99-
if (String(err).includes("unknown command 'setup'")) {
100-
console.error('setup: not applicable')
101-
return
102-
}
99+
if (/unknown command.*setup/i.test(String(err))) return
103100
throw err
104101
}
105102
},
@@ -113,10 +110,7 @@ export function createSourceFromExec(cmd: string): Source {
113110
JSON.stringify(params.config),
114111
])
115112
} catch (err) {
116-
if (String(err).includes("unknown command 'teardown'")) {
117-
console.error('teardown: not applicable')
118-
return
119-
}
113+
if (/unknown command.*teardown/i.test(String(err))) return
120114
throw err
121115
}
122116
},

e2e/temporal.test.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,7 @@ fi
208208

209209
# ── Sync 2: Stripe → Google Sheets (optional) ─────────────────────
210210

211-
# Google Sheets connector doesn't support subprocess mode (setup/teardown commands).
212-
# The engine uses subprocess mode when running connectors as binaries.
213-
# Sheets e2e is tested in vitest (temporal.test.ts) where connectors run in-process.
214-
SHEETS_ENABLED="${SHEETS_ENABLED:-}"
215-
if [ -n "$SHEETS_ENABLED" ] && [ -n "${GOOGLE_CLIENT_ID:-}" ] && [ -n "${GOOGLE_CLIENT_SECRET:-}" ] && \
211+
if [ -n "${GOOGLE_CLIENT_ID:-}" ] && [ -n "${GOOGLE_CLIENT_SECRET:-}" ] && \
216212
[ -n "${GOOGLE_REFRESH_TOKEN:-}" ] && [ -n "${GOOGLE_SPREADSHEET_ID:-}" ]; then
217213

218214
echo ""
@@ -268,8 +264,7 @@ print(len(rows) - 1 if len(rows) > 1 else 0) # minus header
268264
run_sync_cycle "Stripe → Google Sheets" "$SHEETS_SYNC_ID" verify_sheets
269265
else
270266
echo ""
271-
echo "--- Skipping Google Sheets sync (set SHEETS_ENABLED=1 + Google env vars) ---"
272-
echo " Note: Sheets connector requires in-process mode; use vitest (temporal.test.ts) for full Sheets e2e"
267+
echo "--- Skipping Google Sheets sync (set GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_REFRESH_TOKEN, GOOGLE_SPREADSHEET_ID) ---"
273268
fi
274269

275270
echo ""

0 commit comments

Comments
 (0)