mirror of
https://github.com/dbt-labs/dbt-core
synced 2025-12-17 19:31:34 +00:00
* initial hatch implmentation
* cleanup docs
* replacing makefile
* cleanup hatch commands to match adapters
reorganize more to match adapters setup
script comment
dont pip install
fix test commands
* changelog
improve changelog
* CI fix
* fix for env
* use a standard version file
* remove odd license logic
* fix bumpversion
* remove sha input
* more cleanup
* fix legacy build path
* define version for pyproject.toml
* use hatch hook for license
* remove tox
* ensure tests are split
* remove temp file for testing
* explicitly match old verion in pyproject.toml
* fix up testing
* get rid of bumpversion
* put dev_dependencies.txtin hatch
* setup.py is now dead
* set python version for local dev
* local dev fixes
* temp script to compare wheels
* parity with existing wheel builds
* Revert "temp script to compare wheels"
This reverts commit c31417a092.
* fix docker test file
102 lines
3.8 KiB
YAML
102 lines
3.8 KiB
YAML
# **what?**
|
|
# Compares the schema of the dbt version of the given ref vs
|
|
# the latest official schema releases found in schemas.getdbt.com.
|
|
# If there are differences, the workflow will fail and upload the
|
|
# diff as an artifact. The metadata team should be alerted to the change.
|
|
#
|
|
# **why?**
|
|
# Reaction work may need to be done if artifact schema changes
|
|
# occur so we want to proactively alert to it.
|
|
#
|
|
# **when?**
|
|
# Only can be run manually
|
|
name: Artifact Schema Check
|
|
|
|
on:
|
|
# pull_request:
|
|
# types: [ opened, reopened, labeled, unlabeled, synchronize ]
|
|
# paths-ignore: [ '.changes/**', '.github/**', 'tests/**', '**.md', '**.yml' ]
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
target_branch:
|
|
description: "The branch to check against"
|
|
type: string
|
|
default: "main"
|
|
required: true
|
|
|
|
# no special access is needed
|
|
permissions: read-all
|
|
|
|
env:
|
|
LATEST_SCHEMA_PATH: ${{ github.workspace }}/new_schemas
|
|
SCHEMA_DIFF_ARTIFACT: ${{ github.workspace }}/schema_changes.txt
|
|
DBT_REPO_DIRECTORY: ${{ github.workspace }}/dbt
|
|
SCHEMA_REPO_DIRECTORY: ${{ github.workspace }}/schemas.getdbt.com
|
|
|
|
jobs:
|
|
checking-schemas:
|
|
name: "Post-merge schema changes required"
|
|
runs-on: ${{ vars.UBUNTU_LATEST }}
|
|
|
|
steps:
|
|
- name: Set up Python
|
|
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # actions/setup-python@v6
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Checkout dbt repo
|
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
|
|
with:
|
|
path: ${{ env.DBT_REPO_DIRECTORY }}
|
|
ref: ${{ inputs.target_branch }}
|
|
|
|
- name: Check for changes in core/dbt/artifacts
|
|
# https://github.com/marketplace/actions/paths-changes-filter
|
|
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # dorny/paths-filter@v3
|
|
id: check_artifact_changes
|
|
with:
|
|
filters: |
|
|
artifacts_changed:
|
|
- 'core/dbt/artifacts/**'
|
|
list-files: shell
|
|
working-directory: ${{ env.DBT_REPO_DIRECTORY }}
|
|
|
|
- name: Succeed if no artifacts have changed
|
|
if: steps.check_artifact_changes.outputs.artifacts_changed == 'false'
|
|
run: |
|
|
echo "No artifact changes found in core/dbt/artifacts. CI check passed."
|
|
|
|
- name: Checkout schemas.getdbt.com repo
|
|
if: steps.check_artifact_changes.outputs.artifacts_changed == 'true'
|
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
|
|
with:
|
|
repository: dbt-labs/schemas.getdbt.com
|
|
ref: "main"
|
|
path: ${{ env.SCHEMA_REPO_DIRECTORY }}
|
|
|
|
- name: Generate current schema
|
|
if: steps.check_artifact_changes.outputs.artifacts_changed == 'true'
|
|
run: |
|
|
cd ${{ env.DBT_REPO_DIRECTORY }}/core
|
|
pip install --upgrade pip hatch
|
|
hatch run setup
|
|
hatch run json-schema -- --path ${{ env.LATEST_SCHEMA_PATH }}
|
|
|
|
# Copy generated schema files into the schemas.getdbt.com repo
|
|
# Do a git diff to find any changes
|
|
# Ignore any lines with date-like (yyyy-mm-dd) or version-like (x.y.z) changes
|
|
- name: Compare schemas
|
|
if: steps.check_artifact_changes.outputs.artifacts_changed == 'true'
|
|
run: |
|
|
cp -r ${{ env.LATEST_SCHEMA_PATH }}/dbt ${{ env.SCHEMA_REPO_DIRECTORY }}
|
|
cd ${{ env.SCHEMA_REPO_DIRECTORY }}
|
|
git diff -I='*[0-9]{4}-[0-9]{2}-[0-9]{2}' -I='*[0-9]+\.[0-9]+\.[0-9]+' --exit-code > ${{ env.SCHEMA_DIFF_ARTIFACT }}
|
|
|
|
- name: Upload schema diff
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # actions/upload-artifact@v4
|
|
if: ${{ failure() && steps.check_artifact_changes.outputs.artifacts_changed == 'true' }}
|
|
with:
|
|
name: "schema_changes.txt"
|
|
path: "${{ env.SCHEMA_DIFF_ARTIFACT }}"
|