Mobrovac has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362278 )

Change subject: Config: Support red links in ChangeProp
......................................................................


Config: Support red links in ChangeProp

Bug: T133221
Change-Id: I98790e65ffd91fcae82a66de8ac686ccfcc46bd3
---
M scap/templates/config.yaml.j2
1 file changed, 60 insertions(+), 6 deletions(-)

Approvals:
  Mobrovac: Verified; Looks good to me, approved



diff --git a/scap/templates/config.yaml.j2 b/scap/templates/config.yaml.j2
index 7f5c714..7ffa612 100644
--- a/scap/templates/config.yaml.j2
+++ b/scap/templates/config.yaml.j2
@@ -245,6 +245,10 @@
                       cache-control: no-cache
                     query:
                       redirect: false
+                  # The links to the deleted page should become red again
+                  - method: post
+                    uri: '/sys/links/backlinks/{message.page_title}'
+                    body: '{{globals.message}}'
                   # For page deletion RESTBase doesn't emit resource_change 
events, and to go through
                   # the normal purge chain (html update -> html 
resource_change -> summary update -> summary resource_change)
                   # we need to add many workarounds/shortcurst in RESTBase. So 
having this list here is an OK compromise.
@@ -276,12 +280,16 @@
                       domain: /\.wikidata\.org$/
                     page_namespace: 120
                 exec:
-                  method: get
-                  uri: '<%= restbase_uri 
%>/{{message.meta.domain}}/v1/page/title/{message.page_title}'
-                  headers:
-                    cache-control: no-cache
-                  query:
-                    redirect: false
+                  - method: get
+                    uri: '<%= restbase_uri 
%>/{{message.meta.domain}}/v1/page/title/{message.page_title}'
+                    headers:
+                      cache-control: no-cache
+                    query:
+                      redirect: false
+                  # The links to the restored page should not be red any more
+                  - method: post
+                    uri: '/sys/links/backlinks/{message.page_title}'
+                    body: '{{globals.message}}'
 
               page_move:
                 topic: mediawiki.page-move
@@ -335,6 +343,52 @@
                       uri: 
'/sys/links/transcludes/{message.original_event.page_title}'
                       body: '{{globals.message}}'
 
+              page_create:
+                topic: mediawiki.page-create
+                retry_on:
+                  status:
+                    - '5xx'
+                    - 404 # Sometimes occasional 404s happen because of the 
mysql replication lag, so retry
+                match_not:
+                  - meta:
+                      domain: /\.wikidata\.org$/
+                    page_namespace: 0
+                  - meta:
+                      domain: /\.wikidata\.org$/
+                    page_namespace: 120
+                exec:
+                  - method: post
+                    uri: '/sys/links/backlinks/{message.page_title}'
+                    body: '{{globals.message}}'
+
+              on_backlinks_update:
+                topic: change-prop.backlinks.resource-change
+                limiters:
+                  blacklist: '{message.meta.uri}'
+                cases:
+                  - match:
+                      meta:
+                        schema_uri: 'resource_change/1'
+                        uri: '/https?:\/\/[^\/]+\/wiki\/(?<title>.+)/'
+                      tags: [ 'backlinks' ]
+                    exec:
+                      method: get
+                      uri: '<%= restbase_uri 
%>/{{message.meta.domain}}/v1/page/html/{{match.meta.uri.title}}'
+                      headers:
+                        cache-control: no-cache
+                        if-unmodified-since: '{{date(message.meta.dt)}}'
+                        x-restbase-mode: '{{message.tags[1]}}'
+                      query:
+                        redirect: false
+                  - match:
+                      meta:
+                        schema_uri: 'continue/1'
+                    exec:
+                      method: post
+                      uri: 
'/sys/links/backlinks/{message.original_event.page_title}'
+                      body: '{{globals.message}}'
+
+
               # ORES caching updates
               <%- if ores_uris is not defined -%>
                 <%- set ores_uris = [ ores_uri ] -%>

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I98790e65ffd91fcae82a66de8ac686ccfcc46bd3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/change-propagation/deploy
Gerrit-Branch: master
Gerrit-Owner: Ppchelko <ppche...@wikimedia.org>
Gerrit-Reviewer: GWicke <gwi...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Ppchelko <ppche...@wikimedia.org>

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

Reply via email to