From 40f685bcf44eef89c28d7054627b29f84936bf62 Mon Sep 17 00:00:00 2001 From: Enrico Alvarenga Date: Thu, 2 Apr 2026 10:37:41 -0700 Subject: [PATCH 1/8] ci: add GitHub Actions workflows for PR validation --- .github/workflows/ci.yml | 155 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2f0ed72 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,155 @@ +name: CI + +on: + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read + +env: + GO_VERSION_FILE: go.mod + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version-file: ${{ env.GO_VERSION_FILE }} + + - name: Install golines + run: go install github.com/segmentio/golines@latest + + - name: Check golines formatting + run: | + OUTPUT=$(golines --max-len=140 --tab-len=2 --dry-run --chain-split-dots --shorten-comments pkg/ internal/ cmd/ api/) + if [ -n "$OUTPUT" ]; then + echo "::error::Line length violations detected. Run 'make lint-fix' locally." + echo "$OUTPUT" + exit 1 + fi + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v6.5.0 + with: + version: v1.63.4 + + test: + name: Unit Tests + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version-file: ${{ env.GO_VERSION_FILE }} + + - name: Run unit tests + run: CGO_ENABLED=1 go test $(go list ./... | grep -v /internal/controller) -race -coverprofile=cover.out + + - name: Upload coverage artifact + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: coverage-report + path: cover.out + retention-days: 7 + + build: + name: Build + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version-file: ${{ env.GO_VERSION_FILE }} + + - name: Build binary + run: go build -o bin/manager cmd/main.go + + verify-codegen: + name: Verify Code Generation + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version-file: ${{ env.GO_VERSION_FILE }} + + - name: Run code generation + run: make manifests generate + + - name: Check for uncommitted changes + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "::error::Generated code is out of date. Run 'make manifests generate' and commit the changes." + git diff + exit 1 + fi + + helm-lint: + name: Helm Lint + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + fetch-depth: 0 + + - name: Setup Helm + uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0 + + - name: Setup chart-testing + uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043ecea5d111571 # v2.6.1 + + - name: Run chart-testing lint + run: ct lint --all --validate-maintainers=false + + helm-docs: + name: Verify Helm Docs + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Run helm-docs + uses: losisin/helm-docs-github-action@a82240ec4b508990ea6712069a0a44c95bf95715 # v1.4.5 + with: + git-push: "false" + + - name: Check for uncommitted changes + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "::error::Helm docs are out of date. Run 'helm-docs --document-dependency-values' and commit the changes." + git diff + exit 1 + fi From 888bc7163aadc088fd2fce0e4e1812c63ad3f767 Mon Sep 17 00:00:00 2001 From: Enrico Alvarenga Date: Thu, 2 Apr 2026 10:52:59 -0700 Subject: [PATCH 2/8] ci: fix lint jobs --- .github/workflows/ci.yml | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f0ed72..776166a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,22 +29,8 @@ jobs: with: go-version-file: ${{ env.GO_VERSION_FILE }} - - name: Install golines - run: go install github.com/segmentio/golines@latest - - - name: Check golines formatting - run: | - OUTPUT=$(golines --max-len=140 --tab-len=2 --dry-run --chain-split-dots --shorten-comments pkg/ internal/ cmd/ api/) - if [ -n "$OUTPUT" ]; then - echo "::error::Line length violations detected. Run 'make lint-fix' locally." - echo "$OUTPUT" - exit 1 - fi - - - name: Run golangci-lint - uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v6.5.0 - with: - version: v1.63.4 + - name: Run lint + run: make lint test: name: Unit Tests @@ -61,7 +47,7 @@ jobs: go-version-file: ${{ env.GO_VERSION_FILE }} - name: Run unit tests - run: CGO_ENABLED=1 go test $(go list ./... | grep -v /internal/controller) -race -coverprofile=cover.out + run: make test - name: Upload coverage artifact uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 @@ -85,7 +71,7 @@ jobs: go-version-file: ${{ env.GO_VERSION_FILE }} - name: Build binary - run: go build -o bin/manager cmd/main.go + run: make build verify-codegen: name: Verify Code Generation @@ -127,7 +113,7 @@ jobs: uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0 - name: Setup chart-testing - uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043ecea5d111571 # v2.6.1 + uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0 - name: Run chart-testing lint run: ct lint --all --validate-maintainers=false @@ -141,10 +127,14 @@ jobs: - name: Checkout uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Install helm-docs + run: | + HELM_DOCS_VERSION="1.14.2" + curl -fsSL "https://github.com/norwoodj/helm-docs/releases/download/v${HELM_DOCS_VERSION}/helm-docs_${HELM_DOCS_VERSION}_Linux_x86_64.tar.gz" | tar -xzv helm-docs + sudo mv helm-docs /usr/local/bin/helm-docs + - name: Run helm-docs - uses: losisin/helm-docs-github-action@a82240ec4b508990ea6712069a0a44c95bf95715 # v1.4.5 - with: - git-push: "false" + run: helm-docs --document-dependency-values - name: Check for uncommitted changes run: | From 87fcbf59a905fd948b26b74eaa3975567f956b40 Mon Sep 17 00:00:00 2001 From: Enrico Alvarenga Date: Thu, 2 Apr 2026 10:56:48 -0700 Subject: [PATCH 3/8] docs: fix helm outdated helm docs --- charts/doltdb-operator/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/doltdb-operator/README.md b/charts/doltdb-operator/README.md index 3dc0431..e153773 100644 --- a/charts/doltdb-operator/README.md +++ b/charts/doltdb-operator/README.md @@ -13,8 +13,8 @@ A Helm chart for Kubernetes deployment of Dolt operator | existingClusterRole | string | `""` | Name of an existing ClusterRole to use when installClusterRole is false. If not set, defaults to the fullname. | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | -| image.repository | string | `"%%image_repository%%"` | | -| image.tag | string | `"%%image_tag%%"` | | +| image.repository | string | `"ghcr.io/electronicarts/doltdb-operator"` | | +| image.tag | string | `""` | | | imagePullSecrets | list | `[]` | | | installClusterRole | bool | `true` | A boolean flag indicating whether ClusterRole and ClusterRoleBinding should be installed. Set to false for secondary installations. Default: true. | | installCrds | bool | `false` | A boolean flag indicating whether CRDs should be installed. Set to false when using the standalone doltdb-operator-crds chart. Default: false. | From 6018910afc20efc4ae318ff32b9fd25f09aebff8 Mon Sep 17 00:00:00 2001 From: Enrico Alvarenga Date: Thu, 2 Apr 2026 11:12:06 -0700 Subject: [PATCH 4/8] ci: add integration test workflow --- .github/workflows/integration-tests.yml | 74 +++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/integration-tests.yml diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 0000000..7047835 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,74 @@ +name: Integration Tests + +on: + workflow_dispatch: + inputs: + doltdb_engine_version: + description: "DoltDB engine version to test against" + required: false + default: "1.83.6" + issue_comment: + types: [created] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + pull-requests: read + +env: + GO_VERSION_FILE: go.mod + DOLTDB_ENGINE_VERSION: ${{ github.event.inputs.doltdb_engine_version || '1.83.6' }} + KIND_CLUSTER_NAME: dolt + TILT_VERSION: "0.33.21" + +jobs: + integration-tests: + name: Integration Tests (kind + tilt) + runs-on: ubuntu-latest + timeout-minutes: 45 + if: >- + github.event_name == 'workflow_dispatch' || + (github.event.issue.pull_request && contains(github.event.comment.body, '/test-integration')) + permissions: + contents: read + pull-requests: read + steps: + - name: Checkout PR branch + if: github.event_name == 'issue_comment' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: refs/pull/${{ github.event.issue.number }}/merge + + - name: Checkout + if: github.event_name == 'workflow_dispatch' + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Setup Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version-file: ${{ env.GO_VERSION_FILE }} + + - name: Setup kind + uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0 + with: + cluster_name: ${{ env.KIND_CLUSTER_NAME }} + config: hack/manifests/kind/kind-ci.yaml + + - name: Install tilt + run: | + curl -fsSL https://github.com/tilt-dev/tilt/releases/download/v${TILT_VERSION}/tilt.${TILT_VERSION}.linux.x86_64.tar.gz | tar -xzv tilt + sudo mv tilt /usr/local/bin/tilt + + - name: Install kustomize + run: make kustomize + + - name: Set cluster context + run: kubectl config use-context kind-${{ env.KIND_CLUSTER_NAME }} + + - name: Run integration tests + run: tilt ci + env: + DOLTDB_ENGINE_VERSION: ${{ env.DOLTDB_ENGINE_VERSION }} From af379a00f84fc1f818404004fa8e2d530901faa7 Mon Sep 17 00:00:00 2001 From: Enrico Alvarenga Date: Thu, 2 Apr 2026 11:22:48 -0700 Subject: [PATCH 5/8] ci: temporarily add integration test run on all PRs --- .github/workflows/integration-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 7047835..4d6b5bd 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -1,6 +1,8 @@ name: Integration Tests on: + pull_request: # TODO: remove after validating — keep only workflow_dispatch + issue_comment + branches: [main] workflow_dispatch: inputs: doltdb_engine_version: From e3c41d79bbbaadaa7532ab7f639752ce46318cec Mon Sep 17 00:00:00 2001 From: Enrico Alvarenga Date: Thu, 2 Apr 2026 11:24:38 -0700 Subject: [PATCH 6/8] fix: ci condition --- .github/workflows/integration-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 4d6b5bd..d42eb99 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -32,6 +32,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 45 if: >- + github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || (github.event.issue.pull_request && contains(github.event.comment.body, '/test-integration')) permissions: From 9efc9c3726cd74a2f809e4e9bb245729d54fb68a Mon Sep 17 00:00:00 2001 From: Enrico Alvarenga Date: Thu, 2 Apr 2026 11:27:01 -0700 Subject: [PATCH 7/8] fix: go checkout on ci job --- .github/workflows/integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index d42eb99..b939cbc 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -39,14 +39,14 @@ jobs: contents: read pull-requests: read steps: - - name: Checkout PR branch + - name: Checkout PR branch (comment trigger) if: github.event_name == 'issue_comment' uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: refs/pull/${{ github.event.issue.number }}/merge - name: Checkout - if: github.event_name == 'workflow_dispatch' + if: github.event_name != 'issue_comment' uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Setup Go From 4719304c683fb95dafd99b20a99dd13ff2872365 Mon Sep 17 00:00:00 2001 From: Enrico Alvarenga Date: Thu, 2 Apr 2026 12:58:20 -0700 Subject: [PATCH 8/8] fix: attempt fix int test CI job --- .github/workflows/integration-tests.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index b939cbc..23e2075 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -24,7 +24,6 @@ env: GO_VERSION_FILE: go.mod DOLTDB_ENGINE_VERSION: ${{ github.event.inputs.doltdb_engine_version || '1.83.6' }} KIND_CLUSTER_NAME: dolt - TILT_VERSION: "0.33.21" jobs: integration-tests: @@ -54,15 +53,20 @@ jobs: with: go-version-file: ${{ env.GO_VERSION_FILE }} - - name: Setup kind - uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0 - with: - cluster_name: ${{ env.KIND_CLUSTER_NAME }} - config: hack/manifests/kind/kind-ci.yaml + - name: Install kind + run: | + KIND_VERSION="v0.30.0" + curl -Lo ./kind "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64" + chmod +x ./kind + sudo mv ./kind /usr/local/bin/kind + + - name: Create kind cluster + run: kind create cluster --name ${{ env.KIND_CLUSTER_NAME }} --config hack/manifests/kind/kind-ci.yaml - name: Install tilt run: | - curl -fsSL https://github.com/tilt-dev/tilt/releases/download/v${TILT_VERSION}/tilt.${TILT_VERSION}.linux.x86_64.tar.gz | tar -xzv tilt + TILT_VERSION="0.33.21" + curl -fsSL "https://github.com/tilt-dev/tilt/releases/download/v${TILT_VERSION}/tilt.${TILT_VERSION}.linux.x86_64.tar.gz" | tar -xzv tilt sudo mv tilt /usr/local/bin/tilt - name: Install kustomize