Skip to content

Commit 9dd3c5e

Browse files
committed
fix: bridge merge cross-boundary fixes — dbt-tools + filesystem
Two boundary issues from the v1.4.0 bridge merge: 1. `packages/dbt-tools/src/adapter.ts` — `DBTCloudProjectIntegration` and `DBTFusionCommandProjectIntegration` constructors now require a `cloudVariantDetector` parameter (added in newer @altimateai/dbt-integration). Pass a fresh `DbtCloudVariantDetector` instance per adapter. 2. `packages/opencode/src/util/filesystem.ts` — add `normalizePathPattern` (Windows path-pattern helper). The function exists in v1.4.0's filesystem.ts; we kept main's version because filesystem.ts has altimate_change markers, but the test file (overlaid from v1.4.0) calls the new helper.
1 parent b842642 commit 9dd3c5e

3 files changed

Lines changed: 26 additions & 40 deletions

File tree

.github/meta/commit.txt

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,15 @@
1-
chore: bridge upstream v1.4.0 across history rewrite — DRAFT
1+
fix: bridge merge cross-boundary fixes — dbt-tools + filesystem
22

3-
Upstream rewrote git history between v1.3.17 and v1.4.0 (2026-04-04),
4-
leaving zero common ancestor with our fork. The standard `merge.ts`
5-
tooling cannot bridge across this. This commit overlays v1.4.0's tree
6-
using a new `script/upstream/bridge-merge.ts` tool.
3+
Two boundary issues from the v1.4.0 bridge merge:
74

8-
Bridge approach:
9-
- For files in v1.4.0 NOT in keepOurs/skipFiles: take v1.4.0's content
10-
- For files with `altimate_change` markers in main: KEEP main's version
11-
entirely (no marker re-application — the markers don't carry
12-
replace-vs-insert semantics, so re-application produces duplicates)
13-
- For files in main not in v1.4.0: keep by default; flag for review
14-
- Restore PR #18186 (anthropic legal requests) so we keep Anthropic
15-
as a provider — the user asked for this exclusion.
5+
1. `packages/dbt-tools/src/adapter.ts` — `DBTCloudProjectIntegration`
6+
and `DBTFusionCommandProjectIntegration` constructors now require
7+
a `cloudVariantDetector` parameter (added in newer
8+
@altimateai/dbt-integration). Pass a fresh `DbtCloudVariantDetector`
9+
instance per adapter.
1610

17-
Bridge results:
18-
- 730 files overlaid from v1.4.0
19-
- 61 marker-bearing files preserved from main entirely
20-
- 65 keepOurs files left unchanged
21-
- 3676 skipFiles excluded
22-
- 243 files upstream removed but kept by default (see review list)
23-
- PR #18186 changes preserved via main-version retention of marker files
24-
25-
Verification:
26-
- bun install: clean (after removing packages/slack and packages/console
27-
workspace entries we don't ship)
28-
- turbo typecheck: 5 packages clean, dbt-tools has 2 constructor-arity
29-
errors (DBTCoreProjectIntegration / DBTCoreCommandProjectIntegration)
30-
caused by upstream signature changes — needs followup fix
31-
32-
NOT ready to merge. Followup work needed:
33-
1. Fix dbt-tools typecheck errors (constructor arity)
34-
2. Per the 61 preserved marker files, manually merge upstream's
35-
improvements while keeping markers intact (see report)
36-
3. Triage 243 review-list files (add to keepOurs or skipFiles)
37-
4. Address marker hygiene gaps surfaced (e.g. agent.ts safetyDenials
38-
const is altimate code without markers)
39-
5. Run full test suite
40-
41-
See .bridge-merge-report.md for the full per-file breakdown.
11+
2. `packages/opencode/src/util/filesystem.ts` — add
12+
`normalizePathPattern` (Windows path-pattern helper). The function
13+
exists in v1.4.0's filesystem.ts; we kept main's version because
14+
filesystem.ts has altimate_change markers, but the test file
15+
(overlaid from v1.4.0) calls the new helper.

packages/dbt-tools/src/adapter.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
DBTCoreCommandProjectIntegration,
2727
DBTFusionCommandProjectIntegration,
2828
CommandProcessExecutionFactory,
29+
DbtCloudVariantDetector,
2930
} from "@altimateai/dbt-integration"
3031
import type {
3132
DBTConfiguration,
@@ -103,14 +104,16 @@ export async function create(cfg: Config): Promise<DBTProjectIntegrationAdapter>
103104
const core = (root: string, diag: DBTDiagnosticData[], defer: DeferConfig, changed: () => void): DBTProjectIntegration =>
104105
new DBTCoreProjectIntegration(infra, runtime, provider, python, cli, term, config, client, root, diag, defer, changed)
105106

107+
const cloudVariantDetector = new DbtCloudVariantDetector(term)
108+
106109
const cloud = (root: string, diag: DBTDiagnosticData[], defer: DeferConfig, changed: () => void): DBTProjectIntegration =>
107-
new DBTCloudProjectIntegration(infra, factory, cli, runtime, provider, term, root, diag, defer, changed)
110+
new DBTCloudProjectIntegration(infra, factory, cli, runtime, provider, term, root, diag, defer, changed, cloudVariantDetector)
108111

109112
const command = (root: string, diag: DBTDiagnosticData[], defer: DeferConfig, changed: () => void): DBTProjectIntegration =>
110113
new DBTCoreCommandProjectIntegration(infra, runtime, provider, python, cli, term, config, client, root, diag, defer, changed)
111114

112115
const fusion = (root: string, diag: DBTDiagnosticData[], defer: DeferConfig, changed: () => void): DBTProjectIntegration =>
113-
new DBTFusionCommandProjectIntegration(infra, factory, cli, runtime, provider, term, root, diag, defer, changed)
116+
new DBTFusionCommandProjectIntegration(infra, factory, cli, runtime, provider, term, root, diag, defer, changed, cloudVariantDetector)
114117

115118
const adapter = new DBTProjectIntegrationAdapter(
116119
config,

packages/opencode/src/util/filesystem.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ export namespace Filesystem {
119119
}
120120
}
121121

122+
export function normalizePathPattern(p: string): string {
123+
if (process.platform !== "win32") return p
124+
if (p === "*") return p
125+
const match = p.match(/^(.*)[\\/]\*$/)
126+
if (!match) return normalizePath(p)
127+
const dir = /^[A-Za-z]:$/.test(match[1]!) ? match[1] + "\\" : match[1]!
128+
return join(normalizePath(dir), "*")
129+
}
130+
122131
// We cannot rely on path.resolve() here because git.exe may come from Git Bash, Cygwin, or MSYS2, so we need to translate these paths at the boundary.
123132
// Also resolves symlinks so that callers using the result as a cache key
124133
// always get the same canonical path for a given physical directory.

0 commit comments

Comments
 (0)