[MediaWiki-commits] [Gerrit] mediawiki/event-schemas[master]: Don't require performer in properties-change event.
jenkins-bot has submitted this change and it was merged. Change subject: Don't require performer in properties-change event. .. Don't require performer in properties-change event. The page-properties-change event is emitted from LinksUpdateComplete hook, and in that hook the information about the performer might not be available. So, don't require the property. Change-Id: I139f12ae3f592dcf690617f9dd95a4df828c4a70 --- M jsonschema/mediawiki/page/properties-change/1.yaml M test/jsonschema/index.js M test/jsonschema/mediawiki/mediawiki_common_schema.yaml 3 files changed, 6 insertions(+), 32 deletions(-) Approvals: Mobrovac: Looks good to me, approved jenkins-bot: Verified diff --git a/jsonschema/mediawiki/page/properties-change/1.yaml b/jsonschema/mediawiki/page/properties-change/1.yaml index 729231f..5c938c9 100644 --- a/jsonschema/mediawiki/page/properties-change/1.yaml +++ b/jsonschema/mediawiki/page/properties-change/1.yaml @@ -49,35 +49,6 @@ 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 properties has been changed. @@ -128,7 +99,6 @@ required: - meta - database - - performer - page_id - page_title - page_namespace diff --git a/test/jsonschema/index.js b/test/jsonschema/index.js index c3d1e07..4b33a85 100644 --- a/test/jsonschema/index.js +++ b/test/jsonschema/index.js @@ -35,7 +35,12 @@ // Go recursively return Object.keys(example) .filter((key) => key !== 'title' && key !== 'description') -.forEach((key) => assert.isSuperSchema(schema[key], example[key], path + '.' + key)); +.forEach((key) => { +if (example.required.indexOf(key) !== -1 +|| schema.required.indexOf(key) !== -1) { +assert.isSuperSchema(schema[key], example[key], path + '.' + key) +} +}); } else if (schema !== example) { throw new assert.AssertionError({ message: `Error at path: ${path}`, diff --git a/test/jsonschema/mediawiki/mediawiki_common_schema.yaml b/test/jsonschema/mediawiki/mediawiki_common_schema.yaml index 220837c..08c0418 100644 --- a/test/jsonschema/mediawiki/mediawiki_common_schema.yaml +++ b/test/jsonschema/mediawiki/mediawiki_common_schema.yaml @@ -27,4 +27,3 @@ required: - database - - performer -- To view, visit https://gerrit.wikimedia.org/r/315567 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I139f12ae3f592dcf690617f9dd95a4df828c4a70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/event-schemas Gerrit-Branch: master Gerrit-Owner: Ppchelko Gerrit-Reviewer: GWicke Gerrit-Reviewer: Mobrovac Gerrit-Reviewer: Ottomata Gerrit-Reviewer: Ppchelko Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/event-schemas[master]: Don't require performer in properties-change event.
Ppchelko has uploaded a new change for review. https://gerrit.wikimedia.org/r/315567 Change subject: Don't require performer in properties-change event. .. Don't require performer in properties-change event. The page-properties-change event is emitted from LinksUpdateComplete hook, and in that hook the information about the performer might not be available. So, don't require the property. Change-Id: I139f12ae3f592dcf690617f9dd95a4df828c4a70 --- M jsonschema/mediawiki/page/properties-change/1.yaml M test/jsonschema/index.js M test/jsonschema/mediawiki/mediawiki_common_schema.yaml 3 files changed, 6 insertions(+), 32 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/event-schemas refs/changes/67/315567/1 diff --git a/jsonschema/mediawiki/page/properties-change/1.yaml b/jsonschema/mediawiki/page/properties-change/1.yaml index 729231f..5c938c9 100644 --- a/jsonschema/mediawiki/page/properties-change/1.yaml +++ b/jsonschema/mediawiki/page/properties-change/1.yaml @@ -49,35 +49,6 @@ 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 properties has been changed. @@ -128,7 +99,6 @@ required: - meta - database - - performer - page_id - page_title - page_namespace diff --git a/test/jsonschema/index.js b/test/jsonschema/index.js index c3d1e07..4b33a85 100644 --- a/test/jsonschema/index.js +++ b/test/jsonschema/index.js @@ -35,7 +35,12 @@ // Go recursively return Object.keys(example) .filter((key) => key !== 'title' && key !== 'description') -.forEach((key) => assert.isSuperSchema(schema[key], example[key], path + '.' + key)); +.forEach((key) => { +if (example.required.indexOf(key) !== -1 +|| schema.required.indexOf(key) !== -1) { +assert.isSuperSchema(schema[key], example[key], path + '.' + key) +} +}); } else if (schema !== example) { throw new assert.AssertionError({ message: `Error at path: ${path}`, diff --git a/test/jsonschema/mediawiki/mediawiki_common_schema.yaml b/test/jsonschema/mediawiki/mediawiki_common_schema.yaml index 220837c..08c0418 100644 --- a/test/jsonschema/mediawiki/mediawiki_common_schema.yaml +++ b/test/jsonschema/mediawiki/mediawiki_common_schema.yaml @@ -27,4 +27,3 @@ required: - database - - performer -- To view, visit https://gerrit.wikimedia.org/r/315567 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I139f12ae3f592dcf690617f9dd95a4df828c4a70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/event-schemas Gerrit-Branch: master Gerrit-Owner: Ppchelko ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits