Skip to content

Commit

Permalink
fix(artifacts), fix missing component error after tag (#7353)
Browse files Browse the repository at this point in the history
In some cases, the first run of `bit artifact` after `bit tag` was
throwing an error of ComponentNotFound.
This PR uses `scope.getMany` instead of `scope.loadMany` because there
is no need to load all aspects. This change also improves this command
performance dramatically.
  • Loading branch information
davidfirst authored May 3, 2023
1 parent 08b9943 commit 0b2d8f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scopes/pipelines/builder/artifact/artifact-extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ArtifactExtractor {

async list(): Promise<ExtractorResult[]> {
const ids = await this.scope.idsByPattern(this.pattern);
const components = await this.scope.loadMany(ids);
const components = await this.scope.getMany(ids);
const artifactListPerId: ArtifactListPerId[] = components.map((component) => {
return {
id: component.id,
Expand Down
3 changes: 2 additions & 1 deletion scopes/scope/scope/scope.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,8 @@ export class ScopeMain implements ComponentFactory {
}

/**
* load components from a scope and load their aspects
* important! you probably want to use `getMany`, which returns the components from the scope.
* this method loads all aspects of the loaded components. (which hurts performance)
*/
async loadMany(ids: ComponentID[], lane?: Lane): Promise<Component[]> {
const components = await mapSeries(ids, (id) => this.load(id, lane));
Expand Down

0 comments on commit 0b2d8f1

Please sign in to comment.