Skip to content

Commit dd8492a

Browse files
Merge branch 'main' into fix/bitbucket-username-extraction
2 parents cf9aefe + 2c0b583 commit dd8492a

File tree

269 files changed

+12780
-4477
lines changed

Some content is hidden

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

269 files changed

+12780
-4477
lines changed

.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: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
66
ZOEKT_WEBSERVER_URL="http://localhost:6070"
77
# The command to use for generating ctags.
88
CTAGS_COMMAND=ctags
9-
# logging, strict
10-
SRC_TENANT_ENFORCEMENT_MODE=strict
119

1210
# Auth.JS
1311
# You can generate a new secret with:
@@ -23,15 +21,14 @@ AUTH_URL="http://localhost:3000"
2321

2422
DATA_CACHE_DIR=${PWD}/.sourcebot # Path to the sourcebot cache dir (ex. ~/sourcebot/.sourcebot)
2523
SOURCEBOT_PUBLIC_KEY_PATH=${PWD}/public.pem
26-
# 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)
2725

2826
# Email
2927
# EMAIL_FROM_ADDRESS="" # The from address for transactional emails.
3028
# SMTP_CONNECTION_URL="" # The SMTP connection URL for transactional emails.
3129

3230
# PostHog
3331
# POSTHOG_PAPIK=""
34-
# NEXT_PUBLIC_POSTHOG_PAPIK=""
3532

3633
# Sentry
3734
# SENTRY_BACKEND_DSN=""
@@ -80,9 +77,6 @@ SOURCEBOT_TELEMETRY_DISABLED=true # Disables telemetry collection
8077
# Controls the number of concurrent indexing jobs that can run at once
8178
# INDEX_CONCURRENCY_MULTIPLE=
8279

83-
# Controls the version of the web app
84-
# NEXT_PUBLIC_SOURCEBOT_VERSION=
85-
8680
# CONFIG_MAX_REPOS_NO_TOKEN=
8781
NODE_ENV=development
8882
# SOURCEBOT_TENANCY_MODE=single

.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/GbXMEM5H
3+
url: https://discord.gg/HDScTs3ptP
44
about: Something else? Join the Discord!
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
1-
name: Publish to ghcr
2-
3-
# This workflow is a modification of a example.
1+
# Internal reusable workflow for building multi-platform Docker images.
2+
#
3+
# This workflow builds Docker images for linux/amd64 and linux/arm64 platforms,
4+
# pushes them by digest to GHCR, signs them with cosign/Sigstore for supply chain
5+
# security, and uploads build artifacts for subsequent manifest creation.
6+
#
47
# @ see: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
58

9+
name: Build Multi-Platform Images
10+
611
on:
7-
push:
8-
branches: ["main"]
9-
tags: ["v*.*.*"]
12+
workflow_call:
13+
inputs:
14+
git_ref:
15+
description: "Git ref to checkout"
16+
required: true
17+
type: string
18+
docker_tags:
19+
description: "Docker tags configuration (JSON array or raw tags)"
20+
required: true
21+
type: string
22+
use_app_token:
23+
description: "Whether to use GitHub App token for checkout"
24+
required: false
25+
type: boolean
26+
default: false
27+
secrets:
28+
release_app_id:
29+
description: "GitHub App ID (required if use_app_token is true)"
30+
required: false
31+
release_app_private_key:
32+
description: "GitHub App private key (required if use_app_token is true)"
33+
required: false
1034

1135
env:
12-
# Use docker.io for Docker Hub if empty
1336
REGISTRY_IMAGE: ghcr.io/sourcebot-dev/sourcebot
1437

1538
jobs:
@@ -19,19 +42,27 @@ jobs:
1942
permissions:
2043
contents: read
2144
packages: write
22-
# This is used to complete the identity challenge
23-
# with sigstore/fulcio when running outside of PRs.
45+
# Required for keyless signing with cosign/Sigstore.
46+
# Allows workflow to obtain OIDC token for ephemeral certificate from Fulcio.
2447
id-token: write
2548
strategy:
2649
matrix:
2750
platform: [linux/amd64, linux/arm64]
2851
include:
2952
- platform: linux/amd64
30-
runs-on: blacksmith-4vcpu-ubuntu-2404
53+
runs-on: ubuntu-latest
3154
- platform: linux/arm64
32-
runs-on: blacksmith-8vcpu-ubuntu-2204-arm
55+
runs-on: ubuntu-24.04-arm
3356

3457
steps:
58+
- name: Generate GitHub App token
59+
if: inputs.use_app_token
60+
id: generate_token
61+
uses: actions/create-github-app-token@v1
62+
with:
63+
app-id: ${{ secrets.release_app_id }}
64+
private-key: ${{ secrets.release_app_private_key }}
65+
3566
- name: Prepare
3667
run: |
3768
platform=${{ matrix.platform }}
@@ -40,7 +71,10 @@ jobs:
4071
- name: Checkout repository
4172
uses: actions/checkout@v4
4273
with:
74+
ref: ${{ inputs.git_ref }}
4375
submodules: "true"
76+
fetch-depth: 0
77+
token: ${{ inputs.use_app_token && steps.generate_token.outputs.token || github.token }}
4478

4579
# Extract metadata (tags, labels) for Docker
4680
# https://github.com/docker/metadata-action
@@ -49,6 +83,7 @@ jobs:
4983
uses: docker/metadata-action@v5
5084
with:
5185
images: ${{ env.REGISTRY_IMAGE }}
86+
tags: ${{ inputs.docker_tags }}
5287

5388
# Install the cosign tool except on PR
5489
# https://github.com/sigstore/cosign-installer
@@ -57,8 +92,8 @@ jobs:
5792
with:
5893
cosign-release: "v2.2.4"
5994

60-
- name: Setup Blacksmith Builder
61-
uses: useblacksmith/setup-docker-builder@v1
95+
- name: Set up Docker Buildx
96+
uses: docker/setup-buildx-action@v3
6297

6398
- name: Login to GitHub Packages Docker Registry
6499
uses: docker/login-action@v3
@@ -69,15 +104,14 @@ jobs:
69104

70105
- name: Build Docker image
71106
id: build
72-
uses: useblacksmith/build-push-action@v2
107+
uses: docker/build-push-action@v6
73108
with:
74109
context: .
75110
labels: ${{ steps.meta.outputs.labels }}
111+
cache-from: type=gha,scope=${{ env.PLATFORM_PAIR }}
112+
cache-to: type=gha,mode=max,scope=${{ env.PLATFORM_PAIR }}
76113
platforms: ${{ matrix.platform }}
77114
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
78-
build-args: |
79-
NEXT_PUBLIC_SOURCEBOT_VERSION=${{ github.ref_name }}
80-
NEXT_PUBLIC_POSTHOG_PAPIK=${{ vars.NEXT_PUBLIC_POSTHOG_PAPIK }}
81115

82116
- name: Export digest
83117
run: |
@@ -106,43 +140,4 @@ jobs:
106140
# This step uses the identity token to provision an ephemeral certificate
107141
# against the sigstore community Fulcio instance.
108142
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
109-
110-
merge:
111-
runs-on: blacksmith-4vcpu-ubuntu-2404
112-
permissions:
113-
packages: write
114-
needs:
115-
- build
116-
steps:
117-
- name: Download digests
118-
uses: actions/download-artifact@v4
119-
with:
120-
path: /tmp/digests
121-
pattern: digests-*
122-
merge-multiple: true
123-
124-
- name: Setup Blacksmith Builder
125-
uses: useblacksmith/setup-docker-builder@v1
126-
127-
- name: Extract Docker metadata
128-
id: meta
129-
uses: docker/metadata-action@v5
130-
with:
131-
images: ${{ env.REGISTRY_IMAGE }}
132143

133-
- name: Login to GitHub Packages Docker Registry
134-
uses: docker/login-action@v3
135-
with:
136-
registry: ghcr.io
137-
username: ${{ github.actor }}
138-
password: ${{ secrets.GITHUB_TOKEN }}
139-
140-
- name: Create manifest list and push
141-
working-directory: /tmp/digests
142-
run: |
143-
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
144-
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
145-
146-
- name: Inspect image
147-
run: |
148-
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

.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/_merge.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Internal reusable workflow for merging platform-specific image digests into a
2+
# single multi-platform manifest and pushing to GHCR.
3+
#
4+
# This workflow takes the individual platform image digests created by _build.yml,
5+
# combines them into a multi-platform manifest, and pushes the final tagged images.
6+
7+
name: Merge Multi-Platform Manifest
8+
9+
on:
10+
workflow_call:
11+
inputs:
12+
docker_tags:
13+
description: "Docker tags configuration (JSON array or raw tags)"
14+
required: true
15+
type: string
16+
17+
env:
18+
REGISTRY_IMAGE: ghcr.io/sourcebot-dev/sourcebot
19+
20+
jobs:
21+
merge:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
packages: write
25+
steps:
26+
- name: Download digests
27+
uses: actions/download-artifact@v4
28+
with:
29+
path: /tmp/digests
30+
pattern: digests-*
31+
merge-multiple: true
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Extract Docker metadata
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: ${{ env.REGISTRY_IMAGE }}
41+
tags: ${{ inputs.docker_tags }}
42+
43+
- name: Login to GitHub Packages Docker 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: Create manifest list and push
51+
working-directory: /tmp/digests
52+
run: |
53+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
54+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
55+
56+
- name: Inspect image
57+
run: |
58+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
59+

.github/workflows/deploy-demo.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77

88
jobs:
99
deploy-demo:
10+
# Demo instance is down so skip this job for now
11+
if: false
1012
uses: ./.github/workflows/_gcp-deploy.yml
1113
secrets: inherit
1214
permissions:

.github/workflows/pr-gate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: blacksmith-4vcpu-ubuntu-2404
11+
runs-on: ubuntu-latest
1212
permissions:
1313
contents: read
1414
steps:
@@ -19,6 +19,6 @@ jobs:
1919

2020
- name: Build Docker image
2121
id: build
22-
uses: useblacksmith/build-push-action@v2
22+
uses: docker/build-push-action@v6
2323
with:
2424
context: .

.github/workflows/release-dev.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Sourcebot (Development)
2+
3+
permissions:
4+
contents: read
5+
packages: write
6+
id-token: write
7+
8+
on:
9+
push:
10+
branches: ["main"]
11+
12+
jobs:
13+
build:
14+
uses: ./.github/workflows/_build.yml
15+
with:
16+
git_ref: ${{ github.ref_name }}
17+
docker_tags: type=raw,value=main
18+
use_app_token: false
19+
secrets: inherit
20+
21+
publish-to-registry:
22+
needs: build
23+
uses: ./.github/workflows/_merge.yml
24+
with:
25+
docker_tags: type=raw,value=main

0 commit comments

Comments
 (0)