Ottomata has submitted this change and it was merged.

Change subject: Basic MediaWiki events
......................................................................


Basic MediaWiki events

This is the first round of schemas we want to start using for the
EventBus. These schemas have been taken and modified from
https://github.com/wikimedia/restevent/pull/5 with the latest changes
based on comments and feedback.

Bug: T116247
Change-Id: I0c6f3e833c2368ac167e9287bc34dfa7653ee4dd
---
A jsonschema/mediawiki/PageDelete/PageDelete.yaml
A jsonschema/mediawiki/PageEdit/PageEdit.yaml
A jsonschema/mediawiki/PageMove/PageMove.yaml
A jsonschema/mediawiki/PageRestore/PageRestore.yaml
A jsonschema/mediawiki/RevisionVisibilitySet/RevisionVisibilitySet.yaml
5 files changed, 361 insertions(+), 0 deletions(-)

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



diff --git a/jsonschema/mediawiki/PageDelete/PageDelete.yaml 
b/jsonschema/mediawiki/PageDelete/PageDelete.yaml
new file mode 100644
index 0000000..be7f827
--- /dev/null
+++ b/jsonschema/mediawiki/PageDelete/PageDelete.yaml
@@ -0,0 +1,63 @@
+title: MediaWiki Page Delete
+description: Represents a MW Page Delete event
+$schema: http://json-schema.org/draft-04/schema#
+type: object
+properties:
+  # global event fields
+  meta:
+    type: object
+    properties:
+      topic:
+        type: string
+        description: the queue topic name this message belongs to
+      schema:
+        type: string
+        description: The name of this schema
+      revision:
+        type: integer
+        description: The revision of this schema
+      uri:
+        type: string
+        format: uri
+        description: the unique URI identifying the event
+      request_id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique UUID v1 ID of the event derived from the 
X-Request-Id header
+      id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique ID of this event; should match the dt field
+      dt:
+        type: string
+        format: date-time
+        description: the time stamp of the event, in ISO8601 format
+      domain:
+        type: string
+        description: the domain the event pertains to
+    required:
+      - topic
+      - uri
+      - id
+      - dt
+      - domain
+  # event-specific fields
+  title:
+    type: string
+    description: the title of the page
+  page_id:
+    type: integer
+    minimum: 1
+    description: the page ID of the deleted page
+  user_id:
+    type: integer
+    description: the user that performed the delete
+  user_text:
+    type: string
+    description: the text representation of the user
+  summary:
+    type: string
+    description: the summary comment left by the user
+required:
+  - meta
+  - title
diff --git a/jsonschema/mediawiki/PageEdit/PageEdit.yaml 
b/jsonschema/mediawiki/PageEdit/PageEdit.yaml
new file mode 100644
index 0000000..a994cf9
--- /dev/null
+++ b/jsonschema/mediawiki/PageEdit/PageEdit.yaml
@@ -0,0 +1,80 @@
+title: MediaWiki Page Edit
+description: Represents a MW Page Edit event
+$schema: http://json-schema.org/draft-04/schema#
+type: object
+properties:
+  # global event fields
+  meta:
+    type: object
+    properties:
+      topic:
+        type: string
+        description: the queue topic name this message belongs to
+      schema:
+        type: string
+        description: The name of this schema
+      revision:
+        type: integer
+        description: The revision of this schema
+      uri:
+        type: string
+        format: uri
+        description: the unique URI identifying the event
+      request_id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique UUID v1 ID of the event derived from the 
X-Request-Id header
+      id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique ID of this event; should match the dt field
+      dt:
+        type: string
+        format: date-time
+        description: the time stamp of the event, in ISO8601 format
+      domain:
+        type: string
+        description: the domain the event pertains to
+    required:
+      - topic
+      - uri
+      - id
+      - dt
+      - domain
+  # event-specific fields
+  title:
+    type: string
+    description: the title of the edited page
+  page_id:
+    type: integer
+    minimum: 1
+    description: the page ID of the edited page
+  namespace:
+    type: integer
+    description: the namespace ID the page belongs to
+  revision_id:
+    type: integer
+    minimum: 1
+    description: the revision ID created by this edit event
+  parent_revision_id:
+    type: integer
+    minimum: 1
+    description: the revision ID that the edit is based on
+  save_dt:
+    type: string
+    format: date-time
+    description: the time stamp of the revision in ISO8601 format
+  user_id:
+    type: integer
+    description: the user that performed the edit
+  user_text:
+    type: string
+    description: the text representation of the user
+  summary:
+    type: string
+    description: the summary comment left by the user
+required:
+  - meta
+  - title
+  - revision_id
+  - save_dt
diff --git a/jsonschema/mediawiki/PageMove/PageMove.yaml 
b/jsonschema/mediawiki/PageMove/PageMove.yaml
new file mode 100644
index 0000000..b7ac73a
--- /dev/null
+++ b/jsonschema/mediawiki/PageMove/PageMove.yaml
@@ -0,0 +1,76 @@
+title: MediaWiki Page Move
+description: Represents a MW Page Move event
+$schema: http://json-schema.org/draft-04/schema#
+type: object
+properties:
+  # global event fields
+  meta:
+    type: object
+    properties:
+      topic:
+        type: string
+        description: the queue topic name this message belongs to
+      schema:
+        type: string
+        description: The name of this schema
+      revision:
+        type: integer
+        description: The revision of this schema
+      uri:
+        type: string
+        format: uri
+        description: the unique URI identifying the event
+      request_id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique UUID v1 ID of the event derived from the 
X-Request-Id header
+      id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique ID of this event; should match the dt field
+      dt:
+        type: string
+        format: date-time
+        description: the time stamp of the event, in ISO8601 format
+      domain:
+        type: string
+        description: the domain the event pertains to
+    required:
+      - topic
+      - uri
+      - id
+      - dt
+      - domain
+  # event-specific fields
+  new_title:
+    type: string
+    description: the new title of the page
+  old_title:
+    type: string
+    description: the old title of the page
+  page_id:
+    type: integer
+    minimum: 1
+    description: the page ID of the moved page
+  old_revision_id:
+    type: integer
+    minimum: 1
+    description: the last revision ID before the move
+  new_revision_id:
+    type: integer
+    minimum: 1
+    description: the first revision ID after the move
+  user_id:
+    type: integer
+    description: the user that performed the move
+  user_text:
+    type: string
+    description: the text representation of the user
+  summary:
+    type: string
+    description: the summary comment left by the user
+required:
+  - meta
+  - new_title
+  - old_title
+  - page_id
diff --git a/jsonschema/mediawiki/PageRestore/PageRestore.yaml 
b/jsonschema/mediawiki/PageRestore/PageRestore.yaml
new file mode 100644
index 0000000..176e41e
--- /dev/null
+++ b/jsonschema/mediawiki/PageRestore/PageRestore.yaml
@@ -0,0 +1,70 @@
+title: MediaWiki Page Restore
+description: Represents a MW Page Restore Edit event
+$schema: http://json-schema.org/draft-04/schema#
+type: object
+properties:
+  # global event fields
+  meta:
+    type: object
+    properties:
+      topic:
+        type: string
+        description: the queue topic name this message belongs to
+      schema:
+        type: string
+        description: The name of this schema
+      revision:
+        type: integer
+        description: The revision of this schema
+      uri:
+        type: string
+        format: uri
+        description: the unique URI identifying the event
+      request_id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique UUID v1 ID of the event derived from the 
X-Request-Id header
+      id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique ID of this event; should match the dt field
+      dt:
+        type: string
+        format: date-time
+        description: the time stamp of the event, in ISO8601 format
+      domain:
+        type: string
+        description: the domain the event pertains to
+    required:
+      - topic
+      - uri
+      - id
+      - dt
+      - domain
+  # event-specific fields
+  title:
+    type: string
+    description: the title of the page
+  new_page_id:
+    type: integer
+    minimum: 1
+    description: the new page ID of the restored page
+  old_page_id:
+    type: integer
+    minimum: 1
+    description: the old page ID of the restored page
+  namespace:
+    type: integer
+    description: the namespace ID the page belongs to
+  user_id:
+    type: integer
+    description: the user that performed the restoration
+  user_text:
+    type: string
+    description: the text representation of the user
+  summary:
+    type: string
+    description: the summary comment left by the user
+required:
+  - meta
+  - title
diff --git 
a/jsonschema/mediawiki/RevisionVisibilitySet/RevisionVisibilitySet.yaml 
b/jsonschema/mediawiki/RevisionVisibilitySet/RevisionVisibilitySet.yaml
new file mode 100644
index 0000000..253a45f
--- /dev/null
+++ b/jsonschema/mediawiki/RevisionVisibilitySet/RevisionVisibilitySet.yaml
@@ -0,0 +1,72 @@
+title: MediaWiki Revision Visibility Set
+description: Represents a MW Revision Visibility Set event
+$schema: http://json-schema.org/draft-04/schema#
+type: object
+properties:
+  # global event fields
+  meta:
+    type: object
+    properties:
+      topic:
+        type: string
+        description: the queue topic name this message belongs to
+      schema:
+        type: string
+        description: The name of this schema
+      revision:
+        type: integer
+        description: The revision of this schema
+      uri:
+        type: string
+        format: uri
+        description: the unique URI identifying the event
+      request_id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique UUID v1 ID of the event derived from the 
X-Request-Id header
+      id:
+        type: string
+        pattern: '^[a-fA-F0-9]{8}(-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12}$'
+        description: the unique ID of this event; should match the dt field
+      dt:
+        type: string
+        format: date-time
+        description: the time stamp of the event, in ISO8601 format
+      domain:
+        type: string
+        description: the domain the event pertains to
+    required:
+      - topic
+      - uri
+      - id
+      - dt
+      - domain
+  # event-specific fields
+  revision_id:
+    type: integer
+    minimum: 1
+    description: the revision ID the visibility of which is being changed
+  hidden:
+    type: object
+    properties:
+      sha1:
+        type: boolean
+        description: "whether the SHA1 of the revision's text is available"
+      text:
+        type: boolean
+        description: "whether the revision's text is available"
+      user:
+        type: boolean
+        description: "whether the author of the revision's text is available"
+      comment:
+        type: boolean
+        description: whether the comment of the revision is available
+  user_id:
+    type: integer
+    description: the user that performed the visibility change
+  user_text:
+    type: string
+    description: the text representation of the user
+required:
+  - meta
+  - revision_id

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c6f3e833c2368ac167e9287bc34dfa7653ee4dd
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/event-schemas
Gerrit-Branch: master
Gerrit-Owner: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Halfak <ahalfa...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Nuria <nu...@wikimedia.org>
Gerrit-Reviewer: Ottomata <o...@wikimedia.org>

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

Reply via email to