Skip to content

feat: serve cached digest if available #462

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

MickaelCa
Copy link
Member

  • Added methods to upload metadata alongside digest files to S3.
  • Implemented S3-based digest caching mechanism for improved efficiency.
  • Refactored digest storage logic to support both S3 and local storage.

@MickaelCa MickaelCa added push-container Allow the PR to build & push a docker container instead of just building it deploy-pr-temp-env labels Jul 27, 2025
Copy link

⚙️ Preview environment for PR #462 is available at:
https://pr-462.gitingest.coderamp.dev/

@MickaelCa MickaelCa marked this pull request as ready for review July 27, 2025 16:17
@MickaelCa MickaelCa force-pushed the use-s3-as-cache branch 2 times, most recently from acb00ea to dd6e541 Compare July 28, 2025 15:05
@MickaelCa MickaelCa requested a review from NicolasIRAGNE July 28, 2025 17:24
Copy link
Contributor

@NicolasIRAGNE NicolasIRAGNE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RGPD

Copy link
Contributor

@ix-56h ix-56h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we ingest a repo hello_world then try to ingest it again with include/exclude patterns the cache is not used ?

Anyway, LGTM !

Comment on lines +70 to +79
clone_config = query.extract_clone_config()
commit_sha = await resolve_commit(clone_config, token=token)
query.commit = commit_sha

# Generate S3 file path using the resolved commit
s3_file_path = generate_s3_file_path(
source=query.url,
user_name=cast("str", query.user_name),
repo_name=cast("str", query.repo_name),
commit=commit_sha,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
clone_config = query.extract_clone_config()
commit_sha = await resolve_commit(clone_config, token=token)
query.commit = commit_sha
# Generate S3 file path using the resolved commit
s3_file_path = generate_s3_file_path(
source=query.url,
user_name=cast("str", query.user_name),
repo_name=cast("str", query.repo_name),
commit=commit_sha,
clone_config = query.extract_clone_config()
query.commit = await resolve_commit(clone_config, token=token)
# Generate S3 file path using the resolved commit
s3_file_path = generate_s3_file_path(
source=query.url,
user_name=cast("str", query.user_name),
repo_name=cast("str", query.repo_name),
commit=query.commit,

except ClientError as err:
# Object doesn't exist if we get a 404 error
error_code = err.response.get("Error", {}).get("Code")
if error_code == "404":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use fastapi.status.HTTP_404_NOT_FOUND instead of string validation

except ClientError as err:
# Object doesn't exist if we get a 404 error
error_code = err.response.get("Error", {}).get("Code")
if error_code == "404":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-pr-temp-env push-container Allow the PR to build & push a docker container instead of just building it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants