Skip to content

Conversation

@davidfirst
Copy link
Member

@davidfirst davidfirst commented Oct 8, 2025

Summary

Add pattern matching support to bit recover command to enable recovering multiple soft-deleted components at once, similar to other Bit commands like bit delete and bit remove.

Changes

  • Change command signature from <component-name> to <component-pattern>
  • Add getComponentsToRecover() method to discover all soft-removed components matching a pattern
  • Refactor recover() to return ComponentID[] instead of boolean
  • Rename original recover() to recoverSingle() for internal use
  • Pattern matching discovers components from:
    • Locally soft-removed (.bitmap)
    • Remotely soft-removed (imported components marked as deleted)
    • Staged removed components (on lanes)
  • Use filterIdsFromPoolIdsByPattern() for consistent pattern matching across Bit
  • Add comprehensive e2e tests for pattern recovery scenarios
- Change command signature to accept patterns instead of single component
- Add pattern matching logic to discover all soft-removed components
- Refactor recover() to return array of recovered ComponentIDs
- Add comprehensive e2e tests for pattern recovery scenarios
- Maintain backward compatibility with single component names
@davidfirst davidfirst force-pushed the add-pattern-support-to-recover branch from aa14d45 to e844a14 Compare October 8, 2025 17:29
- Batch import all components needing recovery in a single operation
- Fix test pattern from 'comp*' to '**' to match scoped component names
- Dramatically improves performance when recovering multiple remote components
- Extract recovery logic into classifyComponentForRecovery method
- Preserve all 5 recovery scenarios from original implementation
- Keep critical steps: delete bitMapEntry.config, removeComponentConfig, etc.
- Remove duplicate recoverSingle method
- Batch imports while maintaining all original recovery logic
- Clearer separation of concerns and better code organization
Combine duplicate branches that both called addSpecificComponentConfig
into a single else clause covering cases #2, #3, #4, #5
@davidfirst davidfirst merged commit dc70697 into master Oct 9, 2025
11 checks passed
@davidfirst davidfirst deleted the add-pattern-support-to-recover branch October 9, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants