7 Commits

Author SHA1 Message Date
338210eb74 chore: bump handler-base to v0.1.5, add netrc secret mount to Dockerfile
Some checks failed
CI / Lint (push) Successful in 2m56s
CI / Test (push) Successful in 2m53s
CI / Release (push) Successful in 1m34s
CI / Docker Build & Push (push) Failing after 7m4s
CI / Notify (push) Successful in 1s
2026-02-20 18:17:58 -05:00
8b50306568 ci: retrigger build
Some checks failed
CI / Lint (push) Successful in 2m41s
CI / Test (push) Successful in 2m23s
CI / Release (push) Successful in 1m15s
CI / Docker Build & Push (push) Failing after 6m26s
CI / Notify (push) Successful in 3s
2026-02-20 10:05:22 -05:00
1bdf92c376 fix: add GOPRIVATE and git auth for private handler-base module
Some checks failed
CI / Lint (push) Successful in 2m33s
CI / Test (push) Successful in 2m36s
CI / Release (push) Successful in 1m20s
CI / Docker Build & Push (push) Failing after 6m44s
CI / Notify (push) Successful in 1s
- Set GOPRIVATE=git.daviestechlabs.io to bypass public Go module proxy
- Configure git URL insteadOf with DISPATCH_TOKEN for private repo access
2026-02-20 09:22:36 -05:00
c832a837eb fix: rename GITEA_TOKEN to DISPATCH_TOKEN
Some checks failed
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Release (push) Has been cancelled
CI / Docker Build & Push (push) Has been cancelled
CI / Notify (push) Has been cancelled
2026-02-20 09:10:21 -05:00
b6f0e9b88f ci: add handler-base auto-update workflow, remove old Python CI
Some checks failed
CI / Test (push) Has been cancelled
CI / Release (push) Has been cancelled
CI / Docker Build & Push (push) Has been cancelled
CI / Notify (push) Has been cancelled
CI / Lint (push) Has been cancelled
2026-02-20 09:06:00 -05:00
43fb5afcc5 fix: use tagged handler-base v0.1.3, remove local replace directive
Some checks failed
CI / Lint (push) Failing after 1m20s
CI / Release (push) Has been cancelled
CI / Notify (push) Has been cancelled
CI / Docker Build & Push (push) Has been cancelled
CI / Test (push) Failing after 1m22s
2026-02-20 09:00:46 -05:00
de4fa6ea90 fix: resolve golangci-lint errcheck warnings
Some checks failed
CI / Release (push) Has been cancelled
CI / Docker Build & Push (push) Has been cancelled
CI / Notify (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
- Add error checks for unchecked return values (errcheck)
- Remove unused struct fields (unused)
- Fix gofmt formatting issues
2026-02-20 08:45:25 -05:00
9 changed files with 91 additions and 150 deletions

View File

@@ -8,6 +8,7 @@ on:
env:
NTFY_URL: http://ntfy.observability.svc.cluster.local:80
GOPRIVATE: git.daviestechlabs.io
REGISTRY: gitea-http.gitea.svc.cluster.local:3000/daviestechlabs
REGISTRY_HOST: gitea-http.gitea.svc.cluster.local:3000
IMAGE_NAME: pipeline-bridge
@@ -26,6 +27,9 @@ jobs:
go-version-file: go.mod
cache: true
- name: Configure private modules
run: git config --global url."https://gitea-actions:${{ secrets.DISPATCH_TOKEN }}@git.daviestechlabs.io/".insteadOf "https://git.daviestechlabs.io/"
- name: Run go vet
run: go vet ./...
@@ -50,6 +54,9 @@ jobs:
go-version-file: go.mod
cache: true
- name: Configure private modules
run: git config --global url."https://gitea-actions:${{ secrets.DISPATCH_TOKEN }}@git.daviestechlabs.io/".insteadOf "https://git.daviestechlabs.io/"
- name: Verify dependencies
run: go mod verify

View File

@@ -1,129 +0,0 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
NTFY_URL: http://ntfy.observability.svc.cluster.local:80
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh && echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Set up Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync --frozen --extra dev
- name: Run ruff check
run: uv run ruff check .
- name: Run ruff format check
run: uv run ruff format --check .
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh && echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Set up Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync --frozen --extra dev
- name: Run tests
run: uv run pytest -v
release:
name: Release
runs-on: ubuntu-latest
needs: [lint, test]
if: gitea.ref == 'refs/heads/main' && gitea.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine version bump
id: version
run: |
# Get latest tag or default to v0.0.0
LATEST=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
VERSION=${LATEST#v}
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
# Check commit message for keywords
MSG="${{ gitea.event.head_commit.message }}"
if echo "$MSG" | grep -qiE "^major:|BREAKING CHANGE"; then
MAJOR=$((MAJOR + 1)); MINOR=0; PATCH=0
BUMP="major"
elif echo "$MSG" | grep -qiE "^(minor:|feat:)"; then
MINOR=$((MINOR + 1)); PATCH=0
BUMP="minor"
else
PATCH=$((PATCH + 1))
BUMP="patch"
fi
NEW_VERSION="v${MAJOR}.${MINOR}.${PATCH}"
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "bump=$BUMP" >> $GITHUB_OUTPUT
echo "Bumping $LATEST → $NEW_VERSION ($BUMP)"
- name: Create and push tag
run: |
git config user.name "gitea-actions[bot]"
git config user.email "actions@git.daviestechlabs.io"
git tag -a ${{ steps.version.outputs.version }} -m "Release ${{ steps.version.outputs.version }}"
git push origin ${{ steps.version.outputs.version }}
notify:
name: Notify
runs-on: ubuntu-latest
needs: [lint, test, release]
if: always()
steps:
- name: Notify on success
if: needs.lint.result == 'success' && needs.test.result == 'success'
run: |
curl -s \
-H "Title: ✅ CI Passed: ${{ gitea.repository }}" \
-H "Priority: default" \
-H "Tags: white_check_mark,github" \
-H "Click: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}" \
-d "Branch: ${{ gitea.ref_name }}
Commit: ${{ gitea.event.head_commit.message || gitea.sha }}
Release: ${{ needs.release.result == 'success' && 'created' || 'skipped' }}" \
${{ env.NTFY_URL }}/gitea-ci
- name: Notify on failure
if: needs.lint.result == 'failure' || needs.test.result == 'failure'
run: |
curl -s \
-H "Title: ❌ CI Failed: ${{ gitea.repository }}" \
-H "Priority: high" \
-H "Tags: x,github" \
-H "Click: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}" \
-d "Branch: ${{ gitea.ref_name }}
Commit: ${{ gitea.event.head_commit.message || gitea.sha }}
Lint: ${{ needs.lint.result }}
Test: ${{ needs.test.result }}" \
${{ env.NTFY_URL }}/gitea-ci

View File

@@ -0,0 +1,60 @@
name: Update handler-base
on:
repository_dispatch:
types: [handler-base-release]
env:
NTFY_URL: http://ntfy.observability.svc.cluster.local:80
GOPRIVATE: git.daviestechlabs.io
jobs:
update:
name: Update handler-base dependency
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.DISPATCH_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Configure Git
run: |
git config user.name "gitea-actions[bot]"
git config user.email "actions@git.daviestechlabs.io"
git config --global url."https://gitea-actions:${{ secrets.DISPATCH_TOKEN }}@git.daviestechlabs.io/".insteadOf "https://git.daviestechlabs.io/"
- name: Update handler-base
run: |
VERSION="${{ gitea.event.client_payload.version }}"
echo "Updating handler-base to ${VERSION}"
go get git.daviestechlabs.io/daviestechlabs/handler-base@${VERSION}
go mod tidy
- name: Commit and push
run: |
VERSION="${{ gitea.event.client_payload.version }}"
if git diff --quiet go.mod go.sum; then
echo "No changes to commit"
exit 0
fi
git add go.mod go.sum
git commit -m "chore(deps): bump handler-base to ${VERSION}"
git push
- name: Notify
if: success()
run: |
VERSION="${{ gitea.event.client_payload.version }}"
curl -s \
-H "Title: 📦 Dep Update: ${{ gitea.repository }}" \
-H "Priority: default" \
-H "Tags: package,github" \
-d "handler-base updated to ${VERSION}" \
${{ env.NTFY_URL }}/gitea-ci

View File

@@ -4,11 +4,14 @@ FROM golang:1.25-alpine AS builder
WORKDIR /app
# Install ca-certificates for HTTPS
RUN apk add --no-cache ca-certificates
RUN apk add --no-cache ca-certificates git
ENV GOPRIVATE=git.daviestechlabs.io
ENV GONOSUMCHECK=git.daviestechlabs.io
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
RUN --mount=type=secret,id=netrc,target=/root/.netrc go mod download
# Copy source code
COPY . .

View File

@@ -19,8 +19,8 @@ func TestSubmitArgoE2E_FullPayload(t *testing.T) {
var receivedBody map[string]any
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
json.NewDecoder(r.Body).Decode(&receivedBody)
json.NewEncoder(w).Encode(map[string]any{
_ = json.NewDecoder(r.Body).Decode(&receivedBody)
_ = json.NewEncoder(w).Encode(map[string]any{
"metadata": map[string]any{"name": "doc-ingest-xyz"},
})
}))
@@ -72,8 +72,8 @@ func TestSubmitKubeflowE2E_FullPayload(t *testing.T) {
var receivedBody map[string]any
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
json.NewDecoder(r.Body).Decode(&receivedBody)
json.NewEncoder(w).Encode(map[string]any{
_ = json.NewDecoder(r.Body).Decode(&receivedBody)
_ = json.NewEncoder(w).Encode(map[string]any{
"run": map[string]any{"id": "kf-run-e2e-789"},
})
}))
@@ -150,7 +150,7 @@ func TestSubmitArgoE2E_ConcurrentRequests(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
count.Add(1)
json.NewEncoder(w).Encode(map[string]any{
_ = json.NewEncoder(w).Encode(map[string]any{
"metadata": map[string]any{"name": "concurrent-wf"},
})
}))
@@ -184,7 +184,7 @@ func TestSubmitArgoE2E_ConcurrentRequests(t *testing.T) {
func BenchmarkSubmitArgo(b *testing.B) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`{"metadata":{"name":"bench-wf"}}`))
_, _ = w.Write([]byte(`{"metadata":{"name":"bench-wf"}}`))
}))
defer ts.Close()
@@ -193,13 +193,13 @@ func BenchmarkSubmitArgo(b *testing.B) {
b.ResetTimer()
for b.Loop() {
submitArgo(ctx, ts.Client(), ts.URL, "ai-ml", "document-ingestion", params, "bench-req")
_, _ = submitArgo(ctx, ts.Client(), ts.URL, "ai-ml", "document-ingestion", params, "bench-req")
}
}
func BenchmarkSubmitKubeflow(b *testing.B) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`{"run":{"id":"bench-run"}}`))
_, _ = w.Write([]byte(`{"run":{"id":"bench-run"}}`))
}))
defer ts.Close()
@@ -208,6 +208,6 @@ func BenchmarkSubmitKubeflow(b *testing.B) {
b.ResetTimer()
for b.Loop() {
submitKubeflow(ctx, ts.Client(), ts.URL, "rag-pipeline", params, "bench-req")
_, _ = submitKubeflow(ctx, ts.Client(), ts.URL, "rag-pipeline", params, "bench-req")
}
}

6
go.mod
View File

@@ -3,8 +3,9 @@ module git.daviestechlabs.io/daviestechlabs/pipeline-bridge
go 1.25.1
require (
git.daviestechlabs.io/daviestechlabs/handler-base v0.0.0
git.daviestechlabs.io/daviestechlabs/handler-base v0.1.5
github.com/nats-io/nats.go v1.48.0
github.com/vmihailenco/msgpack/v5 v5.4.1
)
require (
@@ -18,7 +19,6 @@ require (
github.com/klauspost/compress v1.18.0 // indirect
github.com/nats-io/nkeys v0.4.11 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.40.0 // indirect
@@ -39,5 +39,3 @@ require (
google.golang.org/grpc v1.78.0 // indirect
google.golang.org/protobuf v1.36.11 // indirect
)
replace git.daviestechlabs.io/daviestechlabs/handler-base => ../handler-base

2
go.sum
View File

@@ -1,3 +1,5 @@
git.daviestechlabs.io/daviestechlabs/handler-base v0.1.5 h1:DqYZpeluTXh5QKqdVFgN8YIMh4Ycqzw5E9+5FTNDFCA=
git.daviestechlabs.io/daviestechlabs/handler-base v0.1.5/go.mod h1:M3HgvUDWnRn7cX3BE8l+HvoCUYtmRr5OoumB+hnRHoE=
github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM=
github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=

View File

@@ -151,7 +151,7 @@ func submitArgo(ctx context.Context, client *http.Client, host, namespace, templ
if err != nil {
return "", fmt.Errorf("argo request: %w", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
respBody, _ := io.ReadAll(resp.Body)
if resp.StatusCode >= 400 {
@@ -196,7 +196,7 @@ func submitKubeflow(ctx context.Context, client *http.Client, host, pipelineID s
if err != nil {
return "", fmt.Errorf("kubeflow request: %w", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
respBody, _ := io.ReadAll(resp.Body)
if resp.StatusCode >= 400 {

View File

@@ -111,7 +111,7 @@ func TestSubmitArgo(t *testing.T) {
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]any{
_ = json.NewEncoder(w).Encode(map[string]any{
"metadata": map[string]any{"name": "document-ingestion-abc123"},
})
}))
@@ -132,7 +132,7 @@ func TestSubmitArgo(t *testing.T) {
func TestSubmitArgoError(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte(`{"message":"bad request"}`))
_, _ = w.Write([]byte(`{"message":"bad request"}`))
}))
defer ts.Close()
@@ -153,7 +153,7 @@ func TestSubmitKubeflow(t *testing.T) {
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]any{
_ = json.NewEncoder(w).Encode(map[string]any{
"run": map[string]any{"id": "kf-run-456"},
})
}))
@@ -174,7 +174,7 @@ func TestSubmitKubeflow(t *testing.T) {
func TestSubmitKubeflowError(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte("internal error"))
_, _ = w.Write([]byte("internal error"))
}))
defer ts.Close()