← Back to issue list

fix(sources): detect local file source changes

View original Github issue

Metadata

Project
craft-parts
Number
#1599
Type
pull request
State
open
Author
gcomneno
Labels
Created
Updated
Closed

Current evaluation

Adds change detection for local file sources in FileSourceHandler, fixing issue #1364. Has 2 unresolved review comments and some failing CI checks.

Suggested action: needs review

Reason: The PR fixes a real bug (issue #1364) and the author claims to have addressed review feedback, but there are 2 unresolved review comments and CI has failing checks (test-common, lint/files, OSV-scanner). A maintainer review is needed to resolve the outstanding comments and assess the CI failures.

Impact: 55 Quick Win: 35.75 Staleness: 75 Complexity: 35 Confidence: 65

Issue body

## Summary Fixes #1364. This adds change detection support for local file sources handled by `FileSourceHandler`. When a local file source is newer than the pull state file, the source handler now reports it as outdated, exposes the changed file through `get_outdated_files()`, and updates the pulled source by re-running the file source pull path. Remote URL-based file sources are left unchanged and are not treated as locally outdated. `file://` sources are treated as local files for change detection. ## Validation - `uv run pytest -q tests/unit/sources/test_base.py -rs` - `uv run pytest -q tests/unit/sources/test_base.py tests/unit/sources/test_file_source.py tests/unit/sources/test_tar_source.py tests/unit/sources/test_zip_source.py tests/unit/sources/test_deb_source.py tests/unit/sources/test_rpm_source.py tests/unit/sources/test_snap_source.py tests/unit/sources/test_sevenzip_source.py -rs` - `uv run ruff check craft_parts/sources/base.py tests/unit/sources/test_base.py` - `uv run ruff format --check craft_parts/sources/base.py tests/unit/sources/test_base.py` - `git diff --check`

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 55
Quick Win: 35.75
Staleness: 75
Complexity: 35
Confidence: 65
needs review Adds change detection for local file sources in FileSourceHandler, fixing issue #1364. Has 2 unresolved review comments and some failing CI checks.
qwen/qwen3.6-35b-a3b
Staleness: 65
Complexity: 35
Confidence: 80
needs review Adds change detection for local file sources in FileSourceHandler, treating file:// as local. Currently pending maintainer review with unresolved comments and mixed CI results.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 25
Confidence: 85
needs review Adds change detection for local file sources in FileSourceHandler. Treats file:// as local, leaves remote URLs unchanged. Addresses review feedback, tests pass, awaiting maintainer review.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 35
Confidence: 85
needs review Adds change detection for local file sources, tracking outdated files and updating pulled sources when local files change. Author addressed review feedback and tests pass. Currently awaiting maintainer review.

Update history

No update history recorded yet.

Related work

  • Related To: craft-parts#1364 (confidence 95%)

    This PR directly addresses issue #1364 which reports that the file source handler ignores changes to the source file.

Related issues

Issue Project State Summary Similarity
#322 sources: improve missing local source error message craft-parts merged Merged. Updates error handling to display a clear source not found message instead of a file copy error when a local source is missing. Approved by two reviewers, passed CI, and changed 17 lines across two files.
74%