Legoktm has uploaded a new change for review.

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

Change subject: Fetch the latest revision id and store it in the env
......................................................................

Fetch the latest revision id and store it in the env

This will be used in a follow up to avoid sending linter API requests
when the parse was for the non-latest revision id.

The variable `latest` is used to correspond to the `page_latest`
database column.

Change-Id: I0f4b4d57d75adcd924c4eca72a3d1829d6edb81d
---
M lib/config/MWParserEnvironment.js
M lib/mw/ApiRequest.js
2 files changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/lib/config/MWParserEnvironment.js 
b/lib/config/MWParserEnvironment.js
index 002cd50..234a288 100644
--- a/lib/config/MWParserEnvironment.js
+++ b/lib/config/MWParserEnvironment.js
@@ -347,6 +347,7 @@
        // Update other page properties
        this.page.id = metadata.id;
        this.page.ns = metadata.ns;
+       this.page.latest = metadata.latest;
        this.page.src = (metadata.revision && metadata.revision['*']) || '';
 };
 
diff --git a/lib/mw/ApiRequest.js b/lib/mw/ApiRequest.js
index 3915e31..5394a0d 100644
--- a/lib/mw/ApiRequest.js
+++ b/lib/mw/ApiRequest.js
@@ -479,7 +479,7 @@
        var apiargs = {
                format: 'json',
                action: 'query',
-               prop: 'revisions',
+               prop: 'info|revisions',
                rawcontinue: 1,
                rvprop: PARSOID_RVPROP,
        };
@@ -564,6 +564,7 @@
                        }
                        metadata.id = page.pageid;
                        metadata.ns = page.ns;
+                       metadata.latest = page.lastrevid;
                        metadata.revision = page.revisions[0];
 
                        if (metadata.revision.texthidden || 
!metadata.revision.hasOwnProperty("*")) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f4b4d57d75adcd924c4eca72a3d1829d6edb81d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

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

Reply via email to