Skip to content

Commit

Permalink
Merge branch 'main' into ADAP-1167/add-athena-adapter-telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare authored Jan 28, 2025
2 parents 6a1b696 + 5de8679 commit 7dc3f79
Show file tree
Hide file tree
Showing 396 changed files with 648 additions and 276 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
updates:
- package-ecosystem: "pip"
directories:
- "/"
- "/dbt-adapters"
- "/dbt-tests-adapter"
- "/dbt-athena"
- "/dbt-athena-community"
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/_changelog-entry-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ permissions:
contents: read
pull-requests: write

jobs:
package:
uses: ./.github/workflows/_package-directory.yml
with:
package: ${{ inputs.package }}
defaults:
run:
shell: bash

jobs:
changelog-check:
needs: package
if: ${{ !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') }}
outputs:
exists: ${{ steps.changelog.outputs.exists }}
Expand All @@ -37,7 +35,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
exists:
- added|modified: '${{ needs.package.outputs.directory }}.changes/unreleased/**.yaml'
- added|modified: '${{ inputs.package }}/.changes/unreleased/**.yaml'
comment:
needs: changelog-check
Expand All @@ -57,7 +55,6 @@ jobs:
body-includes: ${{ env.COMMENT }}
- if: steps.comment.outputs.comment-body == ''
run: gh issue comment ${{ inputs.pull-request }} --repo ${{ github.repository }} --body "${{ env.COMMENT }}"
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@v7
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/_generate-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ defaults:
shell: bash

jobs:
package:
uses: ./.github/workflows/_package-directory.yml
with:
package: ${{ inputs.package }}

version:
needs: package
runs-on: ${{ vars.DEFAULT_RUNNER }}
outputs:
raw: ${{ steps.version.outputs.raw }}
Expand All @@ -87,14 +81,14 @@ jobs:
- uses: pypa/hatch@install
- id: version
run: echo "raw=$(hatch version)" >> $GITHUB_OUTPUT
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
- id: semver
uses: dbt-labs/actions/[email protected]
with:
version: ${{ steps.version.outputs.raw }}

changelog:
needs: [package, version]
needs: version
runs-on: ${{ vars.DEFAULT_RUNNER }}
outputs:
path: ${{ steps.changelog.outputs.path }}
Expand All @@ -120,7 +114,7 @@ jobs:
exists=true
fi
echo "exists=$exists">> $GITHUB_OUTPUT
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}

temp-branch:
needs: [version, changelog]
Expand Down Expand Up @@ -161,7 +155,7 @@ jobs:
- run: rm ${{ steps.temp-file.outputs.name }}

generate-changelog:
needs: [package, version, changelog, temp-branch, dbt-membership]
needs: [version, changelog, temp-branch, dbt-membership]
if: needs.changelog.outputs.exists == 'false'
runs-on: ${{ vars.DEFAULT_RUNNER }}
steps:
Expand All @@ -184,13 +178,12 @@ jobs:
changie batch ${{ needs.version.outputs.base }}
fi
changie merge
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
env:
CHANGIE_CORE_TEAM: ${{ needs.dbt-membership.outputs.team }}
- run: |
pre-commit run trailing-whitespace --files __version__.py CHANGELOG.md .changes/*
pre-commit run end-of-file-fixer --files __version__.py CHANGELOG.md .changes/*
working-directory: ./${{ needs.package.outputs.directory }}
continue-on-error: true
- run: |
git config user.name "Github Build Bot"
Expand All @@ -199,7 +192,6 @@ jobs:
git add .
git commit -m "generate changelog"
git push
working-directory: ./${{ needs.package.outputs.directory }}
merge-changes:
needs: [temp-branch, generate-changelog]
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/_package-directory.yml

This file was deleted.

14 changes: 4 additions & 10 deletions .github/workflows/_publish-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,7 @@ env:
TEMP_PROFILE_NAME: "temp_aws_profile"

jobs:
package:
uses: ./.github/workflows/_package-directory.yml
with:
package: ${{ inputs.package }}

publish:
needs: package
runs-on: ${{ vars.DEFAULT_RUNNER }}
environment:
name: ${{ inputs.deploy-to }}
Expand All @@ -77,7 +71,7 @@ jobs:
# strip the pre-release off to find all iterations of this patch
hatch version release
echo "version=$(hatch version)" >> $GITHUB_OUTPUT
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
- id: published
run: |
versions_published="$(aws codeartifact list-package-versions \
Expand All @@ -96,12 +90,12 @@ jobs:
- run: |
VERSION=${{ steps.next.outputs.internal_release_version }}+$(git rev-parse HEAD)
tee <<< "version = \"$VERSION\"" ./src/dbt/adapters/$(cut -c 5- ${{ inputs.package }})/__version__.py
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
- run: sed -i "/dbt-core[<>~=]/d" ./pyproject.toml
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
- run: |
pip install twine
hatch build --clean
hatch run build:check-all
twine upload --repository codeartifact dist/*
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
14 changes: 4 additions & 10 deletions .github/workflows/_publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,7 @@ defaults:
shell: bash

jobs:
package:
uses: ./.github/workflows/_package-directory.yml
with:
package: ${{ inputs.package }}

publish:
needs: package
runs-on: ${{ vars.DEFAULT_RUNNER }}
environment:
name: ${{ inputs.deploy-to }}
Expand All @@ -72,15 +66,15 @@ jobs:
# hatch will build using test PyPI first and fall back to prod PyPI when deploying to test
# this is done via environment variables in the test environment in GitHub
- run: hatch build && hatch run build:check-all
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ vars.PYPI_REPOSITORY_URL }}
packages-dir: ./${{ needs.package.outputs.directory }}dist/
packages-dir: ./${{ inputs.package }}/dist/

verify:
runs-on: ${{ vars.DEFAULT_RUNNER }}
needs: [package, publish]
needs: publish
# check the correct index
environment:
name: ${{ inputs.deploy-to }}
Expand All @@ -90,7 +84,7 @@ jobs:
ref: ${{ inputs.branch }}
- id: version
run: echo "version=$(hatch version)" >> $GITHUB_OUTPUT
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
- uses: nick-fields/retry@v3
with:
timeout_seconds: 10
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/_unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ on:
permissions:
contents: read

jobs:
package:
uses: ./.github/workflows/_package-directory.yml
with:
package: ${{ inputs.package }}
defaults:
run:
shell: bash

jobs:
unit-tests:
needs: package
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -76,5 +74,4 @@ jobs:
python-version: ${{ inputs.python-version }}
- uses: pypa/hatch@install
- run: hatch run unit-tests
shell: bash
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
13 changes: 5 additions & 8 deletions .github/workflows/_verify-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ on:

permissions: read-all

jobs:
package:
uses: ./.github/workflows/_package-directory.yml
with:
package: ${{ inputs.package }}
defaults:
run:
shell: bash

jobs:
build:
needs: package
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -76,5 +74,4 @@ jobs:
python-version: ${{ inputs.python-version }}
- uses: pypa/hatch@install
- run: hatch build && hatch run build:check-all
shell: bash
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
18 changes: 8 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ concurrency:
group: ${{ github.workflow }}-${{ inputs.package }}-${{ inputs.deploy-to }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
unit-tests:
uses: ./.github/workflows/_unit-tests.yml
Expand Down Expand Up @@ -90,19 +94,13 @@ jobs:
branch: ${{ needs.generate-changelog.outputs.branch-name }}
secrets: inherit

package:
if: ${{ inputs.pypi-public == true }}
uses: ./.github/workflows/_package-directory.yml
with:
package: ${{ inputs.package }}

publish-pypi:
if: |
always() &&
(needs.integration-tests.result == 'skipped' || needs.integration-tests.result == 'success') &&
needs.generate-changelog.result == 'success' &&
inputs.pypi-public == true
needs: [package, generate-changelog]
needs: generate-changelog
runs-on: ${{ vars.DEFAULT_RUNNER }}
environment:
name: ${{ inputs.deploy-to }}
Expand All @@ -122,14 +120,14 @@ jobs:
# hatch will build using test PyPI first and fall back to prod PyPI when deploying to test
# this is done via environment variables in the test environment in GitHub
- run: hatch build && hatch run build:check-all
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: ${{ vars.PYPI_REPOSITORY_URL }}
packages-dir: ./${{ needs.package.outputs.directory }}dist/
packages-dir: ./${{ inputs.package }}/dist/
- id: version
run: echo "version=$(hatch version)" >> $GITHUB_OUTPUT
working-directory: ./${{ needs.package.outputs.directory }}
working-directory: ./${{ inputs.package }}
- uses: nick-fields/retry@v3
with:
timeout_seconds: 10
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ repos:
- --target-version=py310
- --target-version=py311
- --target-version=py312
- --force-exclude=dbt/adapters/events/adapter_types_pb2.py
- --force-exclude=dbt-adapters/src/dbt/adapters/events/adapter_types_pb2.py
additional_dependencies: [flaky]

- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
exclude: dbt/adapters/events/adapter_types_pb2.py|tests/functional/|dbt-spark/tests/|dbt-bigquery/tests/|dbt-redshift/tests|dbt-postgres/tests|dbt-snowflake/tests
exclude: dbt-adapters/src/dbt/adapters/events/adapter_types_pb2.py|dbt-adapters/tests/|dbt-spark/tests/|dbt-bigquery/tests/|dbt-redshift/tests|dbt-postgres/tests|dbt-snowflake/tests
args:
- --max-line-length=99
- --select=E,F,W
Expand All @@ -46,13 +46,13 @@ repos:
rev: v1.11.2
hooks:
- id: mypy
exclude: dbt/adapters/events/adapter_types_pb2.py|dbt-tests-adapter/dbt/__init__.py
exclude: dbt-adapters/src/dbt/adapters/events/adapter_types_pb2.py|dbt-tests-adapter/src/dbt/__init__.py
args:
- --explicit-package-bases
- --ignore-missing-imports
- --pretty
- --show-error-codes
files: ^dbt/adapters/
files: ^dbt-adapters/src/dbt/adapters/
additional_dependencies:
- types-PyYAML
- types-protobuf
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7dc3f79

Please sign in to comment.