[FIX] Simplify ORGDIR check for consistent rebuild behavior#177
[FIX] Simplify ORGDIR check for consistent rebuild behavior#177prenetic wants to merge 1 commit into
ORGDIR check for consistent rebuild behavior#177Conversation
The original heuristic was no longer a real "did the user delete `ORGDIR`?" check, it was an assumption that only worked when `AZ_DIR=True`. With `AZ_DIR=False` those directories are never created, so deleting `ORGDIR` would go undetected and leave the user without an `ORGDIR` entirely. Instead we should just check whether `ORGDIR` exists. Configuration changes already trigger a rebuild via INI ctime, so this only needs to handle the manual deletion case. This also aligns with the `NOTE: Remove the Organized folders if you wish to start from scratch.` message that is currently displayed to the user during incremental builds. Fixes theypsilon#146 (follow-up to merged `AZ_DIR=False` fix)
📝 WalkthroughWalkthrough
ORGDIR Rebuild Detection
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/integration/test_arcade_organizer.py (1)
710-716: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winIncremental regression test no longer covers the
AZ_DIR=Falsescenario from#146.Issue
#146reproduces specifically with alphabetic folders disabled — the old multi-subdirectory check falsely flagged missingORGDIR_*A‑Z folders only whenAZ_DIR=False. By switching this test toAZ_DIR=True, the very condition that triggered the bug is no longer exercised; the pre-fix code would have passed this test too. Consider keeping (or adding) anAZ_DIR=Falsevariant so the regression stays protected.♻️ Suggested additional regression test for the original bug condition
def test_organize___incremental_run_with_az_dir_disabled___does_not_rebuild_from_scratch(self): """Regression for `#146`: second run must stay incremental when AZ_DIR=False.""" self._create_ini_file( SKIPALTS=False, AZ_DIR=False, CATEGORY_DIR=True ) config = self.ao_service.make_arcade_organizer_config( self.ini_path, self.base_path, '' ) success1 = self.ao_service.run_arcade_organizer_organize_all_mras(config) self.assertTrue(success1) with patch.object(Infrastructure, 'remove_orgdir_directories') as mock_remove: success2 = self.ao_service.run_arcade_organizer_organize_all_mras(config) self.assertTrue(success2) self.assertEqual(mock_remove.call_count, 0, "Second run triggered a full rebuild unexpectedly")🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/integration/test_arcade_organizer.py` around lines 710 - 716, The incremental regression test for `test_organize___on_incremental_run___does_not_rebuild_from_scratch` no longer covers the original `AZ_DIR=False` bug condition from `#146`. Restore coverage by keeping this test on the disabled alphabetic-folder path, or add a separate regression test around `make_arcade_organizer_config` and `run_arcade_organizer_organize_all_mras` that runs with `AZ_DIR=False` and asserts the second run does not call `Infrastructure.remove_orgdir_directories`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/test/integration/test_arcade_organizer.py`:
- Around line 710-716: The incremental regression test for
`test_organize___on_incremental_run___does_not_rebuild_from_scratch` no longer
covers the original `AZ_DIR=False` bug condition from `#146`. Restore coverage by
keeping this test on the disabled alphabetic-folder path, or add a separate
regression test around `make_arcade_organizer_config` and
`run_arcade_organizer_organize_all_mras` that runs with `AZ_DIR=False` and
asserts the second run does not call `Infrastructure.remove_orgdir_directories`.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: eb11d005-5d31-489d-9506-2909ff7f30b2
📒 Files selected for processing (2)
src/test/integration/test_arcade_organizer.pysrc/update_all/arcade_organizer/arcade_organizer.py
|
I don't think the AI nitpick applies anymore since we are shifting the signal for an |
ORGDIR check for consistent rebuild behaviorORGDIR check for consistent rebuild behavior
The original heuristic was no longer a real "did the user delete
ORGDIR?" check, it was an assumption that only worked whenAZ_DIR=True. WithAZ_DIR=Falsethose directories are never created, so deletingORGDIRwould go undetected and leave the user without anORGDIRentirely.Instead we should just check whether
ORGDIRexists. Configuration changes already trigger a rebuild via INI ctime, so this only needs to handle the manual deletion case. This also aligns with theNOTE: Remove the Organized folders if you wish to start from scratch.message that is currently displayed to the user during incremental builds.Fixes #146 (follow-up to merged
AZ_DIR=Falsefix)Manual testing performed:
ORGDIRwith A-Z subdirectories on first run.ORGDIRdirectory triggers a full build.ORGDIRdirectory triggers a full build.Summary by CodeRabbit