bit icon indicating copy to clipboard operation
bit copied to clipboard

Renaming component that deprecates another component does not update the reference to the component that supersedes it in .bitmap

Open Termtime opened this issue 1 year ago • 1 comments

Describe the bug

If you rename a component that is already exported it deprecates it and puts a reference to the superseding component, like so:

"config": {
    "teambit.component/deprecation": {
        "deprecate": true,
        "newId": {
            "name": "ui/buttons/icon_buttons",
            "scope": "org_name.scope_name"
        }
    }
}

But if you mistakenly renamed it with a typo, for example in this case icon_buttons in plural instead of singular icon_button, then when you attempt to bit rename the superseding component, it does not update the above config entry in .bitmap.

I have no idea what the impact is in the remote scope as I have yet to use deprecated components (I am mainly starting fresh, and moving components around)

Steps to Reproduce

  1. Create a component
  2. Tag it
  3. Export it
  4. Rename it with a typo
  5. Rename the superseding component to fix the typo
  6. .bitmap entry of the superseding component will update, but newId reference in the deprecated component won't

Expected Behavior

When renaming a component that supersedes another, the reference to it in .bitmap should update as well.

Specifications

  • Bit version: 0.0.800
  • Workspace type: harmony
  • Node version: 16.13.0
  • npm / yarn version: 8.1
  • Platform: macOS

for harmony workspace

  • relevant env: any
  • relevant aspects: any

Termtime avatar Jul 27 '22 15:07 Termtime

The newId will be used to suggest the new component upon import/install. It's not implemented currently. In this case, it'll suggest the wrong component indeed, so yes, it's a bug that needs be addressed.

davidfirst avatar Jul 27 '22 21:07 davidfirst

rename-after-rename was implemtned a few weeks ago and already available. missed that issue when item resolved. closing now.

itaymendel avatar Mar 06 '23 11:03 itaymendel