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

Add support for local repositories #49

Closed

Conversation

vishwamartur
Copy link

Related to #30

Add support for local directories in the UI and backend.

  • UI Changes:

    • Add a file input field for selecting local directories in src/templates/components/github_form.jinja.
    • Add checkboxes to select between "local directory" and "remote repo" options in src/templates/components/github_form.jinja.
  • Backend Changes:

    • Update ingest function in src/gitingest/ingest.py to handle local directories by checking if the input is a directory path.
    • Modify parse_query function in src/gitingest/parse_query.py to parse local directory paths and set appropriate query parameters.
    • Ensure the scan_directory function in src/gitingest/ingest_from_query.py includes safety limits such as MAX_DIRECTORY_DEPTH, MAX_FILES, and MAX_TOTAL_SIZE_BYTES to prevent excessive processing.
  • Documentation:

    • Update README.md to include instructions for using local directories with the CLI and Python package.
  • User Feedback:

    • Provide feedback to the user if the directory exceeds the safety limits in src/templates/components/result.jinja.

Related to cyclotruc#30

Add support for local directories in the UI and backend.

* **UI Changes:**
  - Add a file input field for selecting local directories in `src/templates/components/github_form.jinja`.
  - Add checkboxes to select between "local directory" and "remote repo" options in `src/templates/components/github_form.jinja`.

* **Backend Changes:**
  - Update `ingest` function in `src/gitingest/ingest.py` to handle local directories by checking if the input is a directory path.
  - Modify `parse_query` function in `src/gitingest/parse_query.py` to parse local directory paths and set appropriate query parameters.
  - Ensure the `scan_directory` function in `src/gitingest/ingest_from_query.py` includes safety limits such as `MAX_DIRECTORY_DEPTH`, `MAX_FILES`, and `MAX_TOTAL_SIZE_BYTES` to prevent excessive processing.

* **Documentation:**
  - Update `README.md` to include instructions for using local directories with the CLI and Python package.

* **User Feedback:**
  - Provide feedback to the user if the directory exceeds the safety limits in `src/templates/components/result.jinja`.
README.md Show resolved Hide resolved
@cyclotruc
Copy link
Owner

Very interesting work, thank you!
I'll take some time to look more into it, but I'm willing to merge this feature at some point.

One thing I can tell you already:
Since I host gitingest.com straight from this repo we need at least an option to disable this feature from and env_var and maybe make it enabled by default

But if you don't know/don't have time to add this just tell me I can do it myself

@vishwamartur
Copy link
Author

vishwamartur commented Dec 24, 2024

@cyclotruc Absolutely please take the task from here.

@cyclotruc
Copy link
Owner

@cyclotruc Absolutely please take the task from here.

To be honest I think I'm going to close this branch from now
There's been many refactors in the code and I since I have to finish this it's probably going to be easier to start from scratch

If you want you can have another try at it on the updated codebase

@cyclotruc cyclotruc closed this Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants