From f7ca713f0629cd21379636bad784ff0462d1a658 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 13 Jan 2022 14:44:10 +0400 Subject: [PATCH 1/2] [BEAM-13639] Added log about cached results for precompiled examples --- .../lib/pages/playground/states/playground_state.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playground/frontend/lib/pages/playground/states/playground_state.dart b/playground/frontend/lib/pages/playground/states/playground_state.dart index 6a81403e1b02..3f53f976161c 100644 --- a/playground/frontend/lib/pages/playground/states/playground_state.dart +++ b/playground/frontend/lib/pages/playground/states/playground_state.dart @@ -31,6 +31,8 @@ const kPrecompiledDelay = Duration(seconds: 1); const kTitle = 'Catalog'; const kPipelineOptionsParseError = 'Failed to parse pipeline options, please check the format (example: --key1 value1 --key2 value2), only alphanumeric and ",*,/,-,:,;,\',. symbols are allowed'; +const kCachedResultsLog = + 'The results of this example are taken from the Apache Beam Playground cache.\n'; class PlaygroundState with ChangeNotifier { late SDK _sdk; @@ -152,10 +154,11 @@ class PlaygroundState with ChangeNotifier { notifyListeners(); // add a little delay to improve user experience await Future.delayed(kPrecompiledDelay); + String logs = _selectedExample!.logs ?? ''; _result = RunCodeResult( status: RunCodeStatus.finished, output: _selectedExample!.outputs, - log: _selectedExample!.logs, + log: kCachedResultsLog + logs, ); notifyListeners(); } From 9d35582a8bf130503ee0c804d33292701587e28c Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 17 Jan 2022 15:41:25 +0400 Subject: [PATCH 2/2] [BEAM-13639] Fixed _getPipelineResult method of code_repository --- .../editor/repository/code_repository/code_repository.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart index 9e86f0103e63..8f354ce9e8d6 100644 --- a/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart +++ b/playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart @@ -166,6 +166,7 @@ class CodeRepository { final log = responses[1]; final error = responses[2]; return RunCodeResult( + pipelineUuid: pipelineUuid, status: status, output: prevOutput + output.output + error.output, log: prevLog + log.output,