jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/343765 )

Change subject: Added mediawiki.page-restrictions-change schema.
......................................................................


Added mediawiki.page-restrictions-change schema.

Bug: T160942
Change-Id: I8798a78b6dacd7544763ee926980b3473d6cce3f
---
M config/eventbus-topics.yaml
A jsonschema/mediawiki/page/restrictions-change/1.yaml
2 files changed, 147 insertions(+), 0 deletions(-)

Approvals:
  Mobrovac: Looks good to me, approved
  Ottomata: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/config/eventbus-topics.yaml b/config/eventbus-topics.yaml
index 21ece4d..a3031fd 100644
--- a/config/eventbus-topics.yaml
+++ b/config/eventbus-topics.yaml
@@ -21,6 +21,9 @@
 mediawiki.page-properties-change:
   schema_name: mediawiki/page/properties-change
 
+mediawiki.page-restrictions-change:
+  schema_name: mediawiki/page/restrictions-change
+
 mediawiki.revision-visibility-change:
   schema_name: mediawiki/revision/visibility-change
 
diff --git a/jsonschema/mediawiki/page/restrictions-change/1.yaml 
b/jsonschema/mediawiki/page/restrictions-change/1.yaml
new file mode 100644
index 0000000..7a4a96c
--- /dev/null
+++ b/jsonschema/mediawiki/page/restrictions-change/1.yaml
@@ -0,0 +1,144 @@
+title: mediawiki/page/restrictions-change
+description: Represents a MW Page Restrictions Change event.
+$schema: http://json-schema.org/draft-04/schema#
+type: object
+properties:
+  ### Meta data object.  All events schemas should have this.
+  meta:
+    type: object
+    properties:
+      topic:
+        description: The queue topic name this message belongs to.
+        type: string
+      schema_uri:
+        description: >
+          The URI identifying the jsonschema for this event.  This may be just
+          a short uri containing only the name and revision at the end of the
+          URI path.  e.g. schema_name/12345 is acceptable.  This field
+          is not required.
+        type: string
+      uri:
+        description: The unique URI identifying the event.
+        type: string
+        format: uri
+      request_id:
+        description: The unique UUID v1 ID of the event derived from the 
X-Request-Id header.
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+      id:
+        description: The unique ID of this event; should match the dt field.
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+      dt:
+        description: The time stamp of the event, in ISO8601 format.
+        type: string
+        format: date-time
+      domain:
+        description: The domain the event pertains to.
+        type: string
+    required:
+      - topic
+      - uri
+      - id
+      - dt
+      - domain
+
+
+  ### Mediawiki entity fields.  All Mediawiki entity events should have these.
+  database:
+    description: The name of the wiki database this event belongs to.
+    type: string
+
+  performer:
+    description: Represents the user that performed this change.
+    type: object
+    properties:
+      user_id:
+        description: >
+          The user id that performed this change.  This is optional, and
+          will not be present for anonymous users.
+        type: integer
+      user_text:
+        description: The text representation of the user that performed this 
change.
+        type: string
+      user_groups:
+        description: A list of the groups this user belongs to.  E.g. bot, 
sysop etc.
+        type: array
+        items:
+          type: string
+      user_is_bot:
+        description: >
+          True if this user is considered to be a bot.  This is checked
+          via the $user->isBot() method, which considers both user_groups
+          and user permissions.
+        type: boolean
+    required:
+      - user_text
+      - user_groups
+      - user_is_bot
+
+  ### page entity fields - all page related events should have these.
+  page_id:
+    description: The page ID of the page which restrictions has been changed.
+    type: integer
+    # This event is emitted async from the JobQueue and if the page was
+    # deleted before the hook was executed, the returned page_id is 0
+    minimum: 0
+
+  page_title:
+    description: The normalized title of the page.
+    type: string
+
+  page_namespace:
+    description: The namespace ID this page belongs to.
+    type: integer
+
+  page_is_redirect:
+    description: >
+      True if this page is currently a redirect page.  This
+      fact is ultimately represented by revision content containing
+      redirect wikitext.  If rev_id's content has redirect wikitext,
+      then this page is a redirect.  Note that this state is also
+      stored on the Mediawiki page table.
+    type: boolean
+
+  rev_id:
+    description: The head revision of the page which restrictions has been 
changed.
+    type: integer
+    minimum: 0
+
+
+  ### page restrictions change specific fields.
+  page_restrictions: &page_restrictions_schema
+    description: >
+      The new restrictions applied to the page. If one of the properties is 
present,
+      that means the specific action has been restricted to a member of a 
specific
+      user group. An empty string means that a particular action is not 
restricted.
+    patternProperties:
+      '^.+$':
+        type: string
+    type: object
+
+  reason:
+    type: string
+    description: Explanation of the reason for protecting the page.
+
+  prior_state:
+    description: >
+      The prior state of the entity before this event. If a top level entity
+      field is not present in this object, then its value has not changed
+      since the prior event.
+    type: object
+    properties:
+      page_restrictions: *page_restrictions_schema
+
+required:
+  - meta
+  - database
+  - page_id
+  - page_title
+  - page_namespace
+  - page_is_redirect
+  - rev_id
+  - reason
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8798a78b6dacd7544763ee926980b3473d6cce3f
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/event-schemas
Gerrit-Branch: master
Gerrit-Owner: Ppchelko <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: Ppchelko <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to