Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 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
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
90 changes: 90 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
include:
- local: '.gitlab/ci/go-private-modules.yml'

stages:
- sync
- maintain
- build
- test

variables:
GO_VERSION: "1.24"

# 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 "[email protected]"
- 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"

# Test job
test:
extends: .go_private_modules_setup
stage: test
image: golang:${GO_VERSION}
script:
- go mod download
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
coverage: '/coverage: \d+.\d+% of statements/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.txt
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == "main"
174 changes: 174 additions & 0 deletions .gitlab/ci/go-private-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# 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"

# 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.24
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.24
script:
- echo "Downloading dependencies..."
- go mod download
- echo "Running tests..."
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
coverage: '/coverage: \d+.\d+% of statements/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.txt
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.24
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.24
script:
- go mod download
- go mod verify
- go mod tidy
- |
if [ -n "$(git status --porcelain go.mod go.sum)" ]; then
echo "Error: go.mod or go.sum is out of sync"
git diff go.mod go.sum
exit 1
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.24
before_script:
- !reference [.go_private_modules_setup, before_script]
- go install github.com/securego/gosec/v2/cmd/gosec@latest
script:
- gosec -fmt json -out gosec-report.json -no-fail ./...
artifacts:
reports:
sast: gosec-report.json
paths:
- gosec-report.json
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."[email protected]:".insteadOf "https://gitlab.com/"
105 changes: 105 additions & 0 deletions .gitlab/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"platformAutomerge": false,
"baseBranches": ["main"],
"labels": ["dependencies", "renovate"],
"assignees": ["@jesssullivan"],
"reviewers": ["@jesssullivan"],
"timezone": "America/New_York",
"schedule": ["before 5am on monday"],
"prConcurrentLimit": 5,
"prHourlyLimit": 2,
"dependencyDashboard": true,
"dependencyDashboardTitle": "🤖 Dependency Updates Dashboard",
"dependencyDashboardHeader": "This issue lists all pending dependency updates for Fantasy SDK institutional fork.",
"dependencyDashboardLabels": ["dependencies", "renovate-dashboard"],
"packageRules": [
{
"description": "Charmbracelet ecosystem packages",
"matchPackagePatterns": [
"^github.com/charmbracelet/"
],
"labels": ["charmbracelet", "ecosystem"],
"groupName": "charmbracelet packages",
"automerge": false,
"commitMessagePrefix": "chore(deps):",
"semanticCommitType": "chore",
"semanticCommitScope": "deps"
},
{
"description": "OpenAI SDK updates",
"matchPackagePatterns": ["github.com/openai/openai-go"],
"labels": ["openai", "sdk", "provider"],
"automerge": false,
"minimumReleaseAge": "3 days",
"prBodyNotes": ["🔍 Test provider compatibility after upgrade"]
},
{
"description": "Anthropic SDK updates",
"matchPackagePatterns": ["github.com/charmbracelet/anthropic-sdk-go"],
"labels": ["anthropic", "sdk", "provider"],
"automerge": false,
"minimumReleaseAge": "3 days",
"prBodyNotes": ["🔍 Test provider compatibility after upgrade"]
},
{
"description": "AWS SDK updates",
"matchPackagePatterns": ["^github.com/aws/"],
"labels": ["aws", "sdk", "provider"],
"groupName": "aws sdk",
"automerge": false
},
{
"description": "Google Cloud SDK updates",
"matchPackagePatterns": ["^cloud.google.com/"],
"labels": ["gcp", "sdk", "provider"],
"groupName": "gcp sdk",
"automerge": false
},
{
"description": "Go module digest updates - auto-merge when CI passes",
"matchDatasources": ["go"],
"matchUpdateTypes": ["digest"],
"labels": ["golang", "digest-update", "auto-merge"],
"automerge": true,
"commitMessagePrefix": "chore(deps):",
"semanticCommitType": "chore",
"semanticCommitScope": "deps"
},
{
"description": "Go module minor and patch updates - auto-merge when CI passes",
"matchDatasources": ["go"],
"matchUpdateTypes": ["minor", "patch"],
"labels": ["golang", "minor-update", "auto-merge"],
"groupName": "go dependencies (non-major)",
"rangeStrategy": "bump",
"automerge": true
},
{
"description": "Go module major updates - requires careful review",
"matchDatasources": ["go"],
"matchUpdateTypes": ["major"],
"labels": ["golang", "major-update", "needs-review"],
"automerge": false
}
],
"golang": {
"enabled": true
},
"postUpgradeTasks": {
"commands": [
"go mod tidy",
"go build ./...",
"go test ./..."
],
"fileFilters": ["go.mod", "go.sum"],
"executionMode": "branch"
},
"commitMessageAction": "Update",
"commitMessageTopic": "{{depName}}",
"commitMessageExtra": "to {{newVersion}}",
"branchPrefix": "renovate/"
}
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ go 1.24.5

require (
cloud.google.com/go/auth v0.17.0
github.com/aws/aws-sdk-go-v2 v1.39.3
github.com/aws/aws-sdk-go-v2 v1.39.5
github.com/aws/smithy-go v1.23.1
github.com/charmbracelet/anthropic-sdk-go v0.0.0-20251024181547-21d6f3d9a904
github.com/charmbracelet/go-genai v0.0.0-20251021165952-9befde14ce97
github.com/charmbracelet/x/exp/slice v0.0.0-20250904123553-b4e2667e5ad5
github.com/charmbracelet/x/exp/slice v0.0.0-20251103210727-681bf553bc2e
github.com/charmbracelet/x/json v0.2.0
github.com/go-viper/mapstructure/v2 v2.4.0
github.com/google/uuid v1.6.0
Expand All @@ -17,7 +16,8 @@ require (
github.com/stretchr/testify v1.11.1
go.yaml.in/yaml/v4 v4.0.0-rc.2
golang.org/x/oauth2 v0.32.0
gopkg.in/dnaeon/go-vcr.v4 v4.0.6-0.20250923044825-7b4892dd3117
google.golang.org/genai v0.0.0-20250923194548-a075d35ad44a
gopkg.in/dnaeon/go-vcr.v4 v4.0.6-0.20250926081054-3f654157e4a1
)

require (
Expand Down
Loading