diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 04f00a55..781e5418 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -50,7 +50,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -60,7 +60,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 # â„šī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -73,6 +73,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index b1131289..8025b939 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -39,6 +39,6 @@ jobs: publish_results: true # enables the public badge - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3 + uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5 with: sarif_file: results.sarif diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1c861e15..bd427b6c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1 +1 @@ -{".":"0.3.0"} +{".":"0.3.1"} diff --git a/CHANGELOG.md b/CHANGELOG.md index 918afc53..137ec55d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.3.1](https://github.com/coderamp-labs/gitingest/compare/v0.3.0...v0.3.1) (2025-07-31) + + +### Bug Fixes + +* make cache aware of subpaths ([#481](https://github.com/coderamp-labs/gitingest/issues/481)) ([8b59bef](https://github.com/coderamp-labs/gitingest/commit/8b59bef541f858ef44eba8fce6ace77df9dea01c)) + ## [0.3.0](https://github.com/coderamp-labs/gitingest/compare/v0.2.1...v0.3.0) (2025-07-30) diff --git a/compose.yml b/compose.yml index fd37406d..8f45a7bf 100644 --- a/compose.yml +++ b/compose.yml @@ -21,7 +21,7 @@ x-prod-environment: &prod-environment x-dev-environment: &dev-environment DEBUG: "true" - LOG_LEVEL: "debug" + LOG_LEVEL: "DEBUG" RELOAD: "true" GITINGEST_SENTRY_ENVIRONMENT: ${GITINGEST_SENTRY_ENVIRONMENT:-development} # S3 Configuration for development diff --git a/pyproject.toml b/pyproject.toml index 96da66fb..aa17bd7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gitingest" -version = "0.3.0" +version = "0.3.1" description="CLI tool to analyze and create text dumps of codebases for LLMs" readme = {file = "README.md", content-type = "text/markdown" } requires-python = ">= 3.8" diff --git a/src/server/query_processor.py b/src/server/query_processor.py index d568a21f..03f52f16 100644 --- a/src/server/query_processor.py +++ b/src/server/query_processor.py @@ -90,6 +90,7 @@ async def _check_s3_cache( user_name=cast("str", query.user_name), repo_name=cast("str", query.repo_name), commit=query.commit, + subpath=query.subpath, include_patterns=query.include_patterns, ignore_patterns=query.ignore_patterns, ) @@ -168,6 +169,7 @@ def _store_digest_content( user_name=cast("str", query.user_name), repo_name=cast("str", query.repo_name), commit=query.commit, + subpath=query.subpath, include_patterns=query.include_patterns, ignore_patterns=query.ignore_patterns, ) diff --git a/src/server/s3_utils.py b/src/server/s3_utils.py index 80acea45..f02f0270 100644 --- a/src/server/s3_utils.py +++ b/src/server/s3_utils.py @@ -62,6 +62,7 @@ def generate_s3_file_path( user_name: str, repo_name: str, commit: str, + subpath: str, include_patterns: set[str] | None, ignore_patterns: set[str], ) -> str: @@ -69,7 +70,7 @@ def generate_s3_file_path( The file path is formatted as: [/]ingest////// - /-.txt + /--.txt If S3_DIRECTORY_PREFIX environment variable is set, it will be prefixed to the path. The commit-ID is always included in the URL. @@ -85,6 +86,8 @@ def generate_s3_file_path( Repository name. commit : str Commit hash. + subpath : str + Subpath of the repository. include_patterns : set[str] | None Set of patterns specifying which files to include. ignore_patterns : set[str] @@ -111,9 +114,10 @@ def generate_s3_file_path( patterns_str = f"include:{sorted(include_patterns) if include_patterns else []}" patterns_str += f"exclude:{sorted(ignore_patterns)}" patterns_hash = hashlib.sha256(patterns_str.encode()).hexdigest()[:16] + subpath_hash = hashlib.sha256(subpath.encode()).hexdigest()[:16] - # Build the base path using hostname directly - base_path = f"ingest/{hostname}/{user_name}/{repo_name}/{commit}/{patterns_hash}/{user_name}-{repo_name}.txt" + file_name = f"{user_name}-{repo_name}-{subpath_hash}.txt" + base_path = f"ingest/{hostname}/{user_name}/{repo_name}/{commit}/{patterns_hash}/{file_name}" # Check for S3_DIRECTORY_PREFIX environment variable s3_directory_prefix = os.getenv("S3_DIRECTORY_PREFIX")