Skip to content

Conversation

@MarcelGeo
Copy link
Contributor

from compare file_set is coming diffs key as diffs are accidentaly diffs key.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 21880134649

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 82.377%

Totals Coverage Status
Change from base Build 21823644831: 0.003%
Covered Lines: 4235
Relevant Lines: 5141

💛 - Coveralls

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the local change model to accept a diffs key (a list of diff filenames) when constructing FileChange instances from dictionaries, matching metadata produced during pull/compare flows.

Changes:

  • Add a diffs attribute to FileChange in mergin/local_changes.py.
  • Update test_local_changes_from_dict to include a diffs key in sample input data.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
mergin/local_changes.py Extends FileChange dataclass to include optional diffs list.
mergin/test/test_local_changes.py Updates test fixture data to include diffs key when building FileChange from dicts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# some functions (MerginProject.compare_file_sets) are adding location dict to the change from project info
location: Optional[str] = None
# list of diff filenames associated with this change
diffs: Optional[List[str]] = None
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new diffs field defaults to None, but its doc comment describes it as a list of diff filenames. To avoid forcing callers to guard against None (and to align with how chunks is modeled), consider using field(default_factory=list) and a non-optional List[str] (or normalize None to [] in __post_init__).

Suggested change
diffs: Optional[List[str]] = None
diffs: List[str] = field(default_factory=list)

Copilot uses AI. Check for mistakes.
Comment on lines +31 to 32
"diffs": ["diff"],
}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test adds the diffs key to the input dict, but it never asserts that FileChange actually stores it. Adding an assertion like local_changes.removed[0].diffs == ["diff"] would ensure the new field is covered (and avoid the test passing if the key is silently dropped elsewhere).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants