Ticket #7309 (closed: invalid)
Rename Workspace Does Not Check Duplicate Name in Other Workspaces
Reported by: | Karl Palmen | Owned by: | Arturs Bekasovs |
---|---|---|---|
Priority: | major | Milestone: | Release 3.2 |
Component: | Framework | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Jay Rainey |
Description (last modified by Nick Draper) (diff)
I find that if I open several workspaces. I then rename one of them so its name is the same as one of the others. That workspace or the one being ranamed vanishes and no error message is given.
Ideally RenameWorkspace and RenameWorkspaces should detect such a situation and refuse to rename and issue an informative error message.
Change History
comment:2 Changed 7 years ago by Nick Draper
You can do it in two rename operations and that is enough. The logic of swapping if the resulting workspace exists would not make sense to most people, and the need for this is rare at best.
comment:3 Changed 7 years ago by Nick Draper
- Owner set to Anyone
- Keywords Student First added
- Status changed from new to assigned
comment:6 Changed 7 years ago by Nick Draper
- Owner changed from Anyone to Arturs Bekasovs
- Description modified (diff)
comment:7 Changed 7 years ago by Arturs Bekasovs
- Status changed from new to inprogress
Added a new flag defining whether a workspace name should be unique within ADS.
Refs #7309
Changeset: 9a489740ad03134f8d18dfbd331edd84174b62bf
comment:9 Changed 7 years ago by Arturs Bekasovs
Updated rename algorithms so they don't allow using already existing workspace names.
Refs #7309
Changeset: ddd795383b973abfb35692e207c5e2ddb8c585e8
comment:10 Changed 7 years ago by Arturs Bekasovs
Added the name of the workspace to the error message
Refs #7309
Changeset: 9047d32c9482efb859f446c09af483a82779b8a4
comment:11 Changed 7 years ago by Arturs Bekasovs
Made the algorithm handle group workspaces correctly.
Refs #7309
Changeset: 39fa9c4882e5fa0159480928152788362a5dc7ba
comment:12 Changed 7 years ago by Arturs Bekasovs
Updated the tests and added a few more.
Refs #7309
Changeset: 7267cb29449141f5d42e9fd8df772d85aec203f1
comment:13 Changed 7 years ago by Arturs Bekasovs
Added explanation of what UniqueMode is
Refs #7309
Changeset: 4484dbd341f6dc6ffbd99a6bdd37d7e4b028b44e
comment:14 Changed 7 years ago by Arturs Bekasovs
Added some tests for WorkspaceProperty
Refs #7309
Changeset: 98a17aec24dfc6416b3a1cb517a4c207d56460fb
comment:15 Changed 7 years ago by Arturs Bekasovs
Fixed the problem with renaming in ADS.
This was causing tests to fail.
Refs #7309
Changeset: eac1866423e8a7f92bd4b48e50688a84726808ac
comment:16 Changed 7 years ago by Arturs Bekasovs
Update documentation for the algorithms.
Refs #7309
Changeset: f07bacfa994f137b875c9c54d92169b7efd1f160
comment:17 Changed 7 years ago by Arturs Bekasovs
- Status changed from inprogress to verify
- Resolution set to fixed
Branch: 7309_rename_ws_duplicate_name
Tester:
Open any two workspaces.
Rename the first one to ws1, and the second one to ws2. Rename should be successful.
Then try to rename ws1 to ws2. Rename dialog shouldn't allow that, showing a red error star near the OutputWorkspace parameter. Point a mouse the star. An error "The workspace with name "ws2" already exists" should appear. Notice that both ws1 and ws2 are still there.
Then, open another workspace and rename it to new_ws1. Run the RenameWorkspaces algorithm, and set InputWorkspaces to "ws1, ws2" and a Prefix parameter to "new_". Then execute an algorithm. It should throw an error saying "The workspace with name "new_ws1" already exists". ws1 and ws2 should both remain unchanged.
Open RenameWorkspaces again, and try "other_" as Prefix this time. This should throw no error, ws1 and ws2 shoud disappear, and other_ws1 and other_ws2 should appear.
comment:18 Changed 7 years ago by Jay Rainey
- Status changed from verify to verifying
- Tester set to Jay Rainey
comment:19 Changed 7 years ago by Jay Rainey
- Status changed from verifying to closed
Testing
- Testing on Ubuntu 12.4.
- Successfully prevents the user from renaming a workspace to one that already exists of that name.
- No longer overwrites workspace if name is already existing.
- Good error messages are thrown when a workspace name exists that the user wants to use.
Code review
- Clean and consistent code.
- No visible bugs/problems.
comment:20 Changed 7 years ago by Jay Rainey
Merge remote-tracking branch 'origin/feature/7309_rename_ws_duplicate_name'
comment:21 Changed 7 years ago by Arturs Bekasovs
- Status changed from closed to reopened
- Tester Jay Rainey deleted
- type changed from defect to enhancement
- Priority changed from minor to major
- Milestone changed from Release 2.6 to Backlog
- Keywords Student First removed
- Resolution fixed deleted
This ticket was done and tested, but the way it was done conflicted with how the Mantid fundamentally works and broke almost all of the system tests. All of the algorithms do rewrite their results no questions asked, and rename algorithms should not make an exception. All the commits were taken out of the master.
However, the problem still remains - when renaming the workspace it would be nice to make sure user realizes that he might lose some important data, so the confirmation might be a good idea.
Need to come up with a way of doing this and think about whether it might be useful for when user is running other algorithms as well.
comment:23 Changed 7 years ago by Arturs Bekasovs
- Status changed from reopened to verify
- Resolution set to invalid
This ticket has quite a lot of [bad] heritage, so I've created a new one for solving described problem: #9161. Consequently, this one becomes invalid.
comment:24 Changed 7 years ago by Jay Rainey
- Status changed from verify to verifying
- Tester set to Jay Rainey
comment:25 Changed 7 years ago by Jay Rainey
- Status changed from verifying to closed
The functionality described in comment:21, and in #9161 will be fixed in #2480. Closing as invalid.
comment:26 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 8155
Another issue is that RenameWorkspaces cannot be used to swap the names of two workspaces. This would be complicated to implement and the user can do the name swap in two rename operations.