@teambit/merging 1.0.123 → 1.0.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -274,7 +274,7 @@ other: ${otherLaneHead.toString()}`);
274
274
  }
275
275
  }
276
276
  const isModified = async () => {
277
- const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);
277
+ const componentModificationStatus = await this.workspace.getComponentStatusById(currentComponent.id);
278
278
  if (!componentModificationStatus.modified) return undefined;
279
279
  if (!existingBitMapId) return undefined;
280
280
  const baseComponent = await modelComponent.loadVersion(existingBitMapId.version, consumer.scope.objects);
@@ -1 +1 @@
1
- {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_componentId","_laneId","_getDivergeData","_repositories","_lodash","_threeWayMerge","_noCommonSnap","_configMerger","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","MergeStatusProvider","constructor","workspace","logger","importer","currentLane","otherLane","options","getStatus","bitIds","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","mapSeries","id","getComponentStatusBeforeMergeAttempt","shouldImportHistoryOfOtherLane","shouldSquash","scope","toImport","map","compStatus","divergeData","versionsToImport","commonSnapBeforeDiverge","snapsOnTargetOnly","compact","v","changeVersion","toString","flat","reason","consumer","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","lane","cache","includeVersionHistory","compStatusNotNeedMerge","c","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","err","results","componentMergeStatusBeforeMergeAttempt","currentComponent","Error","otherLaneHead","currentId","modelComponent","repo","objects","baseSnap","debug","toStringWithoutVersion","version","baseComponent","loadVersion","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","configMergeResult","merge","mergeResults","threeWayMerge","returnUnmerged","msg","unmergedLegitimately","componentStatus","unchangedMessage","unchangedLegitimately","getModelComponentIfExist","unmerged","unmergedComponents","getEntry","getRef","existingBitMapId","bitMap","getComponentIdIfExist","ignoreVersion","componentOnOther","idOnCurrentLane","getComponent","isRemoved","shouldMerge","shouldRemoveFromMain","shouldBeRemoved","getCurrentId","head","getHeadAsTagIfExist","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","loadExtensions","getConsumerComponent","isTargetNotAhead","isTargetAhead","shouldIgnore","isModified","componentModificationStatus","getComponentStatusById","modified","undefined","isSourceCodeModified","isComponentSourceCodeModified","modifiedType","ignoreConfigChanges","NoCommonSnap","resolveUnrelated","message","handleNoCommonSnap","isDiverged","isSourceAhead","mainHead","returnAccordingToOurs","headToSaveInLane","unrelatedHead","unrelatedLaneId","resolvedUnrelated","strategy","headOnCurrentLane","returnAccordingToTheirs","resolvedRef","unrelatedHeadRef","currentVersionRef","otherVersionRef","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","refToSaveInLane","exports"],"sources":["merge-status-provider.ts"],"sourcesContent":["import { Workspace } from '@teambit/workspace';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ImporterMain } from '@teambit/importer';\nimport { Logger } from '@teambit/logger';\nimport { compact } from 'lodash';\nimport threeWayMerge from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { ConfigMerger } from './config-merger';\nimport { ComponentMergeStatus, ComponentMergeStatusBeforeMergeAttempt } from './merging.main.runtime';\n\nexport type MergeStatusProviderOptions = {\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n shouldSquash?: boolean;\n};\n\nexport class MergeStatusProvider {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private importer: ImporterMain,\n private currentLane?: Lane, // currently checked out lane. if on main, then it's undefined.\n private otherLane?: Lane, // the lane we want to merged to our lane. (undefined if it's \"main\").\n private options?: MergeStatusProviderOptions\n ) {}\n\n async getStatus(\n bitIds: ComponentID[] // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatus[]> {\n if (!this.currentLane && this.otherLane) {\n await this.importer.importObjectsFromMainIfExist(this.otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id)\n );\n // whether or not we need to import the gap between the common-snap and the other lane.\n // the common-snap itself we need anyway in order to get the files hash/content for checking conflicts.\n const shouldImportHistoryOfOtherLane =\n !this.options?.shouldSquash && // when squashing, no need for all history, only the head is going to be pushed\n (!this.currentLane || // on main. we need all history in order to push each component to its remote\n this.currentLane.scope !== this.otherLane?.scope); // on lane, but the other lane is from a different scope. we need all history in order to push to the current lane's scope\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData) return [];\n const versionsToImport = [compStatus.divergeData.commonSnapBeforeDiverge];\n if (shouldImportHistoryOfOtherLane) {\n versionsToImport.push(...compStatus.divergeData.snapsOnTargetOnly);\n }\n return compact(versionsToImport).map((v) => compStatus.id.changeVersion(v.toString()));\n })\n .flat();\n const reason = shouldImportHistoryOfOtherLane\n ? `for filling the gap between the common-snap and the head of ${this.otherLane?.id() || 'main'}`\n : `for getting the common-snap between ${this.currentLane?.id() || 'main'} and ${this.otherLane?.id() || 'main'}`;\n await this.workspace.consumer.scope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: this.otherLane,\n cache: true,\n includeVersionHistory: false,\n reason,\n });\n\n const compStatusNotNeedMerge = componentStatusBeforeMergeAttempt.filter(\n (c) => !c.mergeProps\n ) as ComponentMergeStatus[];\n const compStatusNeedMerge = componentStatusBeforeMergeAttempt.filter((c) => c.mergeProps);\n\n const getComponentsStatusNeedMerge = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(this.workspace.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) => this.getComponentMergeStatus(compStatus))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n const results = await getComponentsStatusNeedMerge();\n\n results.push(...compStatusNotNeedMerge);\n return results;\n }\n\n private async getComponentMergeStatus(\n componentMergeStatusBeforeMergeAttempt: ComponentMergeStatusBeforeMergeAttempt\n ) {\n const { id, divergeData, currentComponent, mergeProps } = componentMergeStatusBeforeMergeAttempt;\n if (!mergeProps) throw new Error(`getDivergedMergeStatus, mergeProps is missing for ${id.toString()}`);\n const { otherLaneHead, currentId, modelComponent } = mergeProps;\n const repo = this.workspace.consumer.scope.objects;\n if (!divergeData) throw new Error(`getDivergedMergeStatus, divergeData is missing for ${id.toString()}`);\n if (!currentComponent) throw new Error(`getDivergedMergeStatus, currentComponent is missing for ${id.toString()}`);\n\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n this.logger.debug(`merging snaps details:\nid: ${id.toStringWithoutVersion()}\nbase: ${baseSnap.toString()}\ncurrent: ${currentId.version}\nother: ${otherLaneHead.toString()}`);\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n\n const currentLaneName = this.currentLane?.toLaneId().toString() || 'main';\n const otherLaneName = this.otherLane ? this.otherLane.toLaneId().toString() : DEFAULT_LANE;\n const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;\n const otherLabel = `${otherLaneHead.toString()} (${\n otherLaneName === currentLaneName ? 'incoming' : otherLaneName\n })`;\n const workspaceIds = await this.workspace.listIds();\n const configMerger = new ConfigMerger(\n id.toStringWithoutVersion(),\n workspaceIds,\n this.otherLane,\n currentComponent.extensions,\n baseComponent.extensions,\n otherComponent.extensions,\n currentLabel,\n otherLabel,\n this.logger\n );\n const configMergeResult = configMerger.merge();\n\n const mergeResults = await threeWayMerge({\n consumer: this.workspace.consumer,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\n }\n\n private returnUnmerged(\n id: ComponentID,\n msg: string,\n unmergedLegitimately = false\n ): ComponentMergeStatusBeforeMergeAttempt {\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unmergedLegitimately;\n return componentStatus;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return this.returnUnmerged(\n id,\n `component ${id.toString()} is on the lane/main but its objects were not found, please re-import the lane`\n );\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id);\n if (unmerged) {\n return this.returnUnmerged(\n id,\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort/ bit lane merge-abort)`\n );\n }\n const repo = consumer.scope.objects;\n const version = id.version as string;\n const otherLaneHead = modelComponent.getRef(version);\n const existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n const idOnCurrentLane = this.currentLane?.getComponent(id);\n\n if (componentOnOther.isRemoved()) {\n // if exist in current lane, we want the current lane to get the soft-remove update.\n // or if it was removed with --update-main, we want to merge it so then main will get the update.\n const shouldMerge = idOnCurrentLane || componentOnOther.shouldRemoveFromMain();\n if (shouldMerge) {\n // remove the component from the workspace if exist.\n componentStatus.shouldBeRemoved = true;\n } else {\n // on main, don't merge soft-removed components unless it's marked with removeOnMain.\n // on lane, if it's not part of the current lane, don't merge it.\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (this.currentLane) {\n if (!idOnCurrentLane) return null;\n return idOnCurrentLane.id.changeVersion(idOnCurrentLane.head.toString());\n }\n // it's on main\n const head = modelComponent.getHeadAsTagIfExist();\n if (head) {\n return id.changeVersion(head);\n }\n return null;\n };\n const currentId = getCurrentId();\n if (!currentId) {\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n return { ...componentStatus, componentFromModel: componentOnOther, divergeData };\n }\n const getCurrentComponent = () => {\n if (existingBitMapId) return consumer.loadComponent(existingBitMapId, { loadExtensions: true });\n return consumer.scope.getConsumerComponent(currentId);\n };\n const currentComponent = await getCurrentComponent();\n if (currentComponent.isRemoved()) {\n // we have a few options:\n // 1. \"other\" is main. in this case, we don't care what happens on main, we want the component to stay deleted on\n // this lane. (even when main is ahead, we don't want to merge it).\n // 2. other is ahead. in this case, other recovered the component. so we can continue with the merge.\n // it is possible that it is diverged, in which case, still continue with the merge, and later on, the\n // merge-config will show a config conflict of the remove aspect.\n // 3. other is not ahead. in this case, just ignore this component, no point to merge it, we want it removed.\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n const isTargetNotAhead = !divergeData.err && !divergeData.isTargetAhead();\n const shouldIgnore = this.otherLane\n ? isTargetNotAhead // option #2 and #3 above\n : true; // it's main. option #1 above.\n if (shouldIgnore) {\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n\n const isModified = async (): Promise<undefined | 'code' | 'config'> => {\n const componentModificationStatus = await consumer.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return undefined;\n if (!existingBitMapId) return undefined;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n const isSourceCodeModified = await consumer.isComponentSourceCodeModified(baseComponent, currentComponent);\n if (isSourceCodeModified) return 'code';\n return 'config';\n };\n\n const modifiedType = await isModified();\n if (modifiedType === 'config' && !this.options?.ignoreConfigChanges) {\n return this.returnUnmerged(\n id,\n `component has config changes, please snap/tag it first. alternatively, use --ignore-config-changes flag to bypass`\n );\n }\n if (modifiedType === 'code') {\n return this.returnUnmerged(id, `component is modified, please snap/tag it first`);\n }\n\n if (!otherLaneHead) {\n throw new Error(`merging: unable finding a hash for the version ${version} of ${id.toString()}`);\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n targetHead: otherLaneHead,\n throws: false,\n });\n if (divergeData.err) {\n if (!(divergeData.err instanceof NoCommonSnap) || !this.options?.resolveUnrelated) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n return this.handleNoCommonSnap(\n modelComponent,\n id,\n otherLaneHead,\n currentComponent,\n componentOnOther,\n divergeData\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return this.returnUnmerged(id, `component ${currentComponent.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isTargetAhead()) {\n // just override with the model data\n return {\n ...componentStatus,\n currentComponent,\n componentFromModel: componentOnOther,\n divergeData,\n };\n }\n // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal\n return this.returnUnmerged(id, `component ${currentComponent.id.toString()} is already merged`, true);\n }\n\n // it's diverged and needs merge operation\n const mergeProps = {\n otherLaneHead,\n currentId,\n modelComponent,\n };\n\n return { ...componentStatus, currentComponent, mergeProps, divergeData };\n }\n\n private async handleNoCommonSnap(\n modelComponent: ModelComponent,\n id: ComponentID,\n otherLaneHead: Ref,\n currentComponent: ConsumerComponent,\n componentOnOther?: Version,\n divergeData?: SnapsDistance\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n let { resolveUnrelated } = this.options || {};\n if (currentComponent.isRemoved()) {\n resolveUnrelated = 'theirs';\n }\n if (!resolveUnrelated) throw new Error(`handleNoCommonSnap expects resolveUnrelated to be set`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const mainHead = modelComponent.head;\n\n const returnAccordingToOurs = (\n headToSaveInLane: Ref,\n unrelatedHead: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'ours',\n headOnCurrentLane: headToSaveInLane,\n unrelatedHead,\n unrelatedLaneId,\n },\n };\n };\n const returnAccordingToTheirs = (\n resolvedRef: Ref,\n unrelatedHeadRef: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'theirs',\n headOnCurrentLane: resolvedRef,\n unrelatedHead: unrelatedHeadRef,\n unrelatedLaneId,\n },\n };\n };\n\n const currentVersionRef = modelComponent.getRef(currentComponent.id.version as string);\n if (!currentVersionRef)\n throw new Error(\n `handleNoCommonSnap, unable to get ref of current version \"${\n currentComponent.id.version\n }\" for \"${id.toString()}\"`\n );\n const otherVersionRef = modelComponent.getRef(id.version as string);\n if (!otherVersionRef)\n throw new Error(`handleNoCommonSnap, unable to get ref of other version \"${id.version}\" for \"${id.toString()}\"`);\n\n if (mainHead) {\n const hasResolvedFromMain = async (hashToCompare: Ref | null) => {\n const divergeDataFromMain = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: hashToCompare,\n targetHead: mainHead,\n throws: false,\n });\n if (!divergeDataFromMain.err) return true;\n return !(divergeDataFromMain.err instanceof NoCommonSnap);\n };\n const hasResolvedLocally = await hasResolvedFromMain(modelComponent.getHeadRegardlessOfLane() as Ref);\n const hasResolvedRemotely = await hasResolvedFromMain(otherLaneHead);\n if (!hasResolvedLocally && !hasResolvedRemotely) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes.\nit was probably created in each lane separately and it also exists on main. please merge main first to one of these lanes`\n );\n }\n const refToSaveInLane = hasResolvedLocally ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = hasResolvedLocally ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n\n const refToSaveInLane = resolveUnrelated === 'ours' ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = resolveUnrelated === 'ours' ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.otherLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error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AAQ,CAAC,CAAW,CAAC;IAC3G;IACA,MAAM,IAAId,KAAK,CACZ,yBAAwB0E,gBAAiB,kEAC5C,CAAC;EACH;AACF;AAAC0B,OAAA,CAAA7J,mBAAA,GAAAA,mBAAA"}
1
+ {"version":3,"names":["_pMapSeries","data","_interopRequireDefault","require","_componentId","_laneId","_getDivergeData","_repositories","_lodash","_threeWayMerge","_noCommonSnap","_configMerger","obj","__esModule","default","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","key","value","_toPropertyKey","configurable","writable","i","_toPrimitive","String","Symbol","toPrimitive","call","TypeError","Number","MergeStatusProvider","constructor","workspace","logger","importer","currentLane","otherLane","options","getStatus","bitIds","importObjectsFromMainIfExist","toBitIds","toVersionLatest","componentStatusBeforeMergeAttempt","mapSeries","id","getComponentStatusBeforeMergeAttempt","shouldImportHistoryOfOtherLane","shouldSquash","scope","toImport","map","compStatus","divergeData","versionsToImport","commonSnapBeforeDiverge","snapsOnTargetOnly","compact","v","changeVersion","toString","flat","reason","consumer","scopeImporter","importWithoutDeps","ComponentIdList","fromArray","lane","cache","includeVersionHistory","compStatusNotNeedMerge","c","mergeProps","compStatusNeedMerge","getComponentsStatusNeedMerge","tmp","Tmp","componentsStatus","Promise","all","getComponentMergeStatus","clear","err","results","componentMergeStatusBeforeMergeAttempt","currentComponent","Error","otherLaneHead","currentId","modelComponent","repo","objects","baseSnap","debug","toStringWithoutVersion","version","baseComponent","loadVersion","otherComponent","currentLaneName","toLaneId","otherLaneName","DEFAULT_LANE","currentLabel","otherLabel","workspaceIds","listIds","configMerger","ConfigMerger","extensions","configMergeResult","merge","mergeResults","threeWayMerge","returnUnmerged","msg","unmergedLegitimately","componentStatus","unchangedMessage","unchangedLegitimately","getModelComponentIfExist","unmerged","unmergedComponents","getEntry","getRef","existingBitMapId","bitMap","getComponentIdIfExist","ignoreVersion","componentOnOther","idOnCurrentLane","getComponent","isRemoved","shouldMerge","shouldRemoveFromMain","shouldBeRemoved","getCurrentId","head","getHeadAsTagIfExist","getDivergeData","targetHead","throws","componentFromModel","getCurrentComponent","loadComponent","loadExtensions","getConsumerComponent","isTargetNotAhead","isTargetAhead","shouldIgnore","isModified","componentModificationStatus","getComponentStatusById","modified","undefined","isSourceCodeModified","isComponentSourceCodeModified","modifiedType","ignoreConfigChanges","NoCommonSnap","resolveUnrelated","message","handleNoCommonSnap","isDiverged","isSourceAhead","mainHead","returnAccordingToOurs","headToSaveInLane","unrelatedHead","unrelatedLaneId","resolvedUnrelated","strategy","headOnCurrentLane","returnAccordingToTheirs","resolvedRef","unrelatedHeadRef","currentVersionRef","otherVersionRef","hasResolvedFromMain","hashToCompare","divergeDataFromMain","sourceHead","hasResolvedLocally","getHeadRegardlessOfLane","hasResolvedRemotely","refToSaveInLane","exports"],"sources":["merge-status-provider.ts"],"sourcesContent":["import { Workspace } from '@teambit/workspace';\nimport { MergeStrategy } from '@teambit/legacy/dist/consumer/versions-ops/merge-version';\nimport mapSeries from 'p-map-series';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { DEFAULT_LANE, LaneId } from '@teambit/lane-id';\nimport { getDivergeData } from '@teambit/legacy/dist/scope/component-ops/get-diverge-data';\nimport { Lane, ModelComponent, Version } from '@teambit/legacy/dist/scope/models';\nimport { Ref } from '@teambit/legacy/dist/scope/objects';\nimport { Tmp } from '@teambit/legacy/dist/scope/repositories';\nimport ConsumerComponent from '@teambit/legacy/dist/consumer/component/consumer-component';\nimport { ImporterMain } from '@teambit/importer';\nimport { Logger } from '@teambit/logger';\nimport { compact } from 'lodash';\nimport threeWayMerge from '@teambit/legacy/dist/consumer/versions-ops/merge-version/three-way-merge';\nimport { SnapsDistance } from '@teambit/legacy/dist/scope/component-ops/snaps-distance';\nimport { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';\nimport { ConfigMerger } from './config-merger';\nimport { ComponentMergeStatus, ComponentMergeStatusBeforeMergeAttempt } from './merging.main.runtime';\n\nexport type MergeStatusProviderOptions = {\n resolveUnrelated?: MergeStrategy;\n ignoreConfigChanges?: boolean;\n shouldSquash?: boolean;\n};\n\nexport class MergeStatusProvider {\n constructor(\n private workspace: Workspace,\n private logger: Logger,\n private importer: ImporterMain,\n private currentLane?: Lane, // currently checked out lane. if on main, then it's undefined.\n private otherLane?: Lane, // the lane we want to merged to our lane. (undefined if it's \"main\").\n private options?: MergeStatusProviderOptions\n ) {}\n\n async getStatus(\n bitIds: ComponentID[] // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatus[]> {\n if (!this.currentLane && this.otherLane) {\n await this.importer.importObjectsFromMainIfExist(this.otherLane.toBitIds().toVersionLatest());\n }\n const componentStatusBeforeMergeAttempt = await mapSeries(bitIds, (id) =>\n this.getComponentStatusBeforeMergeAttempt(id)\n );\n // whether or not we need to import the gap between the common-snap and the other lane.\n // the common-snap itself we need anyway in order to get the files hash/content for checking conflicts.\n const shouldImportHistoryOfOtherLane =\n !this.options?.shouldSquash && // when squashing, no need for all history, only the head is going to be pushed\n (!this.currentLane || // on main. we need all history in order to push each component to its remote\n this.currentLane.scope !== this.otherLane?.scope); // on lane, but the other lane is from a different scope. we need all history in order to push to the current lane's scope\n const toImport = componentStatusBeforeMergeAttempt\n .map((compStatus) => {\n if (!compStatus.divergeData) return [];\n const versionsToImport = [compStatus.divergeData.commonSnapBeforeDiverge];\n if (shouldImportHistoryOfOtherLane) {\n versionsToImport.push(...compStatus.divergeData.snapsOnTargetOnly);\n }\n return compact(versionsToImport).map((v) => compStatus.id.changeVersion(v.toString()));\n })\n .flat();\n const reason = shouldImportHistoryOfOtherLane\n ? `for filling the gap between the common-snap and the head of ${this.otherLane?.id() || 'main'}`\n : `for getting the common-snap between ${this.currentLane?.id() || 'main'} and ${this.otherLane?.id() || 'main'}`;\n await this.workspace.consumer.scope.scopeImporter.importWithoutDeps(ComponentIdList.fromArray(toImport), {\n lane: this.otherLane,\n cache: true,\n includeVersionHistory: false,\n reason,\n });\n\n const compStatusNotNeedMerge = componentStatusBeforeMergeAttempt.filter(\n (c) => !c.mergeProps\n ) as ComponentMergeStatus[];\n const compStatusNeedMerge = componentStatusBeforeMergeAttempt.filter((c) => c.mergeProps);\n\n const getComponentsStatusNeedMerge = async (): Promise<ComponentMergeStatus[]> => {\n const tmp = new Tmp(this.workspace.consumer.scope);\n try {\n const componentsStatus = await Promise.all(\n compStatusNeedMerge.map((compStatus) => this.getComponentMergeStatus(compStatus))\n );\n await tmp.clear();\n return componentsStatus;\n } catch (err: any) {\n await tmp.clear();\n throw err;\n }\n };\n const results = await getComponentsStatusNeedMerge();\n\n results.push(...compStatusNotNeedMerge);\n return results;\n }\n\n private async getComponentMergeStatus(\n componentMergeStatusBeforeMergeAttempt: ComponentMergeStatusBeforeMergeAttempt\n ) {\n const { id, divergeData, currentComponent, mergeProps } = componentMergeStatusBeforeMergeAttempt;\n if (!mergeProps) throw new Error(`getDivergedMergeStatus, mergeProps is missing for ${id.toString()}`);\n const { otherLaneHead, currentId, modelComponent } = mergeProps;\n const repo = this.workspace.consumer.scope.objects;\n if (!divergeData) throw new Error(`getDivergedMergeStatus, divergeData is missing for ${id.toString()}`);\n if (!currentComponent) throw new Error(`getDivergedMergeStatus, currentComponent is missing for ${id.toString()}`);\n\n const baseSnap = divergeData.commonSnapBeforeDiverge as Ref; // must be set when isTrueMerge\n this.logger.debug(`merging snaps details:\nid: ${id.toStringWithoutVersion()}\nbase: ${baseSnap.toString()}\ncurrent: ${currentId.version}\nother: ${otherLaneHead.toString()}`);\n const baseComponent: Version = await modelComponent.loadVersion(baseSnap.toString(), repo);\n const otherComponent: Version = await modelComponent.loadVersion(otherLaneHead.toString(), repo);\n\n const currentLaneName = this.currentLane?.toLaneId().toString() || 'main';\n const otherLaneName = this.otherLane ? this.otherLane.toLaneId().toString() : DEFAULT_LANE;\n const currentLabel = `${currentId.version} (${currentLaneName === otherLaneName ? 'current' : currentLaneName})`;\n const otherLabel = `${otherLaneHead.toString()} (${\n otherLaneName === currentLaneName ? 'incoming' : otherLaneName\n })`;\n const workspaceIds = await this.workspace.listIds();\n const configMerger = new ConfigMerger(\n id.toStringWithoutVersion(),\n workspaceIds,\n this.otherLane,\n currentComponent.extensions,\n baseComponent.extensions,\n otherComponent.extensions,\n currentLabel,\n otherLabel,\n this.logger\n );\n const configMergeResult = configMerger.merge();\n\n const mergeResults = await threeWayMerge({\n consumer: this.workspace.consumer,\n otherComponent,\n otherLabel,\n currentComponent,\n currentLabel,\n baseComponent,\n });\n return { currentComponent, id, mergeResults, divergeData, configMergeResult };\n }\n\n private returnUnmerged(\n id: ComponentID,\n msg: string,\n unmergedLegitimately = false\n ): ComponentMergeStatusBeforeMergeAttempt {\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n componentStatus.unchangedMessage = msg;\n componentStatus.unchangedLegitimately = unmergedLegitimately;\n return componentStatus;\n }\n\n private async getComponentStatusBeforeMergeAttempt(\n id: ComponentID // the id.version is the version we want to merge to the current component\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n const consumer = this.workspace.consumer;\n const componentStatus: ComponentMergeStatusBeforeMergeAttempt = { id };\n const modelComponent = await consumer.scope.getModelComponentIfExist(id);\n if (!modelComponent) {\n return this.returnUnmerged(\n id,\n `component ${id.toString()} is on the lane/main but its objects were not found, please re-import the lane`\n );\n }\n const unmerged = consumer.scope.objects.unmergedComponents.getEntry(id);\n if (unmerged) {\n return this.returnUnmerged(\n id,\n `component ${id.toStringWithoutVersion()} is in during-merge state a previous merge, please snap/tag it first (or use bit merge --resolve/--abort/ bit lane merge-abort)`\n );\n }\n const repo = consumer.scope.objects;\n const version = id.version as string;\n const otherLaneHead = modelComponent.getRef(version);\n const existingBitMapId = consumer.bitMap.getComponentIdIfExist(id, { ignoreVersion: true });\n const componentOnOther: Version = await modelComponent.loadVersion(version, consumer.scope.objects);\n const idOnCurrentLane = this.currentLane?.getComponent(id);\n\n if (componentOnOther.isRemoved()) {\n // if exist in current lane, we want the current lane to get the soft-remove update.\n // or if it was removed with --update-main, we want to merge it so then main will get the update.\n const shouldMerge = idOnCurrentLane || componentOnOther.shouldRemoveFromMain();\n if (shouldMerge) {\n // remove the component from the workspace if exist.\n componentStatus.shouldBeRemoved = true;\n } else {\n // on main, don't merge soft-removed components unless it's marked with removeOnMain.\n // on lane, if it's not part of the current lane, don't merge it.\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n const getCurrentId = () => {\n if (existingBitMapId) return existingBitMapId;\n if (this.currentLane) {\n if (!idOnCurrentLane) return null;\n return idOnCurrentLane.id.changeVersion(idOnCurrentLane.head.toString());\n }\n // it's on main\n const head = modelComponent.getHeadAsTagIfExist();\n if (head) {\n return id.changeVersion(head);\n }\n return null;\n };\n const currentId = getCurrentId();\n if (!currentId) {\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n return { ...componentStatus, componentFromModel: componentOnOther, divergeData };\n }\n const getCurrentComponent = () => {\n if (existingBitMapId) return consumer.loadComponent(existingBitMapId, { loadExtensions: true });\n return consumer.scope.getConsumerComponent(currentId);\n };\n const currentComponent = await getCurrentComponent();\n if (currentComponent.isRemoved()) {\n // we have a few options:\n // 1. \"other\" is main. in this case, we don't care what happens on main, we want the component to stay deleted on\n // this lane. (even when main is ahead, we don't want to merge it).\n // 2. other is ahead. in this case, other recovered the component. so we can continue with the merge.\n // it is possible that it is diverged, in which case, still continue with the merge, and later on, the\n // merge-config will show a config conflict of the remove aspect.\n // 3. other is not ahead. in this case, just ignore this component, no point to merge it, we want it removed.\n const divergeData = await getDivergeData({ repo, modelComponent, targetHead: otherLaneHead, throws: false });\n const isTargetNotAhead = !divergeData.err && !divergeData.isTargetAhead();\n const shouldIgnore = this.otherLane\n ? isTargetNotAhead // option #2 and #3 above\n : true; // it's main. option #1 above.\n if (shouldIgnore) {\n return this.returnUnmerged(id, `component has been removed`, true);\n }\n }\n\n const isModified = async (): Promise<undefined | 'code' | 'config'> => {\n const componentModificationStatus = await this.workspace.getComponentStatusById(currentComponent.id);\n if (!componentModificationStatus.modified) return undefined;\n if (!existingBitMapId) return undefined;\n const baseComponent = await modelComponent.loadVersion(\n existingBitMapId.version as string,\n consumer.scope.objects\n );\n const isSourceCodeModified = await consumer.isComponentSourceCodeModified(baseComponent, currentComponent);\n if (isSourceCodeModified) return 'code';\n return 'config';\n };\n\n const modifiedType = await isModified();\n if (modifiedType === 'config' && !this.options?.ignoreConfigChanges) {\n return this.returnUnmerged(\n id,\n `component has config changes, please snap/tag it first. alternatively, use --ignore-config-changes flag to bypass`\n );\n }\n if (modifiedType === 'code') {\n return this.returnUnmerged(id, `component is modified, please snap/tag it first`);\n }\n\n if (!otherLaneHead) {\n throw new Error(`merging: unable finding a hash for the version ${version} of ${id.toString()}`);\n }\n const divergeData = await getDivergeData({\n repo,\n modelComponent,\n targetHead: otherLaneHead,\n throws: false,\n });\n if (divergeData.err) {\n if (!(divergeData.err instanceof NoCommonSnap) || !this.options?.resolveUnrelated) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. error: ${divergeData.err.message}`\n );\n }\n return this.handleNoCommonSnap(\n modelComponent,\n id,\n otherLaneHead,\n currentComponent,\n componentOnOther,\n divergeData\n );\n }\n if (!divergeData.isDiverged()) {\n if (divergeData.isSourceAhead()) {\n // do nothing!\n return this.returnUnmerged(id, `component ${currentComponent.id.toString()} is ahead, nothing to merge`, true);\n }\n if (divergeData.isTargetAhead()) {\n // just override with the model data\n return {\n ...componentStatus,\n currentComponent,\n componentFromModel: componentOnOther,\n divergeData,\n };\n }\n // we know that localHead and remoteHead are set, so if none of them is ahead they must be equal\n return this.returnUnmerged(id, `component ${currentComponent.id.toString()} is already merged`, true);\n }\n\n // it's diverged and needs merge operation\n const mergeProps = {\n otherLaneHead,\n currentId,\n modelComponent,\n };\n\n return { ...componentStatus, currentComponent, mergeProps, divergeData };\n }\n\n private async handleNoCommonSnap(\n modelComponent: ModelComponent,\n id: ComponentID,\n otherLaneHead: Ref,\n currentComponent: ConsumerComponent,\n componentOnOther?: Version,\n divergeData?: SnapsDistance\n ): Promise<ComponentMergeStatusBeforeMergeAttempt> {\n let { resolveUnrelated } = this.options || {};\n if (currentComponent.isRemoved()) {\n resolveUnrelated = 'theirs';\n }\n if (!resolveUnrelated) throw new Error(`handleNoCommonSnap expects resolveUnrelated to be set`);\n const consumer = this.workspace.consumer;\n const repo = consumer.scope.objects;\n const mainHead = modelComponent.head;\n\n const returnAccordingToOurs = (\n headToSaveInLane: Ref,\n unrelatedHead: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n return {\n currentComponent,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'ours',\n headOnCurrentLane: headToSaveInLane,\n unrelatedHead,\n unrelatedLaneId,\n },\n };\n };\n const returnAccordingToTheirs = (\n resolvedRef: Ref,\n unrelatedHeadRef: Ref,\n unrelatedLaneId: LaneId\n ): ComponentMergeStatusBeforeMergeAttempt => {\n // just override with the model data\n return {\n currentComponent,\n componentFromModel: componentOnOther,\n id,\n divergeData,\n resolvedUnrelated: {\n strategy: 'theirs',\n headOnCurrentLane: resolvedRef,\n unrelatedHead: unrelatedHeadRef,\n unrelatedLaneId,\n },\n };\n };\n\n const currentVersionRef = modelComponent.getRef(currentComponent.id.version as string);\n if (!currentVersionRef)\n throw new Error(\n `handleNoCommonSnap, unable to get ref of current version \"${\n currentComponent.id.version\n }\" for \"${id.toString()}\"`\n );\n const otherVersionRef = modelComponent.getRef(id.version as string);\n if (!otherVersionRef)\n throw new Error(`handleNoCommonSnap, unable to get ref of other version \"${id.version}\" for \"${id.toString()}\"`);\n\n if (mainHead) {\n const hasResolvedFromMain = async (hashToCompare: Ref | null) => {\n const divergeDataFromMain = await getDivergeData({\n repo,\n modelComponent,\n sourceHead: hashToCompare,\n targetHead: mainHead,\n throws: false,\n });\n if (!divergeDataFromMain.err) return true;\n return !(divergeDataFromMain.err instanceof NoCommonSnap);\n };\n const hasResolvedLocally = await hasResolvedFromMain(modelComponent.getHeadRegardlessOfLane() as Ref);\n const hasResolvedRemotely = await hasResolvedFromMain(otherLaneHead);\n if (!hasResolvedLocally && !hasResolvedRemotely) {\n return this.returnUnmerged(\n id,\n `unable to traverse ${currentComponent.id.toString()} history. the main-head ${mainHead.toString()} doesn't appear in both lanes.\nit was probably created in each lane separately and it also exists on main. please merge main first to one of these lanes`\n );\n }\n const refToSaveInLane = hasResolvedLocally ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = hasResolvedLocally ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n\n const refToSaveInLane = resolveUnrelated === 'ours' ? currentVersionRef : otherVersionRef;\n const unrelatedHeadRef = resolveUnrelated === 'ours' ? otherVersionRef : currentVersionRef;\n if (resolveUnrelated === 'ours') {\n return returnAccordingToOurs(refToSaveInLane, unrelatedHeadRef, this.otherLane?.toLaneId() as LaneId);\n }\n if (resolveUnrelated === 'theirs') {\n return returnAccordingToTheirs(refToSaveInLane, unrelatedHeadRef, this.currentLane?.toLaneId() as LaneId);\n }\n throw new Error(\n `unsupported strategy \"${resolveUnrelated}\" of resolve-unrelated. supported strategies are: [ours, theirs]`\n );\n }\n}\n"],"mappings":";;;;;;AAEA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA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.125",
4
4
  "homepage": "https://bit.cloud/teambit/component/merging",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "merging",
9
- "version": "1.0.123"
9
+ "version": "1.0.125"
10
10
  },
11
11
  "dependencies": {
12
12
  "lodash": "4.17.21",
@@ -18,20 +18,20 @@
18
18
  "@teambit/bit-error": "0.0.404",
19
19
  "@teambit/lane-id": "0.0.311",
20
20
  "@teambit/harmony": "0.4.6",
21
- "@teambit/dependency-resolver": "1.0.123",
22
- "@teambit/builder": "1.0.123",
23
- "@teambit/envs": "1.0.123",
21
+ "@teambit/dependency-resolver": "1.0.125",
22
+ "@teambit/builder": "1.0.125",
23
+ "@teambit/envs": "1.0.125",
24
24
  "@teambit/logger": "0.0.938",
25
25
  "@teambit/cli": "0.0.845",
26
26
  "@teambit/global-config": "0.0.848",
27
- "@teambit/importer": "1.0.123",
28
- "@teambit/workspace": "1.0.123",
29
- "@teambit/checkout": "1.0.123",
30
- "@teambit/component-writer": "1.0.123",
31
- "@teambit/config": "0.0.874",
32
- "@teambit/install": "1.0.123",
33
- "@teambit/remove": "1.0.123",
34
- "@teambit/snapping": "1.0.123"
27
+ "@teambit/importer": "1.0.125",
28
+ "@teambit/workspace": "1.0.125",
29
+ "@teambit/checkout": "1.0.125",
30
+ "@teambit/component-writer": "1.0.125",
31
+ "@teambit/config": "0.0.876",
32
+ "@teambit/install": "1.0.125",
33
+ "@teambit/remove": "1.0.125",
34
+ "@teambit/snapping": "1.0.125"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/lodash": "4.14.165",