-
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: avoid throwing ComponentNotFound when .bitmap has a non-exist ve…
…rsion on the scope (#6496) Happens when an exported component has a local tag and `.bit` got deleted. The local scope doesn't have this local tag anymore and it never reached the remote. Previously, this use-case was handled by the out-of-sync algorithm, which synced the version according to the remote. Since Harmony, a new load-hook was added before the out-of-sync logic, which imports components from remotes. This import threw ComponentNotFound in this case. This PR fixes it by running some of the out-of-sync before the on-load hook gets called.
- Loading branch information
1 parent
35a38c5
commit bc03232
Showing
6 changed files
with
55 additions
and
274 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 |
---|---|---|
|
@@ -272,23 +272,20 @@ describe('components that are not synced between the scope and the consumer', fu | |
helper.general.expectToThrow(() => helper.command.status(), err); | ||
}); | ||
}); | ||
// @TODO: FIX ON HARMONY! | ||
describe.skip('bit show', () => { | ||
describe('bit show', () => { | ||
it('should throw an error suggesting to import the components', () => { | ||
const err = new ComponentsPendingImport(); | ||
helper.general.expectToThrow(() => helper.command.showComponent('bar/foo'), err); | ||
}); | ||
}); | ||
// @TODO: FIX ON HARMONY! | ||
describe.skip('bit tag', () => { | ||
describe('bit tag', () => { | ||
it('should throw an error suggesting to import the components', () => { | ||
const err = new ComponentsPendingImport(); | ||
helper.general.expectToThrow(() => helper.command.tagAllWithoutBuild(), err); | ||
}); | ||
}); | ||
}); | ||
// @TODO: FIX ON HARMONY! | ||
describe.skip('when the remote component does not exist or does not have this missing version', () => { | ||
describe('when the remote component does not exist or does not have this missing version', () => { | ||
let scopeAfterV1; | ||
let scopeOutOfSync; | ||
before(() => { | ||
|
@@ -313,9 +310,7 @@ describe('components that are not synced between the scope and the consumer', fu | |
}); | ||
it('should sync .bitmap according to the latest version of the scope', () => { | ||
helper.command.expectStatusToBeClean(); | ||
const bitMap = helper.bitMap.read(); | ||
const newId = `${helper.scopes.remote}/bar/[email protected]`; | ||
expect(bitMap).to.have.property(newId); | ||
helper.bitMap.expectToHaveIdHarmony('bar/foo', '0.0.1', helper.scopes.remote); | ||
}); | ||
}); | ||
describe('bit tag', () => { | ||
|
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
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
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
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
Oops, something went wrong.