-
Notifications
You must be signed in to change notification settings - Fork 9
docs: create guides for version control and continuous integration #356
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <!-- | ||
| Copyright 2026 Columnar Technologies Inc. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
|
|
||
| # Continuous Integration | ||
|
|
||
| dbc works well in non-interactive environments such as on continuous integration (CI) platforms. You may also want to read through our [Version Control](./version_control.md) guide as these two concepts are related. | ||
|
|
||
| ## GitHub Actions | ||
|
|
||
| We recommend using the [columnar-tech/setup-dbc](https://github.com/columnar-tech/setup-dbc) action if you're using [GitHub Actions](https://docs.github.com/en/actions) for CI. | ||
|
|
||
| As an example, here's a workflow that automatically installs all drivers listed in your [driver list](../concepts/driver_list.md) before running your tests: | ||
|
|
||
| ```yaml | ||
| name: Test | ||
| on: [push] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| # Note: Automatically installs drivers specified in dbc.toml | ||
| - uses: columnar-tech/setup-dbc@v1 | ||
|
|
||
| - name: Run tests | ||
| run: pytest ... | ||
| ``` | ||
|
|
||
| See the [columnar-tech/setup-dbc README](https://github.com/columnar-tech/setup-dbc) for usage information and more examples. | ||
|
|
||
| ## Other CI Systems | ||
|
|
||
| To use dbc with other CI systems, we recommend using our command line installers because they will always install the latest version of dbc for whatever platform you run them on. | ||
|
|
||
| As an example for you to adapt to your system, here's a GitHub Actions workflow that installs and makes dbc available without using [columnar-tech/setup-dbc](https://github.com/columnar-tech/setup-dbc): | ||
|
|
||
| {% raw %} | ||
| ```yaml | ||
| name: Test | ||
| on: [push] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Install dbc (Linux, macOS) | ||
| if: runner.os != 'Windows' | ||
| run: | | ||
| curl -LsSf https://dbc.columnar.tech/install.sh | sh | ||
|
|
||
| - name: Install dbc (Windows) | ||
| if: runner.os == 'Windows' | ||
| run: | | ||
| powershell -ExecutionPolicy ByPass -c "irm https://dbc.columnar.tech/install.ps1 | iex" | ||
|
|
||
| - name: Add dbc to PATH (Linux, macOS) | ||
| if: runner.os != 'Windows' | ||
| shell: bash | ||
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
|
||
| - name: Add dbc to PATH (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| run: | | ||
| Join-Path $env:USERPROFILE ".local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
|
|
||
| - name: Run tests | ||
| run: pytest ... | ||
| ``` | ||
| {% endraw %} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| <!-- | ||
| Copyright 2026 Columnar Technologies Inc. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
|
|
||
| # Version Control | ||
|
|
||
| When using dbc in projects where version control software such as [git](https://git-scm.com) is being used, we recommend the following: | ||
|
|
||
| - Use a [driver list](../concepts/driver_list.md) to record drivers and their version constraints instead of installing drivers manually with [`dbc install`](./installing.md) | ||
| - Track `dbc.toml` with version control and always use `dbc sync` to install drivers after checkout | ||
| - To maximize reproducibility, also track [`dbc.lock`](./driver_list.md#lockfile) | ||
| - Don't track installed driver directories with version control, use `dbc.toml` instead | ||
|
|
||
| ## Example Workflow | ||
|
|
||
| To help illustrate how this works in practice, see the example below for how to use dbc when collaborating with git. This assumes both developers have already [installed](../getting_started/installation.md) dbc. | ||
|
|
||
| Developer 1 sets up dbc with the drivers their project needs: | ||
|
|
||
| ```console | ||
| # Create a driver list file | ||
| $ dbc init | ||
|
|
||
| # Add the mysql and sqlite drivers to it. Constrain sqlite's version. | ||
| $ dbc add mysql "sqlite<2" | ||
| added mysql to driver list | ||
| added sqlite to driver list with constraint <2 | ||
| use `dbc sync` to install the drivers in the list | ||
|
|
||
| # Install the drivers from dbc.toml | ||
| $ dbc sync | ||
| ✓ mysql-0.1.0 | ||
| ✓ sqlite-1.11.0 | ||
| Done! | ||
|
|
||
| # Start tracking dbc.toml with git | ||
| $ git add dbc.toml | ||
|
|
||
| # Commit and push | ||
| $ git commit -m "Create dbc.toml" | ||
| $ git push | ||
| ``` | ||
|
|
||
| Developer 2 then clones the repository and uses `dbc sync`: | ||
|
|
||
| ```console | ||
| $ git clone example/repo | ||
|
|
||
| # Install the drivers from dbc.toml | ||
| $ dbc sync | ||
| ✓ mysql-0.1.0 | ||
| ✓ sqlite-1.11.0 | ||
| Done! | ||
| ``` | ||
|
|
||
| Now, at this point, both Developer 1 and Developer 2 have the same set of drivers available on their systems. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to add an example for simply installing individual drivers instead of the dbc.toml etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? When I wrote this, I was thinking that we should nudge users to use driver lists wherever we can. I personally didn't like specifying drivers inline and I'm not sure users will like it either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're not going to include the example, can we at least make sure we point at the setup-dbc README which has all the possible options and examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR currently does that in a way that will work well.
Thoughts on that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!