mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
Merge branch 'main' into bkellam/telemetry_improvements
This commit is contained in:
commit
7a2a361d9d
5 changed files with 24 additions and 20 deletions
|
|
@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Fixed issue where single quotes could not be used in search queries. [#629](https://github.com/sourcebot-dev/sourcebot/pull/629)
|
- Fixed issue where single quotes could not be used in search queries. [#629](https://github.com/sourcebot-dev/sourcebot/pull/629)
|
||||||
- Fixed issue where files with special characters would fail to load. [#636](https://github.com/sourcebot-dev/sourcebot/issues/636)
|
- Fixed issue where files with special characters would fail to load. [#636](https://github.com/sourcebot-dev/sourcebot/issues/636)
|
||||||
- Fixed Ask performance issues. [#632](https://github.com/sourcebot-dev/sourcebot/pull/632)
|
- Fixed Ask performance issues. [#632](https://github.com/sourcebot-dev/sourcebot/pull/632)
|
||||||
|
- Fixed regression where creating a new Ask thread when unauthenticated would result in a 404. [#641](https://github.com/sourcebot-dev/sourcebot/pull/641)
|
||||||
|
|
||||||
## [4.10.0] - 2025-11-24
|
## [4.10.0] - 2025-11-24
|
||||||
|
|
||||||
|
|
|
||||||
27
Dockerfile
27
Dockerfile
|
|
@ -1,3 +1,4 @@
|
||||||
|
# syntax=docker/dockerfile:1
|
||||||
# ------ Global scope variables ------
|
# ------ Global scope variables ------
|
||||||
|
|
||||||
# Set of global build arguments.
|
# Set of global build arguments.
|
||||||
|
|
@ -216,22 +217,23 @@ COPY --from=zoekt-builder \
|
||||||
/cmd/zoekt-index \
|
/cmd/zoekt-index \
|
||||||
/usr/local/bin/
|
/usr/local/bin/
|
||||||
|
|
||||||
|
RUN chown -R sourcebot:sourcebot /app
|
||||||
|
|
||||||
# Copy zoekt proto files (needed for gRPC client at runtime)
|
# Copy zoekt proto files (needed for gRPC client at runtime)
|
||||||
COPY vendor/zoekt/grpc/protos /app/vendor/zoekt/grpc/protos
|
COPY --chown=sourcebot:sourcebot vendor/zoekt/grpc/protos /app/vendor/zoekt/grpc/protos
|
||||||
|
|
||||||
# Copy all of the things
|
# Copy all of the things
|
||||||
COPY --from=web-builder /app/packages/web/public ./packages/web/public
|
COPY --chown=sourcebot:sourcebot --from=web-builder /app/packages/web/public ./packages/web/public
|
||||||
COPY --from=web-builder /app/packages/web/.next/standalone ./
|
COPY --chown=sourcebot:sourcebot --from=web-builder /app/packages/web/.next/standalone ./
|
||||||
COPY --from=web-builder /app/packages/web/.next/static ./packages/web/.next/static
|
COPY --chown=sourcebot:sourcebot --from=web-builder /app/packages/web/.next/static ./packages/web/.next/static
|
||||||
|
|
||||||
COPY --from=backend-builder /app/node_modules ./node_modules
|
COPY --chown=sourcebot:sourcebot --from=backend-builder /app/node_modules ./node_modules
|
||||||
COPY --from=backend-builder /app/packages/backend ./packages/backend
|
COPY --chown=sourcebot:sourcebot --from=backend-builder /app/packages/backend ./packages/backend
|
||||||
|
|
||||||
COPY --from=shared-libs-builder /app/node_modules ./node_modules
|
COPY --chown=sourcebot:sourcebot --from=shared-libs-builder /app/packages/db ./packages/db
|
||||||
COPY --from=shared-libs-builder /app/packages/db ./packages/db
|
COPY --chown=sourcebot:sourcebot --from=shared-libs-builder /app/packages/schemas ./packages/schemas
|
||||||
COPY --from=shared-libs-builder /app/packages/schemas ./packages/schemas
|
COPY --chown=sourcebot:sourcebot --from=shared-libs-builder /app/packages/shared ./packages/shared
|
||||||
COPY --from=shared-libs-builder /app/packages/shared ./packages/shared
|
COPY --chown=sourcebot:sourcebot --from=shared-libs-builder /app/packages/queryLanguage ./packages/queryLanguage
|
||||||
COPY --from=shared-libs-builder /app/packages/queryLanguage ./packages/queryLanguage
|
|
||||||
|
|
||||||
# Fixes git "dubious ownership" issues when the volume is mounted with different permissions to the container.
|
# Fixes git "dubious ownership" issues when the volume is mounted with different permissions to the container.
|
||||||
RUN git config --global safe.directory "*"
|
RUN git config --global safe.directory "*"
|
||||||
|
|
@ -241,9 +243,6 @@ RUN mkdir -p /run/postgresql && \
|
||||||
chown -R postgres:postgres /run/postgresql && \
|
chown -R postgres:postgres /run/postgresql && \
|
||||||
chmod 775 /run/postgresql
|
chmod 775 /run/postgresql
|
||||||
|
|
||||||
# Make app directory accessible to both root and sourcebot user
|
|
||||||
RUN chown -R sourcebot:sourcebot /app
|
|
||||||
# Make data directory accessible to both root and sourcebot user
|
|
||||||
RUN chown -R sourcebot:sourcebot /data
|
RUN chown -R sourcebot:sourcebot /data
|
||||||
|
|
||||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
-- First, remove the NOT NULL constraint on the createdById column.
|
||||||
|
ALTER TABLE "Chat" ALTER COLUMN "createdById" DROP NOT NULL;
|
||||||
|
|
||||||
|
-- Then, set all chats created by the guest user (id: 1) to have a NULL createdById.
|
||||||
|
UPDATE "Chat" SET "createdById" = NULL WHERE "createdById" = '1';
|
||||||
|
|
@ -437,8 +437,8 @@ model Chat {
|
||||||
|
|
||||||
name String?
|
name String?
|
||||||
|
|
||||||
createdBy User @relation(fields: [createdById], references: [id], onDelete: Cascade)
|
createdBy User? @relation(fields: [createdById], references: [id], onDelete: Cascade)
|
||||||
createdById String
|
createdById String?
|
||||||
|
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
'use server';
|
'use server';
|
||||||
|
|
||||||
import { sew } from "@/actions";
|
import { sew } from "@/actions";
|
||||||
import { SOURCEBOT_GUEST_USER_ID } from "@/lib/constants";
|
|
||||||
import { ErrorCode } from "@/lib/errorCodes";
|
import { ErrorCode } from "@/lib/errorCodes";
|
||||||
import { chatIsReadonly, notFound, ServiceError, serviceErrorResponse } from "@/lib/serviceError";
|
import { chatIsReadonly, notFound, ServiceError, serviceErrorResponse } from "@/lib/serviceError";
|
||||||
import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock';
|
import { createAmazonBedrock } from '@ai-sdk/amazon-bedrock';
|
||||||
|
|
@ -34,13 +33,13 @@ const logger = createLogger('chat-actions');
|
||||||
|
|
||||||
export const createChat = async () => sew(() =>
|
export const createChat = async () => sew(() =>
|
||||||
withOptionalAuthV2(async ({ org, user, prisma }) => {
|
withOptionalAuthV2(async ({ org, user, prisma }) => {
|
||||||
const isGuestUser = user?.id === SOURCEBOT_GUEST_USER_ID;
|
const isGuestUser = user === undefined;
|
||||||
|
|
||||||
const chat = await prisma.chat.create({
|
const chat = await prisma.chat.create({
|
||||||
data: {
|
data: {
|
||||||
orgId: org.id,
|
orgId: org.id,
|
||||||
messages: [] as unknown as Prisma.InputJsonValue,
|
messages: [] as unknown as Prisma.InputJsonValue,
|
||||||
createdById: user?.id ?? SOURCEBOT_GUEST_USER_ID,
|
createdById: user?.id,
|
||||||
visibility: isGuestUser ? ChatVisibility.PUBLIC : ChatVisibility.PRIVATE,
|
visibility: isGuestUser ? ChatVisibility.PUBLIC : ChatVisibility.PRIVATE,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue