Skip to content

Commit bb4f156

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/remote-mcp-fabric-compat
2 parents 477baab + f0fb1e1 commit bb4f156

280 files changed

Lines changed: 44611 additions & 1125 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
typescript: ${{ steps.filter.outputs.typescript }}
2424
drivers: ${{ steps.filter.outputs.drivers }}
2525
dbt-tools: ${{ steps.filter.outputs.dbt-tools }}
26+
installer: ${{ steps.filter.outputs.installer }}
2627
steps:
2728
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2829

@@ -50,6 +51,9 @@ jobs:
5051
- 'packages/opencode/test/altimate/connections.test.ts'
5152
dbt-tools:
5253
- 'packages/dbt-tools/**'
54+
installer:
55+
- 'install.ps1'
56+
- 'test/windows/**'
5357
5458
# ---------------------------------------------------------------------------
5559
# Main TypeScript tests — excludes driver E2E tests (separate job) and
@@ -98,8 +102,13 @@ jobs:
98102
# Cloud E2E tests (Snowflake, BigQuery, Databricks) auto-skip when
99103
# ALTIMATE_CODE_CONN_* env vars are not set. Docker E2E tests auto-skip
100104
# when Docker is not available. No exclusion needed — skipIf handles it.
101-
# --timeout 30000: matches package.json "test" script; prevents 5s default
102-
# from cutting off tests that run bun install or bootstrap git instances.
105+
# --timeout 90000: the full suite (9500+ tests across 379 files) runs in
106+
# one parallel bun process. Under CPU contention a handful of slower tests
107+
# (real fs/spawn/git-bootstrap work) get starved and exceed a tight timeout
108+
# NON-deterministically — different tests each run — failing CI with
109+
# "timed out after Nms" (observed 32s/51s at the old 30s limit). 90s gives
110+
# ~3x headroom over the worst observed, killing the resource-contention
111+
# flakiness without masking genuinely-hung tests.
103112
#
104113
# Bun 1.3.x has a known segfault during process cleanup after all tests
105114
# pass (exit code 143/SIGTERM or 134/SIGABRT). We capture test output and
@@ -108,7 +117,7 @@ jobs:
108117
run: |
109118
# Redirect bun output to file, then cat it for CI visibility.
110119
# This avoids tee/pipe issues where SIGTERM kills tee before flush.
111-
bun test --timeout 30000 > /tmp/test-output.txt 2>&1 || true
120+
bun test --timeout 90000 > /tmp/test-output.txt 2>&1 || true
112121
cat /tmp/test-output.txt
113122
114123
# Extract pass/fail counts from Bun test summary (e.g., " 5362 pass")
@@ -304,6 +313,34 @@ jobs:
304313
run: bun run test
305314
working-directory: packages/dbt-tools
306315

316+
# ---------------------------------------------------------------------------
317+
# Windows installer (install.ps1) — Pester behavioral tests on real Windows.
318+
# Runs the script as a subprocess (stopping early via -Help / unknown version
319+
# so nothing is downloaded) to cover arg parsing, the WOW64 arch fix, and
320+
# unknown-version rejection. Only when install.ps1 / its tests change.
321+
# ---------------------------------------------------------------------------
322+
windows-installer:
323+
name: Windows Installer (Pester)
324+
needs: changes
325+
if: needs.changes.outputs.installer == 'true' || github.event_name == 'push'
326+
runs-on: windows-latest
327+
timeout-minutes: 10
328+
steps:
329+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
330+
331+
- name: Install Pester
332+
shell: pwsh
333+
run: Install-Module Pester -MinimumVersion 5.0.0 -Force -Scope CurrentUser -SkipPublisherCheck
334+
335+
- name: Run installer Pester tests
336+
shell: pwsh
337+
run: |
338+
$config = New-PesterConfiguration
339+
$config.Run.Path = "./test/windows/install.Tests.ps1"
340+
$config.Run.Throw = $true
341+
$config.Output.Verbosity = "Detailed"
342+
Invoke-Pester -Configuration $config
343+
307344
# ---------------------------------------------------------------------------
308345
# dbt-tools E2E — slow (~3 min), only on push to main.
309346
# Tests dbt CLI fallbacks against real dbt versions (1.8, 1.10, 1.11) and
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Dispatch Code Review
2+
3+
# Lightweight relay — on PR ready (not every push), dispatches the centralized
4+
# ocr/Gemini review in AltimateAI/altimate-qa (code-review.yml).
5+
#
6+
# Gated loop: review fires only when a PR is opened non-draft or marked Ready for
7+
# review. `synchronize` is intentionally omitted so pushes don't re-trigger.
8+
# altimate-qa flips the PR back to draft on CRITICAL findings, so re-review happens
9+
# on the next ready_for_review after the author addresses them.
10+
#
11+
# Token: reuses the org-level AUTOPILOT_DISPATCH_TOKEN (same one dbt-integration /
12+
# vscode-dbt-power-user use to dispatch to altimate-qa). If that org secret is not
13+
# visible to this repo, the step skips cleanly — ask an admin to extend its repo
14+
# visibility (no new token needs to be created).
15+
16+
on:
17+
pull_request:
18+
types: [opened, ready_for_review]
19+
branches: [main]
20+
21+
concurrency:
22+
group: dispatch-code-review-${{ github.event.pull_request.number }}
23+
cancel-in-progress: true
24+
25+
permissions:
26+
contents: read
27+
28+
jobs:
29+
dispatch:
30+
name: Notify altimate-qa
31+
runs-on: ubuntu-latest
32+
if: github.event.pull_request.draft == false
33+
timeout-minutes: 2
34+
steps:
35+
- name: Dispatch to centralized code review
36+
env:
37+
GH_TOKEN: ${{ secrets.AUTOPILOT_DISPATCH_TOKEN }}
38+
PR_NUMBER: ${{ github.event.pull_request.number }}
39+
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
40+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
41+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
42+
PR_TITLE: ${{ github.event.pull_request.title }}
43+
run: |
44+
if [ -z "$GH_TOKEN" ]; then
45+
echo "AUTOPILOT_DISPATCH_TOKEN not available to altimate-code — skipping centralized dispatch."
46+
echo "Ask an org admin to extend that org secret's visibility to AltimateAI/altimate-code."
47+
exit 0
48+
fi
49+
gh api repos/AltimateAI/altimate-qa/dispatches \
50+
--method POST \
51+
-f event_type=code-review \
52+
-f "client_payload[repo]=AltimateAI/altimate-code" \
53+
-f "client_payload[pr_number]=$PR_NUMBER" \
54+
-f "client_payload[head_ref]=$PR_HEAD_REF" \
55+
-f "client_payload[head_sha]=$PR_HEAD_SHA" \
56+
-f "client_payload[author]=$PR_AUTHOR" \
57+
-f "client_payload[title]=$PR_TITLE"
58+
echo "Dispatched code review for PR #$PR_NUMBER"

‎.github/workflows/release.yml‎

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,17 @@ jobs:
5959
matrix:
6060
include:
6161
# Each target builds ONE binary in parallel (~5 min each)
62-
# Index matches allTargets array in build.ts
62+
# Index matches allTargets array in build.ts. Targets without a
63+
# @altimateai/altimate-core NAPI prebuild (linux-*-musl, win32-arm64)
64+
# are intentionally excluded — see allTargets in build.ts.
6365
- { index: 0, name: "linux-arm64" }
6466
- { index: 1, name: "linux-x64" }
6567
- { index: 2, name: "linux-x64-baseline" }
66-
- { index: 3, name: "linux-arm64-musl" }
67-
- { index: 4, name: "linux-x64-musl" }
68-
- { index: 5, name: "linux-x64-baseline-musl" }
69-
- { index: 6, name: "darwin-arm64" }
70-
- { index: 7, name: "darwin-x64" }
71-
- { index: 8, name: "darwin-x64-baseline" }
72-
- { index: 9, name: "win32-arm64" }
73-
- { index: 10, name: "win32-x64" }
74-
- { index: 11, name: "win32-x64-baseline" }
68+
- { index: 3, name: "darwin-arm64" }
69+
- { index: 4, name: "darwin-x64" }
70+
- { index: 5, name: "darwin-x64-baseline" }
71+
- { index: 6, name: "win32-x64" }
72+
- { index: 7, name: "win32-x64-baseline" }
7573
steps:
7674
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
7775

@@ -106,17 +104,22 @@ jobs:
106104
- name: Smoke test binary
107105
if: matrix.name == 'linux-x64'
108106
run: |
109-
BINARY=$(find packages/opencode/dist -name altimate -type f | head -1)
107+
# Resolve to an absolute path before we cd away from the workspace.
108+
BINARY=$(find "$(pwd)/packages/opencode/dist" -name altimate -type f | head -1)
110109
if [ -z "$BINARY" ]; then
111110
echo "::error::No binary found in dist/"
112111
exit 1
113112
fi
114113
chmod +x "$BINARY"
115114
116-
# Set NODE_PATH so the binary can resolve external NAPI modules
117-
# (mirrors what the npm bin wrapper does at runtime)
118-
NODE_PATH="$(pwd)/packages/opencode/node_modules:$(pwd)/node_modules" "$BINARY" --version
119-
echo "Smoke test passed: binary starts and prints version"
115+
# Run with NO pre-set NODE_PATH AND from a directory with no
116+
# node_modules anywhere upward. Bun's compiled binary would
117+
# otherwise walk the workspace tree for node_modules and resolve
118+
# altimate-core that way — the test would pass for the wrong
119+
# reason if the staged shim ever silently misses.
120+
cd "${RUNNER_TEMP:-/tmp}"
121+
env -u NODE_PATH "$BINARY" --version
122+
echo "Smoke test passed: standalone binary starts hermetically"
120123
121124
- name: Upload build artifact
122125
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
@@ -256,13 +259,18 @@ jobs:
256259
# compile-time checks miss (e.g. missing NAPI externals like v0.5.10).
257260
- name: Pre-publish smoke test
258261
run: |
259-
BINARY=$(find packages/opencode/dist -path '*altimate-code-linux-x64/bin/altimate' -type f | head -1)
262+
# Resolve to an absolute path before we cd away from the workspace.
263+
BINARY=$(find "$(pwd)/packages/opencode/dist" -path '*altimate-code-linux-x64/bin/altimate' -type f | head -1)
260264
if [ -z "$BINARY" ]; then
261265
echo "::error::No linux-x64 binary found in artifacts — cannot verify release"
262266
exit 1
263267
else
264268
chmod +x "$BINARY"
265-
NODE_PATH="$(pwd)/packages/opencode/node_modules:$(pwd)/node_modules" "$BINARY" --version
269+
# No NODE_PATH AND hermetic cwd: see the build-time smoke test
270+
# comment for why this matters. The binary must start without
271+
# walking the workspace for node_modules.
272+
cd "${RUNNER_TEMP:-/tmp}"
273+
env -u NODE_PATH "$BINARY" --version
266274
echo "Pre-publish smoke test passed"
267275
fi
268276
@@ -349,6 +357,13 @@ jobs:
349357
path: packages/opencode/dist/
350358
merge-multiple: true
351359

360+
- name: Generate checksums
361+
# Single checksums.txt (sha256sum format: "<hash> <bare-filename>") shipped
362+
# as a release asset. The curl and PowerShell installers fetch it and verify
363+
# the downloaded archive before extracting.
364+
working-directory: packages/opencode/dist
365+
run: sha256sum *.tar.gz *.zip > checksums.txt
366+
352367
- name: Create GitHub Release
353368
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2
354369
with:
@@ -358,5 +373,6 @@ jobs:
358373
files: |
359374
packages/opencode/dist/*.tar.gz
360375
packages/opencode/dist/*.zip
376+
packages/opencode/dist/checksums.txt
361377
env:
362378
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ __pycache__
4444
**/.github/meta/commit.txt
4545
**/.github/meta/diff.txt
4646
**/.github/meta/pr-body-*.md
47+
*.bak

0 commit comments

Comments
 (0)