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

FEATURE: Offer resolution strategies when conflicts arise during rebase #3744

Closed
9 of 10 tasks
Tracked by #3742
grebaldi opened this issue Mar 13, 2024 · 2 comments · Fixed by #3762
Closed
9 of 10 tasks
Tracked by #3742

FEATURE: Offer resolution strategies when conflicts arise during rebase #3744

grebaldi opened this issue Mar 13, 2024 · 2 comments · Fixed by #3762
Assignees
Labels

Comments

@grebaldi
Copy link
Contributor

grebaldi commented Mar 13, 2024

When conflicts arise during publishing, the user needs a way to decide what to do about them. A possible conflict situation would be for instance:

Editor A removes content node TextElement-1 and publishes their change. Meanwhile, Editor B edits the contents of TextElement-1. Once Editor B publishes their workspace, TextElement-1 is already gone. The changes to TextElement-1 cannot be published.

In this case, Editor B would currently run into an exception during publish:
Screenshot_2024-03-25_14-16-37 Publish Error

That is, if Editor A had published their removal changes during an ongoing editing session of Editor B. In this case, Editor B would not be informed about their workspace having gone into OUTDATED_CONFLICT state.

When Editor B reloads the page, their workspace state is properly reflected:
Screenshot_2024-03-25_15-23-43 Sync Button

Upon clicking the Synchronize personal workspace button, Editor B is currently informed that there's no way out of here:
Screenshot_2024-03-25_12-57-27 Snyhcronize Workspace Error

Editor B is now trapped. Reasonably, they should at least be able to discard their workspace, but this currently leads to an error as well:
Screenshot_2024-03-25_12-58-31 Discard Error

A way to escape this trap would be to perform a force-rebase on Editor Bs workspace. This has been implemented here: neos/neos-development-collection#4939

During the Hamburg spring, @ahaeslich, @mficzel and I discussed the following basic strategies that we can offer the user in case of conflicts:

  1. "Discard All" - If publishing fails due to conflicts, we allow the user to throw away all changes
  • This additionally requires an "Are you sure?"-confirmation type dialog
  1. "Save what you can" - We allow the user to publish everything that can be published, while throwing away all changes that can't (see: TASK: Add force strategy to the rebase workspace command neos-development-collection#4939)
  • For this, we would (ideally in beforehand) display information to the user, so they can understand what they're about to lose if they were to choose this strategy

Additional strategies had also been discussed (with input from @nezaniel and @mhsdesign), with regards on retaining conflicting changes for later use. We concluded that it's best to focus on the above strategies for 9.0 and explore other solutions later.

Here's a sketch for a possible dialog workflow:
Untitled-2024-03-26-1410 Rebase Conflict Resolution
(https://excalidraw.com/#room=b7f4a755ffda65849f6a,1SW-iMdJIpdvwWJWwb-CdQ)

(1) A Select box in anticipation of n possible strategies. At the moment, this select box would contain the options "Discard All", "Save what you can" and "Cancel". The latter will just abort the publishing operation.
(2) Conflicts may be complex and numerous. We will need some way to summarize them for editors.

Open Questions

  • What info can we reasonably display about publishing conflicts in the UI?
  • How do we explain that "Discard All" during conflict resolution is not the same thing as "Discard All" in the Publish Dropdown?
    • "Discard All" during conflict resolution will discard everything in the workspace
    • "Discard All" in the Publish Dropdown will discard all changes in the current site, but leave other sites untouched

Acceptance Criteria

  • If a user clicks on "Synchronize" and a conflict arises during the rebase operation, they are presented with a dialog that allows them to choose between several conflict resolution strategies
  • If a user chooses "Cancel" from the resolution strategy selection, the rebase operation is aborted without side effects
  • If a user chooses "Discard all" from the resolution strategy selection, their changes are discarded globally
  • If a user chooses "Save what you can" from the resolution strategy selection, they are presented with a dialog summarizing what changes they are about to lose
  • If a user clicks on "Cancel" in the "Save what you can" summary dialog, they are again presented with the resolution strategy selection
  • If a user clicks on "Continue" in the "Save what you can" summary dialog, the rebase operation starts again, this time setting the force flag (as established in TASK: Add force strategy to the rebase workspace command neos-development-collection#4939) to true
  • There is an E2E test scenario that creates a conflict state between two editors and asserts the results of choosing "Discard all" as a resolution strategy during rebase
  • There is an E2E test scenario that creates a conflict state between two editors and asserts the results of choosing "Save what you can" as a resolution strategy during rebase
@mficzel
Copy link
Member

mficzel commented Mar 13, 2024

Good description. I only would add that the we ended up calling "Save what you can" forced-rebase.
Also it would be a viable option for 9.0 to include those in the rebase dialog when the workspace is in OUTDATED_CONFLICT state where it currently only says "call your admin | cancel".

@grebaldi grebaldi added the 9.0 label Mar 13, 2024
@grebaldi grebaldi changed the title FEATURE: Offer resolution strategies when conflicts arise during publishing FEATURE: Offer resolution strategies when conflicts arise during rebase Mar 25, 2024
@grebaldi
Copy link
Contributor Author

I've updated the issue description, so it refers to "rebase" rather than "publish". I'll open another issue to integrate both operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants