bit remove changes (soft delete) #6338
davidfirst
started this conversation in
Ideas, feature requests
Replies: 2 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Mostly implemented. See more details in the PR: #6363 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary of a discussion I had with @ranm8 .
Background
We have a few challenges around deletion, some related to lanes, such as how you delete a component from a lane and export it.
Lane doesn't have versions (there is another discussion about this) so if we change the lane object and mark a component as deleted,
bit status
won't show it as such because there is no "modified" status to a lane.Other use-case is when a component was created on a lane and there is a component with the same name in the original scope. We want the lane to replace the component it has currently with the one from the original scope. So even if we have the "versions" concept for lanes, this use-case is tricky, the lane object will have the same component in both, components and deleted components.
Suggestion
Component deletion, by default, will work similar to deprecation. The
Version
object will have aspect-data of a new aspectteambit.component/remove
withremoved: true
. On the remote UI, we won't show these deleted components. On import (bit import scope-name/*
) we won't bring these components.In terms of implementation, when running
bit remove
, it'll delete the component directory from the filesystem, but not from .bitmap. Onbit status
, instead of showing an issue about missing-component-in-path, we'll show a new section of "deleted components", explaining that on the next snap/tag the component will be marked as deleted. Then, once exported, the remote is up to date with the deleted component.A new flag
--workspace
forbit remove
will remove the component from .bitmap as well, so it'll work the same asbit remove
is working now.bit remove --remote
will remain intact, but we can explain that it's safer to use thebit remove
locally, snap and export.Use cases
After the remove (as discussed above - soft delete), the user creates a new component with the same name and export.
On the remote, we throw an error saying a deleted component exists with the same name. suggesting to import+merge/reset according to the following options:
bit reset
first and then the import+merge can take place.@itaymendel , @GiladShoham , please let me know if you have feedback.
Beta Was this translation helpful? Give feedback.
All reactions