fix: use ADK_GCS_BUCKET_NAME in periodic_cleanup - #183
Open
chauhanyash-19 wants to merge 1 commit into
Open
Conversation
AI code reviewThis PR fixes periodic_cleanup to use the same ADK_GCS_BUCKET_NAME environment variable that GcsArtifactService uses, ensuring cleanup targets the configured bucket. The change is minimal, well-tested with mocked unit tests, and follows the existing pattern in the codebase. No blocking issues found. How I read this change
No blocking issues found in this diff. This check passes. Findings are advisory. Reviewed by ASI:One ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
periodic_cleanup in the AI due-diligence agent's executor.py always
targeted a hardcoded GCS bucket ("ai-due-diligence-agent") instead of
reading ADK_GCS_BUCKET_NAME, the same env var GcsArtifactService uses.
On deployments with a custom bucket configured, the hourly cleanup job
silently cleaned the wrong bucket while logging deleted/retained counts
that described data it never touched. This PR reads the bucket name the
same way the artifact service does, so the write path and the cleanup
path always agree.
Type of Change
Checklist
contributors/<agent-name>/(not repo root).ruff check ..ruff format ..README.mdfor changed example(s)..env.exampleif environment variables are required.contributors/CHANGELOG.md, if this PR changes a community agent.README.md(if new agent).review-requiredCI).Related Issue
Fixes #180
Notes for Reviewers
One-line fix:
client.bucket("ai-due-diligence-agent")→client.bucket(os.getenv("ADK_GCS_BUCKET_NAME", "ai-due-diligence-agent")),matching the existing lookup in the GcsArtifactService setup further
down in the same file. Added tests/test_periodic_cleanup.py with two
cases (configured bucket, default fallback) — verified the new test
fails against the old hardcoded code before the fix, and passes after.