-
Notifications
You must be signed in to change notification settings - Fork 940
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(import): fetch versions that are shown in .bitmap but not in the …
…lane object (#7167) currently, when checked out to a lane, `bit import` fetches main components from main and lane components according to the versions in the lane. In some scenarios, the .bitmap can be out-of-sync and a version in .bitmap is different than a version in the lane object. Or maybe `bit checkout` was running to a different version. In such cases, if the local scope is deleted, bit was throwing `ComponentsPendingImport` error. This PR fixes the import process to fetch these versions as well.
- Loading branch information
1 parent
47c9351
commit b1f5a38
Showing
2 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1458,4 +1458,35 @@ describe('bit lane command', function () { | |
}); | ||
}); | ||
}); | ||
describe('checking out to a different version from main', () => { | ||
before(() => { | ||
helper.scopeHelper.setNewLocalAndRemoteScopes(); | ||
helper.fixtures.populateComponents(1, false); | ||
helper.command.tagAllWithoutBuild(); // 0.0.1 | ||
helper.command.tagAllWithoutBuild('--unmodified'); // 0.0.2 | ||
helper.command.export(); | ||
|
||
helper.scopeHelper.reInitLocalScope(); | ||
helper.scopeHelper.addRemoteScope(); | ||
helper.command.createLane(); | ||
helper.fixtures.createComponentBarFoo(); | ||
helper.fixtures.addComponentBarFooAsDir(); | ||
helper.command.snapAllComponentsWithoutBuild(); | ||
helper.command.importComponent('[email protected]', '--save-in-lane'); // now the lane has it as 0.0.1 | ||
helper.command.export(); | ||
|
||
helper.command.checkoutVersion('0.0.2', 'comp1', '-x'); | ||
|
||
// deleting the local scope | ||
helper.command.init('--reset-scope'); | ||
|
||
helper.command.import(); | ||
}); | ||
it('bit import should bring the version in the bitmap', () => { | ||
expect(() => helper.command.catComponent(`${helper.scopes.remote}/[email protected]`)).to.not.throw(); | ||
}); | ||
it('bit status should not throw ComponentsPendingImport', () => { | ||
expect(() => helper.command.status()).to.not.throw(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters