Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

725.conflict resolution #752

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
45ce11f
WIP: conflict-resolution things from pre-pause
meejah Aug 9, 2023
c7c0e08
match api, if not semantics
meejah Oct 22, 2023
ddb0b68
fix test; refactor setup
meejah Oct 22, 2023
dc582e2
test fix
meejah Oct 22, 2023
a0010b1
test fix
meejah Oct 22, 2023
fda06da
incorrect params
meejah Oct 22, 2023
aacd22d
more participants
meejah Oct 22, 2023
c8dc413
fixes
meejah Oct 22, 2023
ad82e45
update version
meejah Oct 22, 2023
a631344
WIP: basic resolution stuff works
meejah Nov 3, 2023
6f003fa
WIP: fix resolutions
meejah Nov 3, 2023
c71d1f4
cleanup
meejah Nov 3, 2023
75583d2
author -> participant_name
meejah Nov 3, 2023
56b0c89
test api
meejah Nov 3, 2023
0eb6b90
rename
meejah Nov 3, 2023
741662f
author_name -> participant_name
meejah Nov 20, 2023
98ed987
add 'resolve' to the local API helper
meejah Dec 4, 2023
072e0e9
fix test?
meejah Jan 31, 2024
4cca010
add 'reactor' arg to CLI
meejah Feb 13, 2024
6671994
document HTTP API ..../resolve-conflict
meejah Feb 13, 2024
c0ef9ae
begin documenting conflicts / resolution
meejah Feb 13, 2024
343c91b
doc refs
meejah Feb 13, 2024
d0ff317
fix assert
meejah Feb 14, 2024
5300aa4
working 3-party conflict removal
meejah Feb 14, 2024
9f42e58
more docs
meejah Feb 14, 2024
a63c166
unused
meejah Feb 14, 2024
526c32f
ignore dupes for conflicts
meejah Feb 14, 2024
4df9c53
fixup: more places need reactor arg
meejah Feb 14, 2024
b625640
conflicted state tests/notes about handling
meejah Feb 14, 2024
9926ee6
incorrect merge
meejah Feb 16, 2024
ce31aa0
linting
meejah Feb 16, 2024
029575b
not really valid test
meejah Feb 19, 2024
de9bfbf
lint
meejah Feb 19, 2024
fb13dcc
copyedit
meejah Mar 27, 2024
063c627
rebase resolution was wrong
meejah Mar 27, 2024
9fcec34
news
meejah Mar 27, 2024
b5354d3
Windows can't move onto existing file
meejah Mar 27, 2024
d69b3c6
integration test for conflict-resolution
meejah Mar 28, 2024
00b9586
improve documentation
meejah May 6, 2024
17c2cb8
only show individual uploads if there's less than 20 of them
meejah May 6, 2024
bd199b9
test invalid resolution
meejah May 6, 2024
dbeef66
in-memory resolve
meejah May 6, 2024
d4deb91
test conflict cases
meejah May 6, 2024
df9564d
refactor and add error-case test
meejah May 6, 2024
efdf878
test for take/use at once
meejah May 6, 2024
18358e7
more error-case Web API tests
meejah May 6, 2024
b42ca10
cleanup
meejah May 6, 2024
deb0294
test a remote-resolve
meejah May 6, 2024
62979f4
linter
meejah May 6, 2024
a4dedc2
windows cares about tests-names, kind of
meejah May 6, 2024
5e7c4c9
properly overwrite, even on windows
meejah Jun 3, 2024
8610424
fixup; delete the dest not source
meejah Jun 3, 2024
0342420
reword
meejah Jun 3, 2024
3fc14ea
debug
meejah Jun 3, 2024
ba01510
missing await
meejah Jun 3, 2024
d4d1b9a
undo debug
meejah Jun 3, 2024
3adf6c8
spell
meejah Jun 11, 2024
e6f48d5
spell
meejah Jun 11, 2024
35e1996
add a ref
meejah Jun 11, 2024
b0b6505
set up the list
meejah Jun 11, 2024
86cb478
add some notes on error-handling
meejah Jun 11, 2024
be5b04f
redirect
meejah Jun 11, 2024
c3db632
try coveralls
meejah Jun 12, 2024
a35af31
syntax?
meejah Jun 12, 2024
aa69345
syntax
meejah Jun 12, 2024
5bba085
circular-import attrib
meejah Jun 17, 2024
e68849b
dead code
meejah Jun 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
author -> participant_name
meejah committed Mar 27, 2024
commit 75583d244e824f81ec9fa4df16be4d9b99f719ae
6 changes: 2 additions & 4 deletions src/magic_folder/config.py
Original file line number Diff line number Diff line change
@@ -822,9 +822,8 @@ class Conflict(object):
Represents information about a particular conflict.
"""
snapshot_cap = attr.ib() # Tahoe URI
author_name = attr.ib(validator=instance_of(str))
## participant_name = attr.ib(validator=instance_of(str))
# should probably re-name to "participant_name" since that's what it is ...?
participant_name = attr.ib(validator=instance_of(str))


@attr.s
class MagicFolderConfig(object):
@@ -1615,7 +1614,6 @@ def add_conflict(self, cursor, snapshot, participant):
VALUES
(?,?,?)
""",
##(snapshot.relpath, snapshot.author.name, snapshot.capability.danger_real_capability_string()),
(snapshot.relpath, participant.name, snapshot.capability.danger_real_capability_string()),
)

8 changes: 4 additions & 4 deletions src/magic_folder/magic_file.py
Original file line number Diff line number Diff line change
@@ -309,17 +309,17 @@ def resolve_conflict(self, resolution):
if resolution is None:
keep_path = self._relpath
rejected = [
conflict_to_marker(self._relpath, con.author_name)
conflict_to_marker(self._relpath, con.participant_name)
for con in conflicts
]
else:
if resolution not in conflicts:
raise ResolutionError(
"Resolution not found as existing conflict"
)
keep_path = conflict_to_marker(self._relpath, resolution.author_name)
keep_path = conflict_to_marker(self._relpath, resolution.participant_name)
rejected = [
conflict_to_marker(self._relpath, con.author_name)
conflict_to_marker(self._relpath, con.participant_name)
for con in conflicts
if con != resolution
]
@@ -1105,7 +1105,7 @@ def _check_if_conflict_resolved(self, snapshot):
if rs.danger_real_capability_string() in snapshot.parents_raw:
conflicts = self._factory._config.list_conflicts_for(self._relpath)
rejected = [
conflict_to_marker(self._relpath, conflict.author_name)
conflict_to_marker(self._relpath, conflict.participant_name)
for conflict in conflicts
]
self._factory._magic_fs.mark_not_conflicted(self._relpath, self._relpath, rejected)
6 changes: 3 additions & 3 deletions src/magic_folder/web.py
Original file line number Diff line number Diff line change
@@ -537,7 +537,7 @@ def list_conflicts(request, folder_name):
folder_config = global_config.get_magic_folder(folder_name)
return json.dumps({
relpath: [
conflict.author_name
conflict.participant_name
for conflict in conflicts
]
for relpath, conflicts in folder_config.list_conflicts().items()
@@ -584,7 +584,7 @@ def resolve_conflict(request, folder_name):
matching_conflicts = [
conflict
for conflict in conflicts
if conflict.author_name == participant_name
if conflict.participant_name == participant_name
]
if not matching_conflicts:
raise _InputError('"{relpath}" is not conflicted with "{take}"'.format(**resolution))
@@ -610,7 +610,7 @@ def resolve_conflict(request, folder_name):

return json.dumps({
relpath: [
conflict.author_name
conflict.participant_name
for conflict in conflicts
]
}).encode("utf8")