Exclude trashed items from Google Drive folder lookup (PP-4435)#3378
Conversation
|
Claude finished @dbernstein's task in 1m 2s —— View job SummaryThe fix is minimal, focused, and correct. Adding DetailsNit:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3378 +/- ##
==========================================
- Coverage 93.34% 93.34% -0.01%
==========================================
Files 507 507
Lines 46434 46434
Branches 6336 6336
==========================================
- Hits 43345 43343 -2
- Misses 1999 2000 +1
- Partials 1090 1091 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
get_file was querying Google Drive without a 'trashed = false' filter, so folders that had been moved to the trash were returned as valid parents. Any report uploaded to a trashed folder is invisible to users. Add 'trashed = false' to the query and cover the behaviour with a test that inspects the raw request URI sent to the Drive API. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8d0fa4c to
e9312d4
Compare
Description
Adds
trashed = falseto theget_filequery inGoogleDriveServiceso that folders moved to the Drive trash are excluded from lookup results.Motivation and Context
Without this filter, a trashed folder named e.g. "Blackstone Unlimited" would be returned by
get_fileas though it were a live folder.create_nested_folders_if_not_existwould then use the trashed folder's ID as the parent for nested folders and the final file upload — causing all uploaded reports to land inside a trashed (invisible) directory.JIRA: https://ebce-lyrasis.atlassian.net/browse/PP-4435
How Has This Been Tested?
test_get_file_excludes_trashed_itemswhich verifiestrashed = falseappears in the decoded Drive API request URI.Checklist