Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bc9cd8b
Add an optional onUpdated event to the iterator returned by ILocator.…
Sep 16, 2020
f687921
fully bump raw kernel (#13941)
IanMatthewHuff Sep 16, 2020
64c8526
Virtualenvwrapper locator (#13895)
kimadeline Sep 16, 2020
a9b5603
Clean up eslint errors (#13951)
karthiknadig Sep 16, 2020
016cce8
Add a legacy DI adapter for the Python envs component. (#13858)
Sep 16, 2020
7b3b541
Extension api for DataScience (#13923)
DonJayamanne Sep 17, 2020
a7c3b7f
Fix installing ipykernel into interpreters for raw kernel (#13959)
IanMatthewHuff Sep 17, 2020
89b47a0
Fix kernel and server name missing in certain situations (#13974)
rchiodo Sep 17, 2020
7a86cf0
Extension API to return path to debugpy for DS (#13973)
DonJayamanne Sep 17, 2020
6b94c8b
Use the component adapter in the extension. (#13869)
Sep 17, 2020
10b8965
Disable split views of custom editors (#13985)
DonJayamanne Sep 17, 2020
245f393
Fix backup storage by looking at the options correctly (#13983)
rchiodo Sep 18, 2020
8ec292e
update test plan for ipykernel (python repo) (#13993)
IanMatthewHuff Sep 18, 2020
da38997
Find interpreter based on hash in kernelspec of nb metadata (#13856)
DonJayamanne Sep 21, 2020
2cc2c93
Pyenv locator (#13996)
kimadeline Sep 21, 2020
ee0cad9
merge
gramster Sep 21, 2020
889375b
Revert "merge"
rchiodo Sep 22, 2020
8c0d3aa
Remove cwd while running using isolate script (#14014)
karthiknadig Sep 22, 2020
a7176fc
Upgrade isort to 5.5.3 (#14035)
Sep 22, 2020
ec568ca
Modify environment info worker to support new type and to work with r…
Sep 22, 2020
68e127a
Remove cross process lock (#14036)
joyceerhl Sep 22, 2020
352d9a5
Add API to get language server from external extensions (#14021)
rchiodo Sep 22, 2020
a531cba
Fix failing virtualenvwrapper Windows unit tests (#14012)
kimadeline Sep 22, 2020
221c0d5
make sure that we run our show code when a custom editor is shown (#1…
IanMatthewHuff Sep 22, 2020
367e002
Rely on AppInsights API for exceptions (#13878)
Sep 22, 2020
ed0e2a7
Fix HTML escaping to match what Jupyter does (#14038)
rchiodo Sep 22, 2020
f60eeaf
Have dependabot ignore pytest and py (#14039)
brettcannon Sep 23, 2020
5f09a26
Added environments reducer (#13953)
Sep 23, 2020
fd5abc1
Merge release back to master (#14059)
Sep 23, 2020
e31046b
Fix object sort order in tools tests (#14050)
karthiknadig Sep 23, 2020
66a4cb1
Update ubuntu images for GPU issue fix (#14064)
karthiknadig Sep 23, 2020
1a0c790
Added environments resolver (#14019)
Sep 25, 2020
6abde6b
Add Windows unit tests to the PR pipeline (#14106)
kimadeline Sep 25, 2020
d498e85
Do not opt users out of the insiders program if they have a stable ve…
Sep 25, 2020
12de21d
Do not quote isolated in exec module (#14108)
karthiknadig Sep 25, 2020
94da334
Update cell output and metadata using Edit API (#13737)
DonJayamanne Sep 25, 2020
57fedbd
Fix unit test broken by recent revert (#14122)
karthiknadig Sep 28, 2020
8b87f08
Merge remote-tracking branch 'origin/main' into rchiodo/merge_main_nods
rchiodo Sep 28, 2020
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
Prev Previous commit
Next Next commit
Do not opt users out of the insiders program if they have a stable ve…
…rsion installed (#14091)

* Remove code that opts users out of the insiders program

* News entry

* Code reviews
  • Loading branch information
Kartik Raj
Kartik Raj authored Sep 25, 2020
commit d498e8500071b2a5da65111df2592d3550220ac4
1 change: 1 addition & 0 deletions news/1 Enhancements/14090.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Do not opt users out of the insiders program if they have a stable version installed.
23 changes: 2 additions & 21 deletions src/client/common/insidersBuild/insidersExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class InsidersExtensionService implements IExtensionSingleActivationServi
const channel = this.extensionChannelService.getChannel();
const isDefault = this.extensionChannelService.isChannelUsingDefaultConfiguration;

const alreadyHandled = await this.handleEdgeCases(channel, isDefault);
const alreadyHandled = await this.handleEdgeCases(isDefault);
if (!alreadyHandled) {
this.handleChannel(channel).ignoreErrors();
}
Expand All @@ -84,14 +84,12 @@ export class InsidersExtensionService implements IExtensionSingleActivationServi
* Choose what to do in miscellaneous situations
* @returns `true` if install channel is handled in these miscellaneous cases, `false` if install channel needs further handling
*/
public async handleEdgeCases(installChannel: ExtensionChannels, isDefault: boolean): Promise<boolean> {
public async handleEdgeCases(isDefault: boolean): Promise<boolean> {
// When running UI Tests we might want to disable these prompts.
if (process.env.UITEST_DISABLE_INSIDERS) {
return true;
} else if (await this.promptToInstallInsidersIfApplicable(isDefault)) {
return true;
} else if (await this.setInsidersChannelToOffIfApplicable(installChannel)) {
return true;
} else {
return false;
}
Expand All @@ -115,21 +113,4 @@ export class InsidersExtensionService implements IExtensionSingleActivationServi
await this.insidersPrompt.promptToInstallInsiders();
return true;
}

/**
* When install channel is not in sync with what is installed, resolve discrepency by setting channel to "off"
* @returns `true` if channel is set to off, `false` otherwise
*/
private async setInsidersChannelToOffIfApplicable(installChannel: ExtensionChannels): Promise<boolean> {
if (installChannel === 'off') {
return false;
}
if (this.appEnvironment.extensionChannel !== 'stable') {
return false;
}

// Install channel is set to "weekly" or "daily" but stable version of extension is installed. Switch channel to "off" to use the installed version
await this.extensionChannelService.updateChannel('off');
return true;
}
}
137 changes: 24 additions & 113 deletions src/test/common/insidersBuild/insidersExtensionService.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ suite('Insiders Extension Service - Activation', () => {
verify(extensionChannelService.isChannelUsingDefaultConfiguration).once();
assert.ok(registerCommandsAndHandlers.calledOnce);
assert.ok(handleEdgeCases.calledOnce);
assert.ok(handleEdgeCases.calledWith('daily', false));
assert.ok(handleEdgeCases.calledWith(false));
assert.ok(handleChannel.notCalled);
});

Expand All @@ -176,7 +176,7 @@ suite('Insiders Extension Service - Activation', () => {
verify(extensionChannelService.isChannelUsingDefaultConfiguration).once();
assert.ok(registerCommandsAndHandlers.calledOnce);
assert.ok(handleEdgeCases.calledOnce);
assert.ok(handleEdgeCases.calledWith('daily', false));
assert.ok(handleEdgeCases.calledWith(false));
assert.ok(handleChannel.calledOnce);
});

Expand Down Expand Up @@ -210,7 +210,7 @@ suite('Insiders Extension Service - Activation', () => {
assert.ok(registerCommandsAndHandlers.calledOnce);
assert.ok(handleEdgeCases.calledOnce);
assert.ok(handleChannel.calledOnce);
assert.ok(handleEdgeCases.calledWith('daily', false));
assert.ok(handleEdgeCases.calledWith(false));
});
});

Expand Down Expand Up @@ -252,6 +252,10 @@ suite('Insiders Extension Service - Function handleEdgeCases()', () => {
.verifiable(TypeMoq.Times.atLeast(0));
}

setup(() => {
setupCommon();
});

function verifyAll() {
// the most important ones:
insidersPrompt.verifyAll();
Expand All @@ -265,23 +269,16 @@ suite('Insiders Extension Service - Function handleEdgeCases()', () => {

type TestInfo = {
vscodeChannel?: Channel;
extensionChannel?: Channel;
installChannel: ExtensionChannels;
installChannel?: ExtensionChannels;
isChannelUsingDefaultConfiguration?: boolean;
hasUserBeenNotified?: boolean;
};

function setState(info: TestInfo, checkPromptEnroll: boolean, checkDisable: boolean) {
function setState(info: TestInfo, checkPromptEnroll: boolean) {
if (info.vscodeChannel) {
appEnvironment.setup((e) => e.channel).returns(() => info.vscodeChannel!);
}
if (info.extensionChannel) {
appEnvironment.setup((e) => e.extensionChannel).returns(() => info.extensionChannel!);
}

if (checkDisable) {
extensionChannelService.setup((ec) => ec.updateChannel('off')).returns(() => Promise.resolve());
}
if (info.hasUserBeenNotified !== undefined) {
when(hasUserBeenNotifiedState.value).thenReturn(info.hasUserBeenNotified!);
}
Expand All @@ -290,125 +287,42 @@ suite('Insiders Extension Service - Function handleEdgeCases()', () => {
}
}

suite('Case II - Verify Insiders Install Prompt is displayed when conditions are met', async () => {
const testsForHandleEdgeCaseII: TestInfo[] = [
test(`Insiders Install Prompt is displayed when vscode channel = 'insiders', user has not been notified to install insiders, isChannelUsingDefaultConfiguration = true`, async () => {
setState(
{
installChannel: 'daily',
// prompt to enroll
vscodeChannel: 'insiders',
hasUserBeenNotified: false,
isChannelUsingDefaultConfiguration: true
},
{
installChannel: 'off',
// prompt to enroll
vscodeChannel: 'insiders',
hasUserBeenNotified: false,
isChannelUsingDefaultConfiguration: true
}
];

setup(() => {
setupCommon();
});

testsForHandleEdgeCaseII.forEach((testParams) => {
const testName = `Insiders Install Prompt is displayed when vscode channel = '${
testParams.vscodeChannel
}', extension channel = '${testParams.extensionChannel}', install channel = '${
testParams.installChannel
}', ${
!testParams.hasUserBeenNotified
? 'user has not been notified to install insiders'
: 'user has already been notified to install insiders'
}, isChannelUsingDefaultConfiguration = ${testParams.isChannelUsingDefaultConfiguration}`;
test(testName, async () => {
setState(testParams, true, false);

await insidersExtensionService.handleEdgeCases(
testParams.installChannel,
testParams.isChannelUsingDefaultConfiguration!
);

verifyAll();
verify(hasUserBeenNotifiedState.value).once();
});
});
});

suite('Case III - Verify Insiders channel is set to off when conditions are met', async () => {
const testsForHandleEdgeCaseIII: TestInfo[] = [
{
installChannel: 'daily',
// skip enroll
vscodeChannel: 'stable',
// disable
// with installChannel from above
extensionChannel: 'stable'
},
{
installChannel: 'weekly',
// skip enroll
vscodeChannel: 'stable',
// disable
// with installChannel from above
extensionChannel: 'stable'
}
];

setup(() => {
setupCommon();
});
true
);

testsForHandleEdgeCaseIII.forEach((testParams) => {
const testName = `Insiders channel is set to off when vscode channel = '${
testParams.vscodeChannel
}', extension channel = '${testParams.extensionChannel}', install channel = '${
testParams.installChannel
}', ${
!testParams.hasUserBeenNotified
? 'user has not been notified to install insiders'
: 'user has already been notified to install insiders'
}, isChannelUsingDefaultConfiguration = ${testParams.isChannelUsingDefaultConfiguration}`;
test(testName, async () => {
setState(testParams, false, true);
await insidersExtensionService.handleEdgeCases(true);

await insidersExtensionService.handleEdgeCases(
testParams.installChannel,
false // isDefault
);

verifyAll();
verify(hasUserBeenNotifiedState.value).never();
});
});
verifyAll();
verify(hasUserBeenNotifiedState.value).once();
});

suite('Case IV - Verify no operation is performed if none of the case conditions are met', async () => {
const testsForHandleEdgeCaseIV: TestInfo[] = [
suite('Verify no operation is performed if none of the case conditions are met', async () => {
const testsForHandleEdgeCases: TestInfo[] = [
{
installChannel: 'daily',
// skip enroll
vscodeChannel: 'insiders',
hasUserBeenNotified: true,
// skip disable
extensionChannel: 'insiders'
hasUserBeenNotified: true
},
{
installChannel: 'daily',
// skip enroll
vscodeChannel: 'insiders',
hasUserBeenNotified: false,
isChannelUsingDefaultConfiguration: false,
// skip disable
extensionChannel: 'insiders'
isChannelUsingDefaultConfiguration: false
},
{
installChannel: 'daily',
// skip enroll
vscodeChannel: 'stable',
// skip disable
extensionChannel: 'insiders'
vscodeChannel: 'stable'
},
{
installChannel: 'off',
Expand Down Expand Up @@ -436,21 +350,18 @@ suite('Insiders Extension Service - Function handleEdgeCases()', () => {
setupCommon();
});

testsForHandleEdgeCaseIV.forEach((testParams) => {
testsForHandleEdgeCases.forEach((testParams) => {
const testName = `No operation is performed when vscode channel = '${
testParams.vscodeChannel
}', extension channel = '${testParams.extensionChannel}', install channel = '${
testParams.installChannel
}', ${
}', install channel = '${testParams.installChannel}', ${
!testParams.hasUserBeenNotified
? 'user has not been notified to install insiders'
: 'user has already been notified to install insiders'
}, isChannelUsingDefaultConfiguration = ${testParams.isChannelUsingDefaultConfiguration}`;
test(testName, async () => {
setState(testParams, false, false);
setState(testParams, false);

await insidersExtensionService.handleEdgeCases(
testParams.installChannel,
testParams.isChannelUsingDefaultConfiguration || testParams.installChannel === 'off'
);

Expand Down