Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid duplicate Documents for same file #330

Open
varungandhi-src opened this issue Mar 11, 2024 · 4 comments · May be fixed by #331
Open

Avoid duplicate Documents for same file #330

varungandhi-src opened this issue Mar 11, 2024 · 4 comments · May be fixed by #331

Comments

@varungandhi-src
Copy link
Contributor

varungandhi-src commented Mar 11, 2024

Originally flagged by @Strum355 in Slack:

It looks like we emit multiple SCIP Documents in the same Index for the same file, but with different relative paths. Out of these, some relative paths are wrong because they are not normalized.

We should make sure to normalize all relative paths and not do duplicate work for the same file.

Example URL

image

Scope

  1. Normalize server side
  2. No db migration
@varungandhi-src varungandhi-src changed the title Correctly handle relative paths in package.json files Avoid duplicate Documents for same file Mar 11, 2024
@varungandhi-src
Copy link
Contributor Author

Hmm, I tried indexing the linked repo with the bad paths, and I cannot reproduce the issue:

git clone https://github.com/deepak2431/cody.git
cd cody && git checkout f32232e6aae6025ea2dc53af9288988c5b6a42eb
node ~/Code/scip-typescript/dist/src/main.js index --pnpm-workspaces --no-global-caches
~/Code/scip/scip print --json index.scip | jq '.documents[].relativePath' | grep '\.\.'

Would need to look deeper into where these bad paths are coming from.

@kritzcreek
Copy link
Contributor

Another instance of this here: https://github.com/sourcegraph/sourcegraph/issues/61245

@mmanela
Copy link
Contributor

mmanela commented Oct 17, 2024

I believe a minimal repo that will have this issue is shown in this sample I made. The key is having a child folder that uses the references node in tsconfig to refer to the parent folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants