Initial version of v2 pull integration + project info v2#282
Open
MarcelGeo wants to merge 17 commits intov2-pull-integrationfrom
Open
Initial version of v2 pull integration + project info v2#282MarcelGeo wants to merge 17 commits intov2-pull-integrationfrom
MarcelGeo wants to merge 17 commits intov2-pull-integrationfrom
Conversation
+ tests for both v2 and v1 features + projectinfo v2 compatibility test
wonder-sk
reviewed
Dec 8, 2025
Contributor
wonder-sk
left a comment
There was a problem hiding this comment.
let's first do a bit of refactoring... the idea is that:
- we introduce a new class that captures project delta (added/updated/updated_diff/deleted) files
- the project delta class would be returned by get_pull_changes and get_push_changes
- there would a function that can combine server changes (from get_pull_changes) and local changes (from get_push_changes) and return a list of tasks to do at the end of the pull (e.g. copy, copy conflict, apply diff, delete - like PullTask in mobile app's merginapi)
- apply_pull_changes() would just go through the list of "pull tasks" and apply them, rather than again getting local changes and doing logic based on that
- models.py for some classes without specific location - clenup of non-necssary functions from previous version - refactor of pull handling using PullActions
+ descriptions + tests for appl_pull_actions + restore get_pull_changes for backward compatibility with project status
varmar05
reviewed
Jan 8, 2026
| self.size_check = size_check # whether we want to do merged file size check | ||
|
|
||
| def merge(self): | ||
| with open(self.dest_file, "wb") as final: |
Contributor
There was a problem hiding this comment.
don't we need to create intermediate dirs?
Contributor
Author
There was a problem hiding this comment.
it was done before. I updated this to create also directory.
| resp = mc.get( | ||
| f"/v2/projects/{mp.project_id()}/raw/diff/{self.file_path}", | ||
| ) | ||
| if resp.status in [200, 206]: |
Contributor
There was a problem hiding this comment.
Do we always download diff in single request? If so, let's state it explicitly somewhere.
Contributor
Author
There was a problem hiding this comment.
added comments ⬇️
| (DeltaChangeType.UPDATE_DIFF, DeltaChangeType.UPDATE): PullActionType.COPY_CONFLICT, | ||
| (DeltaChangeType.UPDATE_DIFF, DeltaChangeType.DELETE): PullActionType.COPY, | ||
| (DeltaChangeType.UPDATE_DIFF, DeltaChangeType.UPDATE_DIFF): PullActionType.APPLY_DIFF, # rebase | ||
| (DeltaChangeType.DELETE, None): PullActionType.DELETE, |
Contributor
There was a problem hiding this comment.
why pull action type delete here and not also for other use cases?
Contributor
Author
There was a problem hiding this comment.
not sure what you mean here. better to discuss @varmar05
Pull Request Test Coverage Report for Build 21143761159Details
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolved #280
/deltaendpoint, where pull changes between current version and server are calculated from delta itemsFixes
Pull logic updates
in
pull_project_asyncis check if server supports v2_pullIf supports: get pull delta from server
If not: calculate pull delta from files and projects
config.jsonThen calculate delta items between local files and server (local delta) - delta needs to be applied to server
Compare pull_delta and local_delta ->
PullActionwith actions needs to be done after files are downloaded from a server defined inPullActionTypeenumStarting download
After download is finished -> call
pull_project_finalizeMethod
apply_pull_actionsis then responsible to finalizePullActionbased on type