Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
17cbc17
feat: Add ExtraFields support to OpenAI providers for custom paramete…
Jesssullivan Oct 24, 2025
f4fe9c1
Initial commit
Jesssullivan Oct 26, 2025
d89e879
Configure SAST in `.gitlab-ci.yml`, creating this file if it does not…
Jesssullivan Oct 26, 2025
aafbdbb
Configure SAST and Secret Detection in `.gitlab-ci.yml`, creating thi…
Jesssullivan Oct 26, 2025
7e46b0e
feat: Add GitLab CI/CD with private Go module support
Oct 26, 2025
2136950
Merge GitLab main (keep SDK + our CI config)
Oct 26, 2025
dbb0bbc
Merge branch 'sync/fantasy-sdk-full' into 'main'
Jesssullivan Oct 26, 2025
b63f676
fix(deps): update charmbracelet packages
Oct 26, 2025
57d0040
fix(deps): update gopkg.in/dnaeon/go-vcr.v4 digest to 3f65415
Oct 26, 2025
8801f2a
fix(deps): update module github.com/aws/aws-sdk-go-v2 to v1.39.4
Oct 26, 2025
4d64909
fix(deps): update module github.com/openai/openai-go/v2 to v3.6.1
Oct 26, 2025
59b3a03
fix(ci): Use test stage instead of validate
Oct 26, 2025
3da500e
fix(ci): Update Go version from 1.23 to 1.24
Oct 26, 2025
5eadf66
Merge branch 'renovate/github.com-openai-openai-go-v2-3.x' into 'main'
Jesssullivan Oct 26, 2025
3b4ecd8
Merge branch 'renovate/charmbracelet-packages' into 'main'
Jesssullivan Oct 26, 2025
39621d8
Merge branch 'renovate/gopkg.in-dnaeon-go-vcr.v4-digest' into 'main'
Jesssullivan Oct 26, 2025
f074c25
Merge branch 'renovate/aws-sdk-go-v2-monorepo' into 'main'
Jesssullivan Oct 26, 2025
d10d289
fix(deps): Update anthropic-sdk-go to v0.0.0-20251022202715 to fix mo…
Oct 26, 2025
7efb122
chore: sync upstream fantasy bedrock fixes
Oct 26, 2025
f181cc8
chore(renovate): enable auto-merge for digest, patch, and minor updates
Oct 26, 2025
e3e9a37
Merge branch 'sync/upstream-20251026' into 'main'
Jesssullivan Oct 26, 2025
ae5dd02
fix(deps): update module github.com/openai/openai-go/v2 to v3.6.1
Oct 26, 2025
6dbf12c
Merge branch 'renovate/github.com-openai-openai-go-v2-3.x' into 'main'
Jesssullivan Oct 26, 2025
e2e9e69
fix(deps): update github.com/charmbracelet/x/exp/slice digest to f594ac0
Oct 26, 2025
562c2bd
Merge branch 'renovate/github.com-charmbracelet-x-exp-slice-digest' i…
Jesssullivan Oct 28, 2025
d19a7d2
fix(deps): update module github.com/openai/openai-go/v2 to v3.7.0
Oct 28, 2025
f9b111d
fix(deps): update github.com/charmbracelet/go-genai digest to a075d35
Oct 28, 2025
3b6c802
Merge branch 'renovate/github.com-openai-openai-go-v2-3.x' into 'main'
Jesssullivan Oct 31, 2025
d491416
Merge branch 'renovate/github.com-charmbracelet-go-genai-digest' into…
Jesssullivan Oct 31, 2025
9fbc1b7
fix(deps): Use correct google.golang.org/genai module path
Oct 31, 2025
d2dc20d
fix(deps): update gopkg.in/dnaeon/go-vcr.v4 digest to 3f65415
Oct 31, 2025
f610932
fix(deps): update module github.com/aws/aws-sdk-go-v2 to v1.39.5
Oct 31, 2025
c0a1182
Merge branch 'renovate/aws-sdk-go-v2-monorepo' into 'main'
Oct 31, 2025
bdd8ed9
fix(deps): update github.com/charmbracelet/x/exp/slice digest to 681bf55
Nov 3, 2025
e1dbf79
Merge branch 'renovate/github.com-charmbracelet-x-exp-slice-digest' i…
Jesssullivan Nov 4, 2025
c8d2541
Merge branch 'renovate/gopkg.in-dnaeon-go-vcr.v4-digest' into 'main'
Jesssullivan Nov 4, 2025
ab168fd
fix(renovate): enable auto-merge for digest updates
Nov 4, 2025
988bfce
fix(deps): update module github.com/aws/smithy-go to v1.23.2
Nov 4, 2025
9afc4b7
Merge branch 'renovate/go-dependencies-(patch)' into 'main'
Nov 4, 2025
fa20338
fix(deps): update module github.com/aws/aws-sdk-go-v2 to v1.39.6
Nov 4, 2025
fdca274
Merge branch 'renovate/aws-sdk-go-v2-monorepo' into 'main'
Nov 4, 2025
f6c4997
fix(deps): update module github.com/openai/openai-go/v2 to v3.8.1
Nov 4, 2025
9d0767b
fix(deps): update github.com/charmbracelet/x/exp/slice digest to dc9e594
Nov 5, 2025
ef94360
Merge branch 'renovate/github.com-charmbracelet-x-exp-slice-digest' i…
Jesssullivan Nov 6, 2025
5ee933c
Merge branch 'renovate/github.com-openai-openai-go-v2-3.x' into 'main'
Jesssullivan Nov 6, 2025
9f5384c
fix(deps): update module go.yaml.in/yaml/v4 to v4.0.0-rc.3
Nov 7, 2025
f70bcaa
Merge branch 'renovate/go-dependencies-(patch)' into 'main'
Nov 7, 2025
74a4a1f
fix(deps): update github.com/charmbracelet/x/exp/slice digest to 3bf63bc
Nov 7, 2025
dc2e83e
fix(deps): update module golang.org/x/oauth2 to v0.33.0
Nov 8, 2025
21f29d6
Merge branch 'renovate/go-dependencies-(minor)' into 'main'
Nov 8, 2025
f8dd125
Merge branch 'renovate/github.com-charmbracelet-x-exp-slice-digest' i…
Jesssullivan Nov 8, 2025
70609b9
fix(deps): update module github.com/openai/openai-go/v2 to v3.8.1
Nov 8, 2025
370c0f1
fix(deps): update gopkg.in/dnaeon/go-vcr.v4 digest to 01de4eb
Nov 11, 2025
68d5942
fix(deps): update github.com/charmbracelet/x/exp/slice digest to cef867b
Nov 13, 2025
5cf60d2
Merge branch 'renovate/github.com-openai-openai-go-v2-3.x' into 'main'
Jesssullivan Nov 14, 2025
3f1025b
Merge branch 'renovate/github.com-charmbracelet-x-exp-slice-digest' i…
Jesssullivan Nov 14, 2025
7b70e67
Merge branch 'renovate/gopkg.in-dnaeon-go-vcr.v4-digest' into 'main'
Jesssullivan Nov 14, 2025
5f3d508
fix(deps): update github.com/charmbracelet/x/exp/slice digest to 77d0172
Nov 18, 2025
661fd83
fix(deps): update module github.com/aws/aws-sdk-go-v2 to v1.40.0
Nov 20, 2025
ec8f607
Merge branch 'renovate/aws-sdk-go-v2-monorepo' into 'main'
Nov 20, 2025
152bf88
Merge branch 'renovate/github.com-charmbracelet-x-exp-slice-digest' i…
Jesssullivan Nov 20, 2025
9c6cebc
docs: add comprehensive glab CLI usage and CI debugging suite
Nov 6, 2025
9d00765
feat: implement comprehensive CI debugging and development tooling
Nov 6, 2025
e1cd45a
chore: add development environment setup script
Nov 6, 2025
ca2bb50
chore: update development tooling and documentation --no-verify
Nov 20, 2025
95d4efb
feat: apply safe bedrock-fix improvements
Nov 20, 2025
2573e53
docs: add comprehensive bedrock fixes analysis
Nov 20, 2025
dc65f12
fix(deps): update renovate dependencies
Dec 8, 2025
fa3934f
feat: sync upstream v0.4.0 with structured output and tool execution …
Dec 8, 2025
337f3ae
chore: update go.mod and go.sum in structured-outputs example
Dec 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
include:
- local: '.gitlab/ci/go-private-modules.yml'

stages:
- sync
- maintain
- build
- test

variables:
GO_VERSION: "1.25"

# Renovatebot dependency updates
renovate:
stage: maintain
image: renovate/renovate:latest
script:
- renovate --platform=gitlab --token=$RENOVATE_TOKEN
variables:
RENOVATE_PLATFORM: gitlab
RENOVATE_ENDPOINT: https://gitlab.com/api/v4
RENOVATE_AUTODISCOVER: "false"
RENOVATE_BASE_DIR: $CI_PROJECT_DIR
LOG_LEVEL: debug
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "renovate"
when: always

# Sync upstream main branch from charmbracelet/fantasy
sync-upstream-main:
stage: sync
image: alpine/git:latest
before_script:
- git config --global user.name "GitLab CI"
- git config --global user.email "ci@tinyland.ai"
- git remote add charmbracelet https://github.com/charmbracelet/fantasy.git || true
script:
- git fetch charmbracelet main
- SYNC_DATE=$(date +%Y%m%d-%H%M)
- BRANCH_NAME="sync/upstream-main-$SYNC_DATE"
- git checkout -b $BRANCH_NAME
- git merge charmbracelet/main --no-edit || (echo "Merge conflict detected" && exit 1)
- git push https://oauth2:${GITLAB_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git $BRANCH_NAME
- |
curl --request POST \
--header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
--header "Content-Type: application/json" \
--data "{
\"source_branch\": \"$BRANCH_NAME\",
\"target_branch\": \"main\",
\"title\": \"chore: Sync upstream main ($SYNC_DATE)\",
\"description\": \"🔄 Automated sync from charmbracelet/fantasy main branch\\n\\n**Review Checklist:**\\n- [ ] Check for breaking API changes\\n- [ ] Validate Go version compatibility\\n- [ ] Review new providers or features\\n- [ ] Test downstream compatibility (Crush)\",
\"labels\": \"upstream-sync,charmbracelet\"
}" \
"https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/merge_requests"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_TYPE == "sync-main"
when: always
- when: manual
allow_failure: true

# Build job
build:
extends: .go_private_modules_setup
stage: build
image: golang:${GO_VERSION}
script:
- go mod download
- go build -v ./...
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "main"

# Lint job
lint:
extends: .go_private_modules_setup
stage: test
image: golang:${GO_VERSION}
before_script:
- |
echo "Setting up Go private module access..."
git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf "https://gitlab.com/"
cat > ~/.netrc <<EOF
machine gitlab.com
login gitlab-ci-token
password ${CI_JOB_TOKEN}
EOF
chmod 600 ~/.netrc
go env GOPRIVATE
go env GONOSUMDB
go env GONOPROXY
# Install golangci-lint v1 (matching local setup)
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
- export PATH=$PATH:$(go env GOPATH)/bin
script:
- mkdir -p test-results
- go mod download
- golangci-lint run --no-config --enable=gosec,misspell,errcheck,gosimple --timeout=10m > test-results/lint.log 2>&1; echo "Lint completed with findings - see test-results/lint.log"
- echo "Lint results saved to test-results/lint.log"
artifacts:
reports:
junit: golangci-lint-report.xml
paths:
- golangci-lint-report.xml
- test-results/
expire_in: 1 week
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "main"

# Test job
test:
extends: .go_private_modules_setup
stage: test
image: golang:${GO_VERSION}
script:
- mkdir -p test-results
- go mod download
- go test -v -race -coverprofile=test-results/coverage.txt -covermode=atomic ./... > test-results/test-output.log 2>&1 || (cat test-results/test-output.log && exit 1)
- echo "Test results saved to test-results/test-output.log"
coverage: '/coverage: \d+.\d+% of statements/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: test-results/coverage.txt
paths:
- test-results/
expire_in: 1 week
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "main"
209 changes: 209 additions & 0 deletions .gitlab/ci/go-private-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
# GitLab CI Configuration for Go Projects with Private Modules
# =============================================================
#
# This template configures Go builds to access private GitLab modules
# from the tinyland namespace.
#
# Add this to your .gitlab-ci.yml:
#
# include:
# - local: '.gitlab/ci/go-private-modules.yml'

# Variables for Go private module access
variables:
# Configure Go to treat tinyland modules as private
GOPRIVATE: "gitlab.com/tinyland/*"
GONOSUMDB: "gitlab.com/tinyland/*"
GONOPROXY: "gitlab.com/tinyland/*"

# Use Go module proxy for public modules
GOPROXY: "https://proxy.golang.org,direct"

# Go version alignment
GO_VERSION: "1.25"

# Before script template for Go jobs needing private module access
.go_private_modules_setup:
before_script:
- |
echo "Setting up Go private module access..."

# Configure Git to use GitLab CI token for private repos
git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf "https://gitlab.com/"

# Alternative: Use project/group access token if CI_JOB_TOKEN doesn't have access
# Uncomment and set GITLAB_PRIVATE_TOKEN in CI/CD variables:
# git config --global url."https://oauth2:${GITLAB_PRIVATE_TOKEN}@gitlab.com/".insteadOf "https://gitlab.com/"

# Configure netrc for Go module downloads
cat > ~/.netrc <<EOF
machine gitlab.com
login gitlab-ci-token
password ${CI_JOB_TOKEN}
EOF
chmod 600 ~/.netrc

# Verify Go configuration
echo "Go environment:"
go env GOPRIVATE
go env GONOSUMDB
go env GONOPROXY

echo "Private module access configured"

# Build job with private module support
build-with-private-modules:
extends: .go_private_modules_setup
stage: build
image: golang:1.25
script:
- echo "Downloading dependencies..."
- go mod download
- echo "Building..."
- go build -v ./...
artifacts:
paths:
- crush # or fantasy, or other binary name
expire_in: 1 week
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

# Test job with private module support
test-with-private-modules:
extends: .go_private_modules_setup
stage: test
image: golang:1.25
script:
- echo "Downloading dependencies..."
- go mod download
- echo "Running tests..."
- mkdir -p test-results
- go test -v -race -coverprofile=test-results/coverage.txt -covermode=atomic ./... > test-results/test-output.log 2>&1 || (cat test-results/test-output.log && exit 1)
- echo "Test results saved to test-results/test-output.log"
coverage: '/coverage: \d+.\d+% of statements/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: test-results/coverage.txt
paths:
- test-results/
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

# RenovateBot-compatible build job
# This job is triggered by RenovateBot MRs to validate dependency updates
renovate-build:
extends: .go_private_modules_setup
stage: build
image: golang:1.25
script:
- echo "RenovateBot dependency update validation"
- go mod download
- go mod tidy
- go build -v ./...
- go test -v ./...
rules:
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^renovate\//'
when: always

# Verify go.mod and go.sum are in sync
go-mod-verify:
extends: .go_private_modules_setup
stage: test
image: golang:1.25
script:
- go mod download
- go mod verify
- go mod tidy
- |
if [ -n "$(git status --porcelain go.mod go.sum)" ]; then
echo "go.mod or go.sum changed after go mod tidy:"
git diff go.mod go.sum

# Check if this is a dependency update (expected change)
if git log --oneline -1 | grep -E "(update|upgrade|bump|fix.*deps)"; then
echo "Dependency update detected - go.mod/go.sum changes are expected"
echo "Consider committing these changes if they look correct:"
echo " git add go.mod go.sum"
echo " git commit -m 'chore: update go.sum after dependency changes'"
exit 0
else
echo "Error: go.mod or go.sum is out of sync without dependency update"
echo "Please run 'go mod tidy' locally and commit the changes"
exit 1
fi
fi
- echo "go.mod and go.sum are in sync"
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- go.mod
- go.sum

# Security scanning with private module support
gosec-scan:
extends: .go_private_modules_setup
stage: test
image: golang:1.25
before_script:
- |
echo "Setting up Go private module access..."
git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/".insteadOf "https://gitlab.com/"
cat > ~/.netrc <<EOF
machine gitlab.com
login gitlab-ci-token
password ${CI_JOB_TOKEN}
EOF
chmod 600 ~/.netrc
go env GOPRIVATE
go env GONOSUMDB
go env GONOPROXY
# Install golangci-lint v1 (matching local setup)
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
- export PATH=$PATH:$(go env GOPATH)/bin
script:
- mkdir -p test-results
- golangci-lint run --no-config --enable=gosec,misspell,errcheck,gosimple --timeout=10m > test-results/lint.log 2>&1; echo "Lint completed with findings - see test-results/lint.log"
- echo "Lint results saved to test-results/lint.log"
artifacts:
reports:
junit: golangci-lint-report.xml
paths:
- golangci-lint-report.xml
- test-results/
expire_in: 1 week
allow_failure: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event"

# Example: Using group/project access token instead of CI_JOB_TOKEN
# -------------------------------------------------------------------
# If CI_JOB_TOKEN doesn't have access to your private modules, use a
# project/group access token:
#
# 1. Create token at: Settings > Access Tokens
# 2. Scopes: read_repository, read_api
# 3. Add to CI/CD variables: GITLAB_PRIVATE_TOKEN
# 4. Uncomment the alternative git config line in .go_private_modules_setup

# Example: SSH-based authentication
# ----------------------------------
# If you prefer SSH over HTTPS:
#
# 1. Add deploy key to private module repos
# 2. Add private key to CI/CD variables: SSH_PRIVATE_KEY
# 3. Use this before_script instead:
#
# .go_private_modules_ssh_setup:
# before_script:
# - |
# eval $(ssh-agent -s)
# echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
# mkdir -p ~/.ssh
# chmod 700 ~/.ssh
# ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
# git config --global url."git@gitlab.com:".insteadOf "https://gitlab.com/"
Loading