Page MenuHomePhabricator

Implement “undo” for Schemas
Closed, ResolvedPublic

Description

Currently, trying to undo a schema revision sends you to the schema edit page, which doesn’t really work right now, and also will break even further once we introduce multilingual terms.

Instead, we should follow Wikibase and only show you a diff page (without the ability to change what’s going to be done) with an input for the summary.

Event Timeline

Lucas_Werkmeister_WMDE triaged this task as High priority.Jan 29 2019, 2:03 PM
Lucas_Werkmeister_WMDE created this task.

Change 487064 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add rudimentary undo support

https://gerrit.wikimedia.org/r/487064

Change 487150 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add SchemaDiff class

https://gerrit.wikimedia.org/r/487150

Change 487151 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add SchemaDiffer class

https://gerrit.wikimedia.org/r/487151

Change 487152 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add SchemaPatcher class

https://gerrit.wikimedia.org/r/487152

Change 487153 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] WIP: Support undo in SchemaEditAction

https://gerrit.wikimedia.org/r/487153

Change 487064 abandoned by Lucas Werkmeister (WMDE):
Add rudimentary undo support

Reason:
in favor of the chain starting at I2e68f1a6dd

https://gerrit.wikimedia.org/r/487064

Change 487522 had a related patch set uploaded (by Lucas Werkmeister (WMDE); owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add UndoUseCase

https://gerrit.wikimedia.org/r/487522

Change 487153 abandoned by Lucas Werkmeister (WMDE):
WIP: Support undo in SchemaEditAction

Reason:
in favor of Ib2dbb2d1cb

https://gerrit.wikimedia.org/r/487153

Change 488081 had a related patch set uploaded (by Tarrow; owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add SchemaDiff class

https://gerrit.wikimedia.org/r/488081

Change 488082 had a related patch set uploaded (by Tarrow; owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add SchemaDiffer class

https://gerrit.wikimedia.org/r/488082

Change 488083 had a related patch set uploaded (by Tarrow; owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add SchemaPatcher class

https://gerrit.wikimedia.org/r/488083

Change 488085 had a related patch set uploaded (by Tarrow; owner: Lucas Werkmeister (WMDE)):
[mediawiki/extensions/WikibaseSchema@master] Add UndoUseCase

https://gerrit.wikimedia.org/r/488085

Change 487150 abandoned by Lucas Werkmeister (WMDE):
Add SchemaDiff class

Reason:
We decided not to use the Wikibase libraries after all. (Strictly speaking, apart from composer.json this commit only binds to the diff/diff library, which we still want to use, but I think it’s cleaner to abandon the whole chain including this commit.)

https://gerrit.wikimedia.org/r/487150

Change 487151 abandoned by Lucas Werkmeister (WMDE):
Add SchemaDiffer class

Reason:
We decided not to use the Wikibase libraries after all.

https://gerrit.wikimedia.org/r/487151

Change 487152 abandoned by Lucas Werkmeister (WMDE):
Add SchemaPatcher class

Reason:
We decided not to use the Wikibase libraries after all.

https://gerrit.wikimedia.org/r/487152

Change 487522 abandoned by Lucas Werkmeister (WMDE):
Add UndoUseCase

Reason:
We decided not to use the Wikibase libraries after all.

https://gerrit.wikimedia.org/r/487522

Change 488081 abandoned by Lucas Werkmeister (WMDE):
Add SchemaDiff class

Reason:
We decided not to use the Wikibase libraries after all.

https://gerrit.wikimedia.org/r/488081

Change 488082 abandoned by Lucas Werkmeister (WMDE):
Add SchemaDiffer class

Reason:
We decided not to use the Wikibase libraries after all.

https://gerrit.wikimedia.org/r/488082

Change 488083 abandoned by Lucas Werkmeister (WMDE):
Add SchemaPatcher class

Reason:
We decided not to use the Wikibase libraries after all.

https://gerrit.wikimedia.org/r/488083

Change 488085 abandoned by Lucas Werkmeister (WMDE):
Implement WikibaseSchemaContentHandler::getUndoContent()

Reason:
We decided not to use the Wikibase libraries after all.

https://gerrit.wikimedia.org/r/488085

Michael added a subscriber: Michael.EditedFeb 14 2019, 1:58 PM

To implement this with the new approach we can look at the following previous patches:

The new Differ class was added in https://gerrit.wikimedia.org/r/#/q/I8ceb9e600543ddb4557a3cab4e43f5b982ba35b1.
This might also utilize the diff view implemented in another task.

Also, we will likely use the function wfMerge and need to understand how it works.

cc: @noarave

Michael claimed this task.Feb 14 2019, 4:39 PM
Restricted Application added a project: User-Michael. · View Herald TranscriptFeb 14 2019, 4:39 PM

Change 490847 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] WIP: Implement undo

https://gerrit.wikimedia.org/r/490847

Change 490897 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] WIP: Add Schema patcher

https://gerrit.wikimedia.org/r/490897

Change 490897 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Add Schema patcher

https://gerrit.wikimedia.org/r/490897

Change 492278 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseSchema@master] Show user commit message for undo

https://gerrit.wikimedia.org/r/492278

Change 490847 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Implement undo

https://gerrit.wikimedia.org/r/490847

We just tested it and at least the edit summary does not work yet. I typed in one in the edit summary field but it was not take over. Here is the edit: https://wikidata-shex.wmflabs.org/w/index.php?title=Schema:O1&diff=38&oldid=20

We just tested it and at least the edit summary does not work yet. I typed in one in the edit summary field but it was not take over. Here is the edit: https://wikidata-shex.wmflabs.org/w/index.php?title=Schema:O1&diff=38&oldid=20

Yeah, I noticed that after it was moved to verification. But since the functionality is already deployed, I left it there for you to check.

The patch for the edit summary is also up since Friday: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikibaseSchema/+/492278, but still needs review.

Change 492278 merged by jenkins-bot:
[mediawiki/extensions/WikibaseSchema@master] Show user summary message for undo

https://gerrit.wikimedia.org/r/492278

Lydia_Pintscher closed this task as Resolved.Feb 27 2019, 11:26 AM
Lydia_Pintscher moved this task from Verification to Done on the Shape Expressions Sprint 3 board.

\o/