mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
127 stars 41 forks source link

[Task]: only sync AMO specific policies from cinder #14791

Closed eviljeff closed 6 months ago

eviljeff commented 6 months ago

Description

Implements https://mozilla-hub.atlassian.net/browse/AMO2-671

Cinder’s API now returns labels with policies which should enable us to selectively add only “AMO” labelled policies to our database as CinderPolicy instances

{
        "last_updated_by": {
          "id": 43,
          "email": "x@mozilla.com"
        },
        "created_by": {
          "id": 43,
          "email": "x@mozilla.com"
        },
        "status": {
          "id": 2,
          "name": "PUBLISHED"
        },
        "uuid": "97b09ece-f949-4a82-9405-963b024d6ce6",
        "description": "This content violates the law in a jurisdiction where Mozilla content is displayed, which is not permitted under Mozilla's Acceptable Use Policy. (See < >.)\n\n",
        "nested_policies": [],
        "labels": [
          {
            "name": "AMO",
            "description": "AMO"
          }
        ],
        "name": "Illegal content ",
        "created_at": "2024-01-23T16:38:26.539Z",
        "updated_at": "2024-05-02T03:10:19.421Z"
      },

Acceptance Criteria

  ### Acceptance Criteria
  - [ ] executing the policy sync task only syncs policies that are labelled with "AMO"

Checks

┆Issue is synchronized with this Jira Task

ioanarusiczki commented 6 months ago

I see in Cinder - Policies that the list has policies labeled with "AMO" or "MoSo".

I assume I should see in admin only what's "AMO"

"Approve" and "Copyright and trademark" have both labels , should also be available after sync.

eviljeff commented 6 months ago

@ioanarusiczki yes - policies labelled with AMO or no label. And it should also remove any policies that are labelled with other labels, if they aren't connected to ReviewActionReason or a decision

ioanarusiczki commented 6 months ago

After sync the number of policies dropped from 139 to 87.

What's with AMO label in Cinder is also present in AMO admin including: Approve, Ignore, Escalate policies + their sub-policies.

There's one sub-policy in admin , id 37 "Online gambling" from "Acceptable Use" which is not present in Cinder. That's something I've noticed missing in Cinder in the action list for reports and I filed it on Lindie