Commit graph

154 commits

Author SHA1 Message Date
Brendan Kellam
eb10d599f3
chore: Sourcebot REST api surface (#290) 2025-05-03 11:33:58 -07:00
Brendan Kellam
14ce633cf0
feat: add rev:* syntax to explicitly search all branches (#281) 2025-04-30 15:38:30 -07:00
Brendan Kellam
ceb8b3ab2e
Embed filter selection in query params (#276) 2025-04-28 12:10:43 -07:00
Michael Sukkarieh
b6dedc78ba
Add Bitbucket support (#275)
* [wip] add bitbucket schema

* wip bitbucket support

* add support for pulling bitbucket repos and UI support for bitbucket

* fix bitbucket app password auth case

* add back support for multiple workspaces and add exclude logic

* add branches to bitbucket

* add bitbucket server support

* add docs for bitbucket and minor nits

* doc nits

* code rabbit fixes

* fix build error

* add bitbucket web ui support

* misc cleanups and fix ui issues with bitbucket connections

* add changelog entry
2025-04-25 11:22:40 -07:00
Brendan Kellam
cfe8b8ccc8
Search contexts (#273) 2025-04-24 22:28:13 -07:00
bkellam
8b1b908c73 fix overflow bug in filter panel 2025-04-04 00:28:02 -07:00
Brendan Kellam
bbd8b221d6
Display name improvements (#259) 2025-04-02 17:50:48 -07:00
bkellam
4f52494235 (fix) Fix issue with match highlighting not appearing when first clicking on a search result. Fixes #255 2025-04-01 16:35:00 -07:00
msukkari
e57a981030 change demo url references 2025-04-01 16:07:16 -07:00
bkellam
68344ce2f5 add demo cloud environment 2025-04-01 15:40:27 -07:00
bkellam
f8adf5974d Add back file watch for declarative config 2025-04-01 14:51:02 -07:00
bkellam
58363abbae show warning & error indicators in unauthed 2025-04-01 14:19:46 -07:00
bkellam
0bb47cdc50 fix issue with array index out of bounds when accessing linkedConnections 2025-04-01 12:02:06 -07:00
bkellam
e28daf9c77 Add docs to footer 2025-04-01 09:29:00 -07:00
msukkari
6b1d7ff8a4 fix bug with env var read in client 2025-04-01 00:05:56 -07:00
Brendan Kellam
39b92b9e98
v3 effort (#158)
* SQL Database (#157)

* point zoekt to v3 branch

* bump zoekt version

* Add tenant ID concept into web app and backend (#160)

* hacked together a example of using zoekt grpc api

* provide tenant id to zoekt git indexer

* update zoekt version to point to multitenant branch

* pipe tenant id through header to zoekt

* remove incorrect submodule reference and settings typo

* update zoekt commit

* remove unused yarn script

* remove unused grpc client in web server

* remove unneeded deps and improve tenant id log

* pass tenant id when creating repo in db

* add mt yarn script

* add nocheckin comment to tenant id in v2 schema

---------

Co-authored-by: bkellam <bshizzle1234@gmail.com>

* bump zoekt version

* parallelize repo indexing (#163)

* hacked together a example of using zoekt grpc api

* provide tenant id to zoekt git indexer

* update zoekt version to point to multitenant branch

* pipe tenant id through header to zoekt

* remove incorrect submodule reference and settings typo

* update zoekt commit

* remove unused yarn script

* remove unused grpc client in web server

* remove unneeded deps and improve tenant id log

* pass tenant id when creating repo in db

* add mt yarn script

* add pol of bullmq into backend

* add better error handling and concurrency setting

* spin up redis instance in dockerfile

* cleanup transaction logic when adding repos to index queue

* add NEW index status fetch condition

* move bullmq deps to backend

---------

Co-authored-by: bkellam <bshizzle1234@gmail.com>

* Authentication (#164)

* Add Org table (#167)

* Move logout button & profile picture into settings dropdown (#172)

* Multi tenancy support in config syncer (#171)

* [wip] initial mt support in config syncer

* Move logout button & profile picture into settings dropdown (#172)

* update sync status properly and fix bug with multiple config in db case

* make config path required in single tenant mode

NOTE: deleting config/repos is currently not supported in multi tenancy case. Support for this will be added in a future PR

---------

Co-authored-by: Brendan Kellam <bshizzle1234@gmail.com>

* add tenant mode support in docker container:

* Organization switching & active org management (#173)

* updated syncedAt date after config sync:

* Migrate to postgres (#174)

* spin up postgres in docker container

* get initial pol of postgres db working in docker image

* spin up postgres server in dev case

* updated syncedAt date after config sync:

* remove unnecessary port expose in docker file

* Connection creation form (#175)

* fix issue with yarn dev startup

* init (#176)

* Add `@sourcebot/schemas` package (#177)

* Connection management (#178)

* add concept of secrets (#180)

* add @sourcebot/schemas package

* migrate things to use the schemas package

* Dockerfile support

* add secret table to schema

* Add concept of connection manager

* Rename Config->Connection

* Handle job failures

* Add join table between repo and connection

* nits

* create first version of crypto package

* add crypto package as deps to others

* forgot to add package changes

* add server action for adding and listing secrets, create test page for it

* add secrets page to nav menu

* add secret to config and support fetching it in backend

* reset secret form on successful submission

* add toast feedback for secrets form

* add instructions for adding encryption key to dev instructions

* add encryption key support in docker file

* add delete secret button

* fix nits from pr review

---------

Co-authored-by: bkellam <bshizzle1234@gmail.com>

* bump zoekt version

* enforce tenancy on search and repo listing endpoints (#181)

* enforce tenancy on search and repo listing

* remove orgId from request schemas

* adds garbage collection for repos (#182)

* refactor repo indexing logic into RepoManager

* wip cleanup stale repos

* add rest of gc logic

* set status to indexing properly

* add initial logic for staging environment

* try to move encryption key env decleration in docker file to fix build issues

* switch encryption key as build arg to se if that fixes build issues

* add deployment action for staging image

* try using mac github action runners instead

* switch to using arm64 runners on arm64 build

* change workflow names to fix trigger issue

* trigger staging actions to see if it works

* fix working directory typo and pray it doesnt push to prod

* checkout v3 when deploying staging

* try to change into the staging dir manuall

* dummy commit to trigger v3 workflows to test

* update staging deploy script to match new version in main

* reference proper image:tag in staging fly config

* update staging fly config to point to ghcr

* Connection management (#183)

* add invite system and google oauth provider (#185)

* add settings page with members list

* add invite to schema and basic create form

* add invite table

* add basic invite link copy button

* add auth invite accept case

* add non auth logic

* add google oauth provider

* fix reference to header component in connections

* add google logo to google oauth

* fix web build errors

* bump staging resources

* change staging cpu to perf

* add side bar nav in settings page

* improve styling of members page

* wip adding stripe checkout button

* wip onboarding flow

* add stripe subscription id to org

* save stripe session id and add manage subscription button in settings

* properly block access to pages if user isn't in an org

* wip add paywall

* Domain support

* Domain support (#188)

* Update Makefile to include crypto package when doing a make clean

* Add default for AUTH_URL in attempt to fix build

* attempt 2

* fix attempt #3: Do not require a encrpytion key at build time

* Fix generate script race condition

* Attempt #4

* add back paywall and also add support for incrememnting seat count on invite redemption

* prevent self invite

* action button styling in settings and toast on copy

* add ability to remove member from org

* move stripe product id to env var

* add await for blocking loop in backend

* add subscription info to billing page

* handle trial case in billing info page

* add trial duration indicator to nav bar

* check if domain starts or ends with dash

* remove unused no org component

* Generate AUTH_SECRET if not provided (#189)

* remove package lock file and fix prisma dep version

* revert dep version updates

* fix yarn.lock

* add auth and membership check to fetchSubscription

* properly handle invite redeem with no valid subscription case

* change back fetch subscription to not require org membership

* add back subscription check in invite redeem page

* Add stripe billing logic (#190)

* add side bar nav in settings page

* improve styling of members page

* wip adding stripe checkout button

* wip onboarding flow

* add stripe subscription id to org

* save stripe session id and add manage subscription button in settings

* properly block access to pages if user isn't in an org

* wip add paywall

* Domain support

* add back paywall and also add support for incrememnting seat count on invite redemption

* prevent self invite

* action button styling in settings and toast on copy

* add ability to remove member from org

* move stripe product id to env var

* add await for blocking loop in backend

* add subscription info to billing page

* handle trial case in billing info page

* add trial duration indicator to nav bar

* check if domain starts or ends with dash

* remove unused no org component

* remove package lock file and fix prisma dep version

* revert dep version updates

* fix yarn.lock

* add auth and membership check to fetchSubscription

* properly handle invite redeem with no valid subscription case

* change back fetch subscription to not require org membership

* add back subscription check in invite redeem page

---------

Co-authored-by: bkellam <bshizzle1234@gmail.com>

* fix nits

* remove providers check

* fix more nits

* change stripe init to be behind function

* fix publishible stripe key handling in docker container

* enforce owner perms (#191)

* add make owner logic, and owner perms for removal, invite, and manage subscription

* add change billing email card to billing settings

* enforce owner role in action level

* remove unused hover card component

* cleanup

* add back gitlab, gitea, and gerrit support (#184)

* add non github config definitions

* refactor github config compilation to seperate file

* add gitlab config compilation

* Connection management (#183)

* wip gitlab repo sync support

* fix gitlab zoekt metadata

* add gitea support

* add gerrit support

* Connection management (#183)

* add gerrit config compilation

* Connection management (#183)

---------

Co-authored-by: Brendan Kellam <bshizzle1234@gmail.com>

* fix apos usage in redeem page

* change csrf cookie to secure not host

* Credentials provider (#192)

* email password functionality

* feedback

* cleanup org's repos and shards if it's inactive (#194)

* add stripe subscription status and webhook

* add inactive org repo cleanup logic

* mark reactivated org connections for sync

* connections qol improvements (#195)

* add client side polling to connections list

* properly fetch repo image url

* add client polling to connection management page, and add ability to sync failed connections

* Fix build with suspense boundary

* improved fix

* add retries for 429 issues (#196)

* add connection compile retry and hard repo limit

* add more retry checks

* cleanup unused change

* address feedback

* fix build errors and add index concurrency env var

* add config upsert timeout env var

* Membership settings rework (#198)

* Add refined members list

* futher progress on members settings polish

* Remove old components

* feedback

* Magic links (#199)

* wip on magic link support

* Switch to nodemailer / resend for transactional mail

* Further cleanup

* Add stylized email using react-email

* fix

* Fix build

* db performance improvements and job resilience  (#200)

* replace upsert with seperate create many and raw update many calls

* add bulk repo status update and queue addition with priority

* add support for managed redis

* add note for changing raw sql on schema change

* remove non secret token options

* fix token examples in schema

* add better visualization for connection/repo errors and warnings (#201)

* replace upsert with seperate create many and raw update many calls

* add bulk repo status update and queue addition with priority

* add support for managed redis

* add note for changing raw sql on schema change

* add error package and use BackendException in connection manager

* handle connection failure display on web app

* add warning banner for not found orgs/repos/users

* add failure handling for gerrit

* add gitea notfound warning support

* add warning icon in connections list

* style nits

* add failed repo vis in connections list

* added retry failed repo index buttons

* move nav indicators to client with polling

* fix indicator flash issue and truncate large list results

* display error nav better

* truncate failed repo list in connection list item

* fix merge error

* fix merge bug

* add connection util file [wip]

* refactor notfound fetch logic and add missing error package to dockerfile

* move repeated logic to function and add zod schema for syncStatusMetadata

* add orgid unique constraint to repo

* revert repo compile update logic to upsert loop

* log upsert stats

* [temp] disable polling everywhere (#205)

* add health check endpoint

* Refined onboarding flow (#202)

* Redeem UX pass (#204)

* add log for health check

* fix new connection complete callback route

* add cpu split logic and only wait for postgres if we're going to connec to it

* Inline secret creation (#207)

* use docker scopes to try and improve caching

* Dummy change

* remove cpu split logic

* Add some instrumentation to web

* add posthog events on various user actions (#208)

* add page view event support

* add posthog events

* nit: remove unused import

* feedback

* fix merge error

* use staging posthog papik when building staging image

* fix other merge error and build warnings

* Add invite email (#209)

* wrap posthog provider in suspense to fix build error

* add grafana alloy config and setup (#210)

* add grafana alloy config and setup

* add basic repo prom metrics

* nits in dockerfile

* remove invalid characters when auto filling domain

* add login posthog events

* remove hard coded sourcebot.app references

* make repo garbage collection async (#211)

* add gc queue logic

* fix missing switch cases for gc status

* style org create form better with new staging domain

* change repo rm logic to be async

* simplify repo for inactive org query

* add grace period for garbage collecting repos

* make prom scrape interval 500ms

* fix typo in trial card

* onboarding tweaks

* rename some prom metrics and cleanup unused

* wipe existing repo if we've picked up a killed job to ensure good state

* Connections UX pass + query optimizations (#212)

* remove git & local schemas (#213)

* skip stripe checkout for trial + fix indexing in progress UI + additional schema validation (#214)

* add additional config validation

* wip bypass stripe checkout for trial

* fix stripe trial checkout bypass

* fix indexing in progress ui on home page

* add subscription checks, more schema validation, and fix issue with complete page

* dont display if no indexed repos

* fix skipping onboard complete check

* fix build error

* add back button in onboard connection creation flow

* Add back revision support (#215)

* fix build

* Fix bug with repository snapshot

* fix share links

* fix repo rm issue, 502 page, condition on test clock

* Make login and onboarding mobile friendly

* fix ordering of quick actions

* remove error msg dump on failed repo index job, and update indexedAt field

* Add mobile unsupported splash screne

* cherry pick fix for file links

* [Cherry Pick] Syntax reference guide (#169) (#216)

* Add .env to db gitignore

* fix case where we have repos but they're all failed for repo snapshot

* /settings/secrets page (#217)

* display domain properly in org create form

* Quick action tweaks (#218)

* revamp repo page (#220)

* wip repo table

* new repo page

* add indicator for when feedback is applied in repo page

* add repo button

* fetch connection data in one query

* fix styling

* fix (#219)

* remove / keyboard shortcut hint in search bar

* prevent switching to first page on data update and truncate long repo names in repo list

* General settings + cleanup (#221)

* General settings

* Add alert to org domain change

* First attempt at sending logs to grafana

* logs wip

* add alloy logs

* wip

* [temp] comment out loki for now

* update trial card content and add events for code host selection on onboard

* reduce scraping interval to 15s

* Add prometheus metric for pending repo indexing jobs

* switch magic link to invite code (#222)

* wip magic link codes

* pipe email to email provider properly

* remove magic link data cookie after sign in

* clean up unused imports

* dont remove cookie before we use it

* rm package-lock.json

* revert yarn files to v3 state

* switch email passing from cookie to search param

* add comment for settings dropdown auth update

* remove unused middleware file

* fix build error and warnings

* fix build error with useSearchParam not wrapped in suspense

* add sentry support to backend and webapp (#223)

* add sentry to web app

* set sentry environemnt from env var

* add sentry env replace logic in docker container

* wip add backend sentry

* add sentry to backend

* move dns to env var

* remove test exception

* Fix root domain issue on onboarding

* add setup sentry cli step to github action

* login to sentry

* fix sentry login in action

* Update grafana loki endpoint

* switch source map publish to runtime in entrypoint

* catch and rethrow simplegit exceptions

* alloy nits

* fix alloy

* backend logging (#224)

* revert grafana loki config

* fix login ui nits

* fix quick actions

* fix typo in secret creation

* fix private repo clone issue for gitlab

* add repo index timeout logic

* add posthog identify call after registeration

* various changes to add terms and security info (#225)

* add terms and security to footer

* add security card

* add demo card

* fix build error

* nit fix: center 'get in touch' on security card

* Dark theme improvements (#226)

* (fix) Fixed bug with gitlab and gitea not including hostname in the repoName

* Switch to using t3-env for env-var management (#230)

* Add missing env var

* fix build

* Centralize to using a single .env.development for development workflows (#231)

* Make billing optional (#232)

* Massage environment variables from strings to numbers (#234)

* Single tenancy & auth modes (#233)

* Add docs to this repo

* dummy change

* Declarative connection configuration (#235)

* fix build

* upgrade to next 14.2.25

* Improved database DX

* migrate to yarn v4

* Use origin from header for baseUrl of emails (instead of AUTH_URL). Also removed reference to hide scrollbars

* Remove SOURCEBOT_ENCRYPTION_KEY from build arg

* Fix issue with linking default user to org in single tenant + no-auth mode

* Fix fallback tokens (#242)

* add SECURITY_CARD_ENABLED flag

* Add repository weburl (#243)

* Random fixes and improvements (#244)

* add zoekt max wall time env var

* remove empty warning in docs

* fix reference in sh docs

* add connection manager upsert timeout env var

* Declarative connection cleanup + improvements (#245)

* change contact us footer in app to point to main contact form

* PostHog event pass (#246)

* fix typo

* Add sourcebot cloud environment prop to staging workflow

* Update generated files

* remove AUTH_URL since it unused and (likely) unnecessary

* Revert "remove AUTH_URL since it unused and (likely) unnecessary"

This reverts commit 1f4a5aed22.

* cleanup GitHub action releases (#252)

* remove alloy, change auth defaul to disabled, add settings page in me dropdown

* enforce connection management perms to owner (#253)

* enforce conneciton management perms to owner

* fix formatting

* more formatting

* naming nits

* fix var name error

* change empty repo set copy if auth is disabled

* add CONTRIBUTING.md file

* hide settings in dropdown with auth isnt enabled

* handle case where gerrit weburl is just gitiles path

* Docs overhall (#251)

* remove nocheckin

* fix build error

* remove v3 trigger from deploy staging

* fix build errors round 2

* another error fix

---------

Co-authored-by: msukkari <michael.sukkarieh@mail.mcgill.ca>
2025-03-31 22:34:42 -07:00
Brendan Kellam
998a4dd07b
make syntax reference guide keyboard shortcut hint clickable (#229) 2025-03-13 13:02:49 -07:00
msukkari
9d1ebcefaa log addition info for public search demo 2025-03-06 15:20:30 -08:00
msukkari
9a204b9557 add sourcebot cloud card to public search demo 2025-03-05 17:27:23 -08:00
Brendan Kellam
27dde3a902
Fix version upgrade toast refresh issue (#179) 2025-01-28 12:04:27 -05:00
msukkari
d20412301d change example repo filter query to use react instead of linux as example 2025-01-27 11:22:03 -08:00
Brendan Kellam
6c77278498
Syntax reference guide (#169) 2025-01-17 14:12:43 -08:00
Brendan Kellam
7d516b1420
Fix broken file links (#161) 2025-01-14 16:50:38 -08:00
bkellam
672832c993 remove Inter font since it was causing build failures 2025-01-07 13:14:31 -08:00
bkellam
11c79d850f Fix issue with share links not including domain sub paths 2025-01-07 11:23:06 -08:00
Brendan Kellam
af8559678c
Add footer to homepage (#151) 2025-01-07 11:13:06 -08:00
Brendan Kellam
2c1de4d005
Share links (#149) 2025-01-07 10:27:42 -08:00
Konrad Staniszewski
5772468930
Refactor Language Support (#132)
* feat: move language utilites out of components and dedup linguist languages

This mot moves all linguist language and codemirror languages into
utility classes.
It also adds syntax highligting for 200+ languages which can use
available parsers.

* Add support for all available 3rd party languages

* Remove some accidental languages

---------

Co-authored-by: Brendan Kellam <bshizzle1234@gmail.com>
2024-12-17 11:00:58 -08:00
Brendan Kellam
415535e794
fix (#133) 2024-12-16 15:20:50 -08:00
bkellam
a4cd49dbc5 quick fix typescript icon 2024-12-13 15:35:58 -08:00
Konrad Staniszewski
0b78ffd2d1
feat: add all 800 linguist language icons (#129)
* feat: add all 800 linguist language icons

This uses existing svg icons for common languages, then falls back on
the iconify library for the remaining 600 languages.

* move icon component to ui components

---------

Co-authored-by: Brendan Kellam <bshizzle1234@gmail.com>
2024-12-13 15:14:01 -08:00
Konrad Staniszewski
1ba4e8215d
feat: Add support for codemirror mode languages (#125)
* feat: Add support for codemirror mode languages

Codemirror 5 had a number of languages supported via modes instead of
explicit language support

* Add additional languages, remove comment
2024-12-13 15:09:07 -08:00
Brendan Kellam
3dd4a16b7f
Make language suggestions case insensitive (#124) 2024-12-11 13:51:59 -08:00
Konrad Staniszewski
d4e6410b28
Fix zoekt language parsing and add more token coloring (#115) 2024-12-09 08:46:53 -10:00
Konrad Staniszewski
ce8232a23c
Filter panel visual fixes (#105)
* Make filter panel full page height

* Fix filter items text

when the filter items were cutoff, the text would break onto multiple
lines and the count would overlap with the text

---------

Co-authored-by: Brendan Kellam <bshizzle1234@gmail.com>
2024-12-03 10:46:42 -10:00
Konrad Staniszewski
b452fd2983
Gerrit sync (#104)
* Basic gerrit sync with working gitiles web-links functionality

This adds basic support for gerrit repo code host syncing. Gerrit uses
gitiles plugin for code browsing (in most cases).
It may be usefull to allow users to provide their own web code-browsing
url templates in the future.

* Add gerrit readme update

* Remove config arg from gerrit fetchAllProjects

* Remove example urls

* Resolve comments
2024-12-02 16:07:02 -08:00
Brendan Kellam
d18601c746
Search history (#99) 2024-11-29 10:42:08 -08:00
Brendan Kellam
120d84a046
Symbol suggestions (#98) 2024-11-28 13:26:27 -08:00
bkellam
55b50f22fd Fixed homepage links not resolving when DOMAIN_SUB_PATH is set. Fixes #96 2024-11-27 10:48:22 -08:00
bkellam
c061136125 Fix filter icon bug. Fixes #95 2024-11-27 10:43:41 -08:00
Brendan Kellam
d6544086e7
Icon & link support for self-hosted repositories (#93) 2024-11-26 21:49:41 -08:00
Brendan Kellam
33b5418bbf
Pass PostHog key at build time (#92) 2024-11-25 21:04:52 -08:00
Brendan Kellam
c73c34428c
File suggestions (#88) 2024-11-24 13:58:05 -08:00
Brendan Kellam
7f952ce163
Search suggestions (#85)
The motivation for building search suggestions is two-fold: (1) to make the zoekt query language more approachable by presenting all available options to the user, and (2) make it easier for power-users to craft complex queries.

The meat-n-potatoes of this change are concentrated in searchBar.tsx and searchSuggestionBox.tsx. The suggestions box works by maintaining a state-machine of "modes". By default, the box is in the refine mode, where suggestions for different prefixes (e.g., repo:, lang:, etc.) are suggested to the user. When one of these prefixes is matched, the state-machine transitions to the corresponding mode (e.g., repository, language, etc.) and surfaces suggestions for that mode (if any).

The query is split up into parts by spaces " " (e.g., 'test repo:hello' -> ['test', 'repo:hello']). See splitQuery. The part that has the cursor over it is considered the active part. We evaluate which mode the state machine is in based on the active part. When a suggestion is clicked, we only modify the active part of the query.

Three modes are currently missing suggestion data: file (file names), revision (branch / tag names), and symbol (symbol names). In future PRs, we will need to introduce endpoints into the backend to allow the frontend to fetch this data and surface it as suggestions..
2024-11-22 18:50:13 -08:00
Brendan Kellam
83270ffdc9
Add support for configurable domain sub-paths (#74) 2024-11-18 12:09:26 -08:00
Brendan Kellam
276086d2d6
Basic syntax highlighting support for search bar (#66) 2024-11-12 18:43:44 -08:00
Brendan Kellam
ada53fc2c6
Multi branch / tag support (#58) 2024-11-06 18:28:10 -08:00
Brendan Kellam
7966c1440c
Local directory support (#56) 2024-11-01 10:51:14 -07:00
Brendan Kellam
e913b22324
Improve rendering performance of search results (#52) 2024-10-30 09:32:05 -07:00
Brendan Kellam
f4c7354037
Filtering panel (#48) 2024-10-28 10:30:29 -07:00
Michael Sukkarieh
1fa3f7484a
Add discord button to nav bar and version in settings drop down (#47)
* add discord button to nav menu

* add version to settings drop down

* nit: prepend version text with "version"

* revert settings json change
2024-10-28 11:06:51 -06:00
Brendan Kellam
82730f1cb0
Gitea support (#45) 2024-10-22 23:06:36 -04:00
Brendan Kellam
cde9f46570
Version upgrade toast (#44) 2024-10-18 15:03:13 -04:00
Brendan Kellam
fc8815d135
Config format V2 (#42) 2024-10-17 16:31:18 -04:00