deepwiki-open icon indicating copy to clipboard operation
deepwiki-open copied to clipboard

Feature Request: Add filter for files

Open mkoeck opened this issue 1 year ago • 1 comments

Description:

When attempting to generate a wiki for a large repository using DeepWiki-Open, the initial step of fetching the repository's file structure often fails.

Steps to Reproduce:

  1. Run DeepWiki-Open (e.g., using docker-compose up).
  2. Enter the name or URL of a very large public GitHub or GitLab repository in the input field (e.g., a repository with tens or hundreds of thousands of files).
  3. Click "Generate Wiki".

Expected Behavior:

The application should successfully retrieve the repository's file structure and proceed to the next steps (determining wiki structure, generating page content).

Actual Behavior:

Generating the repository structure fails. Browser console logs or application logs show an error message indicating a failure to fetch the repository structure, often a 404 Not Found error originating from the GitHub or GitLab API endpoint used to retrieve the recursive file tree.

Example Error (GitHub):

Error fetching repository structure: Status: 404, Response: {
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/git/trees#get-a-tree",
  "status": "404"
}

Problem Context:

The current implementation in the frontend (src/app/page.tsx) relies on fetching the complete file tree recursively using the GitHub API (/repos/{owner}/{repo}/git/trees/{branch}?recursive=1) or the equivalent GitLab API. These API endpoints have limitations and are known to fail (timeout or return errors like 404) for repositories containing a very large number of files. The fetched file tree is then used in a prompt for an AI model to determine the wiki structure.

Suggested Improvement:

The backend service (api/) already clones the target repository locally into the ~/.adalflow/repos/ directory as part of its data pipeline for analysis and embedding generation.

Consider implementing a fallback mechanism, or potentially a primary strategy: if fetching the file tree via the external API fails (or perhaps regardless), the application should attempt to generate the necessary file list by inspecting the already cloned local copy of the repository on the filesystem.

Benefit:

This approach would leverage the data already available locally, bypass the limitations of the external Git provider APIs for fetching large trees, and significantly improve the tool's ability to handle large repositories.

mkoeck avatar May 01 '25 08:05 mkoeck

Thanks for the clear issue write up, pinning this issue. I completely agree with your suggestion.

sng-asyncfunc avatar May 01 '25 13:05 sng-asyncfunc