Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
5fb6d51
commit
Anchel123 Sep 30, 2024
b652d8b
remove header border
Anchel123 Sep 30, 2024
a80b174
restyle
Anchel123 Oct 28, 2024
ec11a2a
add hover card and fix show path and search
Anchel123 Oct 29, 2024
ecbef2a
Fix Typo in Chat Component
gkorland Nov 1, 2024
e7c8d76
replace localhost in ip
Anchel123 Nov 5, 2024
706b487
Merge branch 'restyling' of https://github.com/FalkorDB/code-graph in…
Anchel123 Nov 5, 2024
fbe93b2
improve styling and add multi paths messages
Anchel123 Nov 5, 2024
3d0ad9e
change colors and restyle chat
Anchel123 Nov 5, 2024
98f3cb6
fix type err
Anchel123 Nov 5, 2024
56ce407
fix alert on gibberish insert in search
Anchel123 Nov 5, 2024
d80b8f3
open suggestions only when there is suggestions and add submit in sea…
Anchel123 Nov 6, 2024
9920291
add submit in search and change selection box style
Anchel123 Nov 6, 2024
59288b3
init (#166, #167, #168, #171)
Naseem77 Nov 6, 2024
f326aff
Implement NavBar POM and redirection test (#169, #170)
Naseem77 Nov 6, 2024
89710a4
Update playwright.yml
Naseem77 Nov 7, 2024
e5bd783
Update playwright.yml
swilly22 Nov 7, 2024
4a8e27f
Update playwright.yml
swilly22 Nov 7, 2024
f4d5bb3
Update playwright.yml
swilly22 Nov 7, 2024
bc035f1
Update playwright.yml
swilly22 Nov 7, 2024
c0c7c70
Update playwright.yml
Naseem77 Nov 7, 2024
7e3a47b
fix ssh agent start
dudizimber Nov 7, 2024
5967b96
trying fix for deploy keys
dudizimber Nov 7, 2024
c3d8cbb
Install Poetry before running backend setup
Naseem77 Nov 7, 2024
d30cfe9
Bump @types/node from 22.5.4 to 22.9.0
dependabot[bot] Nov 11, 2024
0d00a00
Bump eslint-config-next from 14.2.5 to 15.0.3
dependabot[bot] Nov 11, 2024
fe926f1
Implement API logic layer with corresponding tests
Naseem77 Nov 11, 2024
ffec1fe
Fix backend setup to properly run Flask
Naseem77 Nov 11, 2024
0180c14
Update playwright.yml
Naseem77 Nov 11, 2024
74fff0a
Update playwright.yml
Naseem77 Nov 11, 2024
5ccad75
Update playwright.yml
Naseem77 Nov 11, 2024
ff67b5d
fix: run flask server in the background
Naseem77 Nov 11, 2024
8f85cdd
remove commit list and change the chat style
Anchel123 Nov 11, 2024
24d9943
add env variables for api keys
Naseem77 Nov 12, 2024
1426b64
final fix
Anchel123 Nov 12, 2024
6c72394
commit
Anchel123 Nov 12, 2024
96e29aa
commit
Anchel123 Nov 12, 2024
e447054
fix search input
Anchel123 Nov 12, 2024
47dbf29
Merge branch 'restyling' into api-logic-tests
Naseem77 Nov 12, 2024
d35231f
chat tests (#189, #190, #191)
Naseem77 Nov 12, 2024
6d966cf
chat tests (#195, #196) path between nodes
Naseem77 Nov 14, 2024
416558c
navBar test (#197, #198, 199)
Naseem77 Nov 14, 2024
938dec2
commit
Anchel123 Nov 14, 2024
679b236
fix commit list
Anchel123 Nov 14, 2024
d1de315
commit
Anchel123 Nov 14, 2024
5626cef
Merge pull request #188 from FalkorDB/restyling
Anchel123 Nov 14, 2024
f03f71a
fix env variable
Anchel123 Nov 14, 2024
5ed94e9
remove unneccery buttons
Anchel123 Nov 14, 2024
2659794
remove apis
Anchel123 Nov 14, 2024
a7062a7
Merge branch 'staging' into remove-for-live
gkorland Nov 14, 2024
2c594cd
Merge pull request #201 from FalkorDB/remove-for-live
gkorland Nov 14, 2024
8b2b92c
Merge branch 'staging' into dependabot/npm_and_yarn/types/node-22.9.0
gkorland Nov 16, 2024
4735ebc
Merge branch 'staging' into dependabot/npm_and_yarn/eslint-config-nex…
gkorland Nov 16, 2024
fb1a044
Merge pull request #175 from FalkorDB/dependabot/npm_and_yarn/types/n…
gkorland Nov 16, 2024
0d6d01f
Merge branch 'staging' into dependabot/npm_and_yarn/eslint-config-nex…
gkorland Nov 17, 2024
aac5628
Merge pull request #178 from FalkorDB/dependabot/npm_and_yarn/eslint-…
gkorland Nov 17, 2024
a041e6b
udpate nextjs and eslint
gkorland Nov 17, 2024
b339c9a
Merge pull request #205 from FalkorDB/deps-update
AviAvni Nov 17, 2024
0876b0e
Update code-graph.tsx
swilly22 Nov 17, 2024
e20d811
add tip dropdown
Anchel123 Nov 17, 2024
51001e4
reorganize the apis
Anchel123 Nov 17, 2024
08a65f7
fix chat response
Naseem77 Nov 17, 2024
6a3af9a
Bump @types/react-dom from 18.3.0 to 18.3.1
dependabot[bot] Nov 18, 2024
f574f45
Merge pull request #208 from FalkorDB/fixChat
gkorland Nov 18, 2024
9abe0d8
commit
Anchel123 Nov 18, 2024
23eaec2
Merge pull request #210 from FalkorDB/use-environment-variable
Anchel123 Nov 18, 2024
5afa2ea
Merge branch 'staging' into api-logic-tests
Naseem77 Nov 18, 2024
00f26d3
playwright tests for staging
Naseem77 Nov 18, 2024
140c1cd
Merge branch 'staging' into dependabot/npm_and_yarn/types/react-dom-1…
gkorland Nov 18, 2024
bbea97d
Fix malformed JSON in package-lock.json
gkorland Nov 18, 2024
c1088e8
Updates from editor
gkorland Nov 18, 2024
a24fdff
update tests
Naseem77 Nov 18, 2024
f684610
Merge pull request #209 from FalkorDB/dependabot/npm_and_yarn/types/r…
gkorland Nov 18, 2024
cca770a
add ,multi selection menu
Anchel123 Nov 18, 2024
8dd162b
Update codeGraph.ts
Naseem77 Nov 18, 2024
bb54cec
update backend to api instead of code_graph
Naseem77 Nov 18, 2024
b4428ef
add suggestions and little fixes
Anchel123 Nov 18, 2024
34d00ff
don't call the handel select if the elements and the length match
Anchel123 Nov 18, 2024
0c2cea7
Merge branch 'staging' into reorginize-api-folder
Anchel123 Nov 18, 2024
f66f7e7
remove unnecessary dependencies
Anchel123 Nov 18, 2024
d8439ee
add requests install
Naseem77 Nov 18, 2024
19b2c7e
Bump tailwindcss from 3.4.9 to 3.4.15
dependabot[bot] Nov 19, 2024
b69af5b
update flask command
Naseem77 Nov 19, 2024
ce859ce
adding requests
Naseem77 Nov 19, 2024
fb34075
ensure dropdown is visible before clicking
Naseem77 Nov 19, 2024
9ff7209
update chat & visible before clicking
Naseem77 Nov 19, 2024
63507b0
remove backend cloning and use vercel
Naseem77 Nov 20, 2024
abbb6e2
move environment variables
Naseem77 Nov 20, 2024
1042013
update locaters & test(#227)
Naseem77 Nov 20, 2024
290d430
Merge branch 'staging' into api-logic-tests
Naseem77 Nov 20, 2024
fe1efe9
Merge pull request #226 from FalkorDB/dependabot/npm_and_yarn/staging…
gkorland Nov 20, 2024
9699aee
Add data-name attribute to search bar
Naseem77 Nov 21, 2024
9f10de2
add tip
Anchel123 Nov 21, 2024
3e00c72
fix data panel
Anchel123 Nov 21, 2024
5f8cf6d
close element menu on scroll
Anchel123 Nov 21, 2024
9a10a98
fix build
Anchel123 Nov 21, 2024
ff49633
Merge branch 'staging' into add-tip
Anchel123 Nov 21, 2024
1701a65
Merge branch 'staging' into fix-data-panel
Anchel123 Nov 21, 2024
b74c5b8
fix build
Anchel123 Nov 21, 2024
3b01620
fix build
Anchel123 Nov 21, 2024
51e8366
tests for searchBar (#234, #235, #236, #237, #238, #239)
Naseem77 Nov 21, 2024
9e01868
Merge pull request #231 from FalkorDB/close-menu-on-scroll
AviAvni Nov 21, 2024
98c709e
Merge branch 'staging' into add-tip
Anchel123 Nov 21, 2024
2ad1bf6
Merge branch 'staging' into fix-data-panel
Anchel123 Nov 21, 2024
83f9167
Merge pull request #232 from FalkorDB/add-tip
AviAvni Nov 21, 2024
0c51b37
adding delay and reduce loop amount for chat tests
Naseem77 Nov 21, 2024
9060837
Merge branch 'staging' into fix-data-panel
Anchel123 Nov 24, 2024
58538cd
Merge pull request #233 from FalkorDB/fix-data-panel
AviAvni Nov 24, 2024
fd56661
Merge branch 'staging' into code-graph-ui-tests
AviAvni Nov 24, 2024
342b836
Merge branch 'staging' into api-logic-tests
AviAvni Nov 24, 2024
5ce70a0
Merge pull request #184 from FalkorDB/api-logic-tests
AviAvni Nov 24, 2024
271e066
Merge branch 'staging' into code-graph-ui-tests
AviAvni Nov 24, 2024
a08ed4d
Bump @radix-ui/react-select from 2.1.1 to 2.1.2
dependabot[bot] Nov 24, 2024
236c048
Bump @radix-ui/react-toast from 1.2.1 to 1.2.2
dependabot[bot] Nov 24, 2024
4f4a6ec
Merge pull request #240 from FalkorDB/code-graph-ui-tests
AviAvni Nov 24, 2024
a174b12
change node ids to number
Anchel123 Nov 24, 2024
c3f9fa2
REMOVE LOG
Anchel123 Nov 25, 2024
ea49177
Merge pull request #243 from FalkorDB/change-node-ids-to-number
AviAvni Nov 25, 2024
e2ea644
Merge branch 'staging' into fix-path-selection
AviAvni Nov 25, 2024
64ffa80
fix collapsed
Anchel123 Nov 25, 2024
93562a7
Merge branch 'staging' into fix-collapsed
Anchel123 Nov 25, 2024
3605943
fix build
Anchel123 Nov 25, 2024
7272707
fix suggestions box
Anchel123 Nov 27, 2024
da92572
Merge branch 'staging' into add-seggustions-in-chat
Anchel123 Nov 27, 2024
7b99256
Merge pull request #214 from FalkorDB/fix-path-selection
Anchel123 Nov 27, 2024
5ea436e
Merge branch 'staging' into add-seggustions-in-chat
Anchel123 Nov 27, 2024
7803c05
Merge branch 'staging' into reorginize-api-folder
Anchel123 Nov 27, 2024
79ea7c7
Merge branch 'staging' into fix-collapsed
Anchel123 Nov 27, 2024
3aecebc
fix
Anchel123 Nov 27, 2024
ef414af
Merge branch 'add-seggustions-in-chat' of https://github.com/FalkorDB…
Anchel123 Nov 27, 2024
59563b4
fix tests
Anchel123 Nov 27, 2024
e398242
fix test
Anchel123 Nov 27, 2024
7091199
fix sugg box
Anchel123 Nov 27, 2024
086ec9d
Merge pull request #215 from FalkorDB/add-seggustions-in-chat
AviAvni Nov 27, 2024
beef368
Merge branch 'staging' into reorginize-api-folder
AviAvni Nov 27, 2024
02d5fc6
Merge pull request #217 from FalkorDB/reorginize-api-folder
Anchel123 Nov 27, 2024
8369d88
Merge branch 'staging' into fix-collapsed
Anchel123 Nov 27, 2024
cacb58d
Merge pull request #245 from FalkorDB/fix-collapsed
Anchel123 Nov 27, 2024
2e24de9
add logs and secure missing variables
Anchel123 Nov 28, 2024
c97250b
fix coderabbitai nots
Anchel123 Nov 28, 2024
f7f7d01
remove cache from all fetch to code-graph-backend
Anchel123 Nov 28, 2024
f7a7a62
fix search
Anchel123 Nov 28, 2024
8123fad
uncommit change
Anchel123 Nov 28, 2024
1433065
fix scroll in input suggestions
Anchel123 Nov 28, 2024
695f432
Merge branch 'staging' into dependabot/npm_and_yarn/staging/radix-ui/…
gkorland Nov 28, 2024
984578c
Merge branch 'staging' into dependabot/npm_and_yarn/staging/radix-ui/…
gkorland Nov 28, 2024
2d39235
Merge pull request #224 from FalkorDB/dependabot/npm_and_yarn/staging…
gkorland Nov 28, 2024
b62729a
Merge branch 'staging' into dependabot/npm_and_yarn/staging/radix-ui/…
gkorland Nov 28, 2024
6dee0df
Merge pull request #223 from FalkorDB/dependabot/npm_and_yarn/staging…
gkorland Nov 28, 2024
f87bfce
Merge branch 'staging' into fix-coderabbitai
gkorland Nov 28, 2024
224b080
Bump typescript from 5.5.4 to 5.7.2
dependabot[bot] Nov 28, 2024
9627f10
Bump next from 14.2.8 to 15.0.3
dependabot[bot] Nov 28, 2024
d578923
Bump @types/node from 22.9.0 to 22.10.1
dependabot[bot] Nov 28, 2024
52fca1b
update data for specialCharacters
Naseem77 Nov 28, 2024
3b264f4
Bump @types/react from 18.3.3 to 18.3.12
dependabot[bot] Nov 29, 2024
9d29138
Bump cytoscape from 3.30.2 to 3.30.4
dependabot[bot] Nov 29, 2024
14421e8
Merge branch 'staging' into no-cache
Anchel123 Nov 29, 2024
7d73831
Merge branch 'staging' into create-logs-and-secure-missing-variables
Anchel123 Nov 29, 2024
d1c0523
Merge pull request #251 from FalkorDB/no-cache
swilly22 Nov 29, 2024
e0d6ef3
Merge branch 'staging' into create-logs-and-secure-missing-variables
Anchel123 Dec 1, 2024
efa22f0
Merge branch 'staging' into fix-coderabbitai
Anchel123 Dec 1, 2024
c286434
un commit
Anchel123 Dec 1, 2024
fae3c40
commit
Anchel123 Dec 1, 2024
873b54b
add comma
Anchel123 Dec 1, 2024
f4391bf
Merge pull request #249 from FalkorDB/fix-coderabbitai
AviAvni Dec 1, 2024
4b007b1
Merge branch 'staging' into create-logs-and-secure-missing-variables
AviAvni Dec 1, 2024
521e8fe
Merge pull request #253 from FalkorDB/create-logs-and-secure-missing-…
Anchel123 Dec 1, 2024
56053c3
remove last path message
Anchel123 Dec 1, 2024
3b224dc
commit
Anchel123 Dec 1, 2024
a0b557f
Merge branch 'main' into staging
Anchel123 Dec 1, 2024
41c7ea8
Merge branch 'staging' into fix-remove-last-path-message
AviAvni Dec 1, 2024
bb6984f
canvas cluster analysis and related tests
Naseem77 Dec 1, 2024
867b0bf
Merge pull request #271 from FalkorDB/fix-remove-last-path-message
AviAvni Dec 1, 2024
4e50f50
Merge branch 'staging' into dependabot/npm_and_yarn/staging/cytoscape…
gkorland Dec 1, 2024
3456201
Merge branch 'staging' into dependabot/npm_and_yarn/staging/types/rea…
gkorland Dec 1, 2024
56dc83c
Add client-side validation for special characters in search bar
Naseem77 Dec 1, 2024
bcbae95
Merge branch 'staging' into dependabot/npm_and_yarn/staging/types/nod…
Anchel123 Dec 1, 2024
c0920ba
Merge branch 'staging' into dependabot/npm_and_yarn/staging/typescrip…
Anchel123 Dec 1, 2024
9c1533a
Merge pull request #269 from FalkorDB/dependabot/npm_and_yarn/staging…
gkorland Dec 1, 2024
01eedde
Merge branch 'staging' into dependabot/npm_and_yarn/staging/types/rea…
gkorland Dec 1, 2024
d2de20c
Merge branch 'staging' into dependabot/npm_and_yarn/next-15.0.3
gkorland Dec 1, 2024
0323a44
Merge branch 'staging' into dependabot/npm_and_yarn/staging/types/nod…
gkorland Dec 1, 2024
ab0b6b8
Merge branch 'staging' into dependabot/npm_and_yarn/staging/typescrip…
gkorland Dec 1, 2024
d48f176
Merge pull request #241 from FalkorDB/dependabot/npm_and_yarn/staging…
gkorland Dec 1, 2024
003f2c2
Merge branch 'staging' into dependabot/npm_and_yarn/staging/types/nod…
gkorland Dec 1, 2024
c5a84be
Merge branch 'staging' into dependabot/npm_and_yarn/staging/types/rea…
Anchel123 Dec 1, 2024
5802392
Merge pull request #267 from FalkorDB/dependabot/npm_and_yarn/staging…
gkorland Dec 1, 2024
f812219
Merge branch 'staging' into dependabot/npm_and_yarn/staging/types/rea…
Anchel123 Dec 1, 2024
6c11ae7
Merge branch 'staging' into SearchBarValidation
Anchel123 Dec 1, 2024
63df81d
Merge branch 'staging' into CanvasAnalysisAndTests
Anchel123 Dec 1, 2024
2646e5a
Merge pull request #268 from FalkorDB/dependabot/npm_and_yarn/staging…
Anchel123 Dec 1, 2024
cc09855
Merge branch 'staging' into dependabot/npm_and_yarn/next-15.0.3
Anchel123 Dec 1, 2024
ad43d84
fix validate message
Anchel123 Dec 1, 2024
e5e1596
Merge branch 'staging' into SearchBarValidation
Anchel123 Dec 1, 2024
6bd66b3
change all api params to promise
Anchel123 Dec 1, 2024
e6d7aef
un commit
Anchel123 Dec 1, 2024
0add821
Merge pull request #176 from FalkorDB/dependabot/npm_and_yarn/next-15…
Anchel123 Dec 1, 2024
59ecdc3
Merge branch 'staging' into SearchBarValidation
Anchel123 Dec 1, 2024
a4ad276
update searchBar test
Naseem77 Dec 1, 2024
19fcbd6
Merge branch 'SearchBarValidation' of https://github.com/FalkorDB/cod…
Naseem77 Dec 1, 2024
ed2b374
Merge pull request #275 from FalkorDB/SearchBarValidation
Anchel123 Dec 2, 2024
b36af0a
Merge branch 'staging' into CanvasAnalysisAndTests
Anchel123 Dec 2, 2024
9a72748
Merge pull request #273 from FalkorDB/CanvasAnalysisAndTests
Anchel123 Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .env.local.template

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Playwright Tests
on:
push:
branches: [ main, staging ]
pull_request:
branches: [ main, staging ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
services:
falkordb:
image: falkordb/falkordb:latest
ports:
- 6379:6379
Comment on lines +11 to +15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Improve service container reliability

  1. Using latest tag can lead to non-deterministic builds. Pin to a specific version.
  2. Add a health check to ensure FalkorDB is ready before running tests.
      falkordb:
-        image: falkordb/falkordb:latest
+        image: falkordb/falkordb:2.4.0  # Replace with actual stable version
        ports:
          - 6379:6379
+        options: >-
+          --health-cmd "redis-cli ping"
+          --health-interval 10s
+          --health-timeout 5s
+          --health-retries 5
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
services:
falkordb:
image: falkordb/falkordb:latest
ports:
- 6379:6379
services:
falkordb:
image: falkordb/falkordb:2.4.0 # Replace with actual stable version
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Set up environment variables and run tests
env:
FALKORDB_URL: ${{ secrets.FALKORDB_URL }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
NEXT_PUBLIC_MODE: UNLIMITED
BACKEND_URL: ${{ secrets.BACKEND_URL }}
run: |
npm install
npm run build
NEXTAUTH_SECRET=SECRET npm start & npx playwright test --reporter=dot,list
Comment on lines +25 to +35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Several issues in test execution setup

  1. npm install is redundant after npm ci
  2. Hardcoding NEXTAUTH_SECRET=SECRET is a security risk
  3. Running the app and tests in a single command makes it harder to debug failures
-      run: |
-        npm install
-        npm run build
-        NEXTAUTH_SECRET=SECRET npm start & npx playwright test --reporter=dot,list
+      env:
+        NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
+      run: |
+        npm run build
+        npm start &
+        echo "Waiting for app to start..."
+        npx wait-on http://localhost:3000
+        npx playwright test --reporter=dot,list
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Set up environment variables and run tests
env:
FALKORDB_URL: ${{ secrets.FALKORDB_URL }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
NEXT_PUBLIC_MODE: UNLIMITED
BACKEND_URL: ${{ secrets.BACKEND_URL }}
run: |
npm install
npm run build
NEXTAUTH_SECRET=SECRET npm start & npx playwright test --reporter=dot,list
- name: Set up environment variables and run tests
env:
FALKORDB_URL: ${{ secrets.FALKORDB_URL }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
NEXT_PUBLIC_MODE: UNLIMITED
BACKEND_URL: ${{ secrets.BACKEND_URL }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
run: |
npm run build
npm start &
echo "Waiting for app to start..."
npx wait-on http://localhost:3000
npx playwright test --reporter=dot,list

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ next-env.d.ts


# vscode
/.vscode/
/.vscode/
node_modules/
Comment on lines +40 to +41
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove duplicate entries

The following entries are duplicates of existing patterns in the file:

  • /.vscode/ is already defined
  • node_modules/ is already covered by /node_modules at the top of the file

Apply this diff to remove the duplicates:

-/.vscode/
-node_modules/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/.vscode/
node_modules/

/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
39 changes: 39 additions & 0 deletions app/api/chat/[graph]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { NextRequest, NextResponse } from "next/server"
import { getEnvVariables } from "../../utils"


export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = (await params).graph
const msg = request.nextUrl.searchParams.get('msg')

try {

if (!msg) {
throw new Error("Message parameter is required")
}

const { url, token } = getEnvVariables()

const result = await fetch(`${url}/chat`, {
method: 'POST',
body: JSON.stringify({ repo, msg }),
headers: {
"Authorization": token,
"Content-Type": 'application/json'
},
cache: 'no-store'
})

if (!result.ok) {
throw new Error(await result.text())
}

const json = await result.json()

return NextResponse.json({ result: json }, { status: 200 })
Comment on lines +28 to +34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Improve response handling security

The current response handling could expose sensitive information or be vulnerable to large responses:

  1. Missing Content-Type verification
  2. No response size limits
  3. Raw backend error messages exposed to client

Implement safer response handling:

     if (!result.ok) {
-        throw new Error(await result.text())
+        const errorText = await result.text()
+        console.error(`Backend error: ${errorText}`)
+        throw new Error('An error occurred while processing your request')
     }

+    const contentType = result.headers.get('content-type')
+    if (!contentType?.includes('application/json')) {
+        throw new Error('Invalid response type from backend')
+    }
+
     const json = await result.json()

Committable suggestion skipped: line range outside the PR's diff.

} catch (err) {
console.error(err)
return NextResponse.json((err as Error).message, { status: 400 })
}
}
55 changes: 38 additions & 17 deletions app/api/repo/[graph]/[node]/route.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,45 @@
import { FalkorDB, Graph } from "falkordb";
import { getEnvVariables } from "@/app/api/utils";
import { NextRequest, NextResponse } from "next/server";

export async function GET(request: NextRequest, { params }: { params: { graph: string, node: string } }) {

const nodeId = parseInt(params.node);
const graphId = params.graph;
export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string, node: string }> }) {

const db = await FalkorDB.connect({url: process.env.FALKORDB_URL || 'falkor://localhost:6379',});
const graph = db.selectGraph(graphId);
const p = await params;
Comment on lines +4 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add input validation for 'repo' and 'src' parameters

The 'repo' and 'src' parameters are used without validation. Ensure they are valid to prevent potential errors.

Apply this diff:

     const p = await params;
     const repo = p.graph;
     const src = Number(p.node);
+    if (!repo || typeof repo !== 'string' || !repo.trim()) {
+        throw new Error("Repository name is required and must be a non-empty string");
+    }
+    if (isNaN(src)) {
+        throw new Error("Source node ID is required and must be a valid number");
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string, node: string }> }) {
const db = await FalkorDB.connect({url: process.env.FALKORDB_URL || 'falkor://localhost:6379',});
const graph = db.selectGraph(graphId);
const p = await params;
export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string, node: string }> }) {
const p = await params;
const repo = p.graph;
const src = Number(p.node);
if (!repo || typeof repo !== 'string' || !repo.trim()) {
throw new Error("Repository name is required and must be a non-empty string");
}
if (isNaN(src)) {
throw new Error("Source node ID is required and must be a valid number");
}


// Get node's neighbors
const q_params = {nodeId: nodeId};
const query = `MATCH (src)-[e]-(n)
WHERE ID(src) = $nodeId
RETURN collect(distinct { label:labels(n)[0], id:ID(n), name: n.name } ) as nodes,
collect( { src: ID(startNode(e)), id: ID(e), dest: ID(endNode(e)), type: type(e) } ) as edges`;
const repo = p.graph;
const src = Number(p.node);
const dest = Number(request.nextUrl.searchParams.get('targetId'))

let res: any = await graph.query(query, { params: q_params });
let nodes = res.data[0]['nodes'];
let edges = res.data[0]['edges'];
try {

return NextResponse.json({ id: graphId, nodes: nodes, edges: edges }, { status: 200 })
if (!dest) {
throw new Error("targetId is required");
}

const { url, token } = getEnvVariables()

const result = await fetch(`${url}/find_paths`, {
method: 'POST',
headers: {
"Authorization": token,
'Content-Type': 'application/json'
},
body: JSON.stringify({
repo,
src,
dest
}),
cache: 'no-store'
})

if (!result.ok) {
throw new Error(await result.text())
}

const json = await result.json()

return NextResponse.json({ result: json }, { status: 200 })
} catch (err) {
console.error(err)
return NextResponse.json((err as Error).message, { status: 400 })
Comment on lines +42 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Avoid exposing internal error messages to the client

Returning internal error messages can leak sensitive information. Return a generic error message and log the detailed error internally.

Apply this diff:

         console.error(err)
-        return NextResponse.json((err as Error).message, { status: 400 })
+        return NextResponse.json({ message: 'An error occurred while processing your request' }, { status: 500 })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.error(err)
return NextResponse.json((err as Error).message, { status: 400 })
console.error(err)
return NextResponse.json({ message: 'An error occurred while processing your request' }, { status: 500 })

}
}
37 changes: 37 additions & 0 deletions app/api/repo/[graph]/commit/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { getEnvVariables } from "@/app/api/utils";
import { NextRequest, NextResponse } from "next/server";

export async function GET(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = (await params).graph

Comment on lines +4 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add input validation for the 'repo' parameter

The 'repo' parameter is used without validation. Ensure that 'repo' is not null or improperly formatted to prevent potential errors or security issues.

Apply this diff:

     const repo = (await params).graph
+    if (!repo || typeof repo !== 'string' || !repo.trim()) {
+        throw new Error("Repository name is required and must be a non-empty string")
+    }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export async function GET(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {
const repo = (await params).graph
export async function GET(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {
const repo = (await params).graph
if (!repo || typeof repo !== 'string' || !repo.trim()) {
throw new Error("Repository name is required and must be a non-empty string")
}

try {

const { url, token } = getEnvVariables()

const result = await fetch(`${url}/list_commits`, {
method: 'POST',
body: JSON.stringify({ repo }),
headers: {
"Authorization": token,
"Content-Type": 'application/json'
},
cache: 'no-store'
})

if (!result.ok) {
throw new Error(await result.text())
}

const json = await result.json()

return NextResponse.json({ result: json }, { status: 200 })
} catch (err) {
console.error(err)
return NextResponse.json((err as Error).message, { status: 400 })
}
}

export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

}
33 changes: 33 additions & 0 deletions app/api/repo/[graph]/info/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { NextRequest, NextResponse } from "next/server";
import { getEnvVariables } from "@/app/api/utils";

export async function GET(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = (await params).graph

try {

const { url, token } = getEnvVariables();

const result = await fetch(`${url}/repo_info`, {
method: 'POST',
body: JSON.stringify({ repo }),
headers: {
"Authorization": token,
"Content-Type": 'application/json'
},
cache: 'no-store'
})

if (!result.ok) {
throw new Error(await result.text())
}

const json = await result.json()

return NextResponse.json({ result: json }, { status: 200 })
} catch (err) {
console.error(err)
return NextResponse.json((err as Error).message, { status: 400 })
}
}
Comment on lines +4 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Based on the comprehensive search results, I can now provide a final response:

Rate limiting implementation needed

The codebase currently lacks any rate limiting mechanisms for the API endpoints. This could potentially expose the service to abuse. Specific concerns:

  • No middleware implementing rate limiting
  • No rate limiting packages installed (like express-rate-limit or similar)
  • All API routes are unprotected against excessive requests
  • While authentication is present via tokens, there's no request frequency control
🔗 Analysis chain

Verify rate limiting implementation

The endpoint might need rate limiting to prevent abuse.


Let me check for rate limiting implementations using different search patterns and also look for any middleware configurations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if rate limiting is implemented elsewhere in the codebase
echo "Searching for rate limiting implementations..."

# Look for common rate limiting patterns
rg -i "rate.?limit|throttle" --type ts

# Check for common rate limiting middleware
rg -i "middleware.*rate" --type ts

# Look for rate limiting packages in package.json
if [ -f "package.json" ]; then
    echo "Checking package.json for rate limiting packages..."
    cat package.json | grep -i "rate-limit"
fi

Length of output: 359


Script:

#!/bin/bash
# Search for middleware configurations
echo "Checking middleware configurations..."
fd middleware -e ts -e js --exec cat {}

# Look for API route configurations
echo "Checking API route configurations..."
fd route.ts$ --exec cat {}

# Check for any config files that might contain rate limiting
echo "Checking config files..."
fd config -e ts -e js --exec cat {}

# Check package.json content for any security or middleware packages
echo "Checking package.json dependencies..."
cat package.json

Length of output: 15722

34 changes: 34 additions & 0 deletions app/api/repo/[graph]/neighbors/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { NextRequest, NextResponse } from "next/server";
import { getEnvVariables } from "@/app/api/utils";

export async function POST(request: NextRequest, { params }: { params: Promise<{ graph: string }> }) {

const repo = (await params).graph;
const node_ids = (await request.json()).nodeIds.map((id: string) => Number(id));

try {

const { url, token } = getEnvVariables();

if (node_ids.length === 0) {
throw new Error("nodeIds is required");
}

const result = await fetch(`${url}/get_neighbors`, {
method: 'POST',
body: JSON.stringify({ node_ids, repo }),
headers: {
"Content-Type": 'application/json',
"Authorization": token,
},
cache: 'no-store'
})

const json = await result.json()

return NextResponse.json({ result: json }, { status: 200 })
} catch (err) {
console.error(err)
return NextResponse.json((err as Error).message, { status: 400 })
}
}
Loading
Loading