Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-14131

Default PR reviewer rules can be created without any reviewers in them

XMLWordPrintable

      Issue Summary

      It's possible to create a default reviewer rule via REST that has no reviewers in it. This is not possible via the web interface.

      This is reproducible on Data Center: (yes) 

      Steps to Reproduce

      1. Create a new default reviewer rule via REST with reviewers missing from the request:

       

      curl --location 'http://localhost:7990/bitbucket/rest/default-reviewers/latest/projects/PROJECT_1/repos/rep_1/condition?avatarSize=32' \ --header 'Accept: application/json, text/javascript, */*; q=0.01' \ --header 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' \ --header 'Cache-Control: no-cache' \ --header 'Connection: keep-alive' \ --header 'Content-Type: application/json' \ --header 'Cookie: _atl_bitbucket_remember_me=Njg3YjEyNzY0NzZjYzEyNjFhNzIzMGVmZTUzMzFlYjNkNTU0NzI0ODpkOWVlNzJmYmQzYjg2N2Q1ZjIwY2UyOWUxZmFlNmFhNDhlMDI3MDE0; BITBUCKETSESSIONID=E061972532795A9A9D964CE9CB59CAF8; ajs_anonymous_id=%221742dd7a-5e44-49e9-9139-b6a5de1893a0%22; atlCohort={"bucketAll":{"bucketedAtUTC":"2022-07-29T05:08:31.947Z","version":"2","index":49,"bucketId":0}}; atlUserHash=1393648548; jenkins-timestamper-offset=-39600000; atl_xid.ts=1672789531093; atl_xid.current=; screenResolution=1920x1080' \ --header 'Origin: http://localhost:7990' \ --header 'Pragma: no-cache' \ --header 'Referer: http://localhost:7990/bitbucket/plugins/servlet/default-reviewers/projects/PROJECT_1/repos/rep_1' \ --header 'Sec-Fetch-Dest: empty' \ --header 'Sec-Fetch-Mode: cors' \ --header 'Sec-Fetch-Site: same-origin' \ --header 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \ --header 'X-AUSERID: 2' \ --header 'X-AUSERNAME: admin' \ --header 'X-Requested-With: XMLHttpRequest' \ --header 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"' \ --header 'sec-ch-ua-mobile: ?0' \ --header 'sec-ch-ua-platform: "macOS"' \ --header 'Authorization: Basic YWRtaW46YWRtaW4=' \ --data '{ "sourceMatcher": { "id": "any", "type": { "id": "ANY_REF" } }, "targetMatcher": { "id": "any", "type": { "id": "ANY_REF" } }, "requiredApprovals": "1" }'

      Expected Results

      An error message stating that you need to specify reviewers in the request. 

      Actual Results

      The rule gets created. Note this rule doesn't do anything, even if you open a PR, it doesn't require 1 approval from anyone. 

      Workaround

      As a workaround, use the web interface to create reviewer rules. 

              Unassigned Unassigned
              e74118b4e28d David Jansons
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: