Skip to content

Commit 9b73c53

Browse files
Merge branch 'main' into bkellam/fix_463
2 parents 7341a49 + fd2d377 commit 9b73c53

554 files changed

Lines changed: 39690 additions & 17169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/rules/cloud_agent.mdc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
alwaysApply: true
3+
---
4+
- After creating a GitHub PR, create a follow-up commit with a Changelog entry in CHANGELOG.md with a short description of the change. Follow the existing conventions in that file, namely: 1) entries must be parented under a header (Added, Changed, Deprecated, Removed, Fixed, or Security), 2) entries must include the GitHub pull request id at the end of the line, formatted as [#<id>](<url>) (e.g., [#696](https://github.com/sourcebot-dev/sourcebot/pull/696)).
5+
- When creating a GitHub PR for a given issue, always include "Fixes #<id>" in the body of the GitHub PR description, where <id> is the id of the GitHub issue.

.env.development

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
44

55
# Zoekt
66
ZOEKT_WEBSERVER_URL="http://localhost:6070"
7-
# SHARD_MAX_MATCH_COUNT=10000
8-
# TOTAL_MAX_MATCH_COUNT=100000
97
# The command to use for generating ctags.
108
CTAGS_COMMAND=ctags
11-
# logging, strict
12-
SRC_TENANT_ENFORCEMENT_MODE=strict
139

1410
# Auth.JS
1511
# You can generate a new secret with:
@@ -25,15 +21,14 @@ AUTH_URL="http://localhost:3000"
2521

2622
DATA_CACHE_DIR=${PWD}/.sourcebot # Path to the sourcebot cache dir (ex. ~/sourcebot/.sourcebot)
2723
SOURCEBOT_PUBLIC_KEY_PATH=${PWD}/public.pem
28-
# CONFIG_PATH=${PWD}/config.json # Path to the sourcebot config file (if one exists)
24+
CONFIG_PATH=${PWD}/config.json # Path to the sourcebot config file (if one exists)
2925

3026
# Email
3127
# EMAIL_FROM_ADDRESS="" # The from address for transactional emails.
3228
# SMTP_CONNECTION_URL="" # The SMTP connection URL for transactional emails.
3329

3430
# PostHog
3531
# POSTHOG_PAPIK=""
36-
# NEXT_PUBLIC_POSTHOG_PAPIK=""
3732

3833
# Sentry
3934
# SENTRY_BACKEND_DSN=""
@@ -82,14 +77,8 @@ SOURCEBOT_TELEMETRY_DISABLED=true # Disables telemetry collection
8277
# Controls the number of concurrent indexing jobs that can run at once
8378
# INDEX_CONCURRENCY_MULTIPLE=
8479

85-
# Controls the polling interval for the web app
86-
# NEXT_PUBLIC_POLLING_INTERVAL_MS=
87-
88-
# Controls the version of the web app
89-
# NEXT_PUBLIC_SOURCEBOT_VERSION=
90-
9180
# CONFIG_MAX_REPOS_NO_TOKEN=
92-
# NODE_ENV=
81+
NODE_ENV=development
9382
# SOURCEBOT_TENANCY_MODE=single
9483

9584
# NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT=

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
contact_links:
22
- name: 👾 Discord
3-
url: https://discord.gg/f4Cbf3HT
3+
url: https://discord.gg/HDScTs3ptP
44
about: Something else? Join the Discord!

.github/workflows/_gcp-deploy.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ jobs:
5454
${{ env.IMAGE_PATH }}:${{ github.sha }}
5555
${{ env.IMAGE_PATH }}:latest
5656
build-args: |
57-
NEXT_PUBLIC_SOURCEBOT_VERSION=${{ github.ref_name }}
58-
NEXT_PUBLIC_POSTHOG_PAPIK=${{ vars.NEXT_PUBLIC_POSTHOG_PAPIK }}
5957
NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT=${{ vars.NEXT_PUBLIC_SOURCEBOT_CLOUD_ENVIRONMENT }}
6058
NEXT_PUBLIC_SENTRY_ENVIRONMENT=${{ vars.NEXT_PUBLIC_SENTRY_ENVIRONMENT }}
6159
NEXT_PUBLIC_SENTRY_WEBAPP_DSN=${{ vars.NEXT_PUBLIC_SENTRY_WEBAPP_DSN }}
@@ -66,6 +64,7 @@ jobs:
6664
SENTRY_ORG=${{ vars.SENTRY_ORG }}
6765
SENTRY_WEBAPP_PROJECT=${{ vars.SENTRY_WEBAPP_PROJECT }}
6866
SENTRY_BACKEND_PROJECT=${{ vars.SENTRY_BACKEND_PROJECT }}
67+
SENTRY_RELEASE=${{ github.ref_name }}
6968
7069
7170
- name: Deploy to GCP

.github/workflows/deploy-demo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Deploy Demo
22

33
on:
44
push:
5-
branches: ["main"]
5+
tags: ["v*.*.*"]
66
workflow_dispatch:
77

88
jobs:

.github/workflows/ghcr-publish.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ on:
77
push:
88
branches: ["main"]
99
tags: ["v*.*.*"]
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: 'Version tag (e.g., v4.10.5)'
14+
required: false
15+
type: string
16+
workflow_call:
17+
inputs:
18+
version:
19+
description: 'Version tag (e.g., v4.10.5)'
20+
required: false
21+
type: string
1022

1123
env:
1224
# Use docker.io for Docker Hub if empty
@@ -40,6 +52,7 @@ jobs:
4052
- name: Checkout repository
4153
uses: actions/checkout@v4
4254
with:
55+
ref: ${{ inputs.version || github.ref_name }}
4356
submodules: "true"
4457

4558
# Extract metadata (tags, labels) for Docker
@@ -73,13 +86,10 @@ jobs:
7386
with:
7487
context: .
7588
labels: ${{ steps.meta.outputs.labels }}
76-
cache-from: type=gha
77-
cache-to: type=gha,mode=max
89+
cache-from: type=gha,scope=${{ env.PLATFORM_PAIR }}
90+
cache-to: type=gha,mode=max,scope=${{ env.PLATFORM_PAIR }}
7891
platforms: ${{ matrix.platform }}
7992
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true,annotation.org.opencontainers.image.description=Blazingly fast code search
80-
build-args: |
81-
NEXT_PUBLIC_SOURCEBOT_VERSION=${{ github.ref_name }}
82-
NEXT_PUBLIC_POSTHOG_PAPIK=${{ vars.NEXT_PUBLIC_POSTHOG_PAPIK }}
8393

8494
- name: Export digest
8595
run: |
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
name: Release Sourcebot
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump_type:
7+
description: "Type of version bump to apply"
8+
required: true
9+
type: choice
10+
options:
11+
- patch
12+
- minor
13+
- major
14+
15+
concurrency:
16+
group: release-sourcebot
17+
cancel-in-progress: false
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: write
24+
outputs:
25+
version: ${{ steps.calculate_version.outputs.version }}
26+
27+
steps:
28+
- name: Generate GitHub App token
29+
id: generate_token
30+
uses: actions/create-github-app-token@v1
31+
with:
32+
app-id: ${{ secrets.RELEASE_APP_ID }}
33+
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
34+
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
with:
38+
ref: main
39+
fetch-depth: 0
40+
token: ${{ steps.generate_token.outputs.token }}
41+
42+
- name: Calculate new version
43+
id: calculate_version
44+
run: |
45+
# Extract current version from CHANGELOG.md
46+
CURRENT_VERSION=$(grep -oP '## \[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md | head -n 1)
47+
48+
if [ -z "$CURRENT_VERSION" ]; then
49+
echo "Error: Could not extract current version from CHANGELOG.md"
50+
exit 1
51+
fi
52+
53+
echo "Current version: $CURRENT_VERSION"
54+
55+
# Parse version components
56+
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
57+
58+
# Apply bump based on input
59+
BUMP_TYPE="${{ inputs.bump_type }}"
60+
case "$BUMP_TYPE" in
61+
major)
62+
MAJOR=$((MAJOR + 1))
63+
MINOR=0
64+
PATCH=0
65+
;;
66+
minor)
67+
MINOR=$((MINOR + 1))
68+
PATCH=0
69+
;;
70+
patch)
71+
PATCH=$((PATCH + 1))
72+
;;
73+
*)
74+
echo "Error: Invalid bump type: $BUMP_TYPE"
75+
exit 1
76+
;;
77+
esac
78+
79+
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
80+
echo "New version: $NEW_VERSION"
81+
82+
# Export to GITHUB_ENV for use in subsequent steps within this job
83+
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
84+
85+
# Export to GITHUB_OUTPUT for use in other jobs
86+
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
87+
88+
- name: Check if version already exists
89+
run: |
90+
if grep -q "## \[$VERSION\]" CHANGELOG.md; then
91+
echo "Error: Version $VERSION already exists in CHANGELOG.md"
92+
exit 1
93+
fi
94+
if git tag | grep -q "^v$VERSION$"; then
95+
echo "Error: Tag v$VERSION already exists"
96+
exit 1
97+
fi
98+
99+
- name: Update CHANGELOG.md and version.ts
100+
run: |
101+
DATE=$(date +%Y-%m-%d)
102+
103+
# Insert the new version header after the [Unreleased] line
104+
sed -i "/## \[Unreleased\]/a\\
105+
\\
106+
## [$VERSION] - $DATE" CHANGELOG.md
107+
108+
echo "Updated CHANGELOG.md with version $VERSION"
109+
cat CHANGELOG.md | head -n 15
110+
111+
# Update version.ts
112+
cat > packages/shared/src/version.ts << EOF
113+
// This file is auto-generated by .github/workflows/release-sourcebot.yml
114+
export const SOURCEBOT_VERSION = "v$VERSION";
115+
EOF
116+
echo "Updated version.ts with version v$VERSION"
117+
cat packages/shared/src/version.ts
118+
119+
- name: Configure git
120+
run: |
121+
git config user.name "github-actions[bot]"
122+
git config user.email "github-actions[bot]@users.noreply.github.com"
123+
124+
- name: Commit changes
125+
run: |
126+
git add CHANGELOG.md packages/shared/src/version.ts
127+
git commit -m "Release v$VERSION"
128+
129+
- name: Create annotated tag
130+
run: |
131+
git tag -a "v$VERSION" -m "sourcebot v$VERSION"
132+
133+
- name: Push changes
134+
env:
135+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
136+
run: |
137+
git push origin main
138+
git push origin --tags
139+
140+
- name: Create GitHub release
141+
env:
142+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143+
run: |
144+
gh release create "v$VERSION" \
145+
--verify-tag \
146+
--generate-notes \
147+
--latest
148+
149+
publish:
150+
needs: release
151+
uses: ./.github/workflows/ghcr-publish.yml
152+
with:
153+
version: v${{ needs.release.outputs.version }}
154+
permissions:
155+
contents: read
156+
packages: write
157+
id-token: write

.github/workflows/update-roadmap-released.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Update Roadmap Released
22

33
on:
4-
pull_request:
5-
types: [closed]
4+
push:
5+
branches:
6+
- main
67
workflow_dispatch:
78
schedule:
89
- cron: "0 */6 * * *"

.vscode/sourcebot.code-workspace

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
},
66
{
77
"path": "../vendor/zoekt"
8+
},
9+
{
10+
"path": "../../sourcebot-helm-chart"
811
}
912
],
1013
"settings": {

0 commit comments

Comments
 (0)