Page MenuHomePhabricator

๐Ÿ“› [Generalised error] data-policy-violation
Closed, ResolvedPublic5 Estimated Story Points

Description

This is a general error that came out of the discussions surrounding reformatting/rewriting all the collision/conflict errors

Acceptance criteria:

  • Current errors it will apply to: patch-result-label-description-duplicate, duplicate-label, label-description-duplicate, label-description-same-value, sitelink-conflict
  • HTTP status code: 422
  • Error code: data-policy-violation
  • Error message: Edit violates data policy
  • Context: { "violation": "{violation}", "violation_context": { "some": "context" } }

Note:

  • {violation} is one of the existing error codes (see above, minus patch-result- errors)
  • {violation_context} includes the illegal context, e.g. { "language-code": "foo" }

Task Breakdown

  • one subtask per:
    • duplicate-label
    • label-description-duplicate
    • label-description-same-value
    • sitelink-conflict

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJun 7 2024, 1:19 PM

Dev chat notes:

1- Pick option (1):

nested policy context
{
  'violated-policy': 'unique-label-description',
  'violation-context': { 'language-code': 'foo', 'conflicting-item': ...
}

2- Rename violation-policy key to violation inside the error response; violation is easier to communicate rather than inventing the policy name.

3- Reuse old error codes as policy violations.

4- Rename conflicting-item to conflicting-resource.

5- Leave out conflicting-resource in case of self conflicts.

Example:

{
  code: data-policy-violation,
  message: "Edit violates data policy",
  context: {
    'violation': 'label-description-same-value',
    'violation-context': { 'language-code': 'foo' }
  }
}
Ollie.Shotton_WMDE renamed this task from [Generalised error] Data-policy-violation to [Generalised error] data-policy-violation.Jul 10 2024, 10:38 AM
Ollie.Shotton_WMDE updated the task description. (Show Details)
Dima_Koushha_WMDE renamed this task from [Generalised error] data-policy-violation to ๐Ÿ“› [Generalised error] data-policy-violation.Jul 23 2024, 4:01 PM