@@ -498,6 +498,10 @@ class GitpodPortViewProvider implements vscode.WebviewViewProvider {
498
498
if ( ! port ) { return ; }
499
499
if ( message . command === 'urlCopy' && port . status . exposed ) {
500
500
await vscode . env . clipboard . writeText ( port . status . exposed . url ) ;
501
+ this . context . fireAnalyticsEvent ( {
502
+ eventName : 'vscode_execute_command_gitpod_ports' ,
503
+ properties : { action : 'urlCopy' , isWebview : true , userOverride : String ( isUserOverrideSetting ( 'gitpod.experimental.portsView.enabled' ) ) }
504
+ } ) ;
501
505
return ;
502
506
}
503
507
vscode . commands . executeCommand ( 'gitpod.ports.' + message . command , { port, isWebview : true } ) ;
@@ -580,23 +584,17 @@ async function registerPorts(context: GitpodExtensionContext): Promise<void> {
580
584
}
581
585
582
586
const packageJSON = context . extension . packageJSON ;
583
- const experiments = new ExperimentalSettings ( packageJSON . configcatKey , packageJSON . version , context . logger ) ;
587
+ const experiments = new ExperimentalSettings ( process . env [ 'GITPOD_CONFIGCAT_SDK_KEY' ] ?? packageJSON . configcatKey , packageJSON . version , context . logger ) ;
584
588
context . subscriptions . push ( experiments ) ;
585
589
586
590
const isSaaSGitpod = context . info . getGitpodHost ( ) === 'https://gitpod.io' ;
587
591
async function getPortsViewExperimentEnable ( ) : Promise < boolean > {
588
- const isEnabled = isSaaSGitpod
589
- ? ( await experiments . get < boolean > ( 'gitpod.experimental.portsView.enabled' , ( await context . user ) . id ) ) !
592
+
593
+ return isSaaSGitpod
594
+ ? ( await experiments . get < boolean > ( 'gitpod.experimental.portsView.enabled' , ( await context . user ) . id , {
595
+ team_ids : ( await context . userTeams ) . map ( e => e . id ) . join ( ',' ) ,
596
+ } ) ) !
590
597
: vscode . workspace . getConfiguration ( 'gitpod' ) . get < boolean > ( 'experimental.portsView.enabled' ) ! ;
591
- const userOverride = isUserOverrideSetting ( 'gitpod.remote.useLocalApp' ) ;
592
- context . fireAnalyticsEvent ( {
593
- eventName : 'vscode_experimental_ports_view' ,
594
- properties : {
595
- enabled : isEnabled ,
596
- userOverride,
597
- }
598
- } ) ;
599
- return isEnabled ;
600
598
}
601
599
602
600
context . subscriptions . push ( observePortsStatus ( ) ) ;
@@ -638,14 +636,14 @@ async function registerPorts(context: GitpodExtensionContext): Promise<void> {
638
636
context . subscriptions . push ( vscode . commands . registerCommand ( 'gitpod.ports.makePrivate' , ( { port, isWebview } : PortItem ) => {
639
637
context . fireAnalyticsEvent ( {
640
638
eventName : 'vscode_execute_command_gitpod_ports' ,
641
- properties : { action : 'private' , isWebview : ! ! isWebview }
639
+ properties : { action : 'private' , isWebview : ! ! isWebview , userOverride : String ( isUserOverrideSetting ( 'gitpod.experimental.portsView.enabled' ) ) }
642
640
} ) ;
643
641
return port . setPortVisibility ( 'private' ) ;
644
642
} ) ) ;
645
643
context . subscriptions . push ( vscode . commands . registerCommand ( 'gitpod.ports.makePublic' , ( { port, isWebview } : PortItem ) => {
646
644
context . fireAnalyticsEvent ( {
647
645
eventName : 'vscode_execute_command_gitpod_ports' ,
648
- properties : { action : 'public' , isWebview : ! ! isWebview }
646
+ properties : { action : 'public' , isWebview : ! ! isWebview , userOverride : String ( isUserOverrideSetting ( 'gitpod.experimental.portsView.enabled' ) ) }
649
647
} ) ;
650
648
return port . setPortVisibility ( 'public' ) ;
651
649
} ) ) ;
@@ -658,14 +656,14 @@ async function registerPorts(context: GitpodExtensionContext): Promise<void> {
658
656
context . subscriptions . push ( vscode . commands . registerCommand ( 'gitpod.ports.preview' , ( { port, isWebview } : PortItem ) => {
659
657
context . fireAnalyticsEvent ( {
660
658
eventName : 'vscode_execute_command_gitpod_ports' ,
661
- properties : { action : 'preview' , isWebview : ! ! isWebview }
659
+ properties : { action : 'preview' , isWebview : ! ! isWebview , userOverride : String ( isUserOverrideSetting ( 'gitpod.experimental.portsView.enabled' ) ) }
662
660
} ) ;
663
661
return openPreview ( port ) ;
664
662
} ) ) ;
665
663
context . subscriptions . push ( vscode . commands . registerCommand ( 'gitpod.ports.openBrowser' , ( { port, isWebview } : PortItem ) => {
666
664
context . fireAnalyticsEvent ( {
667
665
eventName : 'vscode_execute_command_gitpod_ports' ,
668
- properties : { action : 'openBrowser' , isWebview : ! ! isWebview }
666
+ properties : { action : 'openBrowser' , isWebview : ! ! isWebview , userOverride : String ( isUserOverrideSetting ( 'gitpod.experimental.portsView.enabled' ) ) }
669
667
} ) ;
670
668
return openExternal ( port ) ;
671
669
} ) ) ;
0 commit comments