This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unknown link types and link categories (#1730)
The following link types exist in the current production database but they are not known to the code and therefore we re-assign all links associated to those link types with their appropriate *known* link type and later remove these unknown link types. aad2a4ad-d601-4104-9804-2c977ca2e0c1 355b647b-adc5-46b3-b297-cc54bc0554e6 7479a9b9-8607-46fa-9535-d448fa8768ab There also exist two unknown link categories [see here](https://api.openshift.io/api/workitemlinkcategories): 04b89525-84ff-406c-8e18-d990936bdb74 6329fbb3-399b-4a78-ae3b-6a6faa8b1084 Those will be removed as well. After this PR is merged, we should only have three link types to choose from in the UI and the duplicates should be gone as well. Without the duplicate entries of `parent of` and `child of` you then can no longer link a WI to two parents. Without this PR you still can link a child WI to two parent WIs when you choose from two different link types. To double check, what link types exist, try this command: ```sh curl --silent https://api.openshift.io/api/spaces/020f756e-b51a-4b43-b113-45cec16b9ce9/workitemlinktypes \ | jq ".data[] | .id, .attributes.name" ``` It should output the id and name of each link type in the current production database: ```json "aad2a4ad-d601-4104-9804-2c977ca2e0c1" "Bug blocker" "355b647b-adc5-46b3-b297-cc54bc0554e6" "Related planner item" "7479a9b9-8607-46fa-9535-d448fa8768ab" "Parent child item" "2cea3c79-3b79-423b-90f4-1e59174c8f43" "Bug blocker" "9b631885-83b1-4abb-a340-3a9ede8493fa" "Related planner item" "25c326a7-6d03-4f5a-b23b-86a9ee4171e9" "Parent child item" ``` In 90c595e I have introduced fixed IDs for link types and link categories and that must have been the time when the old ones weren't deleted. As part of this PR I've replaced many of the `panic` calls within the migration tests with normal test failures. I've also wrapped errors and added filenames of executed SQL files to the error output to increase *debuggability* (is that a word?). This relates to #1729 and fabric8-ui/fabric8-planner#2291 (comment)
- Loading branch information