From 95658f887f20b9c15b6d47787209765ebfae9fc1 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 22 Sep 2025 17:41:45 -0700 Subject: [PATCH 1/8] Add pre-commit workflow --- .github/workflows/dev.yaml | 38 ++++++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 9 +++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/dev.yaml create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml new file mode 100644 index 00000000..9a36e123 --- /dev/null +++ b/.github/workflows/dev.yaml @@ -0,0 +1,38 @@ +# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. + +name: Dev + +on: + push: + branches: + - main + pull_request: + types: + - opened + - edited + - reopened + - synchronize + +permissions: + contents: read + +jobs: + lint: + name: "Run pre-commit" + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-python@v6 + with: + python-version: "3.x" + - name: Install + run: pip install pre-commit + - name: pre-commit (cache) + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + - name: pre-commit + run: | + pre-commit run --all-files --color=always --show-diff-on-failure --verbose diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..ec247735 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: https://github.com/amoeba/license-header-check + rev: 2e3be28cd7328424b5704881ed8ba789d8a52bfb + hooks: + - id: license-header-check + args: + - "--template" + - >- + Copyright \(c\) [YEAR] Columnar Technologies Inc\. All rights reserved\. From 723ab37411ec1785f4a3362ada72df05159e10e5 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 22 Sep 2025 17:56:05 -0700 Subject: [PATCH 2/8] Use v0.1 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ec247735..5841f582 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/amoeba/license-header-check - rev: 2e3be28cd7328424b5704881ed8ba789d8a52bfb + rev: v0.1 hooks: - id: license-header-check args: From d03d4f3a2684fb8b6fcba514c6fbae93035f621d Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 22 Sep 2025 18:01:59 -0700 Subject: [PATCH 3/8] Fix missing headers --- .github/workflows/publish_docs.yml | 1 + .gitignore | 2 + .goreleaser.yaml | 69 ++++++++++++++++++++++-------- .pre-commit-config.yaml | 2 + cmd/dbc/testdata/test_index.yaml | 2 + docs/requirements.txt | 2 + docs/stylesheets/extra.css | 2 + scripts/cdn.py | 2 +- 8 files changed, 62 insertions(+), 20 deletions(-) diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml index 5752a23e..0e9c90bb 100644 --- a/.github/workflows/publish_docs.yml +++ b/.github/workflows/publish_docs.yml @@ -1,3 +1,4 @@ +# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. name: Publish Docs diff --git a/.gitignore b/.gitignore index fb6c10a2..116c965d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. + # If you prefer the allow list template instead of the deny list, see community template: # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore # diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b5fa56d2..480f4681 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -40,7 +40,7 @@ builds: goos: - linux - windows - - darwin + - darwin goarch: - amd64 - arm64 @@ -65,9 +65,9 @@ archives: {{- else }}{{ .Arch }}{{ end }} {{- if .Arm }}v{{ .Arm }}{{ end }}-{{ .Version }} files: - - 'LICENSE*' - - 'README*' - - src: '{{ .ArtifactPath }}*.sig' + - "LICENSE*" + - "README*" + - src: "{{ .ArtifactPath }}*.sig" strip_parent: true # use zip for windows archives format_overrides: @@ -100,7 +100,15 @@ binary_signs: - id: signs if: '{{ ne .Os "windows" }}' signature: '${artifact}_{{ .Os }}_{{ .Arch }}{{ with .Arm }}v{{ . }}{{ end }}{{ with .Mips }}_{{ . }}{{ end }}{{ if not (eq .Amd64 "v1") }}{{ .Amd64 }}{{ end }}.sig' - args: ["--output", "${signature}", "-u", "hello@columnar.tech", "--detach-sign", "${artifact}"] + args: + [ + "--output", + "${signature}", + "-u", + "hello@columnar.tech", + "--detach-sign", + "${artifact}", + ] stdin: "{{ .Env.SIGNING_PASSWORD }}" changelog: @@ -122,24 +130,24 @@ changelog: dockers: - image_templates: - - "columnar/dbc:{{ .Version }}-amd64" + - "columnar/dbc:{{ .Version }}-amd64" use: buildx dockerfile: Dockerfile skip_push: false build_flag_templates: - "--platform=linux/amd64" - image_templates: - - "columnar/dbc:{{ .Tag }}-amd64" - - "columnar/dbc:v{{ .Major }}-amd64" - - "columnar/dbc:v{{ .Major }}.{{ .Minor }}-amd64" - - "columnar/dbc:latest-amd64" + - "columnar/dbc:{{ .Tag }}-amd64" + - "columnar/dbc:v{{ .Major }}-amd64" + - "columnar/dbc:v{{ .Major }}.{{ .Minor }}-amd64" + - "columnar/dbc:latest-amd64" use: buildx dockerfile: Dockerfile skip_push: auto build_flag_templates: - "--platform=linux/amd64" - image_templates: - - "columnar/dbc:{{ .Version }}-arm64v8" + - "columnar/dbc:{{ .Version }}-arm64v8" use: buildx goarch: arm64 dockerfile: Dockerfile @@ -147,10 +155,10 @@ dockers: build_flag_templates: - "--platform=linux/arm64/v8" - image_templates: - - "columnar/dbc:{{ .Tag }}-arm64v8" - - "columnar/dbc:v{{ .Major }}-arm64v8" - - "columnar/dbc:v{{ .Major }}.{{ .Minor }}-arm64v8" - - "columnar/dbc:latest-arm64v8" + - "columnar/dbc:{{ .Tag }}-arm64v8" + - "columnar/dbc:v{{ .Major }}-arm64v8" + - "columnar/dbc:v{{ .Major }}.{{ .Minor }}-arm64v8" + - "columnar/dbc:latest-arm64v8" use: buildx goarch: arm64 dockerfile: Dockerfile @@ -255,14 +263,37 @@ signs: artifacts: archive ids: - archives - args: ["--output", "${signature}", "-u", "hello@columnar.tech", "--detach-sign", "${artifact}"] + args: + [ + "--output", + "${signature}", + "-u", + "hello@columnar.tech", + "--detach-sign", + "${artifact}", + ] - id: sign-windows-msi if: '{{ isEnvSet "SM_API_KEY" }}' artifacts: installer # Windows MSI installers cmd: jsign - args: ["-keystore", "{{ .Env.PKCS11_CONFIG }}", - "-storepass", "NONE", "-storetype", "PKCS11", "-alg", "SHA-256", "-tsaurl", "http://timestamp.digicert.com", - "--name", "{{ .ProjectName }} Installer", "-alias", "{{ .Env.SM_KEYPAIR_ALIAS }}", "${artifact}"] + args: + [ + "-keystore", + "{{ .Env.PKCS11_CONFIG }}", + "-storepass", + "NONE", + "-storetype", + "PKCS11", + "-alg", + "SHA-256", + "-tsaurl", + "http://timestamp.digicert.com", + "--name", + "{{ .ProjectName }} Installer", + "-alias", + "{{ .Env.SM_KEYPAIR_ALIAS }}", + "${artifact}", + ] after: hooks: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5841f582..0917672a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,5 @@ +# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. + repos: - repo: https://github.com/amoeba/license-header-check rev: v0.1 diff --git a/cmd/dbc/testdata/test_index.yaml b/cmd/dbc/testdata/test_index.yaml index 7f27abf9..b0365e01 100644 --- a/cmd/dbc/testdata/test_index.yaml +++ b/cmd/dbc/testdata/test_index.yaml @@ -1,3 +1,5 @@ +# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. + drivers: - name: Test Driver 1 description: This is a test driver diff --git a/docs/requirements.txt b/docs/requirements.txt index 4c8f017d..cfd0a1a5 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,3 @@ +# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. + mkdocs-material diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 8b8f5244..0363e54b 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -1,3 +1,5 @@ +/* Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. */ + [data-md-color-scheme="slate"] { --md-default-bg-color: rgb(33, 33, 33); --md-code-bg-color: rgb(45, 45, 45); diff --git a/scripts/cdn.py b/scripts/cdn.py index d747393b..0c2b9040 100644 --- a/scripts/cdn.py +++ b/scripts/cdn.py @@ -117,7 +117,7 @@ def create_driver_index(output_dir: str, num_drivers: int, num_versions: int): # Create manifest.yaml manifest = {"drivers": drivers} manifest_path = output_path / "index.yaml" - + with open(manifest_path, "w") as f: yaml.dump(manifest, f, default_flow_style=False, sort_keys=False) From f983814498a5f11ca09541bf3eb1edfba82cc479 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 22 Sep 2025 18:03:15 -0700 Subject: [PATCH 4/8] More fixes --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 912cdb48..dada0695 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,5 @@ + + # Contributing to dbc Thanks for choosing to contribute to dbc. Please read the following sections for more information on contributing. From a9f38dd0d2ce17536df09c51833f21613ecb876f Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Mon, 22 Sep 2025 18:13:12 -0700 Subject: [PATCH 5/8] Fix config --- .pre-commit-config.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0917672a..01641695 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,3 +9,15 @@ repos: - "--template" - >- Copyright \(c\) [YEAR] Columnar Technologies Inc\. All rights reserved\. + - "--max_lines" + - "2" + exclude: | + (?x)^( + .*\.svg| + columnar\.pubkey| + scripts/install\.(ps1|sh)| + LICENSE| + go\.sum| + pixi\.lock| + resources/dbc\.wxs + )$ From d5bd09e2b7f0185738808999adc2ecea488614de Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 23 Sep 2025 09:47:35 -0700 Subject: [PATCH 6/8] Update pre-commit setup and fix files --- .github/workflows/dev.yaml | 14 +++++++++++++- .github/workflows/publish_docs.yml | 14 +++++++++++++- .gitignore | 14 +++++++++++++- .pre-commit-config.yaml | 16 ++++++++++++++-- CONTRIBUTING.md | 16 +++++++++++++++- cmd/dbc/testdata/test_index.yaml | 14 +++++++++++++- docs/requirements.txt | 14 +++++++++++++- docs/stylesheets/extra.css | 16 +++++++++++++++- 8 files changed, 109 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 9a36e123..2273b615 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -1,4 +1,16 @@ -# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. +# Copyright 2025 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. name: Dev diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml index 0e9c90bb..020ea29c 100644 --- a/.github/workflows/publish_docs.yml +++ b/.github/workflows/publish_docs.yml @@ -1,4 +1,16 @@ -# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. +# Copyright 2025 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. name: Publish Docs diff --git a/.gitignore b/.gitignore index 116c965d..3fb1e97b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,16 @@ -# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. +# Copyright 2025 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. # If you prefer the allow list template instead of the deny list, see community template: # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 01641695..1f6541a7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,16 @@ -# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. +# Copyright 2025 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. repos: - repo: https://github.com/amoeba/license-header-check @@ -8,7 +20,7 @@ repos: args: - "--template" - >- - Copyright \(c\) [YEAR] Columnar Technologies Inc\. All rights reserved\. + Copyright [YEAR] Columnar Technologies Inc\. - "--max_lines" - "2" exclude: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dada0695..c37b951d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,18 @@ - + # Contributing to dbc diff --git a/cmd/dbc/testdata/test_index.yaml b/cmd/dbc/testdata/test_index.yaml index b0365e01..9a116c62 100644 --- a/cmd/dbc/testdata/test_index.yaml +++ b/cmd/dbc/testdata/test_index.yaml @@ -1,4 +1,16 @@ -# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. +# Copyright 2025 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. drivers: - name: Test Driver 1 diff --git a/docs/requirements.txt b/docs/requirements.txt index cfd0a1a5..4ca548ea 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,15 @@ -# Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. +# Copyright 2025 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. mkdocs-material diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index 0363e54b..e5113454 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -1,4 +1,18 @@ -/* Copyright (c) 2025 Columnar Technologies Inc. All rights reserved. */ +/* +Copyright 2025 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. +*/ [data-md-color-scheme="slate"] { --md-default-bg-color: rgb(33, 33, 33); From e3c883eeccb1d275723ba3cbf833e1ca011faf76 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 23 Sep 2025 14:51:06 -0700 Subject: [PATCH 7/8] Use checksums instead of labels --- .github/workflows/dev.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 2273b615..84054307 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -34,14 +34,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 - - uses: actions/setup-python@v6 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 + - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c with: python-version: "3.x" - name: Install run: pip install pre-commit - name: pre-commit (cache) - uses: actions/cache@v4 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 with: path: ~/.cache/pre-commit key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} From 14e34a3405abab3f88f4e65197fd997b1f2a3f89 Mon Sep 17 00:00:00 2001 From: Bryce Mecum Date: Tue, 23 Sep 2025 14:57:09 -0700 Subject: [PATCH 8/8] Add comments --- .github/workflows/dev.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dev.yaml b/.github/workflows/dev.yaml index 84054307..053abb71 100644 --- a/.github/workflows/dev.yaml +++ b/.github/workflows/dev.yaml @@ -34,14 +34,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 with: python-version: "3.x" - name: Install run: pip install pre-commit - name: pre-commit (cache) - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: ~/.cache/pre-commit key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}