| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
📝 Walkthrough
WalkthroughThis PR makes dfetch ignore VCS-ignored files when detecting local changes: it adds per-repo ignored-files helpers, threads ignore lists through check/update commands, updates VCS change detection to respect ignore lists, and updates tests and BDD steps accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as dfetch CLI
participant Cmd as Command (update/check)
participant Common as files_to_ignore()
participant Repo as Repo (Git/SVN)
participant VCS as VCS layer
participant FS as Local FS
CLI->>Cmd: run update/check [--force]
Cmd->>Common: files_to_ignore(project.destination)
Common->>Repo: repo.ignored_files(project.destination)
Repo->>FS: query ignored files (git/svn)
FS-->>Repo: ignored files list
Repo-->>Common: ignored files
Common-->>Cmd: files_to_ignore list
Cmd->>VCS: update/check(force, files_to_ignore)
VCS->>VCS: _are_there_local_changes(files_to_ignore)
VCS->>FS: compute current tree hash (exclude files_to_ignore)
FS-->>VCS: computed hash
alt local changes detected and not forced
VCS-->>Cmd: report skipped (local changes)
Cmd-->>CLI: skipped message
else no local changes or forced
VCS->>Repo: fetch/update remote
Repo-->>VCS: fetched
VCS-->>Cmd: updated
Cmd-->>CLI: success message
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
📜 Recent review details Configuration used: defaults Review profile: CHILL Plan: Pro 📥 CommitsReviewing files that changed from the base of the PR and between 63d8e76 and f6978d1. 📒 Files selected for processing (21)
Learnt from: spoorcc Repo: dfetch-org/dfetch PR: 895 File: dfetch/commands/check.py:133-142 Timestamp: 2025-12-31T10:55:20.972Z Learning: In dfetch, when determining ignored files for a project, the VCS detection should use the superproject's VCS type (where the manifest is located), not the fetched project's VCS type. The ignored files are then queried from the project's destination path using the superproject's VCS system. Learnt from: spoorcc Repo: dfetch-org/dfetch PR: 895 File: dfetch/commands/check.py:133-142 Timestamp: 2025-12-31T10:55:20.972Z Learning: In dfetch, when determining ignored files for a project, the VCS detection should use the superproject's VCS type (where the manifest is located), not the fetched project's VCS type. The ignored files are then queried from the project's destination path using the superproject's VCS system. Applied to files:
dfetch/commands/common.py (1)dfetch/commands/update.py (2) dfetch/commands/common.py (1)dfetch/commands/check.py (3) dfetch/commands/common.py (1)dfetch/project/vcs.py (2) dfetch/commands/common.py (1)features/steps/svn_steps.py (1) dfetch/util/util.py (1)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
dfetch/commands/diff.py (1)features/steps/svn_steps.py (1) 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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)dfetch/commands/update.py (1)📜 Review details191-201: Extract _files_to_ignore to dfetch/commands/common.py.
This static method is duplicated identically in both update.py and check.py. Move it to the existing common.py module and update imports in both files.
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📥 CommitsReviewing files that changed from the base of the PR and between 60090e0 and 0d3b3bc.
📒 Files selected for processing (14)dfetch/util/util.py (1)dfetch/project/vcs.py (1)dfetch/util/cmdline.py (1)
- in_directory (66-75)
- run_on_cmdline (38-69)
dfetch/project/abstract_check_reporter.py (1)dfetch/project/svn.py (3)
- AbstractCheckReporter (9-91)
dfetch/vcs/git.py (1)tests/test_vcs.py (2)dfetch/util/util.py (1)
- ignored_files (348-368)
dfetch/util/cmdline.py (1)
- in_directory (66-75)
- run_on_cmdline (38-69)
dfetch/manifest/project.py (1)features/steps/svn_steps.py (1)dfetch/project/vcs.py (1)
- vcs (406-408)
- _are_there_local_changes (349-361)
dfetch/util/util.py (1)dfetch/commands/update.py (6)
- in_directory (66-75)
dfetch/project/svn.py (3)⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)dfetch/manifest/project.py (2)
- SvnRepo (42-450)
- ignored_files (435-450)
- check_path (146-153)
dfetch/vcs/git.py (4)
- vcs (406-408)
- destination (381-383)
dfetch/commands/check.py (1)
- GitLocalRepo (175-501)
- is_git (45-61)
- is_git (184-191)
- ignored_files (348-368)
dfetch/project/__init__.py (1)
- _files_to_ignore (134-143)
dfetch/project/vcs.py (1)
- make (11-22)
- update (95-146)
features/steps/svn_steps.py (1)CHANGELOG.rst (1)93-96: LGTM!
The new SVN tag step implementation is clean and follows established patterns in the file. It correctly uses the in_directory context manager and delegates to the existing create_tag helper.
tests/test_update.py (1)22-22: LGTM!
The changelog entry clearly documents the fix and properly references issue #350.
dfetch/vcs/git.py (1)68-68: LGTM!
The test correctly validates that the update method receives the new files_to_ignore parameter with an empty list as the default value.
dfetch/commands/check.py (2)347-368: LGTM!
The ignored_files implementation correctly uses git ls-files --ignored --others --exclude-standard to enumerate ignored files. The method properly handles non-existent paths and follows the established patterns in the codebase.
features/guard-against-overwriting-git.feature (1)24-24: LGTM!
The new imports are appropriately placed and support the ignore-file handling functionality.
Also applies to: 33-33, 40-40
96-99: LGTM!
The check flow correctly computes and passes the files_to_ignore list to check_for_update, assuming the VCS detection issue in _files_to_ignore is fixed.
dfetch/project/svn.py (1)1-47: LGTM!
The BDD feature file is well-structured and comprehensively covers the guard-against-overwriting behavior for Git repositories. The three scenarios appropriately test: normal blocking on local changes, force override, and ignored files not blocking updates.
features/guard-against-overwriting-svn.feature (2)434-450: LGTM!
The ignored_files implementation correctly uses svn status --no-ignore to enumerate ignored files (marked with "I" status). The method properly handles non-existent paths and follows established patterns in the codebase, maintaining consistency with the Git equivalent.
tests/test_vcs.py (1)39-39: Note the @wip tag on the ignored files scenario.
The third scenario is marked as work-in-progress. This is acceptable, though you may want to verify that the underlying functionality works even if the test is not yet complete.
1-48: LGTM!
The BDD feature file appropriately covers the guard-against-overwriting behavior for SVN repositories, mirroring the Git equivalent. The first two scenarios are complete and should provide good coverage.
dfetch/project/vcs.py (3)140-140: LGTM!
The test correctly passes an empty files_to_ignore list to match the updated method signature. This is appropriate since these test cases focus on hash comparison behavior, not the ignore functionality.
features/steps/generic_steps.py (3)95-116: LGTM!
The update() method correctly:
- Accepts an optional files_to_ignore parameter with None default
- Defaults to an empty list when not provided
- Passes the ignore list to _are_there_local_changes() to exclude VCS-ignored files from the local change detection
This properly addresses the issue where untracked/ignored files were incorrectly causing the directory hash to differ.
159-161: LGTM!
The check_for_update() method now requires files_to_ignore as a mandatory parameter, which is appropriate since the caller (check.py) always computes this list before calling.
349-361: LGTM!
The core fix is implemented correctly here. By adding files_to_ignore to the skiplist passed to hash_directory(), VCS-ignored files (e.g., files matching .gitignore patterns) are now excluded from the hash calculation. This directly resolves the issue where untracked/ignored files incorrectly affected local change detection.
dfetch/commands/update.py (1)124-132: LGTM!
The replace_in_file() utility is a clean helper for BDD tests. The implementation is straightforward and appropriate for test code where files are expected to exist.
157-159: LGTM!
The new step definition provides a convenient way to modify file contents in feature tests, enabling scenarios that test the ignore-file behavior.
205-209: LGTM!
Adding the @given decorator alongside the existing @when decorator provides flexibility for test scenarios to set up local file changes either as preconditions or actions.
84-87: LGTM!
The integration correctly computes the files to ignore before calling update(), ensuring VCS-ignored files don't affect local change detection.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
#350
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.