Ppchelko has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/397709 )
Change subject: Temporary removed 'pattern' for request_id from schemas. ...................................................................... Temporary removed 'pattern' for request_id from schemas. In MediaWiki the request_id is actually a 26-symbols-long random string obtained with WebRequest::getRequestID(), however EventBus for some reason uses some custom method of obtaining the request ID. However, seems like that metod always fails and defaults to a v1 UUID - including that doesn't have anything in common with the actual MediaWiki request ID. As MediaWiki request ID will have different pattern, we need to first remove the pattern property, deploy code changes, and then reintroduce the pattern. Change-Id: Ieab17db6f7ed1a7d37ee801d581791a240bbe74b --- M jsonschema/change-prop/continue/1.yaml M jsonschema/change-prop/retry/1.yaml M jsonschema/error/1.yaml M jsonschema/mediawiki/job/1.yaml M jsonschema/mediawiki/page/delete/2.yaml M jsonschema/mediawiki/page/move/1.yaml M jsonschema/mediawiki/page/move/2.yaml M jsonschema/mediawiki/page/properties-change/1.yaml M jsonschema/mediawiki/page/restrictions-change/1.yaml M jsonschema/mediawiki/page/undelete/2.yaml M jsonschema/mediawiki/recentchange/1.yaml M jsonschema/mediawiki/revision/create/2.yaml M jsonschema/mediawiki/revision/visibility-change/1.yaml M jsonschema/mediawiki/user/blocks-change/1.yaml M jsonschema/resource_change/1.yaml M jsonschema/test/event/1.yaml M test/jsonschema/index.js M test/jsonschema/meta_common_schema.yaml 18 files changed, 18 insertions(+), 33 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/event-schemas refs/changes/09/397709/1 diff --git a/jsonschema/change-prop/continue/1.yaml b/jsonschema/change-prop/continue/1.yaml index ae5f67c..7566d49 100644 --- a/jsonschema/change-prop/continue/1.yaml +++ b/jsonschema/change-prop/continue/1.yaml @@ -23,8 +23,7 @@ description: the unique URI identifying the event / resource 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 + description: The unique ID of the request that caused 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}$' diff --git a/jsonschema/change-prop/retry/1.yaml b/jsonschema/change-prop/retry/1.yaml index 1d0be6b..caed5f4 100644 --- a/jsonschema/change-prop/retry/1.yaml +++ b/jsonschema/change-prop/retry/1.yaml @@ -23,8 +23,7 @@ description: the unique URI identifying the event / resource 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 + description: The unique ID of the request that caused 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}$' diff --git a/jsonschema/error/1.yaml b/jsonschema/error/1.yaml index 5734d0a..2e9bec0 100644 --- a/jsonschema/error/1.yaml +++ b/jsonschema/error/1.yaml @@ -23,8 +23,7 @@ description: the unique URI identifying the event / resource 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 + description: The unique ID of the request that caused 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}$' diff --git a/jsonschema/mediawiki/job/1.yaml b/jsonschema/mediawiki/job/1.yaml index 1517323..e9ab20b 100644 --- a/jsonschema/mediawiki/job/1.yaml +++ b/jsonschema/mediawiki/job/1.yaml @@ -23,7 +23,7 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: the unique ID of the request that caused the event derived from the X-Request-Id header. type: string pattern: '^[a-zA-Z0-9\-@]+$' id: diff --git a/jsonschema/mediawiki/page/delete/2.yaml b/jsonschema/mediawiki/page/delete/2.yaml index 65e35e8..17affdc 100644 --- a/jsonschema/mediawiki/page/delete/2.yaml +++ b/jsonschema/mediawiki/page/delete/2.yaml @@ -22,9 +22,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: the unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/page/move/1.yaml b/jsonschema/mediawiki/page/move/1.yaml index 6191b6d..e725752 100644 --- a/jsonschema/mediawiki/page/move/1.yaml +++ b/jsonschema/mediawiki/page/move/1.yaml @@ -22,9 +22,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/page/move/2.yaml b/jsonschema/mediawiki/page/move/2.yaml index bc13f62..27ca2a3 100644 --- a/jsonschema/mediawiki/page/move/2.yaml +++ b/jsonschema/mediawiki/page/move/2.yaml @@ -22,9 +22,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/page/properties-change/1.yaml b/jsonschema/mediawiki/page/properties-change/1.yaml index 1d4266e..daa2cda 100644 --- a/jsonschema/mediawiki/page/properties-change/1.yaml +++ b/jsonschema/mediawiki/page/properties-change/1.yaml @@ -22,9 +22,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/page/restrictions-change/1.yaml b/jsonschema/mediawiki/page/restrictions-change/1.yaml index 47d5abb..3f1256a 100644 --- a/jsonschema/mediawiki/page/restrictions-change/1.yaml +++ b/jsonschema/mediawiki/page/restrictions-change/1.yaml @@ -22,9 +22,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/page/undelete/2.yaml b/jsonschema/mediawiki/page/undelete/2.yaml index d25e9d5..4c67bf3 100644 --- a/jsonschema/mediawiki/page/undelete/2.yaml +++ b/jsonschema/mediawiki/page/undelete/2.yaml @@ -22,9 +22,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/recentchange/1.yaml b/jsonschema/mediawiki/recentchange/1.yaml index a3ebbad..26c6d4f 100644 --- a/jsonschema/mediawiki/recentchange/1.yaml +++ b/jsonschema/mediawiki/recentchange/1.yaml @@ -24,9 +24,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/revision/create/2.yaml b/jsonschema/mediawiki/revision/create/2.yaml index ec18805..d788bc8 100644 --- a/jsonschema/mediawiki/revision/create/2.yaml +++ b/jsonschema/mediawiki/revision/create/2.yaml @@ -23,9 +23,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/revision/visibility-change/1.yaml b/jsonschema/mediawiki/revision/visibility-change/1.yaml index 5608646..faa1200 100644 --- a/jsonschema/mediawiki/revision/visibility-change/1.yaml +++ b/jsonschema/mediawiki/revision/visibility-change/1.yaml @@ -22,9 +22,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/mediawiki/user/blocks-change/1.yaml b/jsonschema/mediawiki/user/blocks-change/1.yaml index d448c90..7cd8079 100644 --- a/jsonschema/mediawiki/user/blocks-change/1.yaml +++ b/jsonschema/mediawiki/user/blocks-change/1.yaml @@ -22,9 +22,8 @@ type: string format: uri request_id: - description: The unique UUID v1 ID of the event derived from the X-Request-Id header. + description: The unique ID of the request that caused 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 diff --git a/jsonschema/resource_change/1.yaml b/jsonschema/resource_change/1.yaml index c93afe5..26c707c 100644 --- a/jsonschema/resource_change/1.yaml +++ b/jsonschema/resource_change/1.yaml @@ -23,8 +23,7 @@ description: the unique URI identifying the event / resource 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 + description: The unique ID of the request that caused 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}$' diff --git a/jsonschema/test/event/1.yaml b/jsonschema/test/event/1.yaml index 5ce5238..07ad3d3 100644 --- a/jsonschema/test/event/1.yaml +++ b/jsonschema/test/event/1.yaml @@ -23,8 +23,7 @@ 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 + description: The unique ID of the request that caused 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}$' diff --git a/test/jsonschema/index.js b/test/jsonschema/index.js index 2f571a9..991120e 100644 --- a/test/jsonschema/index.js +++ b/test/jsonschema/index.js @@ -34,7 +34,7 @@ } else if (typeof example === 'object') { // Go recursively return Object.keys(example) - .filter((key) => key !== 'title' && key !== 'description') + .filter((key) => key !== 'title' && key !== 'description' && key !== 'pattern') .forEach((key) => assert.isSuperSchema(schema[key], example[key], path + '.' + key)); } else if (schema !== example) { throw new assert.AssertionError({ diff --git a/test/jsonschema/meta_common_schema.yaml b/test/jsonschema/meta_common_schema.yaml index 6651b0e..74b72df 100644 --- a/test/jsonschema/meta_common_schema.yaml +++ b/test/jsonschema/meta_common_schema.yaml @@ -23,7 +23,7 @@ request_id: type: string # We don't test for the pattern, because the job events have different request-id pattern - description: the unique UUID v1 ID of the event derived from the X-Request-Id header + description: The unique ID of the request that caused 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}$' -- To view, visit https://gerrit.wikimedia.org/r/397709 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieab17db6f7ed1a7d37ee801d581791a240bbe74b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/event-schemas Gerrit-Branch: master Gerrit-Owner: Ppchelko <ppche...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits