Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove lane-history from the feature flag, is now enabled by default #9095

Merged
merged 5 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions scopes/harmony/modules/feature-toggle/feature-toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,3 @@ export const CLOUD_IMPORTER = 'cloud-importer';
export const CLOUD_IMPORTER_V2 = 'cloud-importer-v2';

export const ALLOW_SAME_NAME = 'allow-same-name'; // not in use anymore

export const SUPPORT_LANE_HISTORY = 'support-lane-history';
9 changes: 3 additions & 6 deletions scopes/lanes/lanes/lanes.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { ChangeType } from '@teambit/lanes.entities.lane-diff';
import { ComponentsList, DivergeDataPerId } from '@teambit/legacy.component-list';
import { NoCommonSnap } from '@teambit/legacy/dist/scope/exceptions/no-common-snap';
import { concurrentComponentsLimit } from '@teambit/harmony.modules.concurrency';
import { SUPPORT_LANE_HISTORY, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';
import { removeLanes } from './remove-lanes';
import { LanesAspect } from './lanes.aspect';
import {
Expand Down Expand Up @@ -1188,11 +1187,9 @@ please create a new lane instead, which will include all components of this lane
new LaneFetchCmd(fetchCmd, lanesMain),
new LaneEjectCmd(lanesMain),
];
if (isFeatureEnabled(SUPPORT_LANE_HISTORY)) {
laneCmd.commands.push(new LaneHistoryCmd(lanesMain));
laneCmd.commands.push(new LaneCheckoutCmd(lanesMain));
laneCmd.commands.push(new LaneRevertCmd(lanesMain));
}
laneCmd.commands.push(new LaneHistoryCmd(lanesMain));
laneCmd.commands.push(new LaneCheckoutCmd(lanesMain));
laneCmd.commands.push(new LaneRevertCmd(lanesMain));
cli.register(laneCmd, switchCmd, new CatLaneHistoryCmd(lanesMain));
cli.registerOnStart(async () => {
await lanesMain.recreateNewLaneIfDeleted();
Expand Down
5 changes: 0 additions & 5 deletions scopes/lanes/lanes/lanes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { SnappingAspect, SnappingMain } from '@teambit/snapping';
import { WorkspaceAspect, Workspace } from '@teambit/workspace';
import { ExportAspect, ExportMain } from '@teambit/export';
import { LaneId } from '@teambit/lane-id';
import { SUPPORT_LANE_HISTORY, addFeature, removeFeature } from '@teambit/harmony.modules.feature-toggle';
import { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';
import { mockComponents, modifyMockedComponents } from '@teambit/component.testing.mock-components';
import { ChangeType } from '@teambit/lanes.entities.lane-diff';
Expand Down Expand Up @@ -216,7 +215,6 @@ describe('LanesAspect', function () {
let snapping: SnappingMain;
let laneId: LaneId;
before(async () => {
addFeature(SUPPORT_LANE_HISTORY);
workspaceData = mockWorkspace();
const { workspacePath } = workspaceData;
await mockComponents(workspacePath);
Expand All @@ -228,7 +226,6 @@ describe('LanesAspect', function () {
laneId = currentLaneId;
});
after(async () => {
removeFeature(SUPPORT_LANE_HISTORY);
await destroyWorkspace(workspaceData);
});
it('should create lane history object when creating a new lane', async () => {
Expand Down Expand Up @@ -363,7 +360,6 @@ describe('LanesAspect', function () {
let snapping: SnappingMain;
let laneId: LaneId;
before(async () => {
addFeature(SUPPORT_LANE_HISTORY);
workspaceData = mockWorkspace();
const { workspacePath } = workspaceData;
await mockComponents(workspacePath);
Expand All @@ -389,7 +385,6 @@ describe('LanesAspect', function () {
await snapping.snap({ build: false });
});
after(async () => {
removeFeature(SUPPORT_LANE_HISTORY);
await destroyWorkspace(workspaceData);
});
it('should save the deleted data into the lane object', async () => {
Expand Down
9 changes: 3 additions & 6 deletions scopes/scope/export/export.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import mapSeries from 'p-map-series';
import { LaneId, DEFAULT_LANE } from '@teambit/lane-id';
import { Remote, Remotes } from '@teambit/legacy/dist/remotes';
import { EjectAspect, EjectMain, EjectResults } from '@teambit/eject';
import { SUPPORT_LANE_HISTORY, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';
import { getScopeRemotes } from '@teambit/legacy/dist/scope/scope-remotes';
import { ExportOrigin } from '@teambit/legacy/dist/scope/network/http/http';
import { linkToNodeModulesByIds } from '@teambit/workspace.modules.node-modules-linker';
Expand Down Expand Up @@ -434,11 +433,9 @@ if the export fails with missing objects/versions/components, run "bit fetch --l
// don't use Promise.all, otherwise, it'll throw "JavaScript heap out of memory" on a large set of data
await mapSeries(refsToExportPerComponent, processModelComponent);
if (lane) {
if (isFeatureEnabled(SUPPORT_LANE_HISTORY)) {
const laneHistory = await this.workspace.scope.legacyScope.lanes.getOrCreateLaneHistory(lane);
const laneHistoryData = await bitObjectToObjectItem(laneHistory);
objectList.addIfNotExist([laneHistoryData]);
}
const laneHistory = await this.workspace.scope.legacyScope.lanes.getOrCreateLaneHistory(lane);
const laneHistoryData = await bitObjectToObjectItem(laneHistory);
objectList.addIfNotExist([laneHistoryData]);
const laneData = await bitObjectToObjectItem(lane);
objectList.addIfNotExist([laneData]);
}
Expand Down