Details
Description
Summary
If branch permission with backslash ( \ ) is mistakenly created, none of the existing branch permissions in the repository or project can be edited anymore.
Steps to Reproduce
- Create a few branch permissions in the repository or project
- Create a branch permission with pattern "release\" (backslash instead forward slash)
- Save the setting
It will take some time for the page to reload - Try to create a new or edit other branch permissions
Expected Results
- The incorrect branch permission with the pattern "release\" will not be saved
- Can create and edit other branch permissions
Actual Results
- The incorrect branch permission with the pattern "release\" does not appear in the list but the database table "AO_6978BB_RESTRICTED_REF" have this setting
- Can't create and edit other branch permissions
- The below exception is thrown in the browser Console:
Uncaught Error: Syntax error, unrecognized expression: tbody[data-branch-value="release\"][data-branch-type="PATTERN"][data-effective-scope-type="REPOSITORY"]
Workaround
- Retrieve branch permissions via REST to find the ID (should be a number) of the offending permission:
curl -v -H "Accept:application/json" <USERNAME>:<PASSWORD>@<INSTANCE_URL>/rest/branch-permissions/latest/projects/<PROJECT_KEY>/repos/<REPO_SLUG>/restrictions/
If you have Python installed you can append the following to this command to make the output more readable:
| python -m json.tool
- Delete the offending permission via REST:
curl -v -X DELETE <USERNAME>:<PASSWORD>@<INSTANCE_URL>/rest/branch-permissions/latest/projects/<PROJECT_KEY>/repos/<REPO_SLUG>/restrictions/<PERMISSION_ID>
- Verify the permission has been deleted by repeating step 1.
Attachments
Issue Links
- is duplicated by
-
BBSDEV-17834 Loading...