Skip to content

Commit a92b965

Browse files
authored
fix(vscode): remove affected condition from onboarding checks (#2583)
1 parent 09b1480 commit a92b965

File tree

7 files changed

+9
-52
lines changed

7 files changed

+9
-52
lines changed

apps/nxls-e2e/src/nx-cloud/nx-cloud-onboarding-info-default.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ describe('nx cloud onboarding - default', () => {
4444
});
4545
expect(onboardingInfoResponse.result).toMatchInlineSnapshot(`
4646
Object {
47-
"hasAffectedCommandsInCI": false,
4847
"hasNxInCI": false,
4948
"isConnectedToCloud": false,
5049
"isWorkspaceClaimed": false,
@@ -120,7 +119,6 @@ describe('nx cloud onboarding - default', () => {
120119

121120
const info = onboardingInfoResponse.result as CloudOnboardingInfo;
122121

123-
expect(info.hasAffectedCommandsInCI).toEqual(true);
124122
expect(info.hasNxInCI).toEqual(true);
125123
});
126124
});

libs/language-server/workspace/src/lib/get-cloud-onboarding-info.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@ export async function getCloudOnboardingInfo(
1919
const hasNxInCI = commonCIFileContents.some((content) =>
2020
content.includes('nx '),
2121
);
22-
const hasAffectedCommandsInCI = commonCIFileContents.some((content) =>
23-
content.includes('nx affected'),
24-
);
2522

2623
if (!(await isNxCloudUsed(workspacePath))) {
2724
return {
2825
hasNxInCI,
29-
hasAffectedCommandsInCI,
3026
isConnectedToCloud: false,
3127
isWorkspaceClaimed: false,
3228
personalAccessToken: undefined,
@@ -52,7 +48,6 @@ export async function getCloudOnboardingInfo(
5248

5349
return {
5450
hasNxInCI,
55-
hasAffectedCommandsInCI,
5651
isConnectedToCloud,
5752
isWorkspaceClaimed,
5853
personalAccessToken,

libs/shared/types/src/lib/cloud-info.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export type CloudOnboardingInfo = {
22
hasNxInCI: boolean;
3-
hasAffectedCommandsInCI: boolean;
43
isConnectedToCloud: boolean;
54
isWorkspaceClaimed: boolean;
65
personalAccessToken: string | undefined;

libs/vscode/nx-cloud-onboarding-webview/src/main.ts

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export class Root extends LitElement {
2121
<div style="font-size: var(--vscode-font-size)">
2222
${completed.map(
2323
(text) =>
24-
html`<list-entry .text=${text} .completed=${true}></list-entry>`
24+
html`<list-entry .text=${text} .completed=${true}></list-entry>`,
2525
)}
2626
${notCompleted.map(
2727
(text) =>
28-
html`<list-entry .text=${text} .completed=${false}></list-entry>`
28+
html`<list-entry .text=${text} .completed=${false}></list-entry>`,
2929
)}
3030
</div>
3131
@@ -51,14 +51,9 @@ export class Root extends LitElement {
5151
const notCompleted: string[] = [];
5252

5353
(this.cloudOnboardingInfo?.hasNxInCI ? completed : notCompleted).push(
54-
'Use Nx in your CI configuration'
54+
'Use Nx in your CI configuration',
5555
);
5656

57-
(this.cloudOnboardingInfo?.hasAffectedCommandsInCI
58-
? completed
59-
: notCompleted
60-
).push('Use affected commands in your CI configuration');
61-
6257
(this.cloudOnboardingInfo?.isConnectedToCloud
6358
? completed
6459
: notCompleted
@@ -88,8 +83,6 @@ export class Root extends LitElement {
8883
return 'Finish Nx Cloud Setup';
8984
} else if (!this.cloudOnboardingInfo.hasNxInCI) {
9085
return 'Generate CI configuration';
91-
} else if (!this.cloudOnboardingInfo.hasAffectedCommandsInCI) {
92-
return 'Learn about affected commands';
9386
} else {
9487
return 'Open Nx Cloud App';
9588
}
@@ -119,14 +112,6 @@ export class Root extends LitElement {
119112
>Learn more about Nx Cloud</vscode-link
120113
>
121114
</p>`;
122-
} else if (!this.cloudOnboardingInfo.hasAffectedCommandsInCI) {
123-
return html`<p>
124-
Affected commands are a powerful feature of Nx and allow you to skip any
125-
unnecessary computation in your CI pipeline.
126-
<vscode-link href="https://nx.dev/ci/intro/why-nx-cloud"
127-
>Learn more about Nx Cloud</vscode-link
128-
>
129-
</p>`;
130115
} else {
131116
return html``;
132117
}
@@ -141,8 +126,6 @@ export class Root extends LitElement {
141126
});
142127
} else if (!this.cloudOnboardingInfo.hasNxInCI) {
143128
this.vscodeApi.postMessage({ type: 'generate-ci' });
144-
} else if (!this.cloudOnboardingInfo.hasAffectedCommandsInCI) {
145-
this.vscodeApi.postMessage({ type: 'show-affected-docs' });
146129
} else {
147130
this.vscodeApi.postMessage({ type: 'open-cloud-app' });
148131
}

libs/vscode/nx-cloud-view/src/cloud-onboarding-view.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export class CloudOnboardingViewProvider implements WebviewViewProvider {
5555

5656
async resolveWebviewView(
5757
webviewView: WebviewView,
58-
context: WebviewViewResolveContext,
59-
token: CancellationToken,
58+
_context: WebviewViewResolveContext,
59+
_token: CancellationToken,
6060
): Promise<void> {
6161
this.ensureStateSubscription();
6262

@@ -113,14 +113,6 @@ export class CloudOnboardingViewProvider implements WebviewViewProvider {
113113
generateCI();
114114
break;
115115
}
116-
case 'show-affected-docs': {
117-
getTelemetry().logUsage('cloud.show-affected-docs');
118-
commands.executeCommand(
119-
'vscode.open',
120-
Uri.parse('https://nx.dev/ci/features/affected?utm_source=nxconsole'),
121-
);
122-
break;
123-
}
124116
case 'open-cloud-app': {
125117
commands.executeCommand('nxCloud.openApp');
126118
break;

libs/vscode/nx-cloud-view/src/cloud-view-state-machine.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ describe('Cloud View State Machine', () => {
9191
type: 'UPDATE_ONBOARDING',
9292
value: {
9393
hasNxInCI: true,
94-
hasAffectedCommandsInCI: true,
9594
isConnectedToCloud: false,
9695
isWorkspaceClaimed: false,
9796
personalAccessToken: undefined,
@@ -111,7 +110,6 @@ describe('Cloud View State Machine', () => {
111110
type: 'UPDATE_ONBOARDING',
112111
value: {
113112
hasNxInCI: true,
114-
hasAffectedCommandsInCI: true,
115113
isConnectedToCloud: true,
116114
isWorkspaceClaimed: true,
117115
personalAccessToken: undefined,
@@ -148,7 +146,6 @@ describe('Cloud View State Machine', () => {
148146
type: 'UPDATE_ONBOARDING',
149147
value: {
150148
hasNxInCI: true,
151-
hasAffectedCommandsInCI: true,
152149
isConnectedToCloud: true,
153150
isWorkspaceClaimed: false,
154151
personalAccessToken: undefined,

libs/vscode/nx-cloud-view/src/cloud-view-state-machine.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,13 @@ export const machine = setup({
160160
type: 'setErrorContext',
161161
} as any);
162162
}),
163-
compareCIPEDataAndSendNotification: (
164-
_,
165-
params: {
166-
oldData: CIPEInfo[];
167-
newData: CIPEInfo[];
168-
},
169-
) => {
163+
compareCIPEDataAndSendNotification: () => {
170164
throw new Error('Not implemented');
171165
},
172-
setViewVisible: (_, params: { viewId: string }) => {
166+
setViewVisible: () => {
173167
throw new Error('Not implemented');
174168
},
175-
setErrorContext: ({ context }) => {
169+
setErrorContext: () => {
176170
throw new Error('Not implemented');
177171
},
178172
requestRecentCIPEData: emit({
@@ -193,8 +187,7 @@ export const machine = setup({
193187
return Boolean(
194188
context.onboardingInfo?.isWorkspaceClaimed &&
195189
context.onboardingInfo?.isConnectedToCloud &&
196-
context.onboardingInfo?.hasNxInCI &&
197-
context.onboardingInfo?.hasAffectedCommandsInCI,
190+
context.onboardingInfo?.hasNxInCI,
198191
);
199192
},
200193
hasOnboardingInfo: ({ context }) => {

0 commit comments

Comments
 (0)