From a0132989554b74a4703f0080ef6a3c88d20a1450 Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Tue, 14 Jan 2025 15:09:20 -0800 Subject: [PATCH 01/32] curl error handling in entrypoint.sh (#159) --- CHANGELOG.md | 4 ++++ entrypoint.sh | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b64bd46b..a8a8ac58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixed issue where we crash on startup if the install / upgrade PostHog event fails to send. ([#159](https://github.com/sourcebot-dev/sourcebot/pull/159)) + ## [2.7.0] - 2025-01-10 ### Added diff --git a/entrypoint.sh b/entrypoint.sh index 6bc3b70a..2ed5ec20 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -30,14 +30,16 @@ if [ ! -f "$FIRST_RUN_FILE" ]; then # If this is our first run, send a `install` event to PostHog # (if telemetry is enabled) if [ -z "$SOURCEBOT_TELEMETRY_DISABLED" ]; then - curl -L -s --header "Content-Type: application/json" -d '{ + if ! ( curl -L --output /dev/null --silent --fail --header "Content-Type: application/json" -d '{ "api_key": "'"$POSTHOG_PAPIK"'", "event": "install", "distinct_id": "'"$SOURCEBOT_INSTALL_ID"'", "properties": { "sourcebot_version": "'"$SOURCEBOT_VERSION"'" } - }' https://us.i.posthog.com/capture/ > /dev/null + }' https://us.i.posthog.com/capture/ ) then + echo -e "\e[33m[Warning] Failed to send install event.\e[0m" + fi fi else export SOURCEBOT_INSTALL_ID=$(cat "$FIRST_RUN_FILE" | jq -r '.install_id') @@ -48,7 +50,7 @@ else echo -e "\e[34m[Info] Upgraded from version $PREVIOUS_VERSION to $SOURCEBOT_VERSION\e[0m" if [ -z "$SOURCEBOT_TELEMETRY_DISABLED" ]; then - curl -L -s --header "Content-Type: application/json" -d '{ + if ! ( curl -L --output /dev/null --silent --fail --header "Content-Type: application/json" -d '{ "api_key": "'"$POSTHOG_PAPIK"'", "event": "upgrade", "distinct_id": "'"$SOURCEBOT_INSTALL_ID"'", @@ -56,7 +58,9 @@ else "from_version": "'"$PREVIOUS_VERSION"'", "to_version": "'"$SOURCEBOT_VERSION"'" } - }' https://us.i.posthog.com/capture/ > /dev/null + }' https://us.i.posthog.com/capture/ ) then + echo -e "\e[33m[Warning] Failed to send upgrade event.\e[0m" + fi fi fi fi From 7d516b1420ecfe46909a30a48302ef119ab36b90 Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Tue, 14 Jan 2025 16:50:38 -0800 Subject: [PATCH 02/32] Fix broken file links (#161) --- CHANGELOG.md | 1 + .../components/codePreviewPanel/index.tsx | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8a8ac58..65900079 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed issue where we crash on startup if the install / upgrade PostHog event fails to send. ([#159](https://github.com/sourcebot-dev/sourcebot/pull/159)) +- Fixed issue with broken file links. ([#161](https://github.com/sourcebot-dev/sourcebot/pull/161)) ## [2.7.0] - 2025-01-10 diff --git a/packages/web/src/app/search/components/codePreviewPanel/index.tsx b/packages/web/src/app/search/components/codePreviewPanel/index.tsx index 22a0332f..8f72700e 100644 --- a/packages/web/src/app/search/components/codePreviewPanel/index.tsx +++ b/packages/web/src/app/search/components/codePreviewPanel/index.tsx @@ -41,12 +41,30 @@ export const CodePreviewPanel = ({ .then(({ source }) => { const link = (() => { const template = repoUrlTemplates[fileMatch.Repository]; - if (!template) { + + // This is a hacky parser for templates generated by + // the go text/template package. Example template: + // {{URLJoinPath "https://github.com/sourcebot-dev/sourcebot" "blob" .Version .Path}} + // @see: https://pkg.go.dev/text/template + if (!template || !template.match(/^{{URLJoinPath\s.*}}(\?.+)?$/)) { return undefined; } - return template - .replace("{{.Version}}", branch ?? "HEAD") - .replace("{{.Path}}", fileMatch.FileName); + + const url = + template.substring("{{URLJoinPath ".length,template.indexOf("}}")) + .replace(".Version", branch ?? "HEAD") + .replace(".Path", fileMatch.FileName) + .split(" ") + .map((part) => { + // remove wrapping quotes + if (part.startsWith("\"")) part = part.substring(1); + if (part.endsWith("\"")) part = part.substring(0, part.length - 1); + return part; + }) + .join("/"); + + const optionalQueryParams = template.substring(template.indexOf("}}") + 2); + return url + optionalQueryParams; })(); const decodedSource = base64Decode(source); From b96fffcc837c61c2cbbc06254742329b3c67e3ca Mon Sep 17 00:00:00 2001 From: bkellam Date: Wed, 15 Jan 2025 09:20:14 -0800 Subject: [PATCH 03/32] Release v2.7.1 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65900079..9cb83e0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.7.1] - 2025-01-15 + ### Fixed - Fixed issue where we crash on startup if the install / upgrade PostHog event fails to send. ([#159](https://github.com/sourcebot-dev/sourcebot/pull/159)) From 6c77278498c8cd918f1dc2cc29b483194d0d8f8a Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Fri, 17 Jan 2025 14:12:43 -0800 Subject: [PATCH 04/32] Syntax reference guide (#169) --- CHANGELOG.md | 4 + packages/web/package.json | 1 + .../web/src/app/components/fireHeader.tsx | 2 +- .../app/components/keyboardShortcutHint.tsx | 16 ++ .../src/app/components/repositoryCarousel.tsx | 2 +- .../app/components/searchBar/searchBar.tsx | 4 +- .../searchBar/searchSuggestionsBox.tsx | 37 ++- .../app/components/syntaxReferenceGuide.tsx | 244 ++++++++++++++++++ packages/web/src/app/layout.tsx | 2 + packages/web/src/app/page.tsx | 5 +- .../search/components/filterPanel/index.tsx | 2 +- packages/web/src/components/ui/dialog.tsx | 122 +++++++++ packages/web/src/lib/utils.ts | 10 +- yarn.lock | 134 ++++++++-- 14 files changed, 544 insertions(+), 41 deletions(-) create mode 100644 packages/web/src/app/components/keyboardShortcutHint.tsx create mode 100644 packages/web/src/app/components/syntaxReferenceGuide.tsx create mode 100644 packages/web/src/components/ui/dialog.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cb83e0b..08538f55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Added a syntax reference guide. The guide can be opened using the hotkey "Cmd + /" ("Ctrl + /" on Windows). ([#169](https://github.com/sourcebot-dev/sourcebot/pull/169)) + ## [2.7.1] - 2025-01-15 ### Fixed diff --git a/packages/web/package.json b/packages/web/package.json index 706b4329..59199010 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -39,6 +39,7 @@ "@hookform/resolvers": "^3.9.0", "@iconify/react": "^5.1.0", "@iizukak/codemirror-lang-wgsl": "^0.3.0", + "@radix-ui/react-dialog": "^1.1.4", "@radix-ui/react-dropdown-menu": "^2.1.1", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-label": "^2.1.0", diff --git a/packages/web/src/app/components/fireHeader.tsx b/packages/web/src/app/components/fireHeader.tsx index 702cce58..b5df9e14 100644 --- a/packages/web/src/app/components/fireHeader.tsx +++ b/packages/web/src/app/components/fireHeader.tsx @@ -31,7 +31,7 @@ export const FileHeader = ({ {info?.icon ? ( {info.costHostName} ): ( diff --git a/packages/web/src/app/components/keyboardShortcutHint.tsx b/packages/web/src/app/components/keyboardShortcutHint.tsx new file mode 100644 index 00000000..f93209f1 --- /dev/null +++ b/packages/web/src/app/components/keyboardShortcutHint.tsx @@ -0,0 +1,16 @@ +import React from 'react' + +interface KeyboardShortcutHintProps { + shortcut: string + label?: string +} + +export function KeyboardShortcutHint({ shortcut, label }: KeyboardShortcutHintProps) { + return ( +
+ + {shortcut} + +
+ ) +} diff --git a/packages/web/src/app/components/repositoryCarousel.tsx b/packages/web/src/app/components/repositoryCarousel.tsx index 3d6fa8a2..fbd61206 100644 --- a/packages/web/src/app/components/repositoryCarousel.tsx +++ b/packages/web/src/app/components/repositoryCarousel.tsx @@ -63,7 +63,7 @@ const RepositoryBadge = ({ return { repoIcon: {info.costHostName}, displayName: info.displayName, diff --git a/packages/web/src/app/components/searchBar/searchBar.tsx b/packages/web/src/app/components/searchBar/searchBar.tsx index 964b5ff7..c79e2c15 100644 --- a/packages/web/src/app/components/searchBar/searchBar.tsx +++ b/packages/web/src/app/components/searchBar/searchBar.tsx @@ -42,6 +42,7 @@ import { useSuggestionModeAndQuery } from "./useSuggestionModeAndQuery"; import { Separator } from "@/components/ui/separator"; import { Tooltip, TooltipTrigger, TooltipContent } from "@/components/ui/tooltip"; import { Toggle } from "@/components/ui/toggle"; +import { KeyboardShortcutHint } from "../keyboardShortcutHint"; interface SearchBarProps { className?: string; @@ -71,7 +72,7 @@ const searchBarKeymap: readonly KeyBinding[] = ([ ] as KeyBinding[]).concat(historyKeymap); const searchBarContainerVariants = cva( - "search-bar-container flex items-center py-0.5 px-1 border rounded-md relative", + "search-bar-container flex items-center justify-center py-0.5 px-2 border rounded-md relative", { variants: { size: { @@ -264,6 +265,7 @@ export const SearchBar = ({ indentWithTab={false} autoFocus={autoFocus ?? false} /> + -

+

{suggestionModeText}

{isLoadingSuggestions ? ( @@ -385,19 +386,29 @@ const SearchSuggestionsBox = forwardRef(({ )} ))} - {isFocused && ( - <> - -
- - Press Enter to select - + +
+
+

+ Syntax help: +

+
+ +
- - )} +
+ {isFocused && ( + + + + to select + + + )} +
) }); diff --git a/packages/web/src/app/components/syntaxReferenceGuide.tsx b/packages/web/src/app/components/syntaxReferenceGuide.tsx new file mode 100644 index 00000000..d2225799 --- /dev/null +++ b/packages/web/src/app/components/syntaxReferenceGuide.tsx @@ -0,0 +1,244 @@ +'use client'; + +import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog"; +import { Separator } from "@/components/ui/separator"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import clsx from "clsx"; +import Link from "next/link"; +import { useCallback, useRef, useState } from "react"; +import { useHotkeys } from "react-hotkeys-hook"; + +const LINGUIST_LINK = "https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml"; +const CTAGS_LINK = "https://ctags.io/"; + +export const SyntaxReferenceGuide = () => { + const [isOpen, setIsOpen] = useState(false); + const previousFocusedElement = useRef(null); + + const openDialog = useCallback(() => { + previousFocusedElement.current = document.activeElement as HTMLElement; + setIsOpen(true); + }, []); + + const closeDialog = useCallback(() => { + setIsOpen(false); + + // @note: Without requestAnimationFrame, focus was not being returned + // to codemirror elements for some reason. + requestAnimationFrame(() => { + previousFocusedElement.current?.focus(); + }); + }, []); + + const handleOpenChange = useCallback((isOpen: boolean) => { + if (isOpen) { + openDialog(); + } else { + closeDialog(); + } + }, [closeDialog, openDialog]); + + useHotkeys("mod+/", (event) => { + event.preventDefault(); + handleOpenChange(!isOpen); + }, { + enableOnFormTags: true, + enableOnContentEditable: true, + description: "Open Syntax Reference Guide", + }); + + return ( + + + + Syntax Reference Guide + + Queries consist of space-seperated regular expressions. Wrapping expressions in {`""`} combines them. By default, a file must have at least one match for each expression to be included. + + + + + + Example + Explanation + + + + + foo + Match files with regex /foo/ + + + foo bar + Match files with regex /foo/ and /bar/ + + + {`"foo bar"`} + Match files with regex /foo bar/ + + +
+ + +

+ {`Multiple expressions can be or'd together with `}or, negated with -, or grouped with (). +

+ + + + Example + Explanation + + + + + foo or bar + Match files with regex /foo/ or /bar/ + + + foo -bar + Match files with regex /foo/ but not /bar/ + + + foo (bar or baz) + Match files with regex /foo/ and either /bar/ or /baz/ + + +
+ + +

+ Expressions can be prefixed with certain keywords to modify search behavior. Some keywords can be negated using the - prefix. +

+ + + + + Prefix + Description + Example + + + + + file: + Filter results from filepaths that match the regex. By default all files are searched. + +
+ + file:README + + + file:{`"my file"`} + + + -file:test\.ts$ + +
+
+
+ + repo: + Filter results from repos that match the regex. By default all repos are searched. + +
+ + repo:linux + + + -repo:^web/.* + +
+
+
+ + rev: + Filter results from a specific branch or tag. By default only the default branch is searched. + +
+ + rev:beta + +
+
+
+ + lang: + Filter results by language (as defined by linguist). By default all languages are searched. + +
+ + lang:TypeScript + + + -lang:YAML + +
+
+
+ + sym: + Match symbol definitions created by universal ctags at index time. + +
+ + sym:\bmain\b + +
+
+
+
+
+
+
+ ) +} + +const Code = ({ children, className, title }: { children: React.ReactNode, className?: string, title?: string }) => { + return ( + + {children} + + ) +} + +const Highlight = ({ children }: { children: React.ReactNode }) => { + return ( + + {children} + + ) +} diff --git a/packages/web/src/app/layout.tsx b/packages/web/src/app/layout.tsx index 9a0f347a..0f370369 100644 --- a/packages/web/src/app/layout.tsx +++ b/packages/web/src/app/layout.tsx @@ -6,6 +6,7 @@ import { QueryClientProvider } from "./queryClientProvider"; import { PHProvider } from "./posthogProvider"; import { Toaster } from "@/components/ui/toaster"; import { TooltipProvider } from "@/components/ui/tooltip"; +import { SyntaxReferenceGuide } from "./components/syntaxReferenceGuide"; export const metadata: Metadata = { title: "Sourcebot", @@ -41,6 +42,7 @@ export default function RootLayout({ {children} + diff --git a/packages/web/src/app/page.tsx b/packages/web/src/app/page.tsx index 4e90d2ab..d432fdb3 100644 --- a/packages/web/src/app/page.tsx +++ b/packages/web/src/app/page.tsx @@ -11,7 +11,7 @@ import { Separator } from "@/components/ui/separator"; import { SymbolIcon } from "@radix-ui/react-icons"; import { UpgradeToast } from "./components/upgradeToast"; import Link from "next/link"; - +import { KeyboardShortcutHint } from "./components/keyboardShortcutHint"; export default async function Home() { return ( @@ -96,6 +96,9 @@ export default async function Home() { +
+ Reference guide: +
diff --git a/packages/web/src/app/search/components/filterPanel/index.tsx b/packages/web/src/app/search/components/filterPanel/index.tsx index 41da0cce..c3ce800b 100644 --- a/packages/web/src/app/search/components/filterPanel/index.tsx +++ b/packages/web/src/app/search/components/filterPanel/index.tsx @@ -33,7 +33,7 @@ export const FilterPanel = ({ const Icon = info ? ( {info.costHostName} ) : ( diff --git a/packages/web/src/components/ui/dialog.tsx b/packages/web/src/components/ui/dialog.tsx new file mode 100644 index 00000000..01ff19c7 --- /dev/null +++ b/packages/web/src/components/ui/dialog.tsx @@ -0,0 +1,122 @@ +"use client" + +import * as React from "react" +import * as DialogPrimitive from "@radix-ui/react-dialog" +import { X } from "lucide-react" + +import { cn } from "@/lib/utils" + +const Dialog = DialogPrimitive.Root + +const DialogTrigger = DialogPrimitive.Trigger + +const DialogPortal = DialogPrimitive.Portal + +const DialogClose = DialogPrimitive.Close + +const DialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName + +const DialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + + {children} + + + Close + + + +)) +DialogContent.displayName = DialogPrimitive.Content.displayName + +const DialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogHeader.displayName = "DialogHeader" + +const DialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +DialogFooter.displayName = "DialogFooter" + +const DialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogTitle.displayName = DialogPrimitive.Title.displayName + +const DialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +DialogDescription.displayName = DialogPrimitive.Description.displayName + +export { + Dialog, + DialogPortal, + DialogOverlay, + DialogClose, + DialogTrigger, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, +} diff --git a/packages/web/src/lib/utils.ts b/packages/web/src/lib/utils.ts index b63b784a..3f508bdb 100644 --- a/packages/web/src/lib/utils.ts +++ b/packages/web/src/lib/utils.ts @@ -34,7 +34,7 @@ export const createPathWithQueryParams = (path: string, ...queryParams: [string, type CodeHostInfo = { type: "github" | "gitlab" | "gitea" | "gerrit"; displayName: string; - costHostName: string; + codeHostName: string; repoLink: string; icon: string; iconClassName?: string; @@ -57,7 +57,7 @@ export const getRepoCodeHostInfo = (repo?: Repository): CodeHostInfo | undefined return { type: "github", displayName: displayName, - costHostName: "GitHub", + codeHostName: "GitHub", repoLink: repo.URL, icon: githubLogo, iconClassName: "dark:invert", @@ -66,7 +66,7 @@ export const getRepoCodeHostInfo = (repo?: Repository): CodeHostInfo | undefined return { type: "gitlab", displayName: displayName, - costHostName: "GitLab", + codeHostName: "GitLab", repoLink: repo.URL, icon: gitlabLogo, } @@ -74,7 +74,7 @@ export const getRepoCodeHostInfo = (repo?: Repository): CodeHostInfo | undefined return { type: "gitea", displayName: displayName, - costHostName: "Gitea", + codeHostName: "Gitea", repoLink: repo.URL, icon: giteaLogo, } @@ -82,7 +82,7 @@ export const getRepoCodeHostInfo = (repo?: Repository): CodeHostInfo | undefined return { type: "gerrit", displayName: displayName, - costHostName: "Gerrit", + codeHostName: "Gerrit", repoLink: repo.URL, icon: gerritLogo, } diff --git a/yarn.lock b/yarn.lock index ab5985b6..7716404c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1250,6 +1250,11 @@ resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.1.0.tgz#42ef83b3b56dccad5d703ae8c42919a68798bbe2" integrity sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA== +"@radix-ui/primitive@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.1.1.tgz#fc169732d755c7fbad33ba8d0cd7fd10c90dc8e3" + integrity sha512-SJ31y+Q/zAyShtXJc8x83i9TYdbAfHZ++tUZnvjJJqFjzsdUnKsxPL6IEtBlxKkU7yzer//GQtZSV4GbldL3YA== + "@radix-ui/react-arrow@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-1.1.0.tgz#744f388182d360b86285217e43b6c63633f39e7a" @@ -1272,6 +1277,11 @@ resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.0.tgz#656432461fc8283d7b591dcf0d79152fae9ecc74" integrity sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw== +"@radix-ui/react-compose-refs@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.1.tgz#6f766faa975f8738269ebb8a23bad4f5a8d2faec" + integrity sha512-Y9VzoRDSJtgFMUCoiZBDVo084VQ5hfpXxVE+NgkdNsjiDBByiImMZKKhxMwCbdHvhlENG6a833CbFkOQvTricw== + "@radix-ui/react-context@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.1.0.tgz#6df8d983546cfd1999c8512f3a8ad85a6e7fcee8" @@ -1282,6 +1292,26 @@ resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.1.1.tgz#82074aa83a472353bb22e86f11bcbd1c61c4c71a" integrity sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q== +"@radix-ui/react-dialog@^1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.1.4.tgz#d68e977acfcc0d044b9dab47b6dd2c179d2b3191" + integrity sha512-Ur7EV1IwQGCyaAuyDRiOLA5JIUZxELJljF+MbM/2NC0BYwfuRrbpS30BiQBJrVruscgUkieKkqXYDOoByaxIoA== + dependencies: + "@radix-ui/primitive" "1.1.1" + "@radix-ui/react-compose-refs" "1.1.1" + "@radix-ui/react-context" "1.1.1" + "@radix-ui/react-dismissable-layer" "1.1.3" + "@radix-ui/react-focus-guards" "1.1.1" + "@radix-ui/react-focus-scope" "1.1.1" + "@radix-ui/react-id" "1.1.0" + "@radix-ui/react-portal" "1.1.3" + "@radix-ui/react-presence" "1.1.2" + "@radix-ui/react-primitive" "2.0.1" + "@radix-ui/react-slot" "1.1.1" + "@radix-ui/react-use-controllable-state" "1.1.0" + aria-hidden "^1.1.1" + react-remove-scroll "^2.6.1" + "@radix-ui/react-direction@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-direction/-/react-direction-1.1.0.tgz#a7d39855f4d077adc2a1922f9c353c5977a09cdc" @@ -1298,6 +1328,17 @@ "@radix-ui/react-use-callback-ref" "1.1.0" "@radix-ui/react-use-escape-keydown" "1.1.0" +"@radix-ui/react-dismissable-layer@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.3.tgz#4ee0f0f82d53bf5bd9db21665799bb0d1bad5ed8" + integrity sha512-onrWn/72lQoEucDmJnr8uczSNTujT0vJnA/X5+3AkChVPowr8n1yvIKIabhWyMQeMvvmdpsvcyDqx3X1LEXCPg== + dependencies: + "@radix-ui/primitive" "1.1.1" + "@radix-ui/react-compose-refs" "1.1.1" + "@radix-ui/react-primitive" "2.0.1" + "@radix-ui/react-use-callback-ref" "1.1.0" + "@radix-ui/react-use-escape-keydown" "1.1.0" + "@radix-ui/react-dropdown-menu@^2.1.1": version "2.1.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.2.tgz#acc49577130e3c875ef0133bd1e271ea3392d924" @@ -1325,6 +1366,15 @@ "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-use-callback-ref" "1.1.0" +"@radix-ui/react-focus-scope@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.1.tgz#5c602115d1db1c4fcfa0fae4c3b09bb8919853cb" + integrity sha512-01omzJAYRxXdG2/he/+xy+c8a8gCydoQ1yOxnWNcRhrrBW5W+RQJ22EK1SaO8tb3WoUsuEw7mJjBozPzihDFjA== + dependencies: + "@radix-ui/react-compose-refs" "1.1.1" + "@radix-ui/react-primitive" "2.0.1" + "@radix-ui/react-use-callback-ref" "1.1.0" + "@radix-ui/react-icons@^1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-icons/-/react-icons-1.3.0.tgz#c61af8f323d87682c5ca76b856d60c2312dbcb69" @@ -1412,6 +1462,14 @@ "@radix-ui/react-primitive" "2.0.0" "@radix-ui/react-use-layout-effect" "1.1.0" +"@radix-ui/react-portal@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.1.3.tgz#b0ea5141103a1671b715481b13440763d2ac4440" + integrity sha512-NciRqhXnGojhT93RPyDaMPfLH3ZSl4jjIFbZQ1b/vxvZEdHsBZ49wP9w8L3HzUQwep01LcWtkUvm0OVB5JAHTw== + dependencies: + "@radix-ui/react-primitive" "2.0.1" + "@radix-ui/react-use-layout-effect" "1.1.0" + "@radix-ui/react-presence@1.1.1": version "1.1.1" resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.1.1.tgz#98aba423dba5e0c687a782c0669dcd99de17f9b1" @@ -1420,6 +1478,14 @@ "@radix-ui/react-compose-refs" "1.1.0" "@radix-ui/react-use-layout-effect" "1.1.0" +"@radix-ui/react-presence@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.1.2.tgz#bb764ed8a9118b7ec4512da5ece306ded8703cdc" + integrity sha512-18TFr80t5EVgL9x1SwF/YGtfG+l0BS0PRAlCWBDoBEiDQjeKgnNZRVJp/oVBl24sr3Gbfwc/Qpj4OcWTQMsAEg== + dependencies: + "@radix-ui/react-compose-refs" "1.1.1" + "@radix-ui/react-use-layout-effect" "1.1.0" + "@radix-ui/react-primitive@2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-2.0.0.tgz#fe05715faa9203a223ccc0be15dc44b9f9822884" @@ -1427,6 +1493,13 @@ dependencies: "@radix-ui/react-slot" "1.1.0" +"@radix-ui/react-primitive@2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-2.0.1.tgz#6d9efc550f7520135366f333d1e820cf225fad9e" + integrity sha512-sHCWTtxwNn3L3fH8qAfnF3WbUZycW93SM1j3NFDzXBiz8D6F5UTTy8G1+WFEaiCdvCVRJWj6N2R4Xq6HdiHmDg== + dependencies: + "@radix-ui/react-slot" "1.1.1" + "@radix-ui/react-roving-focus@1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.0.tgz#b30c59daf7e714c748805bfe11c76f96caaac35e" @@ -1471,6 +1544,13 @@ dependencies: "@radix-ui/react-compose-refs" "1.1.0" +"@radix-ui/react-slot@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.1.1.tgz#ab9a0ffae4027db7dc2af503c223c978706affc3" + integrity sha512-RApLLOcINYJA+dMVbOju7MYv1Mb2EBp2nH4HdDzXTSyaR5optlm6Otrz1euW3HbdOR8UmmFK06TD+A9frYWv+g== + dependencies: + "@radix-ui/react-compose-refs" "1.1.1" + "@radix-ui/react-toast@^1.2.2": version "1.2.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-toast/-/react-toast-1.2.2.tgz#fdd8ed0b80f47d6631dfd90278fee6debc06bf33" @@ -5078,6 +5158,14 @@ react-remove-scroll-bar@^2.3.6: react-style-singleton "^2.2.1" tslib "^2.0.0" +react-remove-scroll-bar@^2.3.7: + version "2.3.8" + resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz#99c20f908ee467b385b68a3469b4a3e750012223" + integrity sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q== + dependencies: + react-style-singleton "^2.2.2" + tslib "^2.0.0" + react-remove-scroll@2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.6.0.tgz#fb03a0845d7768a4f1519a99fdb84983b793dc07" @@ -5089,6 +5177,17 @@ react-remove-scroll@2.6.0: use-callback-ref "^1.3.0" use-sidecar "^1.1.2" +react-remove-scroll@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.6.2.tgz#2518d2c5112e71ea8928f1082a58459b5c7a2a97" + integrity sha512-KmONPx5fnlXYJQqC62Q+lwIeAk64ws/cUw6omIumRzMRPqgnYqhSSti99nbj0Ry13bv7dF+BKn7NB+OqkdZGTw== + dependencies: + react-remove-scroll-bar "^2.3.7" + react-style-singleton "^2.2.1" + tslib "^2.1.0" + use-callback-ref "^1.3.3" + use-sidecar "^1.1.2" + react-resizable-panels@^2.1.1: version "2.1.4" resolved "https://registry.yarnpkg.com/react-resizable-panels/-/react-resizable-panels-2.1.4.tgz#ae1803a916ba759e483336c7bd49830f1b0cd16f" @@ -5103,6 +5202,14 @@ react-style-singleton@^2.2.1: invariant "^2.2.4" tslib "^2.0.0" +react-style-singleton@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.3.tgz#4265608be69a4d70cfe3047f2c6c88b2c3ace388" + integrity sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ== + dependencies: + get-nonce "^1.0.0" + tslib "^2.0.0" + react@^18: version "18.3.1" resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" @@ -5536,16 +5643,7 @@ string-argv@^0.3.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -5642,14 +5740,7 @@ string_decoder@^1.1.1, string_decoder@^1.3.0: dependencies: safe-buffer "~5.2.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -6022,6 +6113,13 @@ use-callback-ref@^1.3.0: dependencies: tslib "^2.0.0" +use-callback-ref@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.3.tgz#98d9fab067075841c5b2c6852090d5d0feabe2bf" + integrity sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg== + dependencies: + tslib "^2.0.0" + use-sidecar@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.2.tgz#2f43126ba2d7d7e117aa5855e5d8f0276dfe73c2" From 1ce33256cf5188516d34ad20418a2724290e852a Mon Sep 17 00:00:00 2001 From: bkellam Date: Fri, 17 Jan 2025 15:23:43 -0800 Subject: [PATCH 05/32] release v2.8.0 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08538f55..5d9dac2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.8.0] - 2025-01-17 + ### Added - Added a syntax reference guide. The guide can be opened using the hotkey "Cmd + /" ("Ctrl + /" on Windows). ([#169](https://github.com/sourcebot-dev/sourcebot/pull/169)) From d20412301d3634c4f1def0e94bad4cbbe764af7d Mon Sep 17 00:00:00 2001 From: msukkari Date: Mon, 27 Jan 2025 11:22:03 -0800 Subject: [PATCH 06/32] change example repo filter query to use react instead of linux as example --- packages/web/src/app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/src/app/page.tsx b/packages/web/src/app/page.tsx index d432fdb3..85f63490 100644 --- a/packages/web/src/app/page.tsx +++ b/packages/web/src/app/page.tsx @@ -70,7 +70,7 @@ export default async function Home() { file:README setup (by filename) - repo:torvalds/linux test (by repo) + repo:facebook/react test (by repo) lang:typescript (by language) From 27dde3a9020073428379819bdd7ea806826850bf Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Tue, 28 Jan 2025 12:04:27 -0500 Subject: [PATCH 07/32] Fix version upgrade toast refresh issue (#179) --- CHANGELOG.md | 4 ++++ packages/web/src/app/api/(client)/client.ts | 15 +++++++++++++-- .../web/src/app/api/(server)/version/route.ts | 15 +++++++++++++++ .../web/src/app/components/upgradeToast.tsx | 17 ++++++++++++++--- packages/web/src/lib/environment.ts | 1 + packages/web/src/lib/schemas.ts | 4 ++++ packages/web/src/lib/types.ts | 4 +++- 7 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 packages/web/src/app/api/(server)/version/route.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d9dac2a..3a6442a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixed issue with version upgrade toast not appearing without a hard refresh. ([#179](https://github.com/sourcebot-dev/sourcebot/pull/179)) + ## [2.8.0] - 2025-01-17 ### Added diff --git a/packages/web/src/app/api/(client)/client.ts b/packages/web/src/app/api/(client)/client.ts index 889ecd42..a2a68583 100644 --- a/packages/web/src/app/api/(client)/client.ts +++ b/packages/web/src/app/api/(client)/client.ts @@ -1,8 +1,8 @@ 'use client'; import { NEXT_PUBLIC_DOMAIN_SUB_PATH } from "@/lib/environment.client"; -import { fileSourceResponseSchema, listRepositoriesResponseSchema, searchResponseSchema } from "@/lib/schemas"; -import { FileSourceRequest, FileSourceResponse, ListRepositoriesResponse, SearchRequest, SearchResponse } from "@/lib/types"; +import { fileSourceResponseSchema, getVersionResponseSchema, listRepositoriesResponseSchema, searchResponseSchema } from "@/lib/schemas"; +import { FileSourceRequest, FileSourceResponse, GetVersionResponse, ListRepositoriesResponse, SearchRequest, SearchResponse } from "@/lib/types"; import assert from "assert"; export const search = async (body: SearchRequest): Promise => { @@ -43,6 +43,17 @@ export const getRepos = async (): Promise => { return listRepositoriesResponseSchema.parse(result); } +export const getVersion = async (): Promise => { + const path = resolveServerPath("/api/version"); + const result = await fetch(path, { + method: "GET", + headers: { + "Content-Type": "application/json", + }, + }).then(response => response.json()); + return getVersionResponseSchema.parse(result); +} + /** * Given a subpath to a api route on the server (e.g., /api/search), * returns the full path to that route on the server, taking into account diff --git a/packages/web/src/app/api/(server)/version/route.ts b/packages/web/src/app/api/(server)/version/route.ts new file mode 100644 index 00000000..309ffa19 --- /dev/null +++ b/packages/web/src/app/api/(server)/version/route.ts @@ -0,0 +1,15 @@ +import { SOURCEBOT_VERSION } from "@/lib/environment"; +import { GetVersionResponse } from "@/lib/types"; + +// Note: In Next.JS 14, GET methods with no params are cached by default at build time. +// This creates issues since environment variables (like SOURCEBOT_VERSION) are +// not available until runtime. To work around this, we fore the route to be +// dynamic and evaluate on each request. +// @see: https://nextjs.org/docs/14/app/building-your-application/routing/route-handlers#caching +export const dynamic = "force-dynamic"; + +export const GET = async () => { + return Response.json({ + version: SOURCEBOT_VERSION, + } satisfies GetVersionResponse); +} \ No newline at end of file diff --git a/packages/web/src/app/components/upgradeToast.tsx b/packages/web/src/app/components/upgradeToast.tsx index 73342266..d5b2da60 100644 --- a/packages/web/src/app/components/upgradeToast.tsx +++ b/packages/web/src/app/components/upgradeToast.tsx @@ -2,9 +2,10 @@ import { useToast } from "@/components/hooks/use-toast"; import { ToastAction } from "@/components/ui/toast"; -import { NEXT_PUBLIC_SOURCEBOT_VERSION } from "@/lib/environment.client"; import { useEffect } from "react"; import { useLocalStorage } from "usehooks-ts"; +import { getVersion } from "../api/(client)/client"; +import { useQuery } from "@tanstack/react-query"; const GITHUB_TAGS_URL = "https://api.github.com/repos/sourcebot-dev/sourcebot/tags"; const SEMVER_REGEX = /^v(\d+)\.(\d+)\.(\d+)$/; @@ -23,8 +24,18 @@ export const UpgradeToast = () => { new Date(0).toUTCString() ); + const { data: versionString } = useQuery({ + queryKey: ["version"], + queryFn: () => getVersion(), + select: (data) => data.version, + }) + useEffect(() => { - const currentVersion = getVersionFromString(NEXT_PUBLIC_SOURCEBOT_VERSION); + if (!versionString) { + return; + } + + const currentVersion = getVersionFromString(versionString); if (!currentVersion) { return; } @@ -71,7 +82,7 @@ export const UpgradeToast = () => { setUpgradeToastLastShownDate(new Date().toUTCString()); }); - }, [setUpgradeToastLastShownDate, toast, upgradeToastLastShownDate]); + }, [setUpgradeToastLastShownDate, toast, upgradeToastLastShownDate, versionString]); return null; } diff --git a/packages/web/src/lib/environment.ts b/packages/web/src/lib/environment.ts index 0102da6d..7f23b0a5 100644 --- a/packages/web/src/lib/environment.ts +++ b/packages/web/src/lib/environment.ts @@ -5,4 +5,5 @@ import { getEnv, getEnvNumber } from "./utils"; export const ZOEKT_WEBSERVER_URL = getEnv(process.env.ZOEKT_WEBSERVER_URL, "http://localhost:6070")!; export const SHARD_MAX_MATCH_COUNT = getEnvNumber(process.env.SHARD_MAX_MATCH_COUNT, 10000); export const TOTAL_MAX_MATCH_COUNT = getEnvNumber(process.env.TOTAL_MAX_MATCH_COUNT, 100000); +export const SOURCEBOT_VERSION = getEnv(process.env.SOURCEBOT_VERSION, 'unknown')!; export const NODE_ENV = process.env.NODE_ENV; diff --git a/packages/web/src/lib/schemas.ts b/packages/web/src/lib/schemas.ts index 25526f6b..4bf82ad2 100644 --- a/packages/web/src/lib/schemas.ts +++ b/packages/web/src/lib/schemas.ts @@ -153,3 +153,7 @@ export const listRepositoriesResponseSchema = z.object({ Stats: repoStatsSchema, }) }); + +export const getVersionResponseSchema = z.object({ + version: z.string(), +}); diff --git a/packages/web/src/lib/types.ts b/packages/web/src/lib/types.ts index c1d8bccd..bc79426d 100644 --- a/packages/web/src/lib/types.ts +++ b/packages/web/src/lib/types.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { fileSourceRequestSchema, fileSourceResponseSchema, listRepositoriesResponseSchema, locationSchema, rangeSchema, repositorySchema, searchRequestSchema, searchResponseSchema, symbolSchema } from "./schemas"; +import { fileSourceRequestSchema, fileSourceResponseSchema, getVersionResponseSchema, listRepositoriesResponseSchema, locationSchema, rangeSchema, repositorySchema, searchRequestSchema, searchResponseSchema, symbolSchema } from "./schemas"; export type KeymapType = "default" | "vim"; @@ -20,6 +20,8 @@ export type Repository = z.infer; export type Symbol = z.infer; +export type GetVersionResponse = z.infer; + export enum SearchQueryParams { query = "query", maxMatchDisplayCount = "maxMatchDisplayCount", From d1ef80d39fae453472bb9fcbdadb069eca9ffb92 Mon Sep 17 00:00:00 2001 From: bkellam Date: Tue, 28 Jan 2025 12:29:07 -0500 Subject: [PATCH 08/32] try out new arm64 hosted runner --- .github/workflows/ghcr-publish.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ghcr-publish.yml b/.github/workflows/ghcr-publish.yml index 0863a349..ef805a8a 100644 --- a/.github/workflows/ghcr-publish.yml +++ b/.github/workflows/ghcr-publish.yml @@ -14,7 +14,7 @@ env: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.runs-on}} permissions: contents: read packages: write @@ -23,9 +23,14 @@ jobs: id-token: write strategy: matrix: - platform: - - linux/amd64 - - linux/arm64 + platform: [linux/amd64, linux/arm64] + include: + - platform: linux/amd64 + runs-on: ubuntu-latest + - platform: linux/arm64 + runs-on: ubuntu-24.04-arm + + steps: - name: Prepare From f83a4db3d6d46db8f9fc1e6991d0b33bc49a91b0 Mon Sep 17 00:00:00 2001 From: msukkari Date: Tue, 28 Jan 2025 14:44:47 -0800 Subject: [PATCH 09/32] add maxTrigramCount setting --- packages/backend/src/constants.ts | 1 + packages/backend/src/main.ts | 1 + packages/backend/src/schemas/v2.ts | 4 ++++ packages/backend/src/types.ts | 6 +++++- packages/backend/src/zoekt.ts | 2 +- schemas/v2/index.json | 6 ++++++ 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/constants.ts b/packages/backend/src/constants.ts index 94b8c764..a9412a76 100644 --- a/packages/backend/src/constants.ts +++ b/packages/backend/src/constants.ts @@ -5,6 +5,7 @@ import { Settings } from "./types.js"; */ export const DEFAULT_SETTINGS: Settings = { maxFileSize: 2 * 1024 * 1024, // 2MB in bytes + maxTrigramCount: 20000, autoDeleteStaleRepos: true, reindexInterval: 1000 * 60 * 60, // 1 hour in milliseconds resyncInterval: 1000 * 60 * 60 * 24, // 1 day in milliseconds diff --git a/packages/backend/src/main.ts b/packages/backend/src/main.ts index 5de504cf..21076965 100644 --- a/packages/backend/src/main.ts +++ b/packages/backend/src/main.ts @@ -209,6 +209,7 @@ const syncConfig = async (configPath: string, db: Database, signal: AbortSignal, // Update the settings const updatedSettings: Settings = { maxFileSize: config.settings?.maxFileSize ?? DEFAULT_SETTINGS.maxFileSize, + maxTrigramCount: config.settings?.maxTrigramCount ?? DEFAULT_SETTINGS.maxTrigramCount, autoDeleteStaleRepos: config.settings?.autoDeleteStaleRepos ?? DEFAULT_SETTINGS.autoDeleteStaleRepos, reindexInterval: config.settings?.reindexInterval ?? DEFAULT_SETTINGS.reindexInterval, resyncInterval: config.settings?.resyncInterval ?? DEFAULT_SETTINGS.resyncInterval, diff --git a/packages/backend/src/schemas/v2.ts b/packages/backend/src/schemas/v2.ts index 0c45d6f3..5114aa6d 100644 --- a/packages/backend/src/schemas/v2.ts +++ b/packages/backend/src/schemas/v2.ts @@ -21,6 +21,10 @@ export interface Settings { * The maximum size of a file (in bytes) to be indexed. Files that exceed this maximum will not be inexed. Defaults to 2MB (2097152 bytes). */ maxFileSize?: number; + /** + * The maximum amount of trigrams per document. Documents that exceed this maximum will not be indexed. Defaults to 20000 + */ + maxTrigramCount?: number; /** * Automatically delete stale repositories from the index. Defaults to true. */ diff --git a/packages/backend/src/types.ts b/packages/backend/src/types.ts index 2b0eca3a..2888fc2a 100644 --- a/packages/backend/src/types.ts +++ b/packages/backend/src/types.ts @@ -46,9 +46,13 @@ export type AppContext = { export type Settings = { /** - * The maximum size of a file (in bytes) to be indexed. Files that exceed this maximum will not be inexed. + * The maximum size of a file (in bytes) to be indexed. Files that exceed this maximum will not be indexed. */ maxFileSize: number; + /** + * The maximum number of trigrams per document. Files that exceed this maximum will not be indexed. + */ + maxTrigramCount: number; /** * Automatically delete stale repositories from the index. Defaults to true. */ diff --git a/packages/backend/src/zoekt.ts b/packages/backend/src/zoekt.ts index ffeadf7e..eab5fea6 100644 --- a/packages/backend/src/zoekt.ts +++ b/packages/backend/src/zoekt.ts @@ -10,7 +10,7 @@ export const indexGitRepository = async (repo: GitRepository, settings: Settings ...repo.tags ?? [], ]; - const command = `zoekt-git-index -allow_missing_branches -index ${ctx.indexPath} -file_limit ${settings.maxFileSize} -branches ${revisions.join(',')} ${repo.path}`; + const command = `zoekt-git-index -allow_missing_branches -index ${ctx.indexPath} -max_trigram_count ${settings.maxTrigramCount} -file_limit ${settings.maxFileSize} -branches ${revisions.join(',')} ${repo.path}`; return new Promise<{ stdout: string, stderr: string }>((resolve, reject) => { exec(command, (error, stdout, stderr) => { diff --git a/schemas/v2/index.json b/schemas/v2/index.json index ee70c0c2..fc04e9d8 100644 --- a/schemas/v2/index.json +++ b/schemas/v2/index.json @@ -570,6 +570,12 @@ "default": 2097152, "minimum": 1 }, + "maxTrigramCount": { + "type": "integer", + "description": "The maximum amount of trigrams per document. Documents that exceed this maximum will not be indexed. Defaults to 20000", + "default": 20000, + "minimum": 1 + }, "autoDeleteStaleRepos": { "type": "boolean", "description": "Automatically delete stale repositories from the index. Defaults to true.", From 26ac654a007f16623ec37edab175b12276c08743 Mon Sep 17 00:00:00 2001 From: msukkari Date: Tue, 28 Jan 2025 14:47:46 -0800 Subject: [PATCH 10/32] release v2.8.1 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a6442a0..4b7cca96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.8.1] - 2025-01-28 + +### Added + +- Added `maxTrigramCount` to the config to control the maximum allowable of trigrams per document. + ### Fixed - Fixed issue with version upgrade toast not appearing without a hard refresh. ([#179](https://github.com/sourcebot-dev/sourcebot/pull/179)) From 553fcb2a30389c1b338e2dfa53c5596d43450f8d Mon Sep 17 00:00:00 2001 From: msukkari Date: Thu, 30 Jan 2025 16:10:25 -0800 Subject: [PATCH 11/32] add staging github actions --- .github/workflows/fly-deploy-staging.yml | 27 +++++ .github/workflows/staging-ghcr-public.yml | 134 ++++++++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 .github/workflows/fly-deploy-staging.yml create mode 100644 .github/workflows/staging-ghcr-public.yml diff --git a/.github/workflows/fly-deploy-staging.yml b/.github/workflows/fly-deploy-staging.yml new file mode 100644 index 00000000..0c1ab174 --- /dev/null +++ b/.github/workflows/fly-deploy-staging.yml @@ -0,0 +1,27 @@ + +name: Fly Deploy (staging) + +on: + workflow_run: + workflows: ["Publish to ghcr (staging)"] + types: + - completed + +jobs: + deploy: + name: Deploy staging app + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Use flyctl + uses: superfly/flyctl-actions/setup-flyctl@master + + - name: Deploy to fly.io + run: flyctl deploy --local-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} + working-directory: ./staging \ No newline at end of file diff --git a/.github/workflows/staging-ghcr-public.yml b/.github/workflows/staging-ghcr-public.yml new file mode 100644 index 00000000..9e71eefe --- /dev/null +++ b/.github/workflows/staging-ghcr-public.yml @@ -0,0 +1,134 @@ + +name: Publish to ghcr (staging) + +on: + push: + branches: ["v3"] + +env: + REGISTRY_IMAGE: ghcr.io/sourcebot-dev/sourcebot + +jobs: + build: + runs-on: ${{ matrix.runs-on}} + permissions: + contents: read + packages: write + id-token: write + strategy: + matrix: + platform: [linux/amd64, linux/arm64] + include: + - platform: linux/amd64 + runs-on: ubuntu-latest + - platform: linux/arm64 + runs-on: ubuntu-24.04-arm + + steps: + - name: Prepare + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: "true" + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + tags: staging + + - name: Install cosign + uses: sigstore/cosign-installer@v3.5.0 + with: + cosign-release: "v2.2.4" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Packages Docker Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Docker image + id: build + uses: docker/build-push-action@v6 + with: + context: . + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + platforms: ${{ matrix.platform }} + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + build-args: | + SOURCEBOT_VERSION=${{ github.ref_name }} + POSTHOG_PAPIK=${{ secrets.POSTHOG_PAPIK }} + SOURCEBOT_ENCRYPTION_KEY=${{ secrets.STAGING_SOURCEBOT_ENCRYPTION_KEY }} + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ env.PLATFORM_PAIR }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + - name: Sign the published Docker image + env: + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build.outputs.digest }} + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} + + merge: + runs-on: ubuntu-latest + permissions: + packages: write + needs: + - build + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + path: /tmp/digests + pattern: digests-* + merge-multiple: true + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} + tags: staging + + - name: Login to GitHub Packages Docker Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + + - name: Inspect image + run: | + docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} \ No newline at end of file From feb466af2b249b45925a2d2320a5469fb47edaf9 Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 31 Jan 2025 11:02:31 -0800 Subject: [PATCH 12/32] fix staging fly deploy config --- .github/workflows/fly-deploy-staging.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fly-deploy-staging.yml b/.github/workflows/fly-deploy-staging.yml index 0c1ab174..08e18b4a 100644 --- a/.github/workflows/fly-deploy-staging.yml +++ b/.github/workflows/fly-deploy-staging.yml @@ -16,12 +16,14 @@ jobs: uses: actions/checkout@v4 with: submodules: 'true' + ref: v3 - name: Use flyctl uses: superfly/flyctl-actions/setup-flyctl@master - name: Deploy to fly.io - run: flyctl deploy --local-only + run: | + cd $GITHUB_WORKSPACE/staging + flyctl deploy --local-only env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} - working-directory: ./staging \ No newline at end of file + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} \ No newline at end of file From ea4e92d704f75c655c523c5be980dc7e43dc5653 Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 31 Jan 2025 11:31:18 -0800 Subject: [PATCH 13/32] reference staging deploy token in deploy workflow config --- .github/workflows/fly-deploy-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/fly-deploy-staging.yml b/.github/workflows/fly-deploy-staging.yml index 08e18b4a..9e68700a 100644 --- a/.github/workflows/fly-deploy-staging.yml +++ b/.github/workflows/fly-deploy-staging.yml @@ -26,4 +26,4 @@ jobs: cd $GITHUB_WORKSPACE/staging flyctl deploy --local-only env: - FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} \ No newline at end of file + FLY_API_TOKEN: ${{ secrets.FLY_STAGING_DEPLOY_TOKEN }} \ No newline at end of file From 65b61155bfeca57bb15fe0a9f67855fdf8141adf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:50:24 -0800 Subject: [PATCH 14/32] Bump vitest from 2.1.4 to 2.1.9 (#186) Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 2.1.4 to 2.1.9. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v2.1.9/packages/vitest) --- updated-dependencies: - dependency-name: vitest dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/backend/package.json | 2 +- yarn.lock | 217 +++++++++++----------------------- 2 files changed, 70 insertions(+), 149 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index 2514cd85..5cead1aa 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -19,7 +19,7 @@ "tsc-watch": "^6.2.0", "tsx": "^4.19.1", "typescript": "^5.6.2", - "vitest": "^2.1.4" + "vitest": "^2.1.9" }, "dependencies": { "@gitbeaker/rest": "^40.5.1", diff --git a/yarn.lock b/yarn.lock index 7716404c..c50f8caf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2086,121 +2086,62 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@vitest/expect@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-2.1.4.tgz#48f4f53a01092a3bdc118cff245f79ef388bdd8e" - integrity sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA== +"@vitest/expect@2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-2.1.9.tgz#b566ea20d58ea6578d8dc37040d6c1a47ebe5ff8" + integrity sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw== dependencies: - "@vitest/spy" "2.1.4" - "@vitest/utils" "2.1.4" + "@vitest/spy" "2.1.9" + "@vitest/utils" "2.1.9" chai "^5.1.2" tinyrainbow "^1.2.0" -"@vitest/expect@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-2.1.5.tgz#5a6afa6314cae7a61847927bb5bc038212ca7381" - integrity sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q== +"@vitest/mocker@2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-2.1.9.tgz#36243b27351ca8f4d0bbc4ef91594ffd2dc25ef5" + integrity sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg== dependencies: - "@vitest/spy" "2.1.5" - "@vitest/utils" "2.1.5" - chai "^5.1.2" - tinyrainbow "^1.2.0" - -"@vitest/mocker@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-2.1.4.tgz#0dc07edb9114f7f080a0181fbcdb16cd4a2d855d" - integrity sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ== - dependencies: - "@vitest/spy" "2.1.4" + "@vitest/spy" "2.1.9" estree-walker "^3.0.3" magic-string "^0.30.12" -"@vitest/mocker@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-2.1.5.tgz#54ee50648bc0bb606dfc58e13edfacb8b9208324" - integrity sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ== - dependencies: - "@vitest/spy" "2.1.5" - estree-walker "^3.0.3" - magic-string "^0.30.12" - -"@vitest/pretty-format@2.1.4", "@vitest/pretty-format@^2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-2.1.4.tgz#fc31993bdc1ef5a6c1a4aa6844e7ba55658a4f9f" - integrity sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww== +"@vitest/pretty-format@2.1.9", "@vitest/pretty-format@^2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-2.1.9.tgz#434ff2f7611689f9ce70cd7d567eceb883653fdf" + integrity sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ== dependencies: tinyrainbow "^1.2.0" -"@vitest/pretty-format@2.1.5", "@vitest/pretty-format@^2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-2.1.5.tgz#bc79b8826d4a63dc04f2a75d2944694039fa50aa" - integrity sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw== +"@vitest/runner@2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-2.1.9.tgz#cc18148d2d797fd1fd5908d1f1851d01459be2f6" + integrity sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g== dependencies: - tinyrainbow "^1.2.0" - -"@vitest/runner@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-2.1.4.tgz#f9346500bdd0be1c926daaac5d683bae87ceda2c" - integrity sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA== - dependencies: - "@vitest/utils" "2.1.4" + "@vitest/utils" "2.1.9" pathe "^1.1.2" -"@vitest/runner@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-2.1.5.tgz#4d5e2ba2dfc0af74e4b0f9f3f8be020559b26ea9" - integrity sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g== +"@vitest/snapshot@2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-2.1.9.tgz#24260b93f798afb102e2dcbd7e61c6dfa118df91" + integrity sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ== dependencies: - "@vitest/utils" "2.1.5" - pathe "^1.1.2" - -"@vitest/snapshot@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-2.1.4.tgz#ef8c3f605fbc23a32773256d37d3fdfd9b23d353" - integrity sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q== - dependencies: - "@vitest/pretty-format" "2.1.4" + "@vitest/pretty-format" "2.1.9" magic-string "^0.30.12" pathe "^1.1.2" -"@vitest/snapshot@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-2.1.5.tgz#a09a8712547452a84e08b3ec97b270d9cc156b4f" - integrity sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg== - dependencies: - "@vitest/pretty-format" "2.1.5" - magic-string "^0.30.12" - pathe "^1.1.2" - -"@vitest/spy@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-2.1.4.tgz#4e90f9783437c5841a27c80f8fd84d7289a6100a" - integrity sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg== +"@vitest/spy@2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-2.1.9.tgz#cb28538c5039d09818b8bfa8edb4043c94727c60" + integrity sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ== dependencies: tinyspy "^3.0.2" -"@vitest/spy@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-2.1.5.tgz#f790d1394a5030644217ce73562e92465e83147e" - integrity sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw== +"@vitest/utils@2.1.9": + version "2.1.9" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-2.1.9.tgz#4f2486de8a54acf7ecbf2c5c24ad7994a680a6c1" + integrity sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ== dependencies: - tinyspy "^3.0.2" - -"@vitest/utils@2.1.4": - version "2.1.4" - resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-2.1.4.tgz#6d67ac966647a21ce8bc497472ce230de3b64537" - integrity sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg== - dependencies: - "@vitest/pretty-format" "2.1.4" - loupe "^3.1.2" - tinyrainbow "^1.2.0" - -"@vitest/utils@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-2.1.5.tgz#0e19ce677c870830a1573d33ee86b0d6109e9546" - integrity sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg== - dependencies: - "@vitest/pretty-format" "2.1.5" + "@vitest/pretty-format" "2.1.9" loupe "^3.1.2" tinyrainbow "^1.2.0" @@ -5609,7 +5550,7 @@ stackback@0.0.2: resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b" integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== -std-env@^3.7.0, std-env@^3.8.0: +std-env@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.8.0.tgz#b56ffc1baf1a29dcc80a3bdf11d7fca7c315e7d5" integrity sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w== @@ -5643,7 +5584,16 @@ string-argv@^0.3.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6" integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -5740,7 +5690,14 @@ string_decoder@^1.1.1, string_decoder@^1.3.0: dependencies: safe-buffer "~5.2.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -6148,20 +6105,10 @@ validate-npm-package-license@^3.0.1: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -vite-node@2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-2.1.4.tgz#97ffb6de913fd8d42253afe441f9512e9dbdfd5c" - integrity sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg== - dependencies: - cac "^6.7.14" - debug "^4.3.7" - pathe "^1.1.2" - vite "^5.0.0" - -vite-node@2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-2.1.5.tgz#cf28c637b2ebe65921f3118a165b7cf00a1cdf19" - integrity sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w== +vite-node@2.1.9: + version "2.1.9" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-2.1.9.tgz#549710f76a643f1c39ef34bdb5493a944e4f895f" + integrity sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA== dependencies: cac "^6.7.14" debug "^4.3.7" @@ -6189,44 +6136,18 @@ vite@^5.0.0: optionalDependencies: fsevents "~2.3.3" -vitest@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.1.4.tgz#ba8f4589fb639cf5a9e6af54781667312b3e8230" - integrity sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ== +vitest@^2.1.5, vitest@^2.1.9: + version "2.1.9" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.1.9.tgz#7d01ffd07a553a51c87170b5e80fea3da7fb41e7" + integrity sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q== dependencies: - "@vitest/expect" "2.1.4" - "@vitest/mocker" "2.1.4" - "@vitest/pretty-format" "^2.1.4" - "@vitest/runner" "2.1.4" - "@vitest/snapshot" "2.1.4" - "@vitest/spy" "2.1.4" - "@vitest/utils" "2.1.4" - chai "^5.1.2" - debug "^4.3.7" - expect-type "^1.1.0" - magic-string "^0.30.12" - pathe "^1.1.2" - std-env "^3.7.0" - tinybench "^2.9.0" - tinyexec "^0.3.1" - tinypool "^1.0.1" - tinyrainbow "^1.2.0" - vite "^5.0.0" - vite-node "2.1.4" - why-is-node-running "^2.3.0" - -vitest@^2.1.5: - version "2.1.5" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.1.5.tgz#a93b7b84a84650130727baae441354e6df118148" - integrity sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A== - dependencies: - "@vitest/expect" "2.1.5" - "@vitest/mocker" "2.1.5" - "@vitest/pretty-format" "^2.1.5" - "@vitest/runner" "2.1.5" - "@vitest/snapshot" "2.1.5" - "@vitest/spy" "2.1.5" - "@vitest/utils" "2.1.5" + "@vitest/expect" "2.1.9" + "@vitest/mocker" "2.1.9" + "@vitest/pretty-format" "^2.1.9" + "@vitest/runner" "2.1.9" + "@vitest/snapshot" "2.1.9" + "@vitest/spy" "2.1.9" + "@vitest/utils" "2.1.9" chai "^5.1.2" debug "^4.3.7" expect-type "^1.1.0" @@ -6238,7 +6159,7 @@ vitest@^2.1.5: tinypool "^1.0.1" tinyrainbow "^1.2.0" vite "^5.0.0" - vite-node "2.1.5" + vite-node "2.1.9" why-is-node-running "^2.3.0" vscode-languageserver-types@^3.17.1: From d993b0eb54ecd2c66e7e868a9bbcb5b6744a37d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 13:55:35 -0800 Subject: [PATCH 15/32] Bump vite from 5.4.11 to 5.4.14 (#187) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 5.4.14. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.4.14/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.4.14/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brendan Kellam --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c50f8caf..8c2e7fcb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6126,9 +6126,9 @@ vite-tsconfig-paths@^5.1.3: tsconfck "^3.0.3" vite@^5.0.0: - version "5.4.11" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.11.tgz#3b415cd4aed781a356c1de5a9ebafb837715f6e5" - integrity sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q== + version "5.4.14" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.14.tgz#ff8255edb02134df180dcfca1916c37a6abe8408" + integrity sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA== dependencies: esbuild "^0.21.3" postcss "^8.4.43" From 39e761f3922f8e5506f22ee8f46f6d9e22cf89b3 Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 14 Feb 2025 11:26:40 -0800 Subject: [PATCH 16/32] clean up demo site repos --- demo-site-config.json | 730 +----------------------------------------- vendor/zoekt | 2 +- 2 files changed, 2 insertions(+), 730 deletions(-) diff --git a/demo-site-config.json b/demo-site-config.json index 70019544..8adbb703 100644 --- a/demo-site-config.json +++ b/demo-site-config.json @@ -17,7 +17,6 @@ } }, "repos": [ - "torvalds/linux", "pytorch/pytorch", "commaai/openpilot", "ggerganov/whisper.cpp", @@ -25,329 +24,23 @@ "codemirror/dev", "tailwindlabs/tailwindcss", "sourcebot-dev/sourcebot", - "freeCodeCamp/freeCodeCamp", - "EbookFoundation/free-programming-books", - "sindresorhus/awesome", - "public-apis/public-apis", - "codecrafters-io/build-your-own-x", - "jwasham/coding-interview-university", - "kamranahmedse/developer-roadmap", - "donnemartin/system-design-primer", - "996icu/996.ICU", - "facebook/react", - "vinta/awesome-python", - "vuejs/vue", - "practical-tutorials/project-based-learning", - "awesome-selfhosted/awesome-selfhosted", - "TheAlgorithms/Python", - "trekhleb/javascript-algorithms", - "tensorflow/tensorflow", - "torvalds/linux", - "getify/You-Dont-Know-JS", - "CyC2018/CS-Notes", - "ohmyzsh/ohmyzsh", - "ossu/computer-science", - "twbs/bootstrap", - "Significant-Gravitas/AutoGPT", - "flutter/flutter", - "microsoft/vscode", - "github/gitignore", - "jackfrued/Python-100-Days", - "jlevy/the-art-of-command-line", - "trimstray/the-book-of-secret-knowledge", - "Snailclimb/JavaGuide", - "airbnb/javascript", - "AUTOMATIC1111/stable-diffusion-webui", - "huggingface/transformers", - "avelino/awesome-go", - "ytdl-org/youtube-dl", - "vercel/next.js", - "labuladong/fucking-algorithm", - "golang/go", - "Chalarangelo/30-seconds-of-code", - "yangshun/tech-interview-handbook", - "facebook/react-native", - "electron/electron", - "Genymobile/scrcpy", - "f/awesome-chatgpt-prompts", - "microsoft/PowerToys", - "justjavac/free-programming-books-zh_CN", - "kubernetes/kubernetes", - "d3/d3", - "nodejs/node", - "massgravel/Microsoft-Activation-Scripts", - "axios/axios", - "mrdoob/three.js", - "krahets/hello-algo", - "facebook/create-react-app", - "ollama/ollama", - "microsoft/TypeScript", - "goldbergyoni/nodebestpractices", - "rust-lang/rust", - "denoland/deno", "angular/angular", - "langchain-ai/langchain", - "microsoft/terminal", - "521xueweihan/HelloGitHub", - "mui/material-ui", - "ant-design/ant-design", - "yt-dlp/yt-dlp", - "ryanmcdermott/clean-code-javascript", - "godotengine/godot", - "ripienaar/free-for-dev", - "iluwatar/java-design-patterns", - "puppeteer/puppeteer", - "papers-we-love/papers-we-love", - "PanJiaChen/vue-element-admin", - "iptv-org/iptv", - "fatedier/frp", - "excalidraw/excalidraw", - "tauri-apps/tauri", - "Hack-with-Github/Awesome-Hacking", - "nvbn/thefuck", - "mtdvio/every-programmer-should-know", - "pytorch/pytorch", - "storybookjs/storybook", - "neovim/neovim", - "tailwindlabs/tailwindcss", - "microsoft/Web-Dev-For-Beginners", - "django/django", - "florinpop17/app-ideas", - "animate-css/animate.css", - "nvm-sh/nvm", - "gothinkster/realworld", - "bitcoin/bitcoin", - "sveltejs/svelte", - "opencv/opencv", - "gin-gonic/gin", - "laravel/laravel", - "fastapi/fastapi", - "macrozheng/mall", - "jaywcjlove/awesome-mac", - "tonsky/FiraCode", - "ChatGPTNextWeb/ChatGPT-Next-Web", - "rustdesk/rustdesk", - "tensorflow/models", - "doocs/advanced-java", - "shadcn-ui/ui", - "gohugoio/hugo", - "MisterBooo/LeetCodeAnimation", - "spring-projects/spring-boot", - "supabase/supabase", - "oven-sh/bun", - "FortAwesome/Font-Awesome", - "home-assistant/core", - "typicode/json-server", - "mermaid-js/mermaid", - "openai/whisper", - "netdata/netdata", - "vuejs/awesome-vue", - "DopplerHQ/awesome-interview-questions", - "3b1b/manim", - "2dust/v2rayN", - "nomic-ai/gpt4all", - "elastic/elasticsearch", - "anuraghazra/github-readme-stats", - "microsoft/ML-For-Beginners", - "MunGell/awesome-for-beginners", - "fighting41love/funNLP", - "vitejs/vite", - "thedaviddias/Front-End-Checklist", "ggerganov/llama.cpp", - "coder/code-server", - "moby/moby", - "CompVis/stable-diffusion", - "base-org/node", - "nestjs/nest", - "pallets/flask", - "hakimel/reveal.js", - "Anduin2017/HowToCook", - "microsoft/playwright", - "swiftlang/swift", - "Developer-Y/cs-video-courses", - "redis/redis", - "bregman-arie/devops-exercises", - "josephmisiti/awesome-machine-learning", - "binary-husky/gpt_academic", - "junegunn/fzf", - "syncthing/syncthing", - "hoppscotch/hoppscotch", - "protocolbuffers/protobuf", - "enaqx/awesome-react", - "expressjs/express", - "microsoft/generative-ai-for-beginners", - "grafana/grafana", - "abi/screenshot-to-code", - "ByteByteGoHq/system-design-101", - "chartjs/Chart.js", - "webpack/webpack", - "d2l-ai/d2l-zh", - "sdmg15/Best-websites-a-programmer-should-visit", - "strapi/strapi", - "python/cpython", - "leonardomso/33-js-concepts", - "kdn251/interviews", - "ventoy/Ventoy", - "ansible/ansible", - "apache/superset", - "tesseract-ocr/tesseract", - "lydiahallie/javascript-questions", - "xtekky/gpt4free", - "FuelLabs/sway", - "twitter/the-algorithm", - "keras-team/keras", - "resume/resume.github.com", - "swisskyrepo/PayloadsAllTheThings", - "ocornut/imgui", - "socketio/socket.io", - "awesomedata/awesome-public-datasets", - "louislam/uptime-kuma", - "kelseyhightower/nocode", - "sherlock-project/sherlock", - "reduxjs/redux", - "apache/echarts", - "obsproject/obs-studio", - "openai/openai-cookbook", - "fffaraz/awesome-cpp", - "scikit-learn/scikit-learn", - "TheAlgorithms/Java", - "atom/atom", "Eugeny/tabby", "lodash/lodash", - "chrislgarry/Apollo-11", - "xingshaocheng/architect-awesome", - "comfyanonymous/ComfyUI", - "h5bp/Front-end-Developer-Interview-Questions", - "adam-p/markdown-here", - "binhnguyennus/awesome-scalability", - "jquery/jquery", - "bradtraversy/design-resources-for-developers", - "danielmiessler/SecLists", "caddyserver/caddy", "sindresorhus/awesome-nodejs", "rust-unofficial/awesome-rust", - "mastodon/mastodon", - "Stirling-Tools/Stirling-PDF", - "iamkun/dayjs", - "romkatv/powerlevel10k", - "algorithm-visualizer/algorithm-visualizer", - "charlax/professional-programming", - "poteto/hiring-without-whiteboards", - "FFmpeg/FFmpeg", - "laurent22/joplin", - "serverless/serverless", - "justjavac/awesome-wechat-weapp", - "minimaxir/big-list-of-naughty-strings", - "agalwood/Motrix", - "JuliaLang/julia", - "square/okhttp", - "firstcontributions/first-contributions", - "geekan/MetaGPT", - "appwrite/appwrite", - "starship/starship", - "PowerShell/PowerShell", - "Avik-Jain/100-Days-Of-ML-Code", - "ziishaned/learn-regex", - "typescript-cheatsheets/react", - "go-gitea/gitea", - "kamranahmedse/design-patterns-for-humans", - "v2ray/v2ray-core", - "karan/Projects", - "WerWolv/ImHex", - "gogs/gogs", - "x64dbg/x64dbg", - "PaddlePaddle/PaddleOCR", - "AlistGo/alist", - "android/architecture-samples", - "meteor/meteor", - "jestjs/jest", - "ColorlibHQ/AdminLTE", - "pixijs/pixijs", - "slab/quill", - "FuelLabs/fuels-ts", - "FuelLabs/fuels-rs", - "pandas-dev/pandas", - "huginn/huginn", - "type-challenges/type-challenges", - "nlohmann/json", - "parcel-bundler/parcel", - "Asabeneh/30-Days-Of-JavaScript", - "vercel/hyper", - "aymericdamien/TensorFlow-Examples", - "jakevdp/PythonDataScienceHandbook", - "astaxie/build-web-application-with-golang", - "babel/babel", - "Asabeneh/30-Days-Of-Python", - "toeverything/AFFiNE", - "google/zx", - "hashicorp/terraform", - "square/retrofit", - "dkhamsing/open-source-ios-apps", - "isocpp/CppCoreGuidelines", - "brillout/awesome-react-components", - "TanStack/query", - "dypsilon/frontend-dev-bookmarks", - "discourse/discourse", - "akullpp/awesome-java", - "skylot/jadx", - "grpc/grpc", "streamich/react-use", "pocketbase/pocketbase", "serhii-londar/open-source-mac-os-apps", "lllyasviel/Fooocus", "k88hudson/git-flight-rules", "react-hook-form/react-hook-form", - "yangshun/front-end-interview-handbook", - "clash-verge-rev/clash-verge-rev", - "Homebrew/brew", - "Unitech/pm2", - "Leaflet/Leaflet", - "hacksider/Deep-Live-Cam", - "kelseyhightower/kubernetes-the-hard-way", - "yarnpkg/yarn", - "Alamofire/Alamofire", - "lyswhut/lx-music-desktop", - "oobabooga/text-generation-webui", - "bailicangdu/vue2-elm", - "jeecgboot/JeecgBoot", - "GitSquared/edex-ui", - "RocketChat/Rocket.Chat", - "dbeaver/dbeaver", - "THUDM/ChatGLM-6B", - "microsoft/monaco-editor", - "faif/python-patterns", - "LeCoupa/awesome-cheatsheets", - "styled-components/styled-components", - "apache/dubbo", - "DovAmir/awesome-design-patterns", - "nwjs/nw.js", - "alex/what-happens-when", - "sudheerj/reactjs-interview-questions", - "dcloudio/uni-app", - "apache/spark", - "dotnet/aspnetcore", - "novuhq/novu", - "naptha/tesseract.js", - "babysor/MockingBird", - "freeCodeCamp/devdocs", - "SimplifyJobs/Summer2025-Internships", - "zhongyang219/TrafficMonitor", - "denysdovhan/wtfjs", - "ziglang/zig", - "expo/expo", - "lukasz-madon/awesome-remote-job", - "geekxh/hello-algorithm", - "alvarotrigo/fullPage.js", - "coollabsio/coolify", - "shadowsocks/shadowsocks-android", "koajs/koa", "SheetJS/sheetjs", "trpc/trpc", "LC044/WeChatMsg", - "rasbt/LLMs-from-scratch", - "microsoft/AI-For-Beginners", - "Kong/insomnia", - "usememos/memos", "airbnb/lottie-android", "huihut/interview", "jgm/pandoc", @@ -358,39 +51,6 @@ "files-community/Files", "sahat/hackathon-starter", "appsmithorg/appsmith", - "formulahendry/955.WLB", - "lapce/lapce", - "jondot/awesome-react-native", - "bumptech/glide", - "carbon-app/carbon", - "unknwon/the-way-to-go_ZH_CN", - "chenfei-wu/TaskMatrix", - "typeorm/typeorm", - "gradio-app/gradio", - "google-research/google-research", - "colinhacks/zod", - "sharkdp/fd", - "saadeghi/daisyui", - "nodejs/node-v0.x-archive", - "ray-project/ray", - "rapid7/metasploit-framework", - "maybe-finance/maybe", - "OpenBB-finance/OpenBB", - "gofiber/fiber", - "junegunn/vim-plug", - "halo-dev/halo", - "DIYgod/RSSHub", - "goabstract/Awesome-Design-Tools", - "docker/compose", - "helix-editor/helix", - "penpot/penpot", - "httpie/cli", - "BVLC/caffe", - "hankcs/HanLP", - "AykutSarac/jsoncrack.com", - "zenorocha/clipboard.js", - "jaredpalmer/formik", - "testerSunshine/12306", "ultralytics/ultralytics", "slidevjs/slidev", "xitu/gold-miner", @@ -400,30 +60,11 @@ "shadowsocks/shadowsocks", "ccxt/ccxt", "netty/netty", - "PKUanonym/REKCARC-TSC-UHT", "tw93/Pake", "fxsjy/jieba", "atlassian/react-beautiful-dnd", "ToolJet/ToolJet", "markedjs/marked", - "Blankj/AndroidUtilCode", - "AFNetworking/AFNetworking", - "alebcay/awesome-shell", - "spacedriveapp/spacedrive", - "adobe/brackets", - "karanpratapsingh/system-design", - "xkcoding/spring-boot-demo", - "halfrost/LeetCode-Go", - "XX-net/XX-Net", - "gulpjs/gulp", - "immutable-js/immutable-js", - "nushell/nushell", - "calcom/cal.com", - "2noise/ChatTTS", - "zxing/zxing", - "alibaba/easyexcel", - "GitHubDaily/GitHubDaily", - "sqlmapproject/sqlmap", "typicode/husky", "laravel/framework", "TheAlgorithms/JavaScript", @@ -433,152 +74,6 @@ "huggingface/pytorch-image-models", "shadowsocks/ShadowsocksX-NG", "carbon-language/carbon-lang", - "chatchat-space/Langchain-Chatchat", - "jaywcjlove/linux-command", - "FlowiseAI/Flowise", - "harness/harness", - "fengdu78/Coursera-ML-AndrewNg-Notes", - "google/material-design-lite", - "freqtrade/freqtrade", - "bayandin/awesome-awesomeness", - "KRTirtho/spotube", - "geekcomputers/Python", - "Pythagora-io/gpt-pilot", - "reworkd/AgentGPT", - "python-poetry/poetry", - "TeamNewPipe/NewPipe", - "facebookresearch/faiss", - "astral-sh/uv", - "kilimchoi/engineering-blogs", - "zhayujie/chatgpt-on-wechat", - "vllm-project/vllm", - "The-Run-Philosophy-Organization/run", - "certbot/certbot", - "upscayl/upscayl", - "beego/beego", - "zsh-users/zsh-autosuggestions", - "Trinea/android-open-project", - "Chanzhaoyu/chatgpt-web", - "CMU-Perceptual-Computing-Lab/openpose", - "hashicorp/vault", - "ryanhanwu/How-To-Ask-Questions-The-Smart-Way", - "swc-project/swc", - "portainer/portainer", - "milvus-io/milvus", - "hasura/graphql-engine", - "ibraheemdev/modern-unix", - "makeplane/plane", - "ziadoz/awesome-php", - "qishibo/AnotherRedisDesktopManager", - "ehang-io/nps", - "yewstack/yew", - "SeleniumHQ/selenium", - "mattermost/mattermost", - "blueimp/jQuery-File-Upload", - "TheAlgorithms/C-Plus-Plus", - "lllyasviel/ControlNet", - "ReactiveX/rxjs", - "pola-rs/polars", - "SerenityOS/serenity", - "amix/vimrc", - "pcottle/learnGitBranching", - "microsoft/MS-DOS", - "dockur/windows", - "mqyqingfeng/Blog", - "facebookresearch/detectron2", - "jax-ml/jax", - "jqlang/jq", - "niklasvh/html2canvas", - "geekan/HowToLiveLonger", - "veggiemonk/awesome-docker", - "vercel/swr", - "airbnb/lottie-web", - "facebookresearch/fairseq", - "lizongying/my-tv", - "gedoor/legado", - "zbezj/HEU_KMS_Activator", - "alibaba/p3c", - "karpathy/LLM101n", - "alibaba/nacos", - "lib-pku/libpku", - "explosion/spaCy", - "mathiasbynens/dotfiles", - "yunjey/pytorch-tutorial", - "huiyadanli/RevokeMsgPatcher", - "ityouknow/spring-boot-examples", - "Binaryify/NeteaseCloudMusicApi", - "floating-ui/floating-ui", - "remix-run/remix", - "cockroachdb/cockroach", - "remoteintech/remote-jobs", - "binarywang/WxJava", - "0xAX/linux-insides", - "labstack/echo", - "balena-io/etcher", - "ianstormtaylor/slate", - "myshell-ai/OpenVoice", - "ShareX/ShareX", - "pnpm/pnpm", - "joshbuchea/HEAD", - "coolsnowwolf/lede", - "qier222/YesPlayMusic", - "microsoft/calculator", - "symfony/symfony", - "aseprite/aseprite", - "SortableJS/Sortable", - "v2fly/v2ray-core", - "open-mmlab/mmdetection", - "vuejs/vue-cli", - "webtorrent/webtorrent", - "layui/layui", - "payloadcms/payload", - "foundation/foundation-sites", - "tatsu-lab/stanford_alpaca", - "sequelize/sequelize", - "donnemartin/interactive-coding-challenges", - "kubernetes/minikube", - "llvm/llvm-project", - "pbatard/rufus", - "gchq/CyberChef", - "react-boilerplate/react-boilerplate", - "parallax/jsPDF", - "ariya/phantomjs", - "zeromicro/go-zero", - "square/leakcanary", - "dokku/dokku", - "lovell/sharp", - "elsewhencode/project-guidelines", - "aosabook/500lines", - "AMAI-GmbH/AI-Expert-Roadmap", - "dromara/hutool", - "fabricjs/fabric.js", - "transloadit/uppy", - "IanLunn/Hover", - "apolloconfig/apollo", - "lukehoban/es6features", - "VincentGarreau/particles.js", - "standard/standard", - "OAI/OpenAPI-Specification", - "influxdata/influxdb", - "CSSEGISandData/COVID-19", - "apache/kafka", - "trailofbits/algo", - "JushBJJ/Mr.-Ranedeer-AI-Tutor", - "codex-team/editor.js", - "herrbischoff/awesome-macos-command-line", - "mckaywrigley/chatbot-ui", - "linexjlin/GPTs", - "mpv-player/mpv", - "refinedev/refine", - "alan2207/bulletproof-react", - "jobbole/awesome-python-cn", - "tqdm/tqdm", - "kodecocodes/swift-algorithm-club", - "outline/outline", - "qbittorrent/qBittorrent", - "facebook/rocksdb", - "xinntao/Real-ESRGAN", - "cheeriojs/cheerio", "s0md3v/roop", "ascoders/weekly", "backstage/backstage", @@ -587,89 +82,6 @@ "tastejs/todomvc", "lutzroeder/netron", "alibaba/canal", - "Lightning-AI/pytorch-lightning", - "encode/django-rest-framework", - "postcss/postcss", - "facebook/folly", - "kenwheeler/slick", - "Ebazhanov/linkedin-skill-assessments-quizzes", - "alpinejs/alpine", - "GoogleChrome/lighthouse", - "AllThingsSmitty/css-protips", - "Mintplex-Labs/anything-llm", - "hashicorp/consul", - "charmbracelet/bubbletea", - "realpython/python-guide", - "mifi/lossless-cut", - "wuyouzhuguli/SpringAll", - "vuejs/vuex", - "microsoft/Data-Science-For-Beginners", - "usebruno/bruno", - "directus/directus", - "fastapi/full-stack-fastapi-template", - "MonitorControl/MonitorControl", - "OWASP/CheatSheetSeries", - "schollz/croc", - "codepath/android_guides", - "k3s-io/k3s", - "numpy/numpy", - "pmndrs/react-spring", - "YunaiV/ruoyi-vue-pro", - "surrealdb/surrealdb", - "ZuzooVn/machine-learning-for-software-engineers", - "caolan/async", - "google/comprehensive-rust", - "ageron/handson-ml2", - "jashkenas/backbone", - "alibaba/spring-cloud-alibaba", - "acheong08/ChatGPT", - "GorvGoyl/Clone-Wars", - "alibaba/druid", - "docsifyjs/docsify", - "jamiebuilds/the-super-tiny-compiler", - "xuxueli/xxl-job", - "iawia002/lux", - "google-ai-edge/mediapipe", - "hiroi-sora/Umi-OCR", - "ueberdosis/tiptap", - "digitalocean/nginxconfig.io", - "wesbos/JavaScript30", - "immerjs/immer", - "viraptor/reverse-interview", - "pmndrs/react-three-fiber", - "derailed/k9s", - "JedWatson/react-select", - "nextcloud/server", - "Pierian-Data/Complete-Python-3-Bootcamp", - "ChartsOrg/Charts", - "nagadomi/waifu2x", - "mobxjs/mobx", - "donnemartin/data-science-ipython-notebooks", - "DevToys-app/DevToys", - "zadam/trilium", - "cfenollosa/os-tutorial", - "google-research/tuning_playbook", - "meta-llama/llama3", - "lenve/vhr", - "mli/paper-reading", - "Advanced-Frontend/Daily-Interview-Question", - "YMFE/yapi", - "spf13/viper", - "eugeneyan/applied-ml", - "MichaelCade/90DaysOfDevOps", - "utmapp/UTM", - "jashkenas/underscore", - "vadimdemedes/ink", - "geekcompany/ResumeSample", - "tokio-rs/tokio", - "GitbookIO/gitbook", - "statelyai/xstate", - "cloudcommunity/Free-Certifications", - "google/python-fire", - "mouredev/Hello-Python", - "Tencent/weui", - "nothings/stb", - "helm/helm", "tinygrad/tinygrad", "ManimCommunity/manim", "filebrowser/filebrowser", @@ -679,150 +91,10 @@ "crossoverJie/JCSprout", "mantinedev/mantine", "Automattic/mongoose", - "zhiwehu/Python-programming-exercises", - "michalsnik/aos", - "Homebrew/legacy-homebrew", - "mudler/LocalAI", - "HeyPuter/puter", - "mindsdb/mindsdb", - "restic/restic", - "codemirror/codemirror5", - "CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers", - "tj/commander.js", - "rethinkdb/rethinkdb", - "dnSpy/dnSpy", - "fzaninotto/Faker", - "angular/angular-cli", - "ajaxorg/ace", - "coder2gwy/coder2gwy", - "qianguyihao/Web", - "houshanren/hangzhou_house_knowledge", - "swagger-api/swagger-ui", - "sampotts/plyr", - "IceWhaleTech/CasaOS", - "nvie/gitflow", - "go-kit/kit", - "imDazui/Tvlist-awesome-m3u-m3u8", - "exelban/stats", - "huggingface/diffusers", - "vercel/turborepo", - "AmruthPillai/Reactive-Resume", - "getredash/redash", - "python-telegram-bot/python-telegram-bot", - "telegramdesktop/tdesktop", - "mongodb/mongo", - "bvaughn/react-virtualized", - "firecracker-microvm/firecracker", - "openai/CLIP", - "fish-shell/fish-shell", - "dmlc/xgboost", - "fastai/fastai", - "tailwindlabs/headlessui", - "medusajs/medusa", - "xyflow/xyflow", - "remy/nodemon", - "hashicorp/vagrant", - "XIU2/TrackersListCollection", - "LadybirdBrowser/ladybird", - "facebookresearch/Detectron", - "dragonflydb/dragonfly", - "motiondivision/motion", - "grafana/k6", - "AvaloniaUI/Avalonia", - "qiurunze123/miaosha", - "ggreer/the_silver_searcher", - "vnpy/vnpy", - "rstacruz/nprogress", - "Asabeneh/30-Days-Of-React", - "microsoft/cascadia-code", - "rxhanson/Rectangle", - "openssl/openssl", - "spipm/Depix", - "svc-develop-team/so-vits-svc", - "XTLS/Xray-core", - "sunface/rust-course", - "quasarframework/quasar", - "deezer/spleeter", - "getcursor/cursor", - "cmderdev/cmder", - "kuchin/awesome-cto", - "Textualize/textual", - "facebookresearch/fastText", - "ossrs/srs", - "sindresorhus/awesome-electron", - "emscripten-core/emscripten", - "AdguardTeam/AdGuardHome", - "danielmiessler/fabric", - "select2/select2", - "pjreddie/darknet", - "OpenBMB/ChatDev", - "awesome-foss/awesome-sysadmin", - "airbnb/lottie-ios", - "dwmkerr/hacker-laws", - "powerline/fonts", - "vbenjs/vue-vben-admin", - "VSCodium/vscodium", - "wailsapp/wails", - "alibaba/fastjson", - "JakeChampion/fetch", - "signalapp/Signal-Android", - "t3-oss/create-t3-app", - "littlecodersh/ItChat", - "ValdikSS/GoodbyeDPI", - "jumpserver/jumpserver", - "request/request", - "chatanywhere/GPT_API_free", - "Modernizr/Modernizr", - "tmrts/go-patterns", - "taichi-dev/taichi", - "DigitalPlatDev/FreeDomain", - "haizlin/fe-interview", - "terryum/awesome-deep-learning-papers", - "DataTalksClub/data-engineering-zoomcamp", - "JakeWharton/butterknife", - "discordjs/discord.js", - "ChrisTitusTech/winutil", - "ycm-core/YouCompleteMe", - "Vision-CAIR/MiniGPT-4", - "DrKLO/Telegram", - "mozilla/DeepSpeech", - "hwdsl2/setup-ipsec-vpn", - "nginx/nginx", - "rollup/rollup", - "mbeaudru/modern-js-cheatsheet", - "ZuodaoTech/everyone-can-use-english", - "apache/incubator-seata", - "TanStack/table", - "hollischuang/toBeTopJavaer", - "fyne-io/fyne", - "sdras/awesome-actions", - "academic/awesome-datascience", - "ApolloAuto/apollo", - "zyedidia/micro", - "akveo/ngx-admin", - "kataras/iris", - "refined-github/refined-github", - "openfaas/faas", - "infiniflow/ragflow", - "ageron/handson-ml", - "locustio/locust", "eslint/eslint", "nextauthjs/next-auth", - "viatsko/awesome-vscode", "flameshot-org/flameshot", - "envoyproxy/envoy", - "RVC-Project/Retrieval-based-Voice-Conversion-WebUI", - "valinet/ExplorerPatcher", - "react-native-elements/react-native-elements", - "NvChad/NvChad", - "marmelab/react-admin", - "feathericons/feather", - "datasciencemasters/go", - "OpenZeppelin/openzeppelin-contracts", - "SDWebImage/SDWebImage", - "celery/celery", - "drizzle-team/drizzle-orm", - "nsqio/nsq" + "envoyproxy/envoy" ] } ] diff --git a/vendor/zoekt b/vendor/zoekt index b51a2335..123cf926 160000 --- a/vendor/zoekt +++ b/vendor/zoekt @@ -1 +1 @@ -Subproject commit b51a2335d51b865e1ffe84aa549e85570da61463 +Subproject commit 123cf926812a0284f7bf1056160b9e7e4c2c7a2f From 8a94949d2d7574726c802eff9d03372b72c8d9a2 Mon Sep 17 00:00:00 2001 From: msukkari Date: Thu, 20 Feb 2025 10:10:28 -0800 Subject: [PATCH 17/32] remove repo_synced event --- packages/backend/src/main.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/backend/src/main.ts b/packages/backend/src/main.ts index 21076965..b1d6e780 100644 --- a/packages/backend/src/main.ts +++ b/packages/backend/src/main.ts @@ -399,14 +399,6 @@ export const main = async (context: AppContext) => { const stats = await syncLocalRepository(repo, db.data.settings, context); indexDuration_s = stats.indexDuration_s; } - - captureEvent('repo_synced', { - vcs: repo.vcs, - codeHost: repo.codeHost, - indexDuration_s, - fetchDuration_s, - cloneDuration_s, - }); } catch (err: any) { // @todo : better error handling here.. logger.error(err); From 0965f1d3ebae50c4847ae0296529be2f67f54f28 Mon Sep 17 00:00:00 2001 From: msukkari Date: Thu, 20 Feb 2025 10:15:35 -0800 Subject: [PATCH 18/32] v2.8.2 release --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b7cca96..1c2ef22f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [2.8.2] - 2025-02-20 + +### Fixed + +- Remove `repo_synced` telemetry event. ## [2.8.1] - 2025-01-28 From a66e3493f71ce7dfcece8508750e69e936a3b85b Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 21 Feb 2025 17:08:55 -0800 Subject: [PATCH 19/32] add gcp staging deployment action --- .github/workflows/gcp-deploy-staging.yml | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/gcp-deploy-staging.yml diff --git a/.github/workflows/gcp-deploy-staging.yml b/.github/workflows/gcp-deploy-staging.yml new file mode 100644 index 00000000..157206c3 --- /dev/null +++ b/.github/workflows/gcp-deploy-staging.yml @@ -0,0 +1,30 @@ +name: GCP Deploy (staging) + +on: + workflow_run: + workflows: ["Publish to ghcr (staging)"] + types: + - completed + +jobs: + deploy: + name: Deploy staging app to GCP + runs-on: ubuntu-latest + + steps: + - name: Configure SSH + run: | + mkdir -p ~/.ssh/ + echo "${{ secrets.GCP_STAGING_SSH_PRIVATE_KEY }}" > ~/.ssh/private.key + chmod 600 ~/.ssh/private.key + echo "${{ secrets.GCP_STAGING_SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts + + - name: Deploy to GCP + run: | + ssh -i ~/.ssh/private.key {{secrets.GCP_STAGING_USERNAME}}@${{ secrets.GCP_STAGING_HOST }} << 'EOF' + # Stop existing container (if running) + staging_stop || true + + # Start new container + staging_start + EOF \ No newline at end of file From 44563469125376ff7777abd7c17d89bbbec7ed70 Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 21 Feb 2025 17:10:17 -0800 Subject: [PATCH 20/32] remove fly staging deployment action --- .github/workflows/fly-deploy-staging.yml | 29 ------------------------ 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/fly-deploy-staging.yml diff --git a/.github/workflows/fly-deploy-staging.yml b/.github/workflows/fly-deploy-staging.yml deleted file mode 100644 index 9e68700a..00000000 --- a/.github/workflows/fly-deploy-staging.yml +++ /dev/null @@ -1,29 +0,0 @@ - -name: Fly Deploy (staging) - -on: - workflow_run: - workflows: ["Publish to ghcr (staging)"] - types: - - completed - -jobs: - deploy: - name: Deploy staging app - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: 'true' - ref: v3 - - - name: Use flyctl - uses: superfly/flyctl-actions/setup-flyctl@master - - - name: Deploy to fly.io - run: | - cd $GITHUB_WORKSPACE/staging - flyctl deploy --local-only - env: - FLY_API_TOKEN: ${{ secrets.FLY_STAGING_DEPLOY_TOKEN }} \ No newline at end of file From 22666d85364c44e0efb7ee28ef86fda6f01c9a4f Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 21 Feb 2025 17:34:04 -0800 Subject: [PATCH 21/32] fix typo in gcp staging deploy action --- .github/workflows/gcp-deploy-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gcp-deploy-staging.yml b/.github/workflows/gcp-deploy-staging.yml index 157206c3..a2a9e475 100644 --- a/.github/workflows/gcp-deploy-staging.yml +++ b/.github/workflows/gcp-deploy-staging.yml @@ -21,7 +21,7 @@ jobs: - name: Deploy to GCP run: | - ssh -i ~/.ssh/private.key {{secrets.GCP_STAGING_USERNAME}}@${{ secrets.GCP_STAGING_HOST }} << 'EOF' + ssh -i ~/.ssh/private.key {{ secrets.GCP_STAGING_USERNAME }}@${{ secrets.GCP_STAGING_HOST }} << 'EOF' # Stop existing container (if running) staging_stop || true From f878e92344053c6af1fd70b2b3c9c1cbb10a1c74 Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 21 Feb 2025 17:50:58 -0800 Subject: [PATCH 22/32] actually fix the typo this time --- .github/workflows/gcp-deploy-staging.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gcp-deploy-staging.yml b/.github/workflows/gcp-deploy-staging.yml index a2a9e475..4fecca07 100644 --- a/.github/workflows/gcp-deploy-staging.yml +++ b/.github/workflows/gcp-deploy-staging.yml @@ -21,10 +21,10 @@ jobs: - name: Deploy to GCP run: | - ssh -i ~/.ssh/private.key {{ secrets.GCP_STAGING_USERNAME }}@${{ secrets.GCP_STAGING_HOST }} << 'EOF' + ssh -i ~/.ssh/private.key ${{ secrets.GCP_STAGING_USERNAME }}@${{ secrets.GCP_STAGING_HOST }} << 'EOF' # Stop existing container (if running) staging_stop || true # Start new container staging_start - EOF \ No newline at end of file + EOF \ No newline at end of file From 21fb03c9c6c2cd2e168a9b9d42106d70f93b6c31 Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 21 Feb 2025 18:45:14 -0800 Subject: [PATCH 23/32] change gcp deploy to run commands directly instead of using alias --- .github/workflows/gcp-deploy-staging.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gcp-deploy-staging.yml b/.github/workflows/gcp-deploy-staging.yml index 4fecca07..298d745d 100644 --- a/.github/workflows/gcp-deploy-staging.yml +++ b/.github/workflows/gcp-deploy-staging.yml @@ -22,9 +22,16 @@ jobs: - name: Deploy to GCP run: | ssh -i ~/.ssh/private.key ${{ secrets.GCP_STAGING_USERNAME }}@${{ secrets.GCP_STAGING_HOST }} << 'EOF' - # Stop existing container (if running) - staging_stop || true - - # Start new container - staging_start + # Stop and remove any existing container + docker stop sourcebot-staging || true + docker rm sourcebot-staging || true + + # Run new container + docker run -d \ + -p 80:3000 \ + --pull always \ + --env-file .env.staging \ + -v /mnt/data:/data \ + --name sourcebot-staging \ + ghcr.io/sourcebot-dev/sourcebot:staging EOF \ No newline at end of file From 2e496e759d060f63eaa0dd7a4945f4eaba19eacd Mon Sep 17 00:00:00 2001 From: msukkari Date: Tue, 25 Feb 2025 09:16:48 -0800 Subject: [PATCH 24/32] add rm flag to gcp deploy --- .github/workflows/gcp-deploy-staging.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gcp-deploy-staging.yml b/.github/workflows/gcp-deploy-staging.yml index 298d745d..5bb1cdc0 100644 --- a/.github/workflows/gcp-deploy-staging.yml +++ b/.github/workflows/gcp-deploy-staging.yml @@ -29,6 +29,7 @@ jobs: # Run new container docker run -d \ -p 80:3000 \ + --rm \ --pull always \ --env-file .env.staging \ -v /mnt/data:/data \ From ba19f39f99adfb9b50f192ffdb02f581323331ea Mon Sep 17 00:00:00 2001 From: msukkari Date: Thu, 27 Feb 2025 16:58:41 -0800 Subject: [PATCH 25/32] bump timeout for gcp deploy container stop command --- .github/workflows/gcp-deploy-staging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gcp-deploy-staging.yml b/.github/workflows/gcp-deploy-staging.yml index 5bb1cdc0..2173cb31 100644 --- a/.github/workflows/gcp-deploy-staging.yml +++ b/.github/workflows/gcp-deploy-staging.yml @@ -23,7 +23,7 @@ jobs: run: | ssh -i ~/.ssh/private.key ${{ secrets.GCP_STAGING_USERNAME }}@${{ secrets.GCP_STAGING_HOST }} << 'EOF' # Stop and remove any existing container - docker stop sourcebot-staging || true + docker stop -t 60 sourcebot-staging || true docker rm sourcebot-staging || true # Run new container From 9a204b9557f528a371585b88448fefbb8316d953 Mon Sep 17 00:00:00 2001 From: msukkari Date: Wed, 5 Mar 2025 17:27:23 -0800 Subject: [PATCH 26/32] add sourcebot cloud card to public search demo --- .github/workflows/ghcr-publish.yml | 3 +- Dockerfile | 5 ++ demo-site-config.json | 15 ++++ entrypoint.sh | 6 ++ .../src/app/components/editorContextMenu.tsx | 2 +- .../src/app/components/registrationCard.tsx | 49 ++++++++++++ packages/web/src/app/page.tsx | 7 ++ packages/web/src/components/ui/card.tsx | 79 +++++++++++++++++++ packages/web/src/lib/environment.ts | 3 +- packages/web/src/lib/posthogEvents.ts | 3 +- 10 files changed, 168 insertions(+), 4 deletions(-) create mode 100644 packages/web/src/app/components/registrationCard.tsx create mode 100644 packages/web/src/components/ui/card.tsx diff --git a/.github/workflows/ghcr-publish.yml b/.github/workflows/ghcr-publish.yml index ef805a8a..164cd7a5 100644 --- a/.github/workflows/ghcr-publish.yml +++ b/.github/workflows/ghcr-publish.yml @@ -81,7 +81,8 @@ jobs: build-args: | SOURCEBOT_VERSION=${{ github.ref_name }} POSTHOG_PAPIK=${{ secrets.POSTHOG_PAPIK }} - + PUBLIC_SEARCH_DEMO=${{ secrets.PUBLIC_SEARCH_DEMO }} + - name: Export digest run: | mkdir -p /tmp/digests diff --git a/Dockerfile b/Dockerfile index 766586c6..6fa4411a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,6 +26,7 @@ ENV NEXT_TELEMETRY_DISABLED=1 # @see: https://phase.dev/blog/nextjs-public-runtime-variables/ ARG NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED=BAKED_NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED ARG NEXT_PUBLIC_SOURCEBOT_VERSION=BAKED_NEXT_PUBLIC_SOURCEBOT_VERSION +ENV NEXT_PUBLIC_SEARCH_DEMO=BAKED_NEXT_PUBLIC_SEARCH_DEMO ENV NEXT_PUBLIC_POSTHOG_PAPIK=BAKED_NEXT_PUBLIC_POSTHOG_PAPIK # @note: leading "/" is required for the basePath property. @see: https://nextjs.org/docs/app/api-reference/next-config-js/basePath ARG NEXT_PUBLIC_DOMAIN_SUB_PATH=/BAKED_NEXT_PUBLIC_DOMAIN_SUB_PATH @@ -54,6 +55,10 @@ ARG SOURCEBOT_VERSION=unknown ENV SOURCEBOT_VERSION=$SOURCEBOT_VERSION RUN echo "Sourcebot Version: $SOURCEBOT_VERSION" +ARG PUBLIC_SEARCH_DEMO=false +ENV PUBLIC_SEARCH_DEMO=$PUBLIC_SEARCH_DEMO +RUN echo "Public Search Demo: $PUBLIC_SEARCH_DEMO" + # Valid values are: debug, info, warn, error ENV SOURCEBOT_LOG_LEVEL=info diff --git a/demo-site-config.json b/demo-site-config.json index 8adbb703..4e89038c 100644 --- a/demo-site-config.json +++ b/demo-site-config.json @@ -96,6 +96,21 @@ "flameshot-org/flameshot", "envoyproxy/envoy" ] + }, + { + "type": "gitlab", + "token": { + "env": "GITLAB_TOKEN" + }, + "groups": [ + "fdroid" + ], + "exclude": { + "projects": [ + "fdroid/wiki", + "Matrixcoffee/internal-twif-preview" + ] + } } ] } \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 2ed5ec20..830c8fd7 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -93,6 +93,11 @@ echo -e "\e[34m[Info] Using config file at: '$CONFIG_PATH'.\e[0m" export NEXT_PUBLIC_SOURCEBOT_VERSION="$SOURCEBOT_VERSION" fi + # Infer NEXT_PUBLIC_SEARCH_DEMO if it is not set + if [ -z "$NEXT_PUBLIC_SEARCH_DEMO" ] && [ ! -z "$PUBLIC_SEARCH_DEMO" ]; then + export NEXT_PUBLIC_SEARCH_DEMO="$PUBLIC_SEARCH_DEMO" + fi + # Always infer NEXT_PUBLIC_POSTHOG_PAPIK export NEXT_PUBLIC_POSTHOG_PAPIK="$POSTHOG_PAPIK" @@ -103,6 +108,7 @@ echo -e "\e[34m[Info] Using config file at: '$CONFIG_PATH'.\e[0m" sed -i "s|BAKED_NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED|${NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED}|g" "$file" sed -i "s|BAKED_NEXT_PUBLIC_SOURCEBOT_VERSION|${NEXT_PUBLIC_SOURCEBOT_VERSION}|g" "$file" sed -i "s|BAKED_NEXT_PUBLIC_POSTHOG_PAPIK|${NEXT_PUBLIC_POSTHOG_PAPIK}|g" "$file" + sed -i "s|BAKED_NEXT_PUBLIC_SEARCH_DEMO|${NEXT_PUBLIC_SEARCH_DEMO}|g" "$file" done } diff --git a/packages/web/src/app/components/editorContextMenu.tsx b/packages/web/src/app/components/editorContextMenu.tsx index 3e7b6286..c6874c64 100644 --- a/packages/web/src/app/components/editorContextMenu.tsx +++ b/packages/web/src/app/components/editorContextMenu.tsx @@ -116,7 +116,7 @@ export const EditorContextMenu = ({ description: "✅ Copied link to selection", }); - captureEvent('share_link_created', {}); + captureEvent('wa_share_link_created', {}); // Reset the selection view.dispatch( diff --git a/packages/web/src/app/components/registrationCard.tsx b/packages/web/src/app/components/registrationCard.tsx new file mode 100644 index 00000000..af64db86 --- /dev/null +++ b/packages/web/src/app/components/registrationCard.tsx @@ -0,0 +1,49 @@ +"use client" + +import { useState } from "react" +import Link from "next/link" +import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" +import { Button } from "@/components/ui/button" +import { ArrowRight, Code, Database, Search } from "lucide-react" +import useCaptureEvent from "@/hooks/useCaptureEvent" + +export default function RegistrationCard() { + const [isHovered, setIsHovered] = useState(false) + const captureEvent = useCaptureEvent() + + return ( + setIsHovered(true)} + onMouseLeave={() => setIsHovered(false)} + > + + Try Sourcebot Cloud + Index and search your own code repositories + + +
+
+ +

Search your private and public repositories

+
+
+ +

Index your own codebase in minutes

+
+
+
+ + captureEvent("wa_demo_try_card_pressed", {})}> + + +

+ 14 day free trial. No credit card required. +

+
+
+ ) +} diff --git a/packages/web/src/app/page.tsx b/packages/web/src/app/page.tsx index 85f63490..4a4a1465 100644 --- a/packages/web/src/app/page.tsx +++ b/packages/web/src/app/page.tsx @@ -12,6 +12,8 @@ import { SymbolIcon } from "@radix-ui/react-icons"; import { UpgradeToast } from "./components/upgradeToast"; import Link from "next/link"; import { KeyboardShortcutHint } from "./components/keyboardShortcutHint"; +import RegistrationCard from "./components/registrationCard"; +import { PUBLIC_SEARCH_DEMO } from "@/lib/environment"; export default async function Home() { return ( @@ -38,6 +40,11 @@ export default async function Home() { autoFocus={true} className="mt-4 w-full max-w-[800px]" /> + {PUBLIC_SEARCH_DEMO && ( +
+ +
+ )}
...
}> diff --git a/packages/web/src/components/ui/card.tsx b/packages/web/src/components/ui/card.tsx new file mode 100644 index 00000000..f62edea5 --- /dev/null +++ b/packages/web/src/components/ui/card.tsx @@ -0,0 +1,79 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +const Card = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +Card.displayName = "Card" + +const CardHeader = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +CardHeader.displayName = "CardHeader" + +const CardTitle = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +CardTitle.displayName = "CardTitle" + +const CardDescription = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +CardDescription.displayName = "CardDescription" + +const CardContent = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +CardContent.displayName = "CardContent" + +const CardFooter = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +CardFooter.displayName = "CardFooter" + +export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } diff --git a/packages/web/src/lib/environment.ts b/packages/web/src/lib/environment.ts index 7f23b0a5..a10e7a8d 100644 --- a/packages/web/src/lib/environment.ts +++ b/packages/web/src/lib/environment.ts @@ -1,9 +1,10 @@ import 'server-only'; -import { getEnv, getEnvNumber } from "./utils"; +import { getEnv, getEnvBoolean, getEnvNumber } from "./utils"; export const ZOEKT_WEBSERVER_URL = getEnv(process.env.ZOEKT_WEBSERVER_URL, "http://localhost:6070")!; export const SHARD_MAX_MATCH_COUNT = getEnvNumber(process.env.SHARD_MAX_MATCH_COUNT, 10000); export const TOTAL_MAX_MATCH_COUNT = getEnvNumber(process.env.TOTAL_MAX_MATCH_COUNT, 100000); export const SOURCEBOT_VERSION = getEnv(process.env.SOURCEBOT_VERSION, 'unknown')!; export const NODE_ENV = process.env.NODE_ENV; +export const PUBLIC_SEARCH_DEMO = getEnvBoolean(process.env.PUBLIC_SEARCH_DEMO, false); diff --git a/packages/web/src/lib/posthogEvents.ts b/packages/web/src/lib/posthogEvents.ts index 114cf106..e73d9483 100644 --- a/packages/web/src/lib/posthogEvents.ts +++ b/packages/web/src/lib/posthogEvents.ts @@ -24,7 +24,8 @@ export type PosthogEventMap = { flushReason: number, fileLanguages: string[] }, - share_link_created: {}, + wa_demo_try_card_pressed: {}, + wa_share_link_created: {}, } export type PosthogEvent = keyof PosthogEventMap; \ No newline at end of file From 9d1ebcefaa56f258a05a44e314ec3643f5cb1ab5 Mon Sep 17 00:00:00 2001 From: msukkari Date: Thu, 6 Mar 2025 15:20:30 -0800 Subject: [PATCH 27/32] log addition info for public search demo --- Dockerfile | 2 +- entrypoint.sh | 8 ++++---- packages/web/src/app/components/registrationCard.tsx | 2 +- packages/web/src/app/posthogProvider.tsx | 8 ++++---- packages/web/src/app/search/page.tsx | 2 ++ packages/web/src/lib/environment.client.ts | 1 + packages/web/src/lib/posthogEvents.ts | 1 + 7 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6fa4411a..f7d0358f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ ENV NEXT_TELEMETRY_DISABLED=1 # @see: https://phase.dev/blog/nextjs-public-runtime-variables/ ARG NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED=BAKED_NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED ARG NEXT_PUBLIC_SOURCEBOT_VERSION=BAKED_NEXT_PUBLIC_SOURCEBOT_VERSION -ENV NEXT_PUBLIC_SEARCH_DEMO=BAKED_NEXT_PUBLIC_SEARCH_DEMO +ENV NEXT_PUBLIC_PUBLIC_SEARCH_DEMO=BAKED_NEXT_PUBLIC_PUBLIC_SEARCH_DEMO ENV NEXT_PUBLIC_POSTHOG_PAPIK=BAKED_NEXT_PUBLIC_POSTHOG_PAPIK # @note: leading "/" is required for the basePath property. @see: https://nextjs.org/docs/app/api-reference/next-config-js/basePath ARG NEXT_PUBLIC_DOMAIN_SUB_PATH=/BAKED_NEXT_PUBLIC_DOMAIN_SUB_PATH diff --git a/entrypoint.sh b/entrypoint.sh index 830c8fd7..d42a0b87 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -93,9 +93,9 @@ echo -e "\e[34m[Info] Using config file at: '$CONFIG_PATH'.\e[0m" export NEXT_PUBLIC_SOURCEBOT_VERSION="$SOURCEBOT_VERSION" fi - # Infer NEXT_PUBLIC_SEARCH_DEMO if it is not set - if [ -z "$NEXT_PUBLIC_SEARCH_DEMO" ] && [ ! -z "$PUBLIC_SEARCH_DEMO" ]; then - export NEXT_PUBLIC_SEARCH_DEMO="$PUBLIC_SEARCH_DEMO" + # Infer NEXT_PUBLIC_PUBLIC_SEARCH_DEMO if it is not set + if [ -z "$NEXT_PUBLIC_PUBLIC_SEARCH_DEMO" ] && [ ! -z "$PUBLIC_SEARCH_DEMO" ]; then + export NEXT_PUBLIC_PUBLIC_SEARCH_DEMO="$PUBLIC_SEARCH_DEMO" fi # Always infer NEXT_PUBLIC_POSTHOG_PAPIK @@ -108,7 +108,7 @@ echo -e "\e[34m[Info] Using config file at: '$CONFIG_PATH'.\e[0m" sed -i "s|BAKED_NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED|${NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED}|g" "$file" sed -i "s|BAKED_NEXT_PUBLIC_SOURCEBOT_VERSION|${NEXT_PUBLIC_SOURCEBOT_VERSION}|g" "$file" sed -i "s|BAKED_NEXT_PUBLIC_POSTHOG_PAPIK|${NEXT_PUBLIC_POSTHOG_PAPIK}|g" "$file" - sed -i "s|BAKED_NEXT_PUBLIC_SEARCH_DEMO|${NEXT_PUBLIC_SEARCH_DEMO}|g" "$file" + sed -i "s|BAKED_NEXT_PUBLIC_PUBLIC_SEARCH_DEMO|${NEXT_PUBLIC_PUBLIC_SEARCH_DEMO}|g" "$file" done } diff --git a/packages/web/src/app/components/registrationCard.tsx b/packages/web/src/app/components/registrationCard.tsx index af64db86..7c2c0420 100644 --- a/packages/web/src/app/components/registrationCard.tsx +++ b/packages/web/src/app/components/registrationCard.tsx @@ -4,7 +4,7 @@ import { useState } from "react" import Link from "next/link" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" -import { ArrowRight, Code, Database, Search } from "lucide-react" +import { ArrowRight, Database, Search } from "lucide-react" import useCaptureEvent from "@/hooks/useCaptureEvent" export default function RegistrationCard() { diff --git a/packages/web/src/app/posthogProvider.tsx b/packages/web/src/app/posthogProvider.tsx index e556678f..747153e0 100644 --- a/packages/web/src/app/posthogProvider.tsx +++ b/packages/web/src/app/posthogProvider.tsx @@ -1,5 +1,5 @@ 'use client' -import { NEXT_PUBLIC_POSTHOG_PAPIK, NEXT_PUBLIC_POSTHOG_UI_HOST, NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED } from '@/lib/environment.client' +import { NEXT_PUBLIC_POSTHOG_PAPIK, NEXT_PUBLIC_POSTHOG_UI_HOST, NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED, NEXT_PUBLIC_PUBLIC_SEARCH_DEMO } from '@/lib/environment.client' import posthog from 'posthog-js' import { PostHogProvider } from 'posthog-js/react' import { resolveServerPath } from './api/(client)/client' @@ -14,10 +14,10 @@ if (typeof window !== 'undefined') { api_host: posthogHostPath, ui_host: NEXT_PUBLIC_POSTHOG_UI_HOST, person_profiles: 'identified_only', - capture_pageview: false, // Disable automatic pageview capture + capture_pageview: NEXT_PUBLIC_PUBLIC_SEARCH_DEMO, // @nocheckin Disable automatic pageview capture if we're not in public demo mode autocapture: false, // Disable automatic event capture // eslint-disable-next-line @typescript-eslint/no-explicit-any - sanitize_properties: (properties: Record, _event: string) => { + sanitize_properties: !NEXT_PUBLIC_PUBLIC_SEARCH_DEMO ? (properties: Record, _event: string) => { // https://posthog.com/docs/libraries/js#config if (properties['$current_url']) { properties['$current_url'] = null; @@ -27,7 +27,7 @@ if (typeof window !== 'undefined') { } return properties; - } + } : undefined }); } else { console.log("PostHog telemetry disabled"); diff --git a/packages/web/src/app/search/page.tsx b/packages/web/src/app/search/page.tsx index 8e9350e5..10772e35 100644 --- a/packages/web/src/app/search/page.tsx +++ b/packages/web/src/app/search/page.tsx @@ -21,6 +21,7 @@ import { TopBar } from "../components/topBar"; import { CodePreviewPanel } from "./components/codePreviewPanel"; import { FilterPanel } from "./components/filterPanel"; import { SearchResultsPanel } from "./components/searchResultsPanel"; +import { NEXT_PUBLIC_PUBLIC_SEARCH_DEMO } from "@/lib/environment.client"; const DEFAULT_MAX_MATCH_DISPLAY_COUNT = 10000; @@ -86,6 +87,7 @@ export default function SearchPage() { const fileLanguages = searchResponse.Result.Files?.map(file => file.Language) || []; captureEvent("search_finished", { + query: NEXT_PUBLIC_PUBLIC_SEARCH_DEMO ? searchQuery : null, // @nocheckin contentBytesLoaded: searchResponse.Result.ContentBytesLoaded, indexBytesLoaded: searchResponse.Result.IndexBytesLoaded, crashes: searchResponse.Result.Crashes, diff --git a/packages/web/src/lib/environment.client.ts b/packages/web/src/lib/environment.client.ts index 117ebf7e..51836065 100644 --- a/packages/web/src/lib/environment.client.ts +++ b/packages/web/src/lib/environment.client.ts @@ -9,3 +9,4 @@ export const NEXT_PUBLIC_POSTHOG_ASSET_HOST = getEnv(process.env.NEXT_PUBLIC_POS export const NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED = getEnvBoolean(process.env.NEXT_PUBLIC_SOURCEBOT_TELEMETRY_DISABLED, false); export const NEXT_PUBLIC_SOURCEBOT_VERSION = getEnv(process.env.NEXT_PUBLIC_SOURCEBOT_VERSION, "unknown")!; export const NEXT_PUBLIC_DOMAIN_SUB_PATH = getEnv(process.env.NEXT_PUBLIC_DOMAIN_SUB_PATH, "")!; +export const NEXT_PUBLIC_PUBLIC_SEARCH_DEMO = getEnvBoolean(process.env.NEXT_PUBLIC_PUBLIC_SEARCH_DEMO, false); diff --git a/packages/web/src/lib/posthogEvents.ts b/packages/web/src/lib/posthogEvents.ts index e73d9483..a628613b 100644 --- a/packages/web/src/lib/posthogEvents.ts +++ b/packages/web/src/lib/posthogEvents.ts @@ -2,6 +2,7 @@ export type PosthogEventMap = { search_finished: { + query: string | null, contentBytesLoaded: number, indexBytesLoaded: number, crashes: number, From bf76cb9358e0f887b5c53ea6b9d32279605d8329 Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 7 Mar 2025 15:04:14 -0800 Subject: [PATCH 28/32] cherry pick gitignore additions into main --- packages/backend/.gitignore | 3 ++- packages/web/.gitignore | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/backend/.gitignore b/packages/backend/.gitignore index 9ce098c9..c3823db7 100644 --- a/packages/backend/.gitignore +++ b/packages/backend/.gitignore @@ -1,2 +1,3 @@ dist/ -!.env \ No newline at end of file +!.env +.sentryclirc \ No newline at end of file diff --git a/packages/web/.gitignore b/packages/web/.gitignore index 4ac2a3ad..e8c2c77f 100644 --- a/packages/web/.gitignore +++ b/packages/web/.gitignore @@ -39,4 +39,5 @@ next-env.d.ts # End of https://www.toptal.com/developers/gitignore/api/nextjs -!.env \ No newline at end of file +!.env +.env.sentry-build-plugin \ No newline at end of file From 998a4dd07bb198e872b95462478e52d75a688237 Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Thu, 13 Mar 2025 13:02:49 -0700 Subject: [PATCH 29/32] make syntax reference guide keyboard shortcut hint clickable (#229) --- .../searchBar/searchSuggestionsBox.tsx | 7 +++- .../app/components/syntaxReferenceGuide.tsx | 13 ++++---- .../components/syntaxReferenceGuideHint.tsx | 17 ++++++++++ packages/web/src/app/layout.tsx | 19 ++++++----- packages/web/src/app/page.tsx | 6 ++-- packages/web/src/app/syntaxGuideProvider.tsx | 32 +++++++++++++++++++ 6 files changed, 75 insertions(+), 19 deletions(-) create mode 100644 packages/web/src/app/components/syntaxReferenceGuideHint.tsx create mode 100644 packages/web/src/app/syntaxGuideProvider.tsx diff --git a/packages/web/src/app/components/searchBar/searchSuggestionsBox.tsx b/packages/web/src/app/components/searchBar/searchSuggestionsBox.tsx index 1b31c1cf..a8bb5bd9 100644 --- a/packages/web/src/app/components/searchBar/searchSuggestionsBox.tsx +++ b/packages/web/src/app/components/searchBar/searchSuggestionsBox.tsx @@ -17,6 +17,7 @@ import { VscFile, VscFilter, VscRepo, VscSymbolMisc } from "react-icons/vsc"; import { Skeleton } from "@/components/ui/skeleton"; import { Separator } from "@/components/ui/separator"; import { KeyboardShortcutHint } from "../keyboardShortcutHint"; +import { useSyntaxGuide } from "@/app/syntaxGuideProvider"; export type Suggestion = { value: string; @@ -79,6 +80,7 @@ const SearchSuggestionsBox = forwardRef(({ searchHistorySuggestions, }: SearchSuggestionsBoxProps, ref: Ref) => { const [highlightedSuggestionIndex, setHighlightedSuggestionIndex] = useState(0); + const { onOpenChanged } = useSyntaxGuide(); const { suggestions, isHighlightEnabled, descriptionPlacement, DefaultIcon, onSuggestionClicked } = useMemo(() => { if (!isEnabled) { @@ -391,7 +393,10 @@ const SearchSuggestionsBox = forwardRef(({ className="my-2" />
-
+
onOpenChanged(true)} + >

Syntax help:

diff --git a/packages/web/src/app/components/syntaxReferenceGuide.tsx b/packages/web/src/app/components/syntaxReferenceGuide.tsx index d2225799..f92edcd3 100644 --- a/packages/web/src/app/components/syntaxReferenceGuide.tsx +++ b/packages/web/src/app/components/syntaxReferenceGuide.tsx @@ -12,30 +12,31 @@ import { } from "@/components/ui/table"; import clsx from "clsx"; import Link from "next/link"; -import { useCallback, useRef, useState } from "react"; +import { useCallback, useRef } from "react"; import { useHotkeys } from "react-hotkeys-hook"; +import { useSyntaxGuide } from "../syntaxGuideProvider"; const LINGUIST_LINK = "https://github.com/github-linguist/linguist/blob/main/lib/linguist/languages.yml"; const CTAGS_LINK = "https://ctags.io/"; export const SyntaxReferenceGuide = () => { - const [isOpen, setIsOpen] = useState(false); + const { isOpen, onOpenChanged } = useSyntaxGuide(); const previousFocusedElement = useRef(null); const openDialog = useCallback(() => { previousFocusedElement.current = document.activeElement as HTMLElement; - setIsOpen(true); - }, []); + onOpenChanged(true); + }, [onOpenChanged]); const closeDialog = useCallback(() => { - setIsOpen(false); + onOpenChanged(false); // @note: Without requestAnimationFrame, focus was not being returned // to codemirror elements for some reason. requestAnimationFrame(() => { previousFocusedElement.current?.focus(); }); - }, []); + }, [onOpenChanged]); const handleOpenChange = useCallback((isOpen: boolean) => { if (isOpen) { diff --git a/packages/web/src/app/components/syntaxReferenceGuideHint.tsx b/packages/web/src/app/components/syntaxReferenceGuideHint.tsx new file mode 100644 index 00000000..35dfa473 --- /dev/null +++ b/packages/web/src/app/components/syntaxReferenceGuideHint.tsx @@ -0,0 +1,17 @@ +'use client'; + +import { useSyntaxGuide } from "../syntaxGuideProvider"; +import { KeyboardShortcutHint } from "./keyboardShortcutHint"; + +export const SyntaxReferenceGuideHint = () => { + const { isOpen, onOpenChanged } = useSyntaxGuide(); + + return ( +
onOpenChanged(!isOpen)} + > + Reference guide: +
+ ) +} \ No newline at end of file diff --git a/packages/web/src/app/layout.tsx b/packages/web/src/app/layout.tsx index 0f370369..9043f590 100644 --- a/packages/web/src/app/layout.tsx +++ b/packages/web/src/app/layout.tsx @@ -7,6 +7,7 @@ import { PHProvider } from "./posthogProvider"; import { Toaster } from "@/components/ui/toaster"; import { TooltipProvider } from "@/components/ui/tooltip"; import { SyntaxReferenceGuide } from "./components/syntaxReferenceGuide"; +import { SyntaxGuideProvider } from "./syntaxGuideProvider"; export const metadata: Metadata = { title: "Sourcebot", @@ -35,14 +36,16 @@ export default function RootLayout({ > - {/* - @todo : ideally we don't wrap everything in a suspense boundary. - @see : https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout - */} - - {children} - - + + {/* + @todo : ideally we don't wrap everything in a suspense boundary. + @see : https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout + */} + + {children} + + + diff --git a/packages/web/src/app/page.tsx b/packages/web/src/app/page.tsx index 4a4a1465..986d5572 100644 --- a/packages/web/src/app/page.tsx +++ b/packages/web/src/app/page.tsx @@ -11,9 +11,9 @@ import { Separator } from "@/components/ui/separator"; import { SymbolIcon } from "@radix-ui/react-icons"; import { UpgradeToast } from "./components/upgradeToast"; import Link from "next/link"; -import { KeyboardShortcutHint } from "./components/keyboardShortcutHint"; import RegistrationCard from "./components/registrationCard"; import { PUBLIC_SEARCH_DEMO } from "@/lib/environment"; +import { SyntaxReferenceGuideHint } from "./components/syntaxReferenceGuideHint"; export default async function Home() { return ( @@ -103,9 +103,7 @@ export default async function Home() {
-
- Reference guide: -
+
diff --git a/packages/web/src/app/syntaxGuideProvider.tsx b/packages/web/src/app/syntaxGuideProvider.tsx new file mode 100644 index 00000000..cd0c2c8b --- /dev/null +++ b/packages/web/src/app/syntaxGuideProvider.tsx @@ -0,0 +1,32 @@ +'use client'; + +import { createContext, useContext, useCallback, useState } from 'react'; + +interface SyntaxGuideContextType { + isOpen: boolean; + onOpenChanged: (isOpen: boolean) => void; +} + +const SyntaxGuideContext = createContext(null); + +export const useSyntaxGuide = () => { + const context = useContext(SyntaxGuideContext); + if (!context) { + throw new Error('useSyntaxGuide must be used within a SyntaxGuideProvider'); + } + return context; +}; + +export const SyntaxGuideProvider = ({ children }: { children: React.ReactNode }) => { + const [isOpen, setIsOpen] = useState(false); + + const onOpenChanged = useCallback((isOpen: boolean) => { + setIsOpen(isOpen); + }, []); + + return ( + + {children} + + ); +}; \ No newline at end of file From 1fe9da7de13f2fe62a84b07baf56fcd53556f089 Mon Sep 17 00:00:00 2001 From: bkellam Date: Thu, 13 Mar 2025 13:13:09 -0700 Subject: [PATCH 30/32] release v2.8.3 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c2ef22f..57bbb58c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +## [2.8.3] - 2025-03-13 + +### Fixed + +- Made syntax reference guide keyboard shortcut hints clickable. ([#229](https://github.com/sourcebot-dev/sourcebot/pull/229)) + ## [2.8.2] - 2025-02-20 ### Fixed From 1b66920c234829553497f9926406660ef13f364c Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 14 Mar 2025 15:10:31 -0700 Subject: [PATCH 31/32] fix bug where Sourcebot Cloud card is shown in self-hosted --- .github/workflows/ghcr-publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ghcr-publish.yml b/.github/workflows/ghcr-publish.yml index 164cd7a5..dc740fa2 100644 --- a/.github/workflows/ghcr-publish.yml +++ b/.github/workflows/ghcr-publish.yml @@ -81,7 +81,6 @@ jobs: build-args: | SOURCEBOT_VERSION=${{ github.ref_name }} POSTHOG_PAPIK=${{ secrets.POSTHOG_PAPIK }} - PUBLIC_SEARCH_DEMO=${{ secrets.PUBLIC_SEARCH_DEMO }} - name: Export digest run: | From 1b7ce39eae1729da5decb6cfaa925b5409a8b941 Mon Sep 17 00:00:00 2001 From: msukkari Date: Fri, 14 Mar 2025 15:11:54 -0700 Subject: [PATCH 32/32] v2.8.4 release --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57bbb58c..084bb8e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.8.4] - 2025-03-14 + +### Fixed + +- Fixed bug where Sourcebot Cloud card was shown to self-hosted users + ## [2.8.3] - 2025-03-13 ### Fixed