Skip to content

feat: dbt BigQuery 프로젝트 뼈대 + 로컬 stage 연결#14

Merged
RimSM merged 1 commit into
mainfrom
feat/dbt-scaffold
Jul 12, 2026
Merged

feat: dbt BigQuery 프로젝트 뼈대 + 로컬 stage 연결#14
RimSM merged 1 commit into
mainfrom
feat/dbt-scaffold

Conversation

@RimSM

@RimSM RimSM commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Dataform을 dbt로 전환하기 위한 첫 단계 — dbt 프로젝트 뼈대 구축.

  • Medallion 구조: silver(view) / gold(table) 레이어
  • 환경 분리: dev(OAuth, 스테이지) / prod(service-account 키, 운영), DBT_TARGET으로 스위칭
  • GA4 소스: 환경변수(KOIN_DATA_GA4_PROJECT/DATASET)로 dev/prod 입력 스위칭. 못생긴 analytics_* 이름은 ga4 별명으로 가림
  • 매크로: generate_schema_name 오버라이드로 데이터셋 이름 깔끔하게 (silver_silver 방지)
  • docker-compose: dbt 서비스에 DBT_PROFILES_DIR + 로컬 gcloud ADC 마운트

확인 완료

  • 로컬에서 docker compose run --rm dbt debug → stage(koin-stage-438512) 연결 성공 (All checks passed!)

배포 안전성

  • dbt 컨테이너는 --version만 실행하므로 up 시 자동 실행 없음
  • 기존 서비스(Airflow/Superset/Postgres/Caddy) 영향 없음
  • 서버 실 작동은 후속(서비스 계정 키 + 서버 .env prod 값 + Airflow DAG) 필요

남은 작업 (별도 PR)

  • 첫 silver 모델 + dbt run
  • 서버 서비스 계정 키 배치
  • Airflow DAG 연동

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added dbt project configuration for managing data models, macros, tests, and seeds.
    • Added GA4 BigQuery event source definitions, including daily and intraday event data.
    • Added development and production BigQuery target configurations.
    • Configured separate silver and gold data layers with appropriate output formats.
  • Chores

    • Enabled local Google Cloud authentication for dbt workflows running in Docker.

- Medallion(silver/gold) dbt 프로젝트 구조
- dev(OAuth/stage) / prod(service-account/운영) 타겟 분리
- GA4 소스를 환경변수로 dev/prod 스위칭 (sources.yml)
- 데이터셋 이름 깔끔이 매크로 (generate_schema_name)
- docker-compose dbt 서비스: profiles 경로 + 로컬 ADC 마운트

로컬에서 dbt debug 로 stage(koin-stage-438512) 연결 확인 완료.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e366bae-2c01-47fe-a64a-8cd330f7df86

📥 Commits

Reviewing files that changed from the base of the PR and between 018f418 and 479d1c1.

📒 Files selected for processing (5)
  • dbt/dbt_project.yml
  • dbt/macros/generate_schema_name.sql
  • dbt/models/silver/_ga4__sources.yml
  • dbt/profiles.yml
  • docker-compose.yml

📝 Walkthrough

Walkthrough

Adds dbt project and profile configuration for BigQuery, custom schema generation, GA4 event source registration, and Docker-based local OAuth/ADC support.

Changes

dbt BigQuery setup

Layer / File(s) Summary
Project and schema configuration
dbt/dbt_project.yml, dbt/macros/generate_schema_name.sql
Defines dbt directories, cleanup targets, silver/gold materializations and schemas, plus custom schema-name resolution.
BigQuery connection and container wiring
dbt/profiles.yml, docker-compose.yml
Adds development OAuth and production service-account targets, configures the profiles directory, and mounts local Google Cloud credentials read-only.
GA4 source registration
dbt/models/silver/_ga4__sources.yml
Registers the environment-configured GA4 events_* source table pattern.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dbt-scaffold

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@RimSM
RimSM merged commit be6b552 into main Jul 12, 2026
1 check failed
@RimSM
RimSM deleted the feat/dbt-scaffold branch July 12, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant