Unverified Commit 0bbd9020 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] remove experiment tracking analytics for null safety (#70183)

parent 39bc68b6
...@@ -633,7 +633,6 @@ class _ResidentWebRunner extends ResidentWebRunner { ...@@ -633,7 +633,6 @@ class _ResidentWebRunner extends ResidentWebRunner {
fullRestart: true, fullRestart: true,
reason: reason, reason: reason,
overallTimeInMs: timer.elapsed.inMilliseconds, overallTimeInMs: timer.elapsed.inMilliseconds,
nullSafety: usageNullSafety,
fastReassemble: null, fastReassemble: null,
).send(); ).send();
} }
......
...@@ -39,7 +39,6 @@ class HotEvent extends UsageEvent { ...@@ -39,7 +39,6 @@ class HotEvent extends UsageEvent {
@required this.sdkName, @required this.sdkName,
@required this.emulator, @required this.emulator,
@required this.fullRestart, @required this.fullRestart,
@required this.nullSafety,
@required this.fastReassemble, @required this.fastReassemble,
this.reason, this.reason,
this.finalLibraryCount, this.finalLibraryCount,
...@@ -57,7 +56,6 @@ class HotEvent extends UsageEvent { ...@@ -57,7 +56,6 @@ class HotEvent extends UsageEvent {
final String sdkName; final String sdkName;
final bool emulator; final bool emulator;
final bool fullRestart; final bool fullRestart;
final bool nullSafety;
final bool fastReassemble; final bool fastReassemble;
final int finalLibraryCount; final int finalLibraryCount;
final int syncedLibraryCount; final int syncedLibraryCount;
...@@ -93,8 +91,6 @@ class HotEvent extends UsageEvent { ...@@ -93,8 +91,6 @@ class HotEvent extends UsageEvent {
CustomDimensions.hotEventTransferTimeInMs: transferTimeInMs.toString(), CustomDimensions.hotEventTransferTimeInMs: transferTimeInMs.toString(),
if (overallTimeInMs != null) if (overallTimeInMs != null)
CustomDimensions.hotEventOverallTimeInMs: overallTimeInMs.toString(), CustomDimensions.hotEventOverallTimeInMs: overallTimeInMs.toString(),
if (nullSafety != null)
CustomDimensions.nullSafety: nullSafety.toString(),
if (fastReassemble != null) if (fastReassemble != null)
CustomDimensions.fastReassemble: fastReassemble.toString(), CustomDimensions.fastReassemble: fastReassemble.toString(),
}); });
......
...@@ -789,11 +789,6 @@ abstract class ResidentRunner { ...@@ -789,11 +789,6 @@ abstract class ResidentRunner {
Completer<int> _finished = Completer<int>(); Completer<int> _finished = Completer<int>();
bool hotMode; bool hotMode;
/// Whether the compiler was instructed to run with null-safety enabled.
@protected
bool get usageNullSafety => debuggingOptions?.buildInfo
?.extraFrontEndOptions?.any((String option) => option.contains('non-nullable')) ?? false;
/// Returns true if every device is streaming observatory URIs. /// Returns true if every device is streaming observatory URIs.
bool get isWaitingForObservatory { bool get isWaitingForObservatory {
return flutterDevices.every((FlutterDevice device) { return flutterDevices.every((FlutterDevice device) {
......
...@@ -699,7 +699,6 @@ class HotRunner extends ResidentRunner { ...@@ -699,7 +699,6 @@ class HotRunner extends ResidentRunner {
sdkName: sdkName, sdkName: sdkName,
emulator: emulator, emulator: emulator,
fullRestart: true, fullRestart: true,
nullSafety: usageNullSafety,
reason: reason, reason: reason,
fastReassemble: null, fastReassemble: null,
).send(); ).send();
...@@ -750,7 +749,6 @@ class HotRunner extends ResidentRunner { ...@@ -750,7 +749,6 @@ class HotRunner extends ResidentRunner {
emulator: emulator, emulator: emulator,
fullRestart: false, fullRestart: false,
reason: reason, reason: reason,
nullSafety: usageNullSafety,
fastReassemble: null, fastReassemble: null,
).send(); ).send();
} else { } else {
...@@ -759,7 +757,6 @@ class HotRunner extends ResidentRunner { ...@@ -759,7 +757,6 @@ class HotRunner extends ResidentRunner {
sdkName: sdkName, sdkName: sdkName,
emulator: emulator, emulator: emulator,
fullRestart: false, fullRestart: false,
nullSafety: usageNullSafety,
reason: reason, reason: reason,
fastReassemble: null, fastReassemble: null,
).send(); ).send();
...@@ -961,7 +958,6 @@ class HotRunner extends ResidentRunner { ...@@ -961,7 +958,6 @@ class HotRunner extends ResidentRunner {
syncedBytes: updatedDevFS.syncedBytes, syncedBytes: updatedDevFS.syncedBytes,
invalidatedSourcesCount: updatedDevFS.invalidatedSourcesCount, invalidatedSourcesCount: updatedDevFS.invalidatedSourcesCount,
transferTimeInMs: devFSTimer.elapsed.inMilliseconds, transferTimeInMs: devFSTimer.elapsed.inMilliseconds,
nullSafety: usageNullSafety,
fastReassemble: featureFlags.isSingleWidgetReloadEnabled fastReassemble: featureFlags.isSingleWidgetReloadEnabled
? updatedDevFS.fastReassembleClassName != null ? updatedDevFS.fastReassembleClassName != null
: null, : null,
...@@ -1024,7 +1020,6 @@ class HotRunner extends ResidentRunner { ...@@ -1024,7 +1020,6 @@ class HotRunner extends ResidentRunner {
emulator: emulator, emulator: emulator,
fullRestart: false, fullRestart: false,
reason: reason, reason: reason,
nullSafety: usageNullSafety,
fastReassemble: null, fastReassemble: null,
).send(); ).send();
// Reset devFS lastCompileTime to ensure the file will still be marked // Reset devFS lastCompileTime to ensure the file will still be marked
......
...@@ -1014,10 +1014,6 @@ abstract class FlutterCommand extends Command<void> { ...@@ -1014,10 +1014,6 @@ abstract class FlutterCommand extends Command<void> {
); );
} }
List<String> get _enabledExperiments => argParser.options.containsKey(FlutterOptions.kEnableExperiment)
? stringsArg(FlutterOptions.kEnableExperiment)
: <String>[];
/// Perform validation then call [runCommand] to execute the command. /// Perform validation then call [runCommand] to execute the command.
/// Return a [Future] that completes with an exit code /// Return a [Future] that completes with an exit code
/// indicating whether execution was successful. /// indicating whether execution was successful.
...@@ -1072,7 +1068,6 @@ abstract class FlutterCommand extends Command<void> { ...@@ -1072,7 +1068,6 @@ abstract class FlutterCommand extends Command<void> {
<CustomDimensions, Object>{ <CustomDimensions, Object>{
...?await usageValues, ...?await usageValues,
CustomDimensions.commandHasTerminal: globals.stdio.hasTerminal, CustomDimensions.commandHasTerminal: globals.stdio.hasTerminal,
CustomDimensions.nullSafety: _enabledExperiments.contains('non-nullable'),
}; };
Usage.command(commandPath, parameters: additionalUsageValues); Usage.command(commandPath, parameters: additionalUsageValues);
} }
......
...@@ -376,7 +376,7 @@ void main() { ...@@ -376,7 +376,7 @@ void main() {
); );
// Allow any CustomDimensions.localTime (cd33) timestamp. // Allow any CustomDimensions.localTime (cd33) timestamp.
final RegExp usageRegexp = RegExp( final RegExp usageRegexp = RegExp(
'screenView {cd3: false, cd4: ios, cd22: iOS 13, cd23: debug, cd18: false, cd15: swift, cd31: false, cd47: false, cd33: .*, viewName: run' 'screenView {cd3: false, cd4: ios, cd22: iOS 13, cd23: debug, cd18: false, cd15: swift, cd31: false, cd33: .*, viewName: run'
); );
expect(buffer.toString(), matches(usageRegexp)); expect(buffer.toString(), matches(usageRegexp));
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
......
...@@ -525,7 +525,6 @@ void main() { ...@@ -525,7 +525,6 @@ void main() {
cdKey(CustomDimensions.hotEventSdkName): 'Example', cdKey(CustomDimensions.hotEventSdkName): 'Example',
cdKey(CustomDimensions.hotEventEmulator): 'false', cdKey(CustomDimensions.hotEventEmulator): 'false',
cdKey(CustomDimensions.hotEventFullRestart): 'false', cdKey(CustomDimensions.hotEventFullRestart): 'false',
cdKey(CustomDimensions.nullSafety): 'false',
})).called(1); })).called(1);
expect(fakeVmServiceHost.hasRemainingExpectations, false); expect(fakeVmServiceHost.hasRemainingExpectations, false);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -580,7 +579,6 @@ void main() { ...@@ -580,7 +579,6 @@ void main() {
cdKey(CustomDimensions.hotEventSdkName): 'Example', cdKey(CustomDimensions.hotEventSdkName): 'Example',
cdKey(CustomDimensions.hotEventEmulator): 'false', cdKey(CustomDimensions.hotEventEmulator): 'false',
cdKey(CustomDimensions.hotEventFullRestart): 'false', cdKey(CustomDimensions.hotEventFullRestart): 'false',
cdKey(CustomDimensions.nullSafety): 'false',
})).called(1); })).called(1);
expect(fakeVmServiceHost.hasRemainingExpectations, false); expect(fakeVmServiceHost.hasRemainingExpectations, false);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -645,7 +643,6 @@ void main() { ...@@ -645,7 +643,6 @@ void main() {
cdKey(CustomDimensions.hotEventSdkName): 'Example', cdKey(CustomDimensions.hotEventSdkName): 'Example',
cdKey(CustomDimensions.hotEventEmulator): 'false', cdKey(CustomDimensions.hotEventEmulator): 'false',
cdKey(CustomDimensions.hotEventFullRestart): 'false', cdKey(CustomDimensions.hotEventFullRestart): 'false',
cdKey(CustomDimensions.nullSafety): 'true',
})).called(1); })).called(1);
expect(fakeVmServiceHost.hasRemainingExpectations, false); expect(fakeVmServiceHost.hasRemainingExpectations, false);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
...@@ -1398,7 +1395,6 @@ void main() { ...@@ -1398,7 +1395,6 @@ void main() {
cdKey(CustomDimensions.hotEventSdkName): 'Example', cdKey(CustomDimensions.hotEventSdkName): 'Example',
cdKey(CustomDimensions.hotEventEmulator): 'false', cdKey(CustomDimensions.hotEventEmulator): 'false',
cdKey(CustomDimensions.hotEventFullRestart): 'true', cdKey(CustomDimensions.hotEventFullRestart): 'true',
cdKey(CustomDimensions.nullSafety): 'false',
})).called(1); })).called(1);
expect(fakeVmServiceHost.hasRemainingExpectations, false); expect(fakeVmServiceHost.hasRemainingExpectations, false);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
......
...@@ -96,30 +96,6 @@ void main() { ...@@ -96,30 +96,6 @@ void main() {
expect(flutterCommand.hidden, isTrue); expect(flutterCommand.hidden, isTrue);
}); });
testUsingContext('null-safety is surfaced in command usage analytics', () async {
final FakeNullSafeCommand fake = FakeNullSafeCommand();
final CommandRunner<void> commandRunner = createTestCommandRunner(fake);
await commandRunner.run(<String>['safety', '--enable-experiment=non-nullable']);
final VerificationResult resultA = verify(usage.sendCommand(
'safety',
parameters: captureAnyNamed('parameters'),
));
expect(resultA.captured.first, containsPair('cd47', 'true'));
reset(usage);
await commandRunner.run(<String>['safety', '--enable-experiment=foo']);
final VerificationResult resultB = verify(usage.sendCommand(
'safety',
parameters: captureAnyNamed('parameters'),
));
expect(resultB.captured.first, containsPair('cd47', 'false'));
}, overrides: <Type, Generator>{
Usage: () => usage,
});
testUsingContext('uses the error handling file system', () async { testUsingContext('uses the error handling file system', () async {
final DummyFlutterCommand flutterCommand = DummyFlutterCommand( final DummyFlutterCommand flutterCommand = DummyFlutterCommand(
commandFunction: () async { commandFunction: () async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment