Skip to content

Commit

Permalink
draft commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Apr 22, 2024
1 parent 8d0b0cd commit c2da70c
Show file tree
Hide file tree
Showing 34 changed files with 1,065 additions and 1,265 deletions.
35 changes: 0 additions & 35 deletions .bumpversion.cfg

This file was deleted.

38 changes: 38 additions & 0 deletions .github/actions/update-dev-branches/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Update dev branches"
description: "Update dev branches for testing cross-repo changes"

inputs:
dbt-adapters-branch:
description: "The branch/tag of `dbt-adapters` to use"
default: ""
dbt-common-branch:
description: "The branch/tag of `dbt-common` to use"
default: ""
dbt-core-branch:
description: "The branch/tag of `dbt-core` to use"
default: ""

runs:
using: composite
steps:
- name: "[DEBUG] Inputs"
shell: bash
run: |
echo dbt-adapters : ${{ inputs.dbt-adapters-branch }}
echo dbt-common : ${{ inputs.dbt-common-branch }}
echo dbt-core : ${{ inputs.dbt-core-branch }}
- name: "Update `dbt-adapters` branch"
if: ${{ inputs.dbt-adapters-branch }}
shell: bash
run: ./.github/actions/update-dev-branches/update_dev_branch.sh "dbt-adapters" ${{ inputs.dbt-adapters-branch }}

- name: "Update `dbt-common` branch"
if: ${{ inputs.dbt-common-branch }}
shell: bash
run: ./.github/actions/update-dev-branches/update_dev_branch.sh "dbt-common" ${{ inputs.dbt-common-branch }}

- name: "Update `dbt-core` branch"
if: ${{ inputs.dbt-core-branch }}
shell: bash
run: ./.github/actions/update-dev-branches/update_dev_branch.sh "dbt-core" ${{ inputs.dbt-core-branch }}
15 changes: 15 additions & 0 deletions .github/actions/update-dev-branches/update_dev_branch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -e
set -e

package=$1
branch=$2

file="pyproject.toml"
sed_pattern="s|${package}.git@main*|${package}.git@${branch}|g"

# mac ships with a different version of sed that requires a delimiter arg
if [[ "$OSTYPE" == darwin* ]]; then
sed -i "" "$sed_pattern" $file
else
sed -i "$sed_pattern" $file
fi
87 changes: 0 additions & 87 deletions .github/scripts/integration-test-matrix.js

This file was deleted.

20 changes: 0 additions & 20 deletions .github/scripts/update_dbt_core_branch.sh

This file was deleted.

3 changes: 2 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ on:
- labeled

permissions:
pull-requests: write # to create the PR

pull-requests: write# to create the PR
contents: write # to create the comment if the process fails

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bot-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ name: "Bot changelog"

on:
pull_request:

types:
- opened
- labeled
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# **what?**
# Verifies python build on all code commited to the repository. This workflow
# should not require any secrets since it runs for PRs from forked repos. By
# default, secrets are not passed to workflows running from a forked repos.

# **why?**
# Ensure code for dbt meets a certain quality standard.

# **when?**
# This will run for all PRs, when code is pushed to main, and when manually triggered.
name: "Build release"

on:
workflow_call:
inputs:
branch:
description: "The branch/tag to run integration tests on"
type: string
default: "main"
archive-name:
description: "The name to use for the upload archive, leave blank for no upload"
type: string
default: ""
workflow_dispatch:
inputs:
branch:
description: "The branch/tag to run integration tests on"
type: string
default: "main"
archive-name:
description: "The name to use for the upload archive, leave blank for no upload"
type: string
default: ""

permissions: read-all

concurrency:
group: "${{ github.workflow }}-${{ github.event_name }}-${{ inputs.archive-name }}"
cancel-in-progress: true

jobs:
build:
name: "Build a release"
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: "Check out ${{ github.repository }}@${{ inputs.branch }}"
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- name: "Setup environment"
uses: dbt-labs/dbt-adapters/.github/actions/setup-environment@update-workflows
with:
python-version: ${{ vars.DBT_TEST_PYTHON_VERSION }}

- name: "Build ${{ github.event.repository.name }}"
uses: dbt-labs/dbt-adapters/.github/actions/build-artifacts@update-workflows
with:
archive-name: ${{ inputs.archive-name }}
46 changes: 46 additions & 0 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# **what?**
# Checks that a file has been committed under the /.changes directory
# as a new CHANGELOG entry. Cannot check for a specific filename as
# it is dynamically generated by change type and timestamp.
# This workflow should not require any secrets since it runs for PRs
# from forked repos.
# By default, secrets are not passed to workflows running from
# a forked repo.
#
# **why?**
# Ensure code changes are reflected in the CHANGELOG.
#
# **when?**
# This will run for all PRs going into main and *.latest. It will run when:
# - the PR is opened or reopened
# - labels are updated on the PR
# - new code is pushed to the branch
# The action will get skipped if the 'Skip Changelog' label is present.
name: Check Changelog Entry

on:
pull_request:
types:
- opened
- reopened
- labeled
- unlabeled
- synchronize
workflow_dispatch:

defaults:
run:
shell: bash

permissions:
contents: read
pull-requests: write

jobs:
changelog:
uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@main
with:
changelog_comment: "Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the [dbt-redshift contributing guide](https://github.com/dbt-labs/dbt-redshift/blob/main/CONTRIBUTING.md)."
skip_label: "Skip Changelog"
# this is only acceptable because we own the action we're calling
secrets: inherit
27 changes: 27 additions & 0 deletions .github/workflows/clean-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# **what?**
# Cleanup branches left over from automation and testing.
# Also cleanup draft releases from release testing.
#
# **why?**
# The automations are leaving behind branches and releases that clutter the repository.
# Sometimes we need them to debug processes so we don't want them immediately deleted.
# Running on Saturday to avoid running at the same time as an actual release
# to prevent breaking a release mid-release.
#
# **when?**
# - every Saturday at noon UTC
# - manually
name: "Clean repo"

on:
schedule:
- cron: '0 12 * * SAT' # noon UTC on Saturday - details in `why` above
workflow_dispatch:

permissions:
contents: write

jobs:
cleanup-repo:
uses: dbt-labs/actions/.github/workflows/repository-cleanup.yml@main
secrets: inherit
Loading

0 comments on commit c2da70c

Please sign in to comment.