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

Continue doesn't respect .gitignore #1196

Open
3 tasks done
romiras opened this issue Apr 27, 2024 · 2 comments
Open
3 tasks done

Continue doesn't respect .gitignore #1196

romiras opened this issue Apr 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@romiras
Copy link

romiras commented Apr 27, 2024

Before submitting your bug report

Relevant environment info

- OS: Ubuntu Linux 20.04
- Continue: v0.8.25
- IDE: VS Code 1.88.1

Description

It seems that Continue doesn't respect .gitignore at all. Every ignored file is leaked into indexing.

To reproduce

Generate RoR application

.gitignore:

# Ignore bundler config.
/.bundle

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key

.env*

After long process of indexing du -hs ~/.continue/index reports about 144M.
After running echo 'ignore me' > tmp/ignore.txt a file indexed also.
Command sqlite3 -column ~/.continue/index/index.sqlite "select * from tag_catalog where path like '%ignore.txt'" shows:

22          /home/user/Projects/r7_app  main        chunks      /home/user/Projects/r7_app/config/master.key  20cc3b0a2108ccc75874833530a741f5b82c89c27a8876cda8933a5981cd8241  1714219436499
1494        /home/user/Projects/r7_app  main        vectordb::  /home/user/Projects/r7_app/config/master.key  20cc3b0a2108ccc75874833530a741f5b82c89c27a8876cda8933a5981cd8241  1714219449950
2900        /home/user/Projects/r7_app  main        sqliteFts   /home/user/Projects/r7_app/config/master.key  20cc3b0a2108ccc75874833530a741f5b82c89c27a8876cda8933a5981cd8241  1714219963517
4371        /home/user/Projects/r7_app  main        codeSnippe  /home/user/Projects/r7_app/config/master.key  20cc3b0a2108ccc75874833530a741f5b82c89c27a8876cda8933a5981cd8241  1714220255652
5820        /home/user/Projects/r7_app  main        chunks      /home/user/Projects/r7_app/tmp/ignore.txt     1475d3ed5223ede0fcb823689c5b83ca154066b72d5a837a1e1b3109ef1d1b6f  1714221543385
5821        /home/user/Projects/r7_app  main        vectordb::  /home/user/Projects/r7_app/tmp/ignore.txt     1475d3ed5223ede0fcb823689c5b83ca154066b72d5a837a1e1b3109ef1d1b6f  1714221543401
5822        /home/user/Projects/r7_app  main        sqliteFts   /home/user/Projects/r7_app/tmp/ignore.txt     1475d3ed5223ede0fcb823689c5b83ca154066b72d5a837a1e1b3109ef1d1b6f  1714221545311
5823        /home/user/Projects/r7_app  main        codeSnippe  /home/user/Projects/r7_app/tmp/ignore.txt     1475d3ed5223ede0fcb823689c5b83ca154066b72d5a837a1e1b3109ef1d1b6f  1714221545550

Log output

No response

@romiras romiras added the bug Something isn't working label Apr 27, 2024
@sestinj sestinj self-assigned this May 2, 2024
@sestinj
Copy link
Contributor

sestinj commented May 2, 2024

@romiras is this .gitignore in the root of your opened VS Code workspace? I just want to make sure I have all of the structural details of your folders correct so that I can test this myself. My first guess at what's happening is that we aren't correctly handling the leading '/' in .gitignore

@romiras
Copy link
Author

romiras commented May 3, 2024

@sestinj
Ruby on Rails (RoR) application has been generated by rails new r7_app --api -J -T -A --skip-hotwire just to let me and others reproduce the issue. RoR was taken just for sake of example. You can generate skeleton app for Django app or whatever else.

Output of command "tree" in root of project
.
├── app
│   ├── channels
│   │   └── application_cable
│   │       ├── channel.rb
│   │       └── connection.rb
│   ├── controllers
│   │   ├── application_controller.rb
│   │   └── concerns
│   ├── jobs
│   │   └── application_job.rb
│   ├── mailers
│   │   └── application_mailer.rb
│   ├── models
│   │   ├── application_record.rb
│   │   └── concerns
│   └── views
│       └── layouts
│           ├── mailer.html.erb
│           └── mailer.text.erb
├── bin
│   ├── bundle
│   ├── rails
│   ├── rake
│   └── setup
├── config
│   ├── application.rb
│   ├── boot.rb
│   ├── cable.yml
│   ├── credentials.yml.enc
│   ├── database.yml
│   ├── environment.rb
│   ├── environments
│   │   ├── development.rb
│   │   ├── production.rb
│   │   └── test.rb
│   ├── initializers
│   │   ├── cors.rb
│   │   ├── filter_parameter_logging.rb
│   │   └── inflections.rb
│   ├── locales
│   │   └── en.yml
│   ├── master.key
│   ├── puma.rb
│   ├── routes.rb
│   └── storage.yml
├── config.ru
├── db
│   ├── development.sqlite3
│   ├── schema.rb
│   ├── seeds.rb
│   └── test.sqlite3
├── Gemfile
├── Gemfile.lock
├── lib
│   └── tasks
├── log
│   └── development.log
├── public
│   └── robots.txt
├── Rakefile
├── README.md
├── storage
├── tmp
│   ├── cache
│   │   └── bootsnap
│   │       ├── compile-cache-iseq
│   │       │   ├── 00
│   │       │   │   ├── 0324cd82370db3
│   │       │   │   └── 2bea6d7542e7b1
│   │       │   ├── 01
│   │       │   │   ├── 87a7d114483147
│   │       │   │   ├── baa583cbd8a735
│   │       │   │   └── d3f77b581741b6
... (with many other temporary directories and files)
│   │       │   ├── fe
│   │       │   │   ├── 2381ed85da335a
│   │       │   │   ├── 5a99b7a28da7d1
│   │       │   │   └── 6acadc23be5f36
│   │       │   └── ff
│   │       │       ├── 32b852982880e8
│   │       │       ├── d8ce61cef93021
│   │       │       ├── dd9911203bbb8a
│   │       │       └── e84f0efbda8321
│   │       └── load-path-cache
│   ├── development_secret.txt
│   ├── ignore.txt
│   ├── pids
│   └── storage
└── vendor

285 directories, 1467 files

File .gitignore also located in root of project.

As result of indexing we can see all tmp, secret file, ... everything that we don't expect... leaked into ~/.continue/index/index.sqlite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants