Skip to content

Commit 465f8dc

Browse files
anandgupta42claude
andcommitted
refactor: remove hand-rolled dbt parser, use altimate-code CLI instead
Removed the lightweight ref()-based DAG parser (dbt-lightweight.ts). It was a shortcut that would break on cross-package refs, dynamic refs, Jinja conditionals, ephemeral models, etc. Now: - altimate-code CLI is ALWAYS installed (from GitHub release binaries) - Impact analysis uses the real CLI tools (impact_analysis, dbt_manifest) - Static mode = no LLM for SQL review, but dbt analysis uses real tools - Fallback: CLI-based impact analysis when no manifest available Also fixed CLI installation: - Downloads binary directly from GitHub releases (the install script at altimate.ai/install redirects to the marketing website) - Supports linux x64/arm64, darwin x64/arm64 - Caches binary per version Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 46ebc95 commit 465f8dc

File tree

6 files changed

+139
-790
lines changed

6 files changed

+139
-790
lines changed

action.yml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,31 +95,59 @@ runs:
9595
steps:
9696
- name: Get altimate-code version
9797
id: version
98-
if: inputs.mode != 'static'
9998
shell: bash
10099
run: |
101100
VERSION=$(curl -sf -H "Authorization: Bearer ${{ github.token }}" https://api.github.com/repos/AltimateAI/altimate-code/releases/latest | grep -o '"tag_name": *"[^"]*"' | cut -d'"' -f4)
102101
echo "version=${VERSION:-latest}" >> $GITHUB_OUTPUT
103102
104103
- name: Cache altimate-code
105104
id: cache
106-
if: inputs.mode != 'static'
107105
uses: actions/cache@v4
108106
with:
109107
path: ~/.altimate-code/bin
110108
key: altimate-code-${{ runner.os }}-${{ runner.arch }}-${{ steps.version.outputs.version }}
111109

112110
- name: Install altimate-code
113-
if: inputs.mode != 'static' && steps.cache.outputs.cache-hit != 'true'
111+
if: steps.cache.outputs.cache-hit != 'true'
114112
shell: bash
115113
run: |
116-
# Install altimate-code CLI (required for full/ai modes)
117-
npm install -g @anthropic-ai/claude-code@latest 2>/dev/null || \
118-
curl -fsSL https://altimate.ai/install | bash || \
119-
echo "::warning::altimate-code CLI not available — static mode still works"
114+
# Download binary directly from GitHub releases
115+
VERSION="${{ steps.version.outputs.version }}"
116+
ARCH=$(uname -m)
117+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
118+
119+
# Map architecture names
120+
case "$ARCH" in
121+
x86_64) ARCH="x64" ;;
122+
aarch64|arm64) ARCH="arm64" ;;
123+
esac
124+
125+
ASSET="altimate-code-${OS}-${ARCH}"
126+
if [ "$OS" = "linux" ]; then
127+
ASSET="${ASSET}.tar.gz"
128+
else
129+
ASSET="${ASSET}.zip"
130+
fi
131+
132+
DOWNLOAD_URL="https://github.com/AltimateAI/altimate-code/releases/download/${VERSION}/${ASSET}"
133+
echo "Downloading altimate-code ${VERSION} from ${DOWNLOAD_URL}"
134+
135+
mkdir -p ~/.altimate-code/bin
136+
cd /tmp
137+
if curl -fsSL -o "altimate-code-archive" "$DOWNLOAD_URL"; then
138+
if [ "$OS" = "linux" ]; then
139+
tar xzf altimate-code-archive -C ~/.altimate-code/bin/ 2>/dev/null || true
140+
else
141+
unzip -o altimate-code-archive -d ~/.altimate-code/bin/ 2>/dev/null || true
142+
fi
143+
chmod +x ~/.altimate-code/bin/altimate-code 2>/dev/null || true
144+
rm -f altimate-code-archive
145+
echo "altimate-code installed successfully"
146+
else
147+
echo "::warning::Failed to download altimate-code binary — some features may be limited"
148+
fi
120149
121150
- name: Add altimate-code to PATH
122-
if: inputs.mode != 'static'
123151
shell: bash
124152
run: |
125153
[ -d "$HOME/.altimate-code/bin" ] && echo "$HOME/.altimate-code/bin" >> $GITHUB_PATH || true

0 commit comments

Comments
 (0)