Subramanya Sastry has uploaded a new change for review.

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

Change subject: WIP: T119265: Add more page-level metadata required by MCS
......................................................................

WIP: T119265: Add more page-level metadata required by MCS

* Some additional cleanup as a followup to 89f0eedf -- no need to
  fetch and store that metadata if we aren't going to spit it out.

* Need to figure out what else we need to add and where it is
  available.

Change-Id: I99781d0668871398de349fa6f4579cb0bb29488a
---
M lib/config/MWParserEnvironment.js
M lib/mw/ApiRequest.js
M lib/wt2html/DOMPostProcessor.js
3 files changed, 19 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/80/307880/1

diff --git a/lib/config/MWParserEnvironment.js 
b/lib/config/MWParserEnvironment.js
index e7de92d..b75e3f0 100644
--- a/lib/config/MWParserEnvironment.js
+++ b/lib/config/MWParserEnvironment.js
@@ -325,11 +325,8 @@
                r.revid = metadata.revision.revid;
                r.parentid = metadata.revision.parentid;
                r.timestamp = metadata.revision.timestamp;
-               r.user = metadata.revision.user;
-               r.userid = metadata.revision.userid;
                r.sha1 = metadata.revision.sha1;
                r.size = metadata.revision.size;
-               r.comment = metadata.revision.comment;
                r.contentmodel = metadata.revision.contentmodel;
                r.contentformat = metadata.revision.contentformat;
        }
diff --git a/lib/mw/ApiRequest.js b/lib/mw/ApiRequest.js
index 886f856..494d71b 100644
--- a/lib/mw/ApiRequest.js
+++ b/lib/mw/ApiRequest.js
@@ -76,7 +76,7 @@
 var latestSerial = 0;
 
 // all revision properties which parsoid is interested in.
-var PARSOID_RVPROP = 
('content|ids|timestamp|user|userid|size|sha1|contentmodel|comment');
+var PARSOID_RVPROP = ('content|ids|timestamp|size|sha1|contentmodel');
 
 var logAPIWarnings = function(req, data) {
        if (req.env.conf.parsoid.logMwApiWarnings &&
diff --git a/lib/wt2html/DOMPostProcessor.js b/lib/wt2html/DOMPostProcessor.js
index eafe367..3a01450 100644
--- a/lib/wt2html/DOMPostProcessor.js
+++ b/lib/wt2html/DOMPostProcessor.js
@@ -37,10 +37,15 @@
                property: 'mw:articleNamespace',
                content: '%d',
        },
-       // the articleID is not stable across article deletion/restore, while
-       // the revisionID is.  So we're going to omit the articleID from the
-       // parsoid API for now; uncomment if we find a use case.
-       //  id: 'mw:articleId',
+       // articleID is not stable across article deletion/restore,
+       // while the revisionID is. However, Mobile Content Service
+       // wants this. See https://phabricator.wikimedia.org/T119265
+       id: {
+               property: 'mw:articleId',
+               content: '%d',
+       },
+
+       // DO NOT ADD rev_user, rev_userid, and rev_comment (See T125266)
 
        // 'rev_revid' is used to set the overall subject of the document, we 
don't
        // need to add a specific <meta> or <link> element for it.
@@ -302,6 +307,15 @@
                document.documentElement.setAttribute(
                        'about', mwrPrefix + 'revision/' + m.get('rev_revid'));
        }
+
+       // SSS quick hack for now .. check if we already have these in 
normalized form.
+       if (env.conf.wiki.mainpage.replace(/_/g, ' ') === 
env.page.name.replace(/_/g, ' ')) {
+               appendToHead(document, 'meta', {
+                       'property': 'isMainPage',
+                       'content': true,
+               });
+       }
+
        // Set the parsoid content-type strings
        appendToHead(document, 'meta', {
                'property': 'mw:html:version',

-- 
To view, visit https://gerrit.wikimedia.org/r/307880
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I99781d0668871398de349fa6f4579cb0bb29488a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <ssas...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to