Skip to content

Commit f4eeed6

Browse files
committed
sync
2 parents 91a31c6 + c77790f commit f4eeed6

430 files changed

Lines changed: 18186 additions & 15873 deletions

File tree

Some content is hidden

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

.github/workflows/docker-build-push-cloud-web-container-on-tag.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
NEXT_PUBLIC_POSTHOG_KEY=${{ secrets.POSTHOG_KEY }}
6666
NEXT_PUBLIC_POSTHOG_HOST=${{ secrets.POSTHOG_HOST }}
6767
NEXT_PUBLIC_SENTRY_DSN=${{ secrets.SENTRY_DSN }}
68+
NEXT_PUBLIC_GTM_ENABLED=true
6869
# needed due to weird interactions with the builds for different platforms
6970
no-cache: true
7071
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
name: Run Chromatic Tests
2+
concurrency:
3+
group: Run-Chromatic-Tests-${{ github.workflow }}-${{ github.head_ref || github.event.workflow_run.head_branch || github.run_id }}
4+
cancel-in-progress: true
5+
6+
on: push
7+
8+
env:
9+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
10+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
11+
12+
jobs:
13+
playwright-tests:
14+
name: Playwright Tests
15+
16+
# See https://runs-on.com/runners/linux/
17+
runs-on: [runs-on,runner=8cpu-linux-x64,ram=16,"run-id=${{ github.run_id }}"]
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: '3.11'
28+
cache: 'pip'
29+
cache-dependency-path: |
30+
backend/requirements/default.txt
31+
backend/requirements/dev.txt
32+
backend/requirements/model_server.txt
33+
- run: |
34+
python -m pip install --upgrade pip
35+
pip install --retries 5 --timeout 30 -r backend/requirements/default.txt
36+
pip install --retries 5 --timeout 30 -r backend/requirements/dev.txt
37+
pip install --retries 5 --timeout 30 -r backend/requirements/model_server.txt
38+
39+
- name: Setup node
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: 22
43+
44+
- name: Install node dependencies
45+
working-directory: ./web
46+
run: npm ci
47+
48+
- name: Install playwright browsers
49+
working-directory: ./web
50+
run: npx playwright install --with-deps
51+
52+
- name: Set up Docker Buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Login to Docker Hub
56+
uses: docker/login-action@v3
57+
with:
58+
username: ${{ secrets.DOCKER_USERNAME }}
59+
password: ${{ secrets.DOCKER_TOKEN }}
60+
61+
# tag every docker image with "test" so that we can spin up the correct set
62+
# of images during testing
63+
64+
# we use the runs-on cache for docker builds
65+
# in conjunction with runs-on runners, it has better speed and unlimited caching
66+
# https://runs-on.com/caching/s3-cache-for-github-actions/
67+
# https://runs-on.com/caching/docker/
68+
# https://github.com/moby/buildkit#s3-cache-experimental
69+
70+
# images are built and run locally for testing purposes. Not pushed.
71+
72+
- name: Build Web Docker image
73+
uses: ./.github/actions/custom-build-and-push
74+
with:
75+
context: ./web
76+
file: ./web/Dockerfile
77+
platforms: linux/amd64
78+
tags: danswer/danswer-web-server:test
79+
push: false
80+
load: true
81+
cache-from: type=s3,prefix=cache/${{ github.repository }}/integration-tests/web-server/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }}
82+
cache-to: type=s3,prefix=cache/${{ github.repository }}/integration-tests/web-server/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max
83+
84+
- name: Build Backend Docker image
85+
uses: ./.github/actions/custom-build-and-push
86+
with:
87+
context: ./backend
88+
file: ./backend/Dockerfile
89+
platforms: linux/amd64
90+
tags: danswer/danswer-backend:test
91+
push: false
92+
load: true
93+
cache-from: type=s3,prefix=cache/${{ github.repository }}/integration-tests/backend/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }}
94+
cache-to: type=s3,prefix=cache/${{ github.repository }}/integration-tests/backend/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max
95+
96+
- name: Build Model Server Docker image
97+
uses: ./.github/actions/custom-build-and-push
98+
with:
99+
context: ./backend
100+
file: ./backend/Dockerfile.model_server
101+
platforms: linux/amd64
102+
tags: danswer/danswer-model-server:test
103+
push: false
104+
load: true
105+
cache-from: type=s3,prefix=cache/${{ github.repository }}/integration-tests/model-server/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }}
106+
cache-to: type=s3,prefix=cache/${{ github.repository }}/integration-tests/model-server/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max
107+
108+
- name: Start Docker containers
109+
run: |
110+
cd deployment/docker_compose
111+
ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=true \
112+
AUTH_TYPE=basic \
113+
REQUIRE_EMAIL_VERIFICATION=false \
114+
DISABLE_TELEMETRY=true \
115+
IMAGE_TAG=test \
116+
docker compose -f docker-compose.dev.yml -p danswer-stack up -d
117+
id: start_docker
118+
119+
- name: Wait for service to be ready
120+
run: |
121+
echo "Starting wait-for-service script..."
122+
123+
docker logs -f danswer-stack-api_server-1 &
124+
125+
start_time=$(date +%s)
126+
timeout=300 # 5 minutes in seconds
127+
128+
while true; do
129+
current_time=$(date +%s)
130+
elapsed_time=$((current_time - start_time))
131+
132+
if [ $elapsed_time -ge $timeout ]; then
133+
echo "Timeout reached. Service did not become ready in 5 minutes."
134+
exit 1
135+
fi
136+
137+
# Use curl with error handling to ignore specific exit code 56
138+
response=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/health || echo "curl_error")
139+
140+
if [ "$response" = "200" ]; then
141+
echo "Service is ready!"
142+
break
143+
elif [ "$response" = "curl_error" ]; then
144+
echo "Curl encountered an error, possibly exit code 56. Continuing to retry..."
145+
else
146+
echo "Service not ready yet (HTTP status $response). Retrying in 5 seconds..."
147+
fi
148+
149+
sleep 5
150+
done
151+
echo "Finished waiting for service."
152+
153+
- name: Run pytest playwright test init
154+
working-directory: ./backend
155+
env:
156+
PYTEST_IGNORE_SKIP: true
157+
run: pytest -s tests/integration/tests/playwright/test_playwright.py
158+
159+
- name: Run Playwright tests
160+
working-directory: ./web
161+
run: npx playwright test
162+
163+
- uses: actions/upload-artifact@v4
164+
if: always()
165+
with:
166+
# Chromatic automatically defaults to the test-results directory.
167+
# Replace with the path to your custom directory and adjust the CHROMATIC_ARCHIVE_LOCATION environment variable accordingly.
168+
name: test-results
169+
path: ./web/test-results
170+
retention-days: 30
171+
172+
# save before stopping the containers so the logs can be captured
173+
- name: Save Docker logs
174+
if: success() || failure()
175+
run: |
176+
cd deployment/docker_compose
177+
docker compose -f docker-compose.dev.yml -p danswer-stack logs > docker-compose.log
178+
mv docker-compose.log ${{ github.workspace }}/docker-compose.log
179+
180+
- name: Upload logs
181+
if: success() || failure()
182+
uses: actions/upload-artifact@v4
183+
with:
184+
name: docker-logs
185+
path: ${{ github.workspace }}/docker-compose.log
186+
187+
- name: Stop Docker containers
188+
run: |
189+
cd deployment/docker_compose
190+
docker compose -f docker-compose.dev.yml -p danswer-stack down -v
191+
192+
chromatic-tests:
193+
name: Chromatic Tests
194+
195+
needs: playwright-tests
196+
runs-on: [runs-on,runner=8cpu-linux-x64,ram=16,"run-id=${{ github.run_id }}"]
197+
steps:
198+
- name: Checkout code
199+
uses: actions/checkout@v4
200+
with:
201+
fetch-depth: 0
202+
203+
- name: Setup node
204+
uses: actions/setup-node@v4
205+
with:
206+
node-version: 22
207+
208+
- name: Install node dependencies
209+
working-directory: ./web
210+
run: npm ci
211+
212+
- name: Download Playwright test results
213+
uses: actions/download-artifact@v4
214+
with:
215+
name: test-results
216+
path: ./web/test-results
217+
218+
- name: Run Chromatic
219+
uses: chromaui/action@latest
220+
with:
221+
playwright: true
222+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
223+
workingDir: ./web
224+
env:
225+
CHROMATIC_ARCHIVE_LOCATION: ./test-results

.github/workflows/pr-helm-chart-testing.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,6 @@ jobs:
2323
with:
2424
version: v3.14.4
2525

26-
- name: Set up Python
27-
uses: actions/setup-python@v5
28-
with:
29-
python-version: '3.11'
30-
cache: 'pip'
31-
cache-dependency-path: |
32-
backend/requirements/default.txt
33-
backend/requirements/dev.txt
34-
backend/requirements/model_server.txt
35-
- run: |
36-
python -m pip install --upgrade pip
37-
pip install --retries 5 --timeout 30 -r backend/requirements/default.txt
38-
pip install --retries 5 --timeout 30 -r backend/requirements/dev.txt
39-
pip install --retries 5 --timeout 30 -r backend/requirements/model_server.txt
40-
4126
- name: Set up chart-testing
4227
uses: helm/chart-testing-action@v2.6.1
4328

@@ -52,6 +37,22 @@ jobs:
5237
echo "changed=true" >> "$GITHUB_OUTPUT"
5338
fi
5439
40+
# rkuo: I don't think we need python?
41+
# - name: Set up Python
42+
# uses: actions/setup-python@v5
43+
# with:
44+
# python-version: '3.11'
45+
# cache: 'pip'
46+
# cache-dependency-path: |
47+
# backend/requirements/default.txt
48+
# backend/requirements/dev.txt
49+
# backend/requirements/model_server.txt
50+
# - run: |
51+
# python -m pip install --upgrade pip
52+
# pip install --retries 5 --timeout 30 -r backend/requirements/default.txt
53+
# pip install --retries 5 --timeout 30 -r backend/requirements/dev.txt
54+
# pip install --retries 5 --timeout 30 -r backend/requirements/model_server.txt
55+
5556
# lint all charts if any changes were detected
5657
- name: Run chart-testing (lint)
5758
if: steps.list-changed.outputs.changed == 'true'

.github/workflows/pr-Integration-tests.yml renamed to .github/workflows/pr-integration-tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ on:
1313
env:
1414
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
1515
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
16-
16+
CONFLUENCE_TEST_SPACE_URL: ${{ secrets.CONFLUENCE_TEST_SPACE_URL }}
17+
CONFLUENCE_USER_NAME: ${{ secrets.CONFLUENCE_USER_NAME }}
18+
CONFLUENCE_ACCESS_TOKEN: ${{ secrets.CONFLUENCE_ACCESS_TOKEN }}
19+
1720
jobs:
1821
integration-tests:
1922
# See https://runs-on.com/runners/linux/
@@ -195,9 +198,13 @@ jobs:
195198
-e API_SERVER_HOST=api_server \
196199
-e OPENAI_API_KEY=${OPENAI_API_KEY} \
197200
-e SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN} \
201+
-e CONFLUENCE_TEST_SPACE_URL=${CONFLUENCE_TEST_SPACE_URL} \
202+
-e CONFLUENCE_USER_NAME=${CONFLUENCE_USER_NAME} \
203+
-e CONFLUENCE_ACCESS_TOKEN=${CONFLUENCE_ACCESS_TOKEN} \
198204
-e TEST_WEB_HOSTNAME=test-runner \
199205
danswer/danswer-integration:test \
200-
/app/tests/integration/tests
206+
/app/tests/integration/tests \
207+
/app/tests/integration/connector_job_tests
201208
continue-on-error: true
202209
id: run_tests
203210

.github/workflows/pr-python-connector-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ env:
2020
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
2121
# Google
2222
GOOGLE_DRIVE_SERVICE_ACCOUNT_JSON_STR: ${{ secrets.GOOGLE_DRIVE_SERVICE_ACCOUNT_JSON_STR }}
23+
GOOGLE_DRIVE_OAUTH_CREDENTIALS_JSON_STR_TEST_USER_1: ${{ secrets.GOOGLE_DRIVE_OAUTH_CREDENTIALS_JSON_STR_TEST_USER_1 }}
2324
GOOGLE_DRIVE_OAUTH_CREDENTIALS_JSON_STR: ${{ secrets.GOOGLE_DRIVE_OAUTH_CREDENTIALS_JSON_STR }}
2425
GOOGLE_GMAIL_SERVICE_ACCOUNT_JSON_STR: ${{ secrets.GOOGLE_GMAIL_SERVICE_ACCOUNT_JSON_STR }}
2526
GOOGLE_GMAIL_OAUTH_CREDENTIALS_JSON_STR: ${{ secrets.GOOGLE_GMAIL_OAUTH_CREDENTIALS_JSON_STR }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
.vscode/
88
*.sw?
99
/backend/tests/regression/answer_quality/search_test_config.yaml
10+
/web/test-results/

.vscode/launch.template.jsonc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
"--loglevel=INFO",
204204
"--hostname=light@%n",
205205
"-Q",
206-
"vespa_metadata_sync,connector_deletion",
206+
"vespa_metadata_sync,connector_deletion,doc_permissions_upsert",
207207
],
208208
"presentation": {
209209
"group": "2",
@@ -232,7 +232,7 @@
232232
"--loglevel=INFO",
233233
"--hostname=heavy@%n",
234234
"-Q",
235-
"connector_pruning",
235+
"connector_pruning,connector_doc_permissions_sync,connector_external_group_sync",
236236
],
237237
"presentation": {
238238
"group": "2",

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To contribute to this project, please follow the
3232
When opening a pull request, mention related issues and feel free to tag relevant maintainers.
3333

3434
Before creating a pull request please make sure that the new changes conform to the formatting and linting requirements.
35-
See the [Formatting and Linting](#-formatting-and-linting) section for how to run these checks locally.
35+
See the [Formatting and Linting](#formatting-and-linting) section for how to run these checks locally.
3636

3737

3838
### Getting Help 🙋

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<a href="https://docs.danswer.dev/" target="_blank">
1313
<img src="https://img.shields.io/badge/docs-view-blue" alt="Documentation">
1414
</a>
15-
<a href="https://join.slack.com/t/danswer/shared_invite/zt-2lcmqw703-071hBuZBfNEOGUsLa5PXvQ" target="_blank">
15+
<a href="https://join.slack.com/t/danswer/shared_invite/zt-2twesxdr6-5iQitKZQpgq~hYIZ~dv3KA" target="_blank">
1616
<img src="https://img.shields.io/badge/slack-join-blue.svg?logo=slack" alt="Slack">
1717
</a>
1818
<a href="https://discord.gg/TDJ59cGV2X" target="_blank">
@@ -135,7 +135,7 @@ Looking to contribute? Please check out the [Contribution Guide](CONTRIBUTING.md
135135

136136
## ✨Contributors
137137

138-
<a href="https://github.com/aryn-ai/sycamore/graphs/contributors">
138+
<a href="https://github.com/danswer-ai/danswer/graphs/contributors">
139139
<img alt="contributors" src="https://contrib.rocks/image?repo=danswer-ai/danswer"/>
140140
</a>
141141

0 commit comments

Comments
 (0)