dbt-lineage-cli 0.15.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. dbt_lineage_cli-0.15.0/.dockerignore +6 -0
  2. dbt_lineage_cli-0.15.0/.github/workflows/ci.yml +62 -0
  3. dbt_lineage_cli-0.15.0/.github/workflows/metrics.yml +41 -0
  4. dbt_lineage_cli-0.15.0/.github/workflows/publish.yml +33 -0
  5. dbt_lineage_cli-0.15.0/.github/workflows/pypi.yml +68 -0
  6. dbt_lineage_cli-0.15.0/.github/workflows/release-binaries.yml +228 -0
  7. dbt_lineage_cli-0.15.0/.gitignore +8 -0
  8. dbt_lineage_cli-0.15.0/.pre-commit-hooks.yaml +24 -0
  9. dbt_lineage_cli-0.15.0/BENCHMARKS.md +56 -0
  10. dbt_lineage_cli-0.15.0/CHANGELOG.md +448 -0
  11. dbt_lineage_cli-0.15.0/Cargo.lock +2719 -0
  12. dbt_lineage_cli-0.15.0/Cargo.toml +80 -0
  13. dbt_lineage_cli-0.15.0/Dockerfile +20 -0
  14. dbt_lineage_cli-0.15.0/LICENSE +21 -0
  15. dbt_lineage_cli-0.15.0/PKG-INFO +581 -0
  16. dbt_lineage_cli-0.15.0/README.md +561 -0
  17. dbt_lineage_cli-0.15.0/action.yml +169 -0
  18. dbt_lineage_cli-0.15.0/assets/tui-demo.gif +0 -0
  19. dbt_lineage_cli-0.15.0/benches/builder_bench.rs +167 -0
  20. dbt_lineage_cli-0.15.0/docs/BI.md +156 -0
  21. dbt_lineage_cli-0.15.0/docs/CACHE.md +79 -0
  22. dbt_lineage_cli-0.15.0/docs/CI.md +105 -0
  23. dbt_lineage_cli-0.15.0/docs/EDITORS.md +78 -0
  24. dbt_lineage_cli-0.15.0/docs/MCP.md +207 -0
  25. dbt_lineage_cli-0.15.0/docs/SITE.md +94 -0
  26. dbt_lineage_cli-0.15.0/editors/vscode/.gitignore +3 -0
  27. dbt_lineage_cli-0.15.0/editors/vscode/.vscodeignore +5 -0
  28. dbt_lineage_cli-0.15.0/editors/vscode/CHANGELOG.md +5 -0
  29. dbt_lineage_cli-0.15.0/editors/vscode/LICENSE +21 -0
  30. dbt_lineage_cli-0.15.0/editors/vscode/README.md +32 -0
  31. dbt_lineage_cli-0.15.0/editors/vscode/package-lock.json +140 -0
  32. dbt_lineage_cli-0.15.0/editors/vscode/package.json +77 -0
  33. dbt_lineage_cli-0.15.0/editors/vscode/src/extension.ts +113 -0
  34. dbt_lineage_cli-0.15.0/editors/vscode/tsconfig.json +14 -0
  35. dbt_lineage_cli-0.15.0/integrations/azure/README.md +48 -0
  36. dbt_lineage_cli-0.15.0/integrations/azure/dbt-lineage.yml +55 -0
  37. dbt_lineage_cli-0.15.0/integrations/bitbucket/Dockerfile +6 -0
  38. dbt_lineage_cli-0.15.0/integrations/bitbucket/README.md +36 -0
  39. dbt_lineage_cli-0.15.0/integrations/bitbucket/pipe.sh +34 -0
  40. dbt_lineage_cli-0.15.0/integrations/bitbucket/pipe.yml +16 -0
  41. dbt_lineage_cli-0.15.0/integrations/gitlab/README.md +30 -0
  42. dbt_lineage_cli-0.15.0/integrations/gitlab/templates/dbt-lineage.yml +60 -0
  43. dbt_lineage_cli-0.15.0/pyproject.toml +30 -0
  44. dbt_lineage_cli-0.15.0/scripts/collect_metrics.py +65 -0
  45. dbt_lineage_cli-0.15.0/scripts/release_notes.py +20 -0
  46. dbt_lineage_cli-0.15.0/src/bi/anofox.rs +397 -0
  47. dbt_lineage_cli-0.15.0/src/bi/looker.rs +798 -0
  48. dbt_lineage_cli-0.15.0/src/bi/metabase.rs +470 -0
  49. dbt_lineage_cli-0.15.0/src/bi/mod.rs +312 -0
  50. dbt_lineage_cli-0.15.0/src/bi/powerbi.rs +1326 -0
  51. dbt_lineage_cli-0.15.0/src/bi/superset.rs +630 -0
  52. dbt_lineage_cli-0.15.0/src/bi/tableau.rs +582 -0
  53. dbt_lineage_cli-0.15.0/src/ci/annotations.rs +426 -0
  54. dbt_lineage_cli-0.15.0/src/ci/comment.rs +678 -0
  55. dbt_lineage_cli-0.15.0/src/ci/mod.rs +690 -0
  56. dbt_lineage_cli-0.15.0/src/cli.rs +811 -0
  57. dbt_lineage_cli-0.15.0/src/error.rs +206 -0
  58. dbt_lineage_cli-0.15.0/src/git.rs +309 -0
  59. dbt_lineage_cli-0.15.0/src/graph/builder.rs +1061 -0
  60. dbt_lineage_cli-0.15.0/src/graph/collapse.rs +321 -0
  61. dbt_lineage_cli-0.15.0/src/graph/coverage.rs +220 -0
  62. dbt_lineage_cli-0.15.0/src/graph/diff.rs +1348 -0
  63. dbt_lineage_cli-0.15.0/src/graph/filter.rs +773 -0
  64. dbt_lineage_cli-0.15.0/src/graph/governance.rs +377 -0
  65. dbt_lineage_cli-0.15.0/src/graph/impact.rs +412 -0
  66. dbt_lineage_cli-0.15.0/src/graph/lint.rs +360 -0
  67. dbt_lineage_cli-0.15.0/src/graph/macros.rs +217 -0
  68. dbt_lineage_cli-0.15.0/src/graph/mod.rs +13 -0
  69. dbt_lineage_cli-0.15.0/src/graph/perf.rs +241 -0
  70. dbt_lineage_cli-0.15.0/src/graph/plan.rs +182 -0
  71. dbt_lineage_cli-0.15.0/src/graph/summary.rs +267 -0
  72. dbt_lineage_cli-0.15.0/src/graph/types.rs +186 -0
  73. dbt_lineage_cli-0.15.0/src/lib.rs +31 -0
  74. dbt_lineage_cli-0.15.0/src/lsp/analysis.rs +498 -0
  75. dbt_lineage_cli-0.15.0/src/lsp/mod.rs +264 -0
  76. dbt_lineage_cli-0.15.0/src/main.rs +1316 -0
  77. dbt_lineage_cli-0.15.0/src/mcp/mod.rs +12 -0
  78. dbt_lineage_cli-0.15.0/src/mcp/prompts.rs +152 -0
  79. dbt_lineage_cli-0.15.0/src/mcp/propose.rs +806 -0
  80. dbt_lineage_cli-0.15.0/src/mcp/resources.rs +292 -0
  81. dbt_lineage_cli-0.15.0/src/mcp/server.rs +307 -0
  82. dbt_lineage_cli-0.15.0/src/mcp/tools.rs +919 -0
  83. dbt_lineage_cli-0.15.0/src/parser/artifacts.rs +677 -0
  84. dbt_lineage_cli-0.15.0/src/parser/ast_column_lineage.rs +538 -0
  85. dbt_lineage_cli-0.15.0/src/parser/cache.rs +234 -0
  86. dbt_lineage_cli-0.15.0/src/parser/column_lineage.rs +818 -0
  87. dbt_lineage_cli-0.15.0/src/parser/columns.rs +473 -0
  88. dbt_lineage_cli-0.15.0/src/parser/discovery.rs +228 -0
  89. dbt_lineage_cli-0.15.0/src/parser/lexer.rs +263 -0
  90. dbt_lineage_cli-0.15.0/src/parser/macros.rs +424 -0
  91. dbt_lineage_cli-0.15.0/src/parser/manifest.rs +1164 -0
  92. dbt_lineage_cli-0.15.0/src/parser/manifest_check.rs +626 -0
  93. dbt_lineage_cli-0.15.0/src/parser/mod.rs +15 -0
  94. dbt_lineage_cli-0.15.0/src/parser/project.rs +160 -0
  95. dbt_lineage_cli-0.15.0/src/parser/python.rs +247 -0
  96. dbt_lineage_cli-0.15.0/src/parser/sql.rs +362 -0
  97. dbt_lineage_cli-0.15.0/src/parser/yaml_schema.rs +344 -0
  98. dbt_lineage_cli-0.15.0/src/render/ascii.rs +463 -0
  99. dbt_lineage_cli-0.15.0/src/render/coverage.rs +237 -0
  100. dbt_lineage_cli-0.15.0/src/render/diff.rs +330 -0
  101. dbt_lineage_cli-0.15.0/src/render/docs.rs +259 -0
  102. dbt_lineage_cli-0.15.0/src/render/dot.rs +291 -0
  103. dbt_lineage_cli-0.15.0/src/render/html.rs +412 -0
  104. dbt_lineage_cli-0.15.0/src/render/impact.rs +220 -0
  105. dbt_lineage_cli-0.15.0/src/render/json.rs +304 -0
  106. dbt_lineage_cli-0.15.0/src/render/layout.rs +297 -0
  107. dbt_lineage_cli-0.15.0/src/render/lint.rs +212 -0
  108. dbt_lineage_cli-0.15.0/src/render/locations.rs +160 -0
  109. dbt_lineage_cli-0.15.0/src/render/macros.rs +130 -0
  110. dbt_lineage_cli-0.15.0/src/render/manifest_check.rs +106 -0
  111. dbt_lineage_cli-0.15.0/src/render/mermaid.rs +510 -0
  112. dbt_lineage_cli-0.15.0/src/render/mod.rs +19 -0
  113. dbt_lineage_cli-0.15.0/src/render/perf.rs +123 -0
  114. dbt_lineage_cli-0.15.0/src/render/plan.rs +70 -0
  115. dbt_lineage_cli-0.15.0/src/render/site.rs +879 -0
  116. dbt_lineage_cli-0.15.0/src/render/site_assets/site.css +79 -0
  117. dbt_lineage_cli-0.15.0/src/render/site_assets/site.js +81 -0
  118. dbt_lineage_cli-0.15.0/src/render/summary.rs +190 -0
  119. dbt_lineage_cli-0.15.0/src/render/svg.rs +424 -0
  120. dbt_lineage_cli-0.15.0/src/tui/app.rs +1992 -0
  121. dbt_lineage_cli-0.15.0/src/tui/event.rs +1780 -0
  122. dbt_lineage_cli-0.15.0/src/tui/graph_widget.rs +399 -0
  123. dbt_lineage_cli-0.15.0/src/tui/mod.rs +105 -0
  124. dbt_lineage_cli-0.15.0/src/tui/run_status.rs +147 -0
  125. dbt_lineage_cli-0.15.0/src/tui/runner.rs +422 -0
  126. dbt_lineage_cli-0.15.0/src/tui/ui.rs +890 -0
  127. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/dbt_project.yml +8 -0
  128. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/models/marts/customers.sql +10 -0
  129. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/models/marts/orders.sql +9 -0
  130. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/models/marts/schema.yml +16 -0
  131. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/models/staging/schema.yml +18 -0
  132. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/models/staging/stg_customers.sql +6 -0
  133. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/models/staging/stg_orders.sql +6 -0
  134. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/models/staging/stg_payments.sql +6 -0
  135. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/seeds/countries.csv +4 -0
  136. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/target/manifest.json +147 -0
  137. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/target/run_results.json +76 -0
  138. dbt_lineage_cli-0.15.0/tests/fixtures/simple_project/tests/assert_orders_positive_amount.sql +3 -0
  139. dbt_lineage_cli-0.15.0/tests/integration_test.rs +359 -0
  140. dbt_lineage_cli-0.15.0/tests/lsp_test.rs +192 -0
  141. dbt_lineage_cli-0.15.0/tests/tui_test.rs +594 -0
@@ -0,0 +1,6 @@
1
+ target
2
+ .git
3
+ .dbt-lineage
4
+ assets
5
+ tests
6
+ docs
@@ -0,0 +1,62 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [master]
6
+ pull_request:
7
+ branches: [master]
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+
12
+ jobs:
13
+ test:
14
+ name: Test (${{ matrix.os }}, ${{ matrix.features }})
15
+ runs-on: ${{ matrix.os }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ os: [ubuntu-latest, macos-latest, windows-latest]
20
+ features: ["--all-features", "--no-default-features"]
21
+ steps:
22
+ - uses: actions/checkout@v5
23
+ - uses: dtolnay/rust-toolchain@stable
24
+ - uses: Swatinem/rust-cache@v2
25
+ - run: cargo test ${{ matrix.features }}
26
+
27
+ lint:
28
+ name: Lint
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - uses: actions/checkout@v5
32
+ - uses: dtolnay/rust-toolchain@stable
33
+ with:
34
+ components: rustfmt, clippy
35
+ - uses: Swatinem/rust-cache@v2
36
+ - run: cargo fmt --check
37
+ - run: cargo clippy --all-features -- -D warnings
38
+
39
+ docs:
40
+ name: Docs
41
+ runs-on: ubuntu-latest
42
+ steps:
43
+ - uses: actions/checkout@v5
44
+ - uses: dtolnay/rust-toolchain@stable
45
+ - uses: Swatinem/rust-cache@v2
46
+ - run: cargo doc --all-features --no-deps
47
+
48
+ coverage:
49
+ name: Coverage
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@v5
53
+ - uses: dtolnay/rust-toolchain@stable
54
+ - uses: Swatinem/rust-cache@v2
55
+ - run: cargo install cargo-tarpaulin
56
+ - run: cargo tarpaulin --all-features --out xml
57
+ - uses: codecov/codecov-action@v6
58
+ with:
59
+ files: cobertura.xml
60
+ fail_ci_if_error: false
61
+ env:
62
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,41 @@
1
+ name: Adoption metrics
2
+
3
+ # Weekly snapshot of release downloads, crates.io downloads, stars and (with
4
+ # a TRAFFIC_TOKEN secret: a token with push access) repo traffic, appended to
5
+ # metrics.jsonl on the `metrics` branch. GitHub keeps traffic for 14 days only.
6
+ on:
7
+ schedule:
8
+ - cron: "23 6 * * 1"
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ collect:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v5
19
+ - name: Check out metrics branch
20
+ run: |
21
+ if git ls-remote --exit-code origin metrics >/dev/null; then
22
+ git fetch --depth=1 origin metrics
23
+ git worktree add metrics-branch FETCH_HEAD
24
+ else
25
+ git worktree add --detach metrics-branch
26
+ git -C metrics-branch checkout --orphan metrics
27
+ git -C metrics-branch rm -rfq .
28
+ fi
29
+ - name: Collect
30
+ env:
31
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
+ TRAFFIC_TOKEN: ${{ secrets.TRAFFIC_TOKEN }}
33
+ run: python3 scripts/collect_metrics.py metrics-branch/metrics.jsonl
34
+ - name: Commit
35
+ working-directory: metrics-branch
36
+ run: |
37
+ git config user.name "github-actions[bot]"
38
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39
+ git add metrics.jsonl
40
+ git commit -qm "metrics $(date -u +%F)"
41
+ git push origin HEAD:refs/heads/metrics
@@ -0,0 +1,33 @@
1
+ name: Publish to crates.io
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v[0-9]+.[0-9]+.[0-9]+*"
7
+
8
+ env:
9
+ CARGO_TERM_COLOR: always
10
+
11
+ jobs:
12
+ test:
13
+ name: Test before publish
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v5
17
+ - uses: dtolnay/rust-toolchain@stable
18
+ - uses: Swatinem/rust-cache@v2
19
+ - run: cargo test --all-features
20
+
21
+ publish:
22
+ name: Publish
23
+ needs: test
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v5
27
+ - uses: dtolnay/rust-toolchain@stable
28
+ - uses: Swatinem/rust-cache@v2
29
+ # `--allow-dirty` because cargo's own resolve step may touch Cargo.lock in
30
+ # the CI runner even though the file is unchanged on the committed tree.
31
+ - run: cargo publish --allow-dirty
32
+ env:
33
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
@@ -0,0 +1,68 @@
1
+ name: Publish to PyPI
2
+
3
+ # Wheels wrap the dbt-lineage binary (maturin `bindings = "bin"`), so
4
+ # `pip install dbt-lineage-cli` / `uvx --from dbt-lineage-cli dbt-lineage` work
5
+ # without Rust. Publishing uses PyPI trusted publishing and only runs when
6
+ # the repository variable PYPI_PUBLISH is "true" (set it after registering the
7
+ # publisher on PyPI: project dbt-lineage-cli, workflow pypi.yml, env pypi).
8
+ on:
9
+ push:
10
+ tags:
11
+ - "v[0-9]+.[0-9]+.[0-9]+*"
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ wheels:
19
+ name: Wheel ${{ matrix.os }} ${{ matrix.target }}
20
+ runs-on: ${{ matrix.os }}
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ include:
25
+ - { os: ubuntu-latest, target: x86_64, manylinux: auto }
26
+ # ring needs a newer cross GCC than manylinux2014 ships for aarch64.
27
+ - { os: ubuntu-latest, target: aarch64, manylinux: "2_28" }
28
+ - { os: macos-latest, target: x86_64 }
29
+ - { os: macos-latest, target: aarch64 }
30
+ - { os: windows-latest, target: x64 }
31
+ steps:
32
+ - uses: actions/checkout@v5
33
+ - uses: PyO3/maturin-action@v1
34
+ with:
35
+ target: ${{ matrix.target }}
36
+ args: --release --out dist
37
+ manylinux: ${{ matrix.manylinux || 'auto' }}
38
+ - uses: actions/upload-artifact@v6
39
+ with:
40
+ name: wheels-${{ matrix.os }}-${{ matrix.target }}
41
+ path: dist
42
+
43
+ sdist:
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - uses: actions/checkout@v5
47
+ - uses: PyO3/maturin-action@v1
48
+ with:
49
+ command: sdist
50
+ args: --out dist
51
+ - uses: actions/upload-artifact@v6
52
+ with:
53
+ name: sdist
54
+ path: dist
55
+
56
+ publish:
57
+ needs: [wheels, sdist]
58
+ if: vars.PYPI_PUBLISH == 'true' && startsWith(github.ref, 'refs/tags/')
59
+ runs-on: ubuntu-latest
60
+ environment: pypi
61
+ permissions:
62
+ id-token: write
63
+ steps:
64
+ - uses: actions/download-artifact@v7
65
+ with:
66
+ path: dist
67
+ merge-multiple: true
68
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,228 @@
1
+ name: Release binaries
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v[0-9]+.[0-9]+.[0-9]+*"
7
+
8
+ env:
9
+ CARGO_TERM_COLOR: always
10
+ BIN_NAME: dbt-lineage
11
+
12
+ permissions:
13
+ contents: write
14
+
15
+ jobs:
16
+ build:
17
+ name: Build ${{ matrix.target }}
18
+ runs-on: ${{ matrix.os }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ include:
23
+ - target: x86_64-unknown-linux-gnu
24
+ os: ubuntu-latest
25
+ archive: tar.gz
26
+ - target: aarch64-unknown-linux-gnu
27
+ os: ubuntu-latest
28
+ archive: tar.gz
29
+ cross: true
30
+ - target: x86_64-apple-darwin
31
+ os: macos-latest
32
+ archive: tar.gz
33
+ - target: aarch64-apple-darwin
34
+ os: macos-latest
35
+ archive: tar.gz
36
+ - target: x86_64-pc-windows-msvc
37
+ os: windows-latest
38
+ archive: zip
39
+
40
+ steps:
41
+ - uses: actions/checkout@v5
42
+
43
+ - uses: dtolnay/rust-toolchain@stable
44
+ with:
45
+ targets: ${{ matrix.target }}
46
+
47
+ - uses: Swatinem/rust-cache@v2
48
+ with:
49
+ key: ${{ matrix.target }}
50
+
51
+ # `cross` provides a Docker-based toolchain for aarch64 Linux without
52
+ # needing the system to have a cross-compiler installed.
53
+ - name: Install cross (Linux aarch64 only)
54
+ if: matrix.cross == true
55
+ run: cargo install cross --locked
56
+
57
+ - name: Build release binary
58
+ shell: bash
59
+ run: |
60
+ if [ "${{ matrix.cross }}" = "true" ]; then
61
+ cross build --release --target ${{ matrix.target }}
62
+ else
63
+ cargo build --release --target ${{ matrix.target }}
64
+ fi
65
+
66
+ - name: Package archive
67
+ shell: bash
68
+ run: |
69
+ set -euxo pipefail
70
+ version="${GITHUB_REF#refs/tags/}"
71
+ stage="${BIN_NAME}-${version}-${{ matrix.target }}"
72
+ mkdir -p "dist/${stage}"
73
+ # Copy the binary.
74
+ if [ "${{ matrix.os }}" = "windows-latest" ]; then
75
+ cp "target/${{ matrix.target }}/release/${BIN_NAME}.exe" "dist/${stage}/"
76
+ else
77
+ cp "target/${{ matrix.target }}/release/${BIN_NAME}" "dist/${stage}/"
78
+ fi
79
+ # Bundle docs.
80
+ cp README.md LICENSE BENCHMARKS.md "dist/${stage}/" 2>/dev/null || true
81
+ # Archive.
82
+ cd dist
83
+ if [ "${{ matrix.archive }}" = "zip" ]; then
84
+ 7z a "${stage}.zip" "${stage}"
85
+ sha256sum "${stage}.zip" > "${stage}.zip.sha256" || shasum -a 256 "${stage}.zip" > "${stage}.zip.sha256"
86
+ else
87
+ tar czf "${stage}.tar.gz" "${stage}"
88
+ shasum -a 256 "${stage}.tar.gz" > "${stage}.tar.gz.sha256" 2>/dev/null || sha256sum "${stage}.tar.gz" > "${stage}.tar.gz.sha256"
89
+ fi
90
+ ls -la
91
+
92
+ - name: Upload as artifact (for the release step)
93
+ uses: actions/upload-artifact@v6
94
+ with:
95
+ name: ${{ matrix.target }}
96
+ path: |
97
+ dist/${{ env.BIN_NAME }}-*-${{ matrix.target }}.tar.gz
98
+ dist/${{ env.BIN_NAME }}-*-${{ matrix.target }}.zip
99
+ dist/${{ env.BIN_NAME }}-*-${{ matrix.target }}.*.sha256
100
+ if-no-files-found: error
101
+ retention-days: 1
102
+
103
+ attach:
104
+ name: Attach to release
105
+ needs: build
106
+ runs-on: ubuntu-latest
107
+ steps:
108
+ - uses: actions/checkout@v5
109
+
110
+ - name: Release notes from CHANGELOG
111
+ run: python3 scripts/release_notes.py "$GITHUB_REF_NAME" > release-notes.md
112
+
113
+ - uses: actions/download-artifact@v7
114
+ with:
115
+ path: dist
116
+ merge-multiple: true
117
+
118
+ - name: List downloaded artifacts
119
+ run: ls -la dist
120
+
121
+ - name: Upload to GitHub Release
122
+ uses: softprops/action-gh-release@v3
123
+ with:
124
+ body_path: release-notes.md
125
+ files: |
126
+ dist/*.tar.gz
127
+ dist/*.zip
128
+ dist/*.sha256
129
+ fail_on_unmatched_files: true
130
+
131
+ major-tag:
132
+ name: Move floating major tag (e.g. v0)
133
+ needs: attach
134
+ runs-on: ubuntu-latest
135
+ # Pre-releases (v1.2.3-rc.1) don't move the floating tag.
136
+ if: ${{ !contains(github.ref_name, '-') }}
137
+ steps:
138
+ - uses: actions/checkout@v5
139
+ - name: Force-update major tag
140
+ run: |
141
+ set -euo pipefail
142
+ major="${GITHUB_REF_NAME%%.*}" # v0.9.1 -> v0
143
+ git tag -f "$major" "$GITHUB_SHA"
144
+ git push -f origin "refs/tags/$major"
145
+
146
+ docker:
147
+ name: Publish container image (ghcr.io)
148
+ runs-on: ubuntu-latest
149
+ permissions:
150
+ contents: read
151
+ packages: write
152
+ steps:
153
+ - uses: actions/checkout@v5
154
+ - uses: docker/setup-qemu-action@v4
155
+ - uses: docker/setup-buildx-action@v4
156
+ - uses: docker/login-action@v4
157
+ with:
158
+ registry: ghcr.io
159
+ username: ${{ github.actor }}
160
+ password: ${{ secrets.GITHUB_TOKEN }}
161
+ - name: Compute tags
162
+ id: tags
163
+ run: |
164
+ set -euo pipefail
165
+ image="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/dbt-lineage"
166
+ version="${GITHUB_REF_NAME#v}" # 0.10.0 or 0.10.0-rc.1
167
+ tags="$image:$version"
168
+ if [[ "$version" != *-* ]]; then
169
+ major="${version%%.*}"
170
+ minor="${version#*.}"; minor="${minor%%.*}"
171
+ tags="$tags,$image:$major.$minor,$image:v$major,$image:latest"
172
+ fi
173
+ echo "tags=$tags" >> "$GITHUB_OUTPUT"
174
+ - uses: docker/build-push-action@v7
175
+ with:
176
+ context: .
177
+ platforms: linux/amd64,linux/arm64
178
+ push: true
179
+ tags: ${{ steps.tags.outputs.tags }}
180
+ labels: |
181
+ org.opencontainers.image.source=https://github.com/${{ github.repository }}
182
+ org.opencontainers.image.description=PR-time dbt lineage, impact analysis and rebuild plans
183
+ org.opencontainers.image.licenses=MIT
184
+ cache-from: type=gha
185
+ cache-to: type=gha,mode=max
186
+
187
+ bitbucket-pipe:
188
+ name: Publish Bitbucket Pipe image (ghcr.io)
189
+ needs: docker
190
+ runs-on: ubuntu-latest
191
+ permissions:
192
+ contents: read
193
+ packages: write
194
+ steps:
195
+ - uses: actions/checkout@v5
196
+ - uses: docker/setup-qemu-action@v4
197
+ - uses: docker/setup-buildx-action@v4
198
+ - uses: docker/login-action@v4
199
+ with:
200
+ registry: ghcr.io
201
+ username: ${{ github.actor }}
202
+ password: ${{ secrets.GITHUB_TOKEN }}
203
+ - name: Compute tags
204
+ id: tags
205
+ run: |
206
+ set -euo pipefail
207
+ owner="${GITHUB_REPOSITORY_OWNER,,}"
208
+ image="ghcr.io/$owner/dbt-lineage-pipe"
209
+ version="${GITHUB_REF_NAME#v}"
210
+ tags="$image:$version"
211
+ if [[ "$version" != *-* ]]; then
212
+ major="${version%%.*}"
213
+ minor="${version#*.}"; minor="${minor%%.*}"
214
+ tags="$tags,$image:$major.$minor,$image:v$major,$image:latest"
215
+ fi
216
+ echo "tags=$tags" >> "$GITHUB_OUTPUT"
217
+ echo "base=ghcr.io/$owner/dbt-lineage:$version" >> "$GITHUB_OUTPUT"
218
+ - uses: docker/build-push-action@v7
219
+ with:
220
+ context: integrations/bitbucket
221
+ platforms: linux/amd64,linux/arm64
222
+ push: true
223
+ build-args: BASE_IMAGE=${{ steps.tags.outputs.base }}
224
+ tags: ${{ steps.tags.outputs.tags }}
225
+ labels: |
226
+ org.opencontainers.image.source=https://github.com/${{ github.repository }}
227
+ org.opencontainers.image.description=dbt-lineage Bitbucket Pipe
228
+ org.opencontainers.image.licenses=MIT
@@ -0,0 +1,8 @@
1
+ /target
2
+ demo.tape
3
+ # Per-project parse cache (created automatically when dbt-lineage runs against
4
+ # a project). Safe to delete; see docs/CACHE.md.
5
+ .dbt-lineage/
6
+
7
+ # Claude Code agent worktrees
8
+ .claude/worktrees/
@@ -0,0 +1,24 @@
1
+ # pre-commit hooks for dbt projects. Usage in a dbt repo's .pre-commit-config.yaml:
2
+ #
3
+ # - repo: https://github.com/sipemu/dbt-lineage-viewer
4
+ # rev: v0.10.0
5
+ # hooks:
6
+ # - id: dbt-lineage-lint
7
+ # - id: dbt-lineage-check-manifest
8
+ #
9
+ # Pass `args: [-p, path/to/dbt]` when the dbt project is not at the repo root.
10
+ - id: dbt-lineage-lint
11
+ name: dbt-lineage lint
12
+ description: Structural lint of the dbt DAG (dead ends, undefined refs, unused sources, missing docs).
13
+ entry: dbt-lineage lint
14
+ language: rust
15
+ pass_filenames: false
16
+ files: \.(sql|py|ya?ml|csv)$
17
+
18
+ - id: dbt-lineage-check-manifest
19
+ name: dbt-lineage check-manifest
20
+ description: Fail if target/manifest.json is out of sync with the SQL files (requires a compiled manifest).
21
+ entry: dbt-lineage check-manifest
22
+ language: rust
23
+ pass_filenames: false
24
+ files: \.(sql|py|ya?ml)$
@@ -0,0 +1,56 @@
1
+ # Benchmarks
2
+
3
+ Baseline numbers for the SQL-parse-mode graph builder. Generated by
4
+ `cargo bench --bench builder_bench`. Numbers below are from a single
5
+ machine (Linux, AMD64, Rust stable). Use them as relative references,
6
+ not absolute targets.
7
+
8
+ ## Fixture
9
+
10
+ `benches/builder_bench.rs` generates a synthetic 500-model dbt project
11
+ into a temp directory on first invocation:
12
+
13
+ - 200 staging models, each ~6 lines of SQL with one source reference.
14
+ - 300 mart models, each ~8 lines of SQL with two ref calls (one via a
15
+ detected wrapper macro to exercise #13).
16
+ - One `schema.yml` per layer with model descriptions.
17
+ - One macro file defining a simple `ref()` wrapper.
18
+
19
+ Total: 500 nodes, 500 `ref()` calls, 200 `source()` calls.
20
+
21
+ ## Baseline (0.5.1)
22
+
23
+ | Target | Time | Notes |
24
+ |---|---|---|
25
+ | `build_graph_cold` (no cache) | **~17 ms** | Parses every file from scratch. Rayon parallelization across cores. |
26
+ | `build_graph_warm` (cache hit) | **~4.3 ms** | Cache populated by a prior cold run. Walks dirs + hashes files + serves cached parse. |
27
+ | `compute_summary` | **~114 µs** | Aggregation only — no I/O. |
28
+ | `compute_impact` | **~1.3 µs** | BFS from a deep-fan-in staging model. |
29
+
30
+ **Warm vs cold ratio: ~4×.** The warm path skips the lexer + regex
31
+ parsing entirely, just walks dirs and hashes file contents. The ratio
32
+ grows on real projects where model files are larger and parsing is
33
+ proportionally heavier.
34
+
35
+ ### Lexer overhead (#25)
36
+
37
+ Cold parse went from ~14.4ms (0.5.0, regex-only) to ~17ms (0.5.1, with
38
+ Jinja+SQL lexer in the path). The ~15% extra buys correctness — false
39
+ positives from `ref(` inside string literals and comments are now
40
+ eliminated. Worth it.
41
+
42
+ ## Reading the numbers
43
+
44
+ For context: 14.4 ms cold means a 500-model project rebuilds the full
45
+ graph in well under a frame on a developer laptop. 5.2 ms warm is
46
+ sub-frame, effectively instant. The cache earns its keep most on
47
+ projects where:
48
+
49
+ - Models are large (heavy Jinja, many lines of SQL).
50
+ - The user runs `dbt-lineage` repeatedly (TUI dev loop, CI watch).
51
+
52
+ ## Regression policy
53
+
54
+ When changes to the parser, builder, or cache affect these numbers,
55
+ update this file in the same commit. CI doesn't gate on bench
56
+ performance yet — these are reference numbers for humans.