test(backup): assert selected folder in retention parent lookup
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 95/100
Research direction
Update tests/test_backup_machine_identity.py in test_opt_in_retention_sees_prior_ids_without_creating_or_moving_folders by asserting that files.get is called once with fileId="stable", fields="parents", and supportsAllDrives=True. Read the retention mock and existing assertions first, then run this focused synthetic test; it is done when the correct lookup passes and a wrong folder ID, fields value, or shared-drive flag fails without making Drive or database calls.
Written by the indexing model from the issue text.
Description
The retention test's mock returns {"parents": ["backups"]} for every files.get call. The test verifies the retained/trash results, but does not assert which folder was queried or the requested fields. A future regression in those arguments could therefore escape this test.
ACCEPTED-AND-ROWED — test hardening only, under the lead's explicit two-round ruling for PR #1347. Origin: CodeRabbit inline 4304929792, review 5560578479 on exact head 5ec264671950ff308a0b80c9db222588adb85f97, base main 7ea3c9f46766005b6fee809c80b18996cf44c446.
The current production implementation already calls service.files().get(fileId=folder_id, fields="parents", supportsAllDrives=True) at backup_daily.py:1125. The production caller passes the upload folder via selected_folder_id at line 1829, which the pruner passes into that helper at lines 1573–1574. No current production lookup defect was found.
In test_opt_in_retention_sees_prior_ids_without_creating_or_moving_folders, add:
service.files.return_value.get.assert_called_once_with(
fileId="stable", fields="parents", supportsAllDrives=True
)
Preserve all existing removed-file/update/create/delete assertions. Scope is this small test assertion only; no production, fixture, timeout, cache, guard or retention-policy changes. The fixture and current assertions are at test_backup_machine_identity.py:92,121–131.
Acceptance for the future follow-up: the focused synthetic test passes against the correct lookup, and a wrong folder ID/fields/shared-drive flag would fail the new assertion. Use existing isolated test guards; no real Drive/database calls. This disposition task deliberately makes no code edit or new test run and retains the frozen PR head.
— bl-stability-lead-w4 (worker) · codex/gpt-6.1-sol
- Dominant language
- Python
- Stars
- 9
- Forks
- 7
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 461
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EtanHey/brainlayer
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EtanHey/brainlayer#1431 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
EtanHey/brainlayer#1428 ·
Maintainers usually reply within 1 day
-
test(BrainBar): inject synthetic observabilityCadence in BackupsHealth/one-page fixtures (DCI-1)Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
EtanHey/brainlayer#1367 ·
Maintainers usually reply within 1 day
-
docs(backup): clarify read-only discovery docstring + refresh backup-strategy schedule/retentionOpen
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EtanHey/brainlayer#1345 · 3 comments ·
Maintainers usually reply within 1 day
-
BrainBar: clear stale DriveAuth detail when clock-forcing expiring/invalid from older valid CLIOpen
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EtanHey/brainlayer#1342 ·
Maintainers usually reply within 1 day
All issues in EtanHey/brainlayer
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
area:docs documentation effort:M ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
mczielinski/ob-analytics#423 ·
Maintainers usually reply within 1 day
-
infra
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
vllm-project/vllm-ascend#21033 ·
Maintainers usually reply within 1 day