Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release workflow #732

Merged
merged 83 commits into from
Oct 17, 2024
Merged

Update release workflow #732

merged 83 commits into from
Oct 17, 2024

Conversation

mikealfare
Copy link
Contributor

@mikealfare mikealfare commented Oct 1, 2024

Description

This PR does multiple things that are all closely related:

Migrate to hatch

Take the existing dbt-athena-community package and rename it dbt-athena.

  • move existing dbt-athena-community into dbt-athena namespace package
  • move code quality config into .pre-commit-config.yaml
  • create pyproject.toml for dbt-athena
  • remove Makefile, MANIFEST.in, dev-requirements.txt, pytest.ini, setup.py
  • update ci, functional-tests, and functional-tests-workflow workflows to point to the new targets

Create dbt-athena-community shell package

Create a new dbt-athena-community package that is a simple wrapper around dbt-athena to preserve backwards compatibility.

  • create new dbt-athena-community namespace package
  • create pyproject.toml for dbt-athena-community
  • update ci, functional-tests, and functional-tests-workflow workflows to take the package as an input, defaulted to dbt-athena

Update release

  • configure PyPI and GHA to use trusted publishers
  • create environments for publishing to test and prod
  • support publishing for both packages

Standardize workflows

  • create reusable workflows for code-quality, unit-tests, integration-tests, and publish-pypi
  • replace ci with pull-request-checks, which calls to code-quality, unit-tests, and integration-tests
  • replace functional-tests-workflow with merge-checks, which calls to integration-tests
  • add label ci:integration-tests to optionally run integration tests during a pr (useful for not running on forks automatically, or skipping integration tests on small changes)
  • allow dispatch of all reusable workflows
  • use alls-green to minimize branch protection rules

Update docs

  • update CONTRIBUTING.md
  • updateRELEASING.md

Checklist

  • You followed contributing section
  • You kept your Pull Request small and focused on a single feature or bug fix.
  • You added unit testing when necessary
  • You added functional testing when necessary

… and prod pypi, and to publish to both packages on pypi
@mikealfare mikealfare self-assigned this Oct 1, 2024
@mikealfare mikealfare requested a review from a team as a code owner October 1, 2024 20:12
@mikealfare mikealfare added the Skip Changelog Skips GHA to check for changelog file label Oct 1, 2024
@mikealfare mikealfare marked this pull request as draft October 2, 2024 00:26
@mikealfare
Copy link
Contributor Author

The skipped/failing functional-tests checks are the workflows from main. These don't work with the new setup since files moved and tests are invoked differently now. The same tests are run via Pull request checks / integration-tests / integration-tests (pull_request).

I triggered the Publish workflow via the GH CLI with parameters for test PyPI and this branch:

gh workflow run publish.yml \
  --ref actions/public-pypi-deploy \
  -f deploy-to=test \
  -f branch=actions/public-pypi-deploy

Workflow run: https://github.com/dbt-labs/dbt-athena/actions/runs/11300329526
PyPI dbt-athena: https://test.pypi.org/project/dbt-athena/1.8.5rc1/
PyPI dbt-athena-community: https://test.pypi.org/project/dbt-athena-community/1.8.5rc1/

I can verify that installing dbt-athena-community gives me dbt-athena:

# create a virtual environment with only pip and setuptools installed
python -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools
pip list

Package    Version
---------- -------
pip        24.2
setuptools 75.1.0

# install dbt-athena-community from test PyPI to get the version in this PR
pip install dbt-athena-community==1.8.5rc1 \
  --index https://test.pypi.org/simple/ \
  --extra-index-url https://pypi.org/simple/

# we get both dbt-athena-community and dbt-athena
pip list | grep dbt-athena

dbt-athena                1.8.5rc1
dbt-athena-community      1.8.5rc1

Since dbt-athena-community used the namespace athena and not athena-community, everything should continue to work the same. The only difference in the packages is an extra, empty athena-community package inside dbt/adapters in the dbt-athena-community package.

@mikealfare mikealfare marked this pull request as ready for review October 12, 2024 00:07
@mikealfare mikealfare merged commit 5db80c7 into main Oct 17, 2024
14 of 15 checks passed
@mikealfare mikealfare deleted the actions/public-pypi-deploy branch October 17, 2024 19:13
@colin-rogers-dbt colin-rogers-dbt mentioned this pull request Dec 2, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Skips GHA to check for changelog file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants