Page MenuHomePhabricator

Add the nowcommons template to the source wiki if requested
Open, Needs TriagePublic8 Story Points

Description

Mock


Texts

You can declare on the source wiki that this file has been imported to <target wiki>. This is done by adding a {{<template name>}} template to the original file page in your name.

  • mark source wiki file as imported to <target wiki>

Acceptance Criteria

  • Add a new section on the preview page as shown in the mock, which allows people to decide whether or not they want to inform the source wiki about the file move.
  • By default, the checkbox is set to “do the automated edit”
  • If the field is clicked and the transfer was successful, the edit is done automatically
  • The edit should be made in the name of the moving user, with the edit summary “This file is now on Wikimedia Commons (moved with FileImporter).”
  • This ticket does not include an changes to the success message handling.

Related Objects

Mentioned In
T226532: If rights exist, suggest automatic deletion of the source wiki file
rEFLI05bd86e1f140: Fix bug involving file renaming and centralauth cleanup/delete
rEFLIbddac62d5046: Remove misplaced comma
rEFLIb4c2f6ac7e64: Option to edit source wiki should be enabled by default
rEFLI5538c2f0ac58: Include a newline with the template, so it always appears on its own line.
rEFLId4b64a88c7b6: Include a newline with the template, so it always appears on its own line.
rEFLI99604822e03f: Assert status after post-import edit
rEFLI56220f23bdc1: Assert status after post-import edit
rEFLI0e2520875b7e: Tests for source wiki editing
rEFLI038f8b09890c: Allow automatic adding of the NowCommons template to the source wiki
T227064: User notification when an automated source edit or deletion fails
rEFLI02c708722499: Allow automatic adding of the NowCommons template to the source wiki
rEFLIf10f3a6d3c03: Allow automatic adding of the NowCommons template to the source wiki
rEFLIb9f65ad1cedd: [WIP] Set notice in file on the source wiki
rEFLI5e93dd5303a7: [WIP] Set notice in file on the source wiki
rEFLI3cbafb92a361: [WIP] Set notice in file on the source wiki
rEFLI713396c66380: [WIP] Set notice in file on the source wiki
rEFLI80ea4e2bfebc: [WIP] Set notice in file on the source wiki
rEFLI7d73dfd6ef70: Post import handler does our success lifting
rEFLIbb0238e06fd1: [WIP] Post import handler does our success lifting
rEFLIed04bac7f847: [WIP] Set notice in file on the source wiki
rEFLI9dcae2b828bf: [WIP] Post import handler does our success lifting
rEFLI66b7bedd80de: [WIP] Set notice in file on the source wiki
rEFLI7b022207979c: [WIP] Set notice in file on the source wiki
rEFLI3a636e6333fd: [WIP] Set notice in file on the source wiki
rEFLI1020d0e35027: [WIP] UI elements to confirm source wiki edits
rEFLI878b3bcbc8ce: [WIP] Add the nowcommons template to the source wiki if requested
T226075: Improve showing of success message
rEFLI596f601ded29: [WIP] Add the nowcommons template to the source wiki if requested
Mentioned Here
T226532: If rights exist, suggest automatic deletion of the source wiki file
T226075: Improve showing of success message

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 517884 abandoned by Awight:
[WIP] UI elements to confirm source wiki edits

Reason:
Squashed into I85f2321220d9eb78fa3acbfe0cb13e4dfcdb30ac

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

WMDE-Fisch updated the task description. (Show Details)Jun 25 2019, 11:23 AM

Just realizing that now while wiring up all parts of the logic here:

We do not really have a fallback - involving source wiki editing - for the case, that there's no template to add ( since we could not figure the right one ).

So at some point we had the idea of just adding a comment to the source wiki, something along the lines of <!--This file was moved to $1 using the FileExporter-->. I don't know if we want to consider this an option, so just wanted to mention it.

Change 519027 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[integration/config@master] Add CentralAuth to FileImporter required extensions

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

sounds fine to me if you know where to append the text (probably at the very end to not mess up anything)

Change 519027 merged by jenkins-bot:
[integration/config@master] Add CentralAuth to FileImporter required extensions

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

WMDE-Fisch changed the point value for this task from 8 to 5.
WMDE-Fisch changed the point value for this task from 5 to 8.
WMDE-Fisch moved this task from Sprint Backlog to Doing on the WMDE-QWERTY-Sprint-2019-06-26 board.

Change 386205 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] [WIP] Set notice in file on the source wiki

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

Change 519415 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] [WIP] Post import handler does our success lifting

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

Change 519415 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Post import handler does our success lifting

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

@JStrodt_WMDE @Lea_WMDE
What text should be presented to the user on a successful import with a successful source wiki template-addition?

@WMDE-Fisch As I understand it, that's included in T226075. @Lea_WMDE Correct?

@WMDE-Fisch As I understand it, that's included in T226075. @Lea_WMDE Correct?

Ah yeah, sorry I kind of overlooked that. Using The file has been successfully imported to <target wiki name>. from T226075 now.

So last message I'm missing:

For the case, that the user wants the auto source edit, but for some reason the auto source edit fails, I would then show this message
The import was successful. To declare that the file is now on <target wiki name>, please return to [[the original file]] and add this template: {{<template name>}}.
but would also want to show a warning, that the auto edit failed. Something along the lines of
Editing the source wiki automatically was not possible please follow the instructions above.

( the "warning" about the failed source wiki edit will be shown underneath the success message )

@JStrodt_WMDE

@WMDE-Fisch: I would prefer the error message to appear before describing the next step. How about this?

The import was successful, but the template {{<template name>}} could not be added automatically on the source wiki. Please return to [[the original file]] and manually add {{<template name>}} to declare that the file is now on <target wiki name>.

Question: Can we give more specifics about why the source wiki couldn't be edited automatically?

Question: Can we give more specifics about why the source wiki couldn't be edited automatically?

If that is not a 5 minute task, but we could theoretically do it, could you please create another ticket for it?
Thanks :)

awight added a subscriber: awight.Jul 2 2019, 8:16 AM

Question: Can we give more specifics about why the source wiki couldn't be edited automatically?

If that is not a 5 minute task, but we could theoretically do it, could you please create another ticket for it?
Thanks :)

I'll split this into a new ticket, because this task's work is otherwise complete, and we have the same question for T226532.

Change 386205 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Allow automatic adding of the NowCommons template to the source wiki

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

Change 519294 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] Tests for source wiki editing

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

Change 520217 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] Assert status after post-import edit

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

Change 520234 had a related patch set uploaded (by Awight; owner: Awight):
[operations/mediawiki-config@master] Enable experimental FileImporter features on labs

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

Change 519294 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Tests for source wiki editing

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

Change 520217 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Assert status after post-import edit

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

Change 520234 merged by jenkins-bot:
[operations/mediawiki-config@master] Enable experimental FileImporter features on labs

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

awight added a comment.Jul 3 2019, 1:16 PM

Minor bug report: We should include a newline before the template, here's an example edit:
https://de.wikipedia.beta.wmflabs.org/w/index.php?title=Datei:Green_Test.png&diff=24510&oldid=22444

Change 520438 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] Include a newline with the template, so it always appears on its own line.

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

Change 520447 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] Option to edit source wiki should be enabled by default

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

Change 520438 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Include a newline with the template, so it always appears on its own line.

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

Change 520447 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Option to edit source wiki should be enabled by default

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

I don't manage to test this before my vacation anymore, my newly created account has too few rights, and my actual one too many :/ Could you please self test this one? Thank you!

Pikne added a subscriber: Pikne.Jul 6 2019, 7:21 PM

Tiny note from translator: comma seems to be misplaced in message "Editing, the source wiki automatically was not possible please follow the instructions above."

Change 521227 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] Remove misplaced comma

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

Tiny note from translator: comma seems to be misplaced in message "Editing, the source wiki automatically was not possible please follow the instructions above."

Thanks. I uploaded a fix for it.

Change 521227 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Remove misplaced comma

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

Change 522052 had a related patch set uploaded (by Andrew-WMDE; owner: Andrew-WMDE):
[mediawiki/extensions/FileImporter@master] [WIP] Fix bug involving file renaming and centralauth cleanup/delete

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

Change 522052 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Fix bug involving file renaming and centralauth cleanup/delete

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

Change 523618 had a related patch set uploaded (by Awight; owner: Andrew-WMDE):
[mediawiki/extensions/FileImporter@wmf/1.34.0-wmf.13] Fix bug involving file renaming and centralauth cleanup/delete

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

Change 523661 had a related patch set uploaded (by Awight; owner: Awight):
[operations/mediawiki-config@master] Enable FileImporter source wiki edit and delete

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

Change 523618 abandoned by Awight:
Fix bug involving file renaming and centralauth cleanup/delete

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

Planning to enable in production on Monday, July 22nd.

Change 523661 merged by jenkins-bot:
[operations/mediawiki-config@master] Enable FileImporter source wiki edit and delete

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

Mentioned in SAL (#wikimedia-operations) [2019-07-22T11:13:05Z] <awight@deploy1001> Synchronized wmf-config/CommonSettings.php: SWAT: [[gerrit:523661|Enable FileImporter source wiki edit and delete (T225617, T226532)]] (duration: 00m 56s)

Mentioned in SAL (#wikimedia-operations) [2019-07-22T11:14:36Z] <awight@deploy1001> Synchronized wmf-config/CommonSettings-labs.php: SWAT: [[gerrit:523661|Enable FileImporter source wiki edit and delete, (remove labs customizations) (T225617, T226532)]] (duration: 00m 54s)