Skip to content

Conversation

@samarthsaxena2004
Copy link

🚀 Description

This PR addresses a critical logic gap in single-file (blob) ingestion. Previously, the system checked for file existence only on the local filesystem of the shallow clone, potentially ignoring the specific branch or commit requested. This implementation enforces strict Git-based validation as noted in the codebase TODO.

🛠️ Changes Made

  • Validation Logic: Updated ingest_query in ingestion.py to use git rev-parse --verify to confirm the requested subpath exists within the provided Git reference (commit, tag, or branch).
  • Error Handling: Implemented a specific ValueError that informs the user if a file is not found in the requested Git state, preventing the system from falling back to incorrect local file versions.

✅ Testing Performed

  • Manual Verification: Confirmed that requesting a valid file on main works as expected.
  • Negative Testing: Verified that requesting a file on a branch where it does not exist now returns a ValueError instead of the version from the default branch.
  • CI Readiness: Ensured all pre-commit hooks (ruff, pydoclint, isort) pass locally.

🔗 Related Issues

Closes #557

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.

Add a title: (bug): Single file ingestion (blob) ignores branch/commit validation

1 participant