Skip to content

Commit 66053dd

Browse files
authored
Merge pull request #1 from StacklokLabs/adds-fetch-server
feat: adds fetch mcp server
2 parents 72f9879 + de1d0de commit 66053dd

29 files changed

+2441
-201
lines changed

.dockerignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Git
2+
.git
3+
.gitignore
4+
5+
# Documentation
6+
README.md
7+
*.md
8+
9+
# Build artifacts
10+
fetch-mcp-server
11+
*.exe
12+
*.dll
13+
*.so
14+
*.dylib
15+
16+
# Test files
17+
*_test.go
18+
test*
19+
*test*
20+
21+
# IDE and editor files
22+
.vscode/
23+
.idea/
24+
*.swp
25+
*.swo
26+
*~
27+
28+
# OS files
29+
.DS_Store
30+
Thumbs.db
31+
32+
# Temporary files
33+
*.tmp
34+
*.temp
35+
.cache/
36+
37+
# Logs
38+
*.log
39+
40+
# Docker
41+
Dockerfile*
42+
.dockerignore
43+
44+
# CI/CD
45+
.github/
46+
.gitlab-ci.yml
47+
.travis.yml
48+
.circleci/
49+
50+
# Dependencies (will be downloaded in container)
51+
vendor/

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build artifacts
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
11+
build:
12+
name: Build and Test
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
20+
with:
21+
go-version-file: 'go.mod'
22+
cache: true
23+
24+
- name: Install Task
25+
uses: arduino/setup-task@v2
26+
with:
27+
version: '3.x'
28+
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Install dependencies
31+
run: task install
32+
33+
- name: Build
34+
run: task build
35+
36+
- name: Test
37+
run: task test
38+
39+
- name: Upload build artifacts
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: fetch-server
43+
path: build/fetch-server
44+
retention-days: 7

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Linting
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
18+
with:
19+
go-version-file: 'go.mod'
20+
cache: true
21+
22+
- name: Run golangci-lint
23+
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
24+
with:
25+
args: --timeout=5m

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
name: Release Container
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
id-token: write
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version-file: 'go.mod'
26+
cache: true
27+
28+
- name: Install Task
29+
uses: arduino/setup-task@v2
30+
with:
31+
version: '3.x'
32+
repo-token: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Install dependencies
35+
run: task install
36+
37+
- name: Test
38+
run: task test
39+
40+
- name: Setup Ko
41+
uses: ko-build/[email protected]
42+
43+
- name: Log in to GitHub Container Registry
44+
uses: docker/login-action@v3
45+
with:
46+
registry: ghcr.io
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Extract tag version
51+
id: tag
52+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
53+
54+
- name: Set repository owner lowercase
55+
id: repo_owner
56+
run: echo "OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
57+
58+
- name: Build and push container
59+
env:
60+
KO_DOCKER_REPO: ghcr.io/${{ steps.repo_owner.outputs.OWNER }}/fetch
61+
VERSION: ${{ steps.tag.outputs.VERSION }}
62+
CREATION_TIME: $(date -u +'%Y-%m-%dT%H:%M:%SZ')
63+
run: |
64+
# Build and push the container with reproducible build flags
65+
ko build \
66+
--bare \
67+
--sbom=spdx \
68+
--platform=linux/amd64,linux/arm64 \
69+
--base-import-paths \
70+
--tags $VERSION,latest \
71+
./cmd/server
72+
73+
- name: Install Cosign
74+
uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2
75+
76+
- name: Sign Image with Cosign
77+
env:
78+
KO_DOCKER_REPO: ghcr.io/${{ steps.repo_owner.outputs.OWNER }}/fetch
79+
run: |
80+
TAG=$(echo "${{ steps.tag.outputs.VERSION }}" | sed 's/+/_/g')
81+
# Sign the ko image
82+
cosign sign -y $KO_DOCKER_REPO/server:$TAG
83+
84+
# Sign the latest tag if building from a tag
85+
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
86+
cosign sign -y $KO_DOCKER_REPO/server:latest
87+
fi

.github/workflows/run-on-main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# These set of workflows run on every push to the main branch
2+
name: Main build
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches: [ main ]
10+
11+
jobs:
12+
linting:
13+
name: Linting
14+
uses: ./.github/workflows/lint.yml
15+
tests:
16+
name: Tests
17+
uses: ./.github/workflows/test.yml
18+
build:
19+
name: Build
20+
uses: ./.github/workflows/build.yml

.github/workflows/run-on-pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# These set of workflows run on every push to the main branch
2+
name: PR Checks
3+
permissions:
4+
contents: read
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
10+
jobs:
11+
linting:
12+
name: Linting
13+
uses: ./.github/workflows/lint.yml
14+
tests:
15+
name: Tests
16+
uses: ./.github/workflows/test.yml

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Tests
2+
3+
on:
4+
workflow_call:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
18+
with:
19+
go-version-file: 'go.mod'
20+
cache: true
21+
22+
- name: Install Task
23+
uses: arduino/setup-task@v2
24+
with:
25+
version: '3.x'
26+
repo-token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Test
29+
run: task test

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# Go workspace file
18+
go.work
19+
20+
# Build directory
21+
/build/
22+
23+
# IDE specific files
24+
.idea/
25+
.vscode/
26+
*.swp
27+
*.swo
28+
29+
# OS specific files
30+
.DS_Store
31+
Thumbs.db
32+
33+
# Kubeconfig files
34+
kubeconfig
35+
.kubeconfig
36+
**/.claude/settings.local.json

0 commit comments

Comments
 (0)