[Android][add2app] Cached engine is destroyed/detach after a few times navigating between Android and Flutter

Steps to reproduce
starting flutter activity with cached engine.
start native activity from flutter
start flutter activity from that native activity
start native activity from flutter
then back,back,back,back
Expected results
expected that flutter engine survives activity.
checked FlutterActivity, it shouldn't be destroyed when cachedEngineId is set.
I also tried to set destroy_engine_with_activity false via bundle args without success.
Actual results
the first time back to flutter works, the second time the engine is removed. Empty grey screen is shown, see error logs below.
Code sample
private void initFluter(){
    FlutterEngine flutterEngine = new FlutterEngine(getApplicationContext());
    flutterEngine.getDartExecutor().executeDartEntrypoint(DartExecutor.DartEntrypoint.createDefault());
    FlutterEngineCache.getInstance().put(FLUTTER_ENGINE_CACHE_KEY, flutterEngine);
}

public void startFlutterActivity(String route) {
    FlutterEngineCache.getInstance().get(FLUTTER_ENGINE_CACHE_KEY).getNavigationChannel().pushRoute(route);
    startActivity(FlutterActivity.withCachedEngine(FLUTTER_ENGINE_CACHE_KEY).build(getActivity()));
}

the last backPress just calling getOnBackPressedDispatcher().onBackPressed()
Logs
Logs
FlutterActivity io.flutter.embedding.android.FlutterActivity@26a9582 connection to the engine io.flutter.embedding.engine.FlutterEngine@6048067 evicted by another attaching activity

FlutterActivity 227426304 onResume called after detach.

Flutter Doctor output
Doctor output

[✓] Flutter (Channel stable, 3.16.9, on Ubuntu Noble Numbat (development branch) 6.6.0-14-generic, locale en_DE.UTF-8)
    • Flutter version 3.16.9 on channel stable at /home/bwahlen/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 41456452f2 (8 days ago), 2024-01-25 10:06:23 -0800
    • Engine revision f40e976bed
    • Dart version 3.2.6
    • DevTools version 2.28.5

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/bwahlen/android-sdk-linux
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /home/bwahlen/android-sdk-linux
    • Java binary at: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java
    • Java version OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2023.1)
    • Android Studio at /home/bwahlen/android-studio
    • Flutter plugin version 77.2.1
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version openjdk version "17.0.7" 2023-04-18

[✓] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Linux (desktop)              • linux         • linux-x64      • Ubuntu Noble Numbat (development branch)
      6.6.0-14-generic
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 121.0.6167.139

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Hello @qeepcologne.
From the logs, this might be similar/related to https://github.com/flutter/flutter/issues/110138. Can you check it out?
If not, kindly share a sample repo we could run on our end to reproduce this issue.
Thank you!

don't think so:

no need to change any settings
happens all the time, 100% reproduceable, not timing related (fast&slow, debug&live, emulator (android14) and real device (android11))

Thanks for your response @qeepcologne.
Kindly share a sample repo we could run on our end to reproduce this issue.

Thanks a log. I tried to strip down the issue into minimal sample app, but at the moment i cannot reproduce it there. I am working on it to find out the difference.

Thanks for your response @qeepcologne.
Running the repo shared, I get a Page Not Found error on the screen. Calling the ChatMainWidget() directly and clicking the fire native button, I get the logs below with no changes.
Logs

E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at dev.fluttercommunity.plus.androidintent.IntentSender.send(IntentSender.java:55)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at dev.fluttercommunity.plus.androidintent.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:101)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at android.os.Handler.handleCallback(Handler.java:958)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at android.os.Looper.loopOnce(Looper.java:205)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at android.os.Looper.loop(Looper.java:294)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at android.app.ActivityThread.main(ActivityThread.java:8176)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/MethodChannel#dev.fluttercommunity.plus/android_intent( 5957): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
E/flutter ( 5957): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, Unable to find explicit activity class {com.example.myapplication/com.example.myapplication.MainActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?, null, android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.myapplication/com.example.myapplication.MainActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
E/flutter ( 5957): 	at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2236)
E/flutter ( 5957): 	at android.app.Instrumentation.execStartActivity(Instrumentation.java:1878)
E/flutter ( 5957): 	at android.app.Activity.startActivityForResult(Activity.java:5589)
E/flutter ( 5957): 	at android.app.Activity.startActivityForResult(Activity.java:5547)
E/flutter ( 5957): 	at android.app.Activity.startActivity(Activity.java:6045)
E/flutter ( 5957): 	at android.app.Activity.startActivity(Activity.java:6012)
E/flutter ( 5957): 	at dev.fluttercommunity.plus.androidintent.IntentSender.send(IntentSender.java:55)
E/flutter ( 5957): 	at dev.fluttercommunity.plus.androidintent.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.java:101)
E/flutter ( 5957): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
E/flutter ( 5957): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter ( 5957): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter ( 5957): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter ( 5957): 	at android.os.Handler.handleCallback(Handler.java:958)
E/flutter ( 5957): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/flutter ( 5957): 	at android.os.Looper.loopOnce(Looper.java:205)
E/flutter ( 5957): 	at android.os.Looper.loop(Looper.java:294)
E/flutter ( 5957): 	at android.app.ActivityThread.main(ActivityThread.java:8176)
E/flutter ( 5957): 	at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 5957): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/flutter ( 5957): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
E/flutter ( 5957): )
E/flutter ( 5957): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7)
E/flutter ( 5957): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18)
E/flutter ( 5957): <asynchronous suspension>
E/flutter ( 5957): #2      AndroidIntent.launch (package:android_intent_plus/android_intent.dart:150:5)
E/flutter ( 5957): <asynchronous suspension>
E/flutter ( 5957): #3      _fireNativeView (package:flutter_module/src/features/chat/presentation/chat_main.dart:58:5)
E/flutter ( 5957): <asynchronous suspension>

Can you recheck this as well on your end to confirm you see similar logs?

I cannot reproduce these problems, but i stripped down the app a little more. I also tested build on fresh dockerized jenkins and installed this build on real device and still cannot reproduce your issue. I added the Dockerfile and steps for the job (jenkins-job).

I can reproduce this issue with sample code at https://github.com/flutter/flutter/issues/142797#issuecomment-1924112872 on Realme 6, Android 11.

Demo
https://github.com/flutter/flutter/assets/104349824/6b09fc91-f618-47ab-9b85-19fad25edcea

flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.16.9, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.16.9 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 41456452f2 (14 hours ago), 2024-01-25 10:06:23 -0800
    • Engine revision f40e976bed
    • Dart version 3.2.6
    • DevTools version 2.28.5

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio Hedgehog.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.85.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (4 available)
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D                         • android-arm64  • Android 11 (API 30)
    • iPhone (mobile)  • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.8 19H370
    • macOS (desktop)  • macos                                    • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)     • chrome                                   • web-javascript • Google Chrome 120.0.6099.234

[✓] Network resources
    • All expected network resources are available.

• No issues found!

[!] Flutter (Channel master, 3.20.0-2.0.pre.17, on macOS 14.1 23B74 darwin-x64, locale en-VN)
    • Flutter version 3.20.0-2.0.pre.17 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6322fef7e0 (29 minutes ago), 2024-02-05 21:53:12 -0500
    • Engine revision 808886312e
    • Dart version 3.4.0 (build 3.4.0-104.0.dev)
    • DevTools version 2.32.0
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio Hedgehog.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • android-studio-dir = /Applications/Android Studio.app/
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.85.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Connected device (4 available)
    • RMX2001 (mobile) • EUYTFEUSQSRGDA6D                         • android-arm64  • Android 11 (API 30)
    • iPhone (mobile)  • d9a94afe2b649fef56ba0bfeb052f0f2a7dae95e • ios            • iOS 15.8 19H370
    • macOS (desktop)  • macos                                    • darwin-x64     • macOS 14.1 23B74 darwin-x64
    • Chrome (web)     • chrome                                   • web-javascript • Google Chrome 121.0.6167.139

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

FYI @gaaclarke , we don't have enough context on this API to know if it is working or not. I would expect that if a cache is tied to an activity, then we'd lose the cache if the OS kills the activity.

when calling
startActivity(new FlutterActivity.CachedEngineIntentBuilder(FlutterActivity.class, FLUTTER_ENGINE_CACHE_KEY).build(getActivity()));
the second time
FlutterActivity.cleanUpFlutterEngine is called
but even when i remove the super call, problem is still there.
when i set android:launchMode= "singleInstance", here is no empty screen, but then backstack is lost
from this point and app minimizes.

any progress? this bug is really annoying when you have a mixed app jumping in and out of flutter a lot. Users are complaining stat they are stuck on that grey screens.

any progress ?


refactor(decorator): use es6 default value instead relying in code check

In the file https://github.com/davinkevin/angularjs-jspm-seed/blob/master/public/decorators.js, we should use default value as https://github.com/davinkevin/Podcast-Server/blob/master/www/decorators.js

Closed by 004fa946c387a17211c0e33897e18f615649e31b


DirectResponseIntegrationTest.DirectResponseBodySizeLarge/IPv6 is flakey in TSAN test

This does not occur very often - i could find only 2 incidences in last 30 days
its not clear when the issue started
[ RUN      ] IpVersions/DirectResponseIntegrationTest.DirectResponseBodySizeLarge/IPv6
[2024-04-12 23:06:37.863][17][critical][assert] [test/integration/base_integration_test.cc:478] assert failure: 0. Details: Timed out waiting for listeners.
[2024-04-12 23:06:37.865][17][critical][backtrace] [./source/server/backtrace.h:127] Caught Aborted, suspect faulting address 0xfffe00000011
[2024-04-12 23:06:37.865][17][critical][backtrace] [./source/server/backtrace.h:111] Backtrace (use tools/stack_decode.py to get line numbers):
    #11 Envoy::DirectResponseIntegrationTest::testDirectResponseBodySize(unsigned int) /proc/self/cwd/test/integration/direct_response_integration_test.cc:31:5 (direct_response_integration_test+0x324dfa7)
    #12 Envoy::DirectResponseIntegrationTest_DirectResponseBodySizeLarge_Test::TestBody() /proc/self/cwd/test/integration/direct_response_integration_test.cc:61:3 (direct_response_integration_test+0x324277a)
    #13 void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2580:10 (direct_response_integration_test+0xa6ebac7)
    #14 void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2616:14 (direct_response_integration_test+0xa6d0dca)
    #15 testing::Test::Run() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2655:5 (direct_response_integration_test+0xa6b4488)
    #16 testing::TestInfo::Run() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2832:11 (direct_response_integration_test+0xa6b52c1)
    #17 testing::TestSuite::Run() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2986:28 (direct_response_integration_test+0xa6b5e60)
    #18 testing::internal::UnitTestImpl::RunAllTests() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:5697:44 (direct_response_integration_test+0xa6c5e9a)
    #19 bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2580:10 (direct_response_integration_test+0xa6f1a67)
    #20 bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:2616:14 (direct_response_integration_test+0xa6d468a)
    #21 testing::UnitTest::Run() /proc/self/cwd/external/com_google_googletest/googletest/src/gtest.cc:5280:10 (direct_response_integration_test+0xa6c575d)
    #22 RUN_ALL_TESTS() /proc/self/cwd/external/com_google_googletest/googletest/include/gtest/gtest.h:2485:46 (direct_response_integration_test+0x7f46277)
    #23 Envoy::TestRunner::runTests(int, char**) /proc/self/cwd/test/test_runner.cc:171:10 (direct_response_integration_test+0x7f455d0)
    #24 main /proc/self/cwd/test/main.cc:34:10 (direct_response_integration_test+0x7f4235e)

SUMMARY: ThreadSanitizer: signal-unsafe call inside of a signal /tmp/tmp.OZoeltcI3e/llvm-project-llvmorg-14.0.0/libcxxabi/src/stdlib_new_delete.cpp:30:17 in operator new(unsigned long)
==================
[2024-04-12 23:06:44.825][17][critical][backtrace] [./source/server/backtrace.h:119] #0: Envoy::SignalAction::sigHandler() [0x890c56b]
[2024-04-12 23:06:44.914][17][critical][backtrace] [./source/server/backtrace.h:119] #1: __tsan::CallUserSignalHandler() [0x31ca242]
================================================================================
INFO: Elapsed time: 3000.710s, Critical Path: 1207.65s
INFO: 25324 processes: 8910 remote cache hit, 11026 internal, 1 local, 5387 remote.
//test/integration:direct_response_integration_test                      FAILED in 115.3s
  /build/bazel_root/base/execroot/envoy/bazel-out/k8-dbg/testlogs/test/integration/direct_response_integration_test/test.log

Executed 1184 out of 1184 tests: 1183 tests pass and 1 fails remotely.

https://dev.azure.com/cncf/envoy/_build/results?buildId=167866&view=logs&j=d1f76054-8f79-554b-6f4a-11d6a63b8e00&t=33c64725-b304-5065-9740-0ce244fa1a25&l=170

this has started to fail again - seems like the same issue

https://dev.azure.com/cncf/envoy/_test/analytics?definitionId=11&contextType=build
cc @ramaraochavali

hmmmm, it's a little hard to reproduce this problem. orz.

as the issue seems to be related to the large body size - which i guess slows something down somewhere - would increasing the body size possibly make it trigger more reliably?

:crossed_fingers: this is fixed by https://github.com/envoyproxy/envoy/pull/35261


[release-v1.15] Add Konflux configurations

Add Konflux components and pipelines

/test 416-test-e2e-tls-aws-416

Konflux CI is broken:
Pipeline ocp-serverless-tenant/kn-serving-activator-115-on-pull-request-b79xm can't be Run; it contains Tasks that don't exist: Couldn't retrieve Task "resolver type bundles\nname = apply-tags\n": error requesting remote resource: resolution took longer than global timeout of 1m0s

Will merge without it, as there is no way to retest them all in one go.


Fix bug where decoding exceptions cause previous email contents to be reused

I was trying to use this code to process some old mbox files and found the source of the bug that was flagged in the code. If an exception occurs during the decoding then it will use the body from the previous email. I also added support for extracting the encoding type and use that, otherwise you also get exceptions for many emails which are not UTF-8.
Thanks for writing this code, really appreciate you sharing this code since there isn't much else out there for extracting mbox files.

Since submitting this pull request, I've done a lot of testing on my email archive and found a lot of problems with handling real-world emails - mail clients do all kinds of things incorrectly. Many emails have the wrong content encoding types, and so I had to detect if a failure occurred and then try alternative encodings in the hope that something would work. I wrote some common functions for handling all this and refactored the code around it. I also added support for creating a directory full of symlinks to all the attachments which is something I wanted. I have published all these changes at https://github.com/waynepiekarski/mbox_process/tree/main if anyone is interested in using these features.

This is great work, thanks for contributing!


[AAP-16339] Update to ERROR state when activations fail in validation

This PR is the followup of both https://github.com/ansible/eda-server/pull/416 and https://github.com/ansible/eda-server/pull/420:

Extract validation logic for creating activations in one place. The validation contains:
- awx token: only one token is allowed
- decision environment needs to be exist;
- if rulebook is related, which need to be verified (only check during creation time)
- if extra var is related, which need to be verified
Add validation check in the beginning of restart, enable, and monitor, and update the activation to ERROR status if the validation fails.

IMO we are doing a misuse of the "create" method of the serializer. Create is for the purpose to transform the data into a model not for validation.

Seems like the best practice of DRF is "Thin views, Thick serializers" (https://stackoverflow.com/questions/41094013/when-to-use-serializers-create-and-modelviewsets-perform-create)

IMO we are doing a misuse of the "create" method of the serializer. Create is for the purpose to transform the data into a model not for validation.

Seems like the best practice of DRF is "Thin views, Thick serializers" (https://stackoverflow.com/questions/41094013/when-to-use-serializers-create-and-modelviewsets-perform-create)

I'm not sure what do you mean. That's is not incompatible with I'm saying. I'm saying to perform the validations in the serializer not in the view. But in the right method for it, not in create.

@hsong-rh If there are no extra vars I am seeing this error

@hsong-rh @Alex-Izquierdo Would it make sense to store the token as a hidden relation field in the Activation object. I am thinking in the future we could have different tokens and the user would be able to pick one of them or None (if the rulebook has custom actions and no run_job_template). During this new field migration if we find that there are activations we could fill in the

token_id = The id of the controller token

This way we would have a consistent way to validate the related fields.

decision_environment_id
rulebook_id
token_id
user_id

This can be done at creation time and also post creation.
The current create serializer doesn't seem to be validating everything in the serializer and the logic is split over in the view and the serializer. This is the relationship validation in the view I think this should have been in the serializer and it should have been able to validate the existence of these objects else raise a ValidationError.

@mkanoor @Alex-Izquierdo I read the DRF doc for serializers. Seems like when we decided to append -id to relation fields (https://issues.redhat.com/browse/AAP-10811), we then lost the type of serializers.PrimaryKeyRelatedField, which is auto generated by model.serializers for us for the relations. Our serializer classes now use serializers.IntegerField for foreign keys. Default validation has no effects on them. We may need to add individual field validator for each foreign key if we want to keep the current way.
@mkanoor Validators are related with serializers and are only used in creating and updating DB records.  Some of our cases are different. We want to make sure if the activation is in good state before it will be restarted, enabled, or reconnected. I don't think we can define a single logic and use it in both creation and post creation time. Maybe part of logic in validators, and part of in mixins, how do think?

@hsong-rh @Alex-Izquierdo Would it make sense to store the token as a hidden relation field in the Activation object. I am thinking in the future we could have different tokens and the user would be able to pick one of them or None (if the rulebook has custom actions and no run_job_template). During this new field migration if we find that there are activations we could fill in the

token_id = The id of the controller token

This way we would have a consistent way to validate the related fields.

decision_environment_id
rulebook_id
token_id
user_id

This can be done at creation time and also post creation.
The current create serializer doesn't seem to be validating everything in the serializer and the logic is split over in the view and the serializer. This is the relationship validation in the view I think this should have been in the serializer and it should have been able to validate the existence of these objects else raise a ValidationError.

@mkanoor @hsong-rh I don't have a strong opinion on it. Eventually we will have multiple tokens, that's for sure. What would be the benefit of that against keeping the related id and performs validations as we already do with DE's and credentials? Why a token should be different?  I think if we implement the capability to pick a token for an activation, that field should not be immutable for rotation purposes. What would be the flow for rotating the keys?

@Alex-Izquierdo @Alex-Izquierdo Based on our discussion, now all validations are checked by validators in serializers.

@hsong-rh Since token is a non field we get this error
 "status_message": "{'non_field_errors': 'No controller token specified'}"

This is because we don't have a token relationship to Activation, we can change the non_field_errors to msg or error? It would have been ideal if we had the token relationship.

@hsong-rh Since token is a non field we get this error
 "status_message": "{'non_field_errors': 'No controller token specified'}"

This is because we don't have a token relationship to Activation, we can change the non_field_errors to msg or error? It would have been ideal if we had the token relationship.

OK, now the status message is changed as:
 "status_message": "{'errors': 'No controller token specified'}"


NETOBSERV-889: fix too many colons in address error

when hostIP is IPv6 address we endup with following error when gRPC try to connect
collector="2604:1380:4642:7e00::5b:2055" component=exporter/GRPCProto error="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp: address 2604:1380:4642:7e00::5b:2055: too many colons in address\""

for IPv6 we need to use [2604:1380:4642:7e00::5b]:2055 format.
Signed-off-by: msherif1234<EMAIL_ADDRESS>

Codecov Report

Merging #98 (91c0116) into main (c54e7eb) will increase coverage by 0.10%.
The diff coverage is 88.88%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   41.54%   41.65%   +0.10%
==========================================
  Files          29       29
  Lines        1993     1995       +2
==========================================
+ Hits          828      831       +3
+ Misses       1127     1126       -1
  Partials       38       38

Flag
Coverage Δ

unittests
41.65% <88.88%> (+0.10%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

pkg/agent/agent.go
39.20% <0.00%> (+0.14%)
:arrow_up:

pkg/exporter/grpc_proto.go
73.91% <100.00%> (+2.48%)
:arrow_up:

pkg/grpc/client.go
68.75% <100.00%> (+2.08%)
:arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

/ok-to-test

@msherif1234 Tried updating the CSV with this eBPF image, the eBPF pods went to CrashLoopBackoff with error
time="2023-02-13T21:23:28Z" level=info msg="starting NetObserv eBPF Agent" time="2023-02-13T21:23:28Z" level=info msg="initializing Flows agent" component=agent.Flows time="2023-02-13T21:23:28Z" level=fatal msg="can't instantiate NetObserv eBPF Agent" error="acquiring Agent IP: can't establish an external connection dial udp <IP_ADDRESS>:80: connect: network is unreachable"

I get the same above error with source install too; after updating the eBPF image in deployments

/ok-to-test

/ok-to-test

@msherif1234 Tried updating the CSV with this eBPF image, the eBPF pods went to CrashLoopBackoff with error time="2023-02-13T21:23:28Z" level=info msg="starting NetObserv eBPF Agent" time="2023-02-13T21:23:28Z" level=info msg="initializing Flows agent" component=agent.Flows time="2023-02-13T21:23:28Z" level=fatal msg="can't instantiate NetObserv eBPF Agent" error="acquiring Agent IP: can't establish an external connection dial udp <IP_ADDRESS>:80: connect: network is unreachable"

tried this more and discussed with error, our initial understanding of not being able to pull image: quay.io/netobserv/netobserv-ebpf-agent:ceaa4ca from quay was incorrect, it was able to pull Image and landing in above runtime error. This is likely a bug with new code.

/ok-to-test

/ok-to-test

/qe-approved
Verified fix works for both IPv6 single stack and IPv4 clusters as well, thanks!

@jotak - is something wrong with labels? I don't see qe-approved label being added.

thanks @msherif1234 !
/approve


Allow test frameworks implementations to participate in test discovery

The current approach to test discovery makes it difficult to use a test framework like partest from sbt. Partest defines test names with a combination of directory and file names rather than with type features of the test class.
My initial thought is to add a enumerateTests method to Framework that would be called during discovery to allow the implementation to provide a set of test names.

Closing. See #1949.


some suggestion

src\Support\Http.php
public function json($url, $data = [], $queries = [], array $options = [], $encodeOption = JSON_UNESCAPED_UNICODE){
        is_array($data) && $data = json_encode($data, $encodeOption);

        $this->setHeaders(['Content-Type' => 'application/json']);

        return $this->request('POST', $url, array_merge([
            'query' => $queries,
            'body' => $data,
        ], $options));
 }

It is proposed to be changed as follows
public function json($url, $data = [], $queries = [], array $options = [], $encodeOption = JSON_UNESCAPED_UNICODE){
        is_array($data) && $data = json_encode($data, $encodeOption);

        $options = ['header' => ['Content-Type' => 'application/json']];

        return $this->request('POST', $url, array_merge([
            'query' => $queries,
            'body' => $data,
        ], $options));
 }

$this->setHeaders(['Content-Type' => 'application/json']); It is be a global setting, and it will dirty other requests

thanks @zhongjq suggestion, Would you like to create a PR for this? That would be fantastic!

thanks @zhongjq suggestion, Would you like to create a PR for this? That would be fantastic!

yes，thanks


ENH: Euler diagrams (Donation)

Is your feature request related to a problem? Please describe.
How can I incorporate my library 'eule' to scipy?
TAKE NOTE: The test coverage badge is not working. The library has currently 100% coverage.
Describe the solution you'd like.
See implementation on repository
Describe alternatives you've considered.
https://github.com/trouchet/eule
Additional context (e.g. screenshots, GIFs)
No response

Hi @brunolnetto . Wonderful that you want to contribute your hard work to the public domain. I think this work can better be suited to a visualization library instead of a number crunching one or something like a sympy or sage where folks are more pure math users in my opinion. We have a very limited visualization capabilities and only for specific results of algorithms like voronoi and so on.

Well, at least I tried. I do not know sage. I thought scipy would be the most suitable place to host this solution. Visualization of Euler Diagrams is exactly what I do not want to do at the moment due complexity.

@brunolnetto I would recommend posting this on the mailing list, you may get some good suggestions on where the best fit for this is

May I get some instructions on how to post on mailing list? :)

@brunolnetto I would start a new thread

I am afraid, I have no such privilege.


[Feature][Gitlab] Support Issue-type transformations in Gitlab Blueprint

Search before asking

[X] I had searched in the issues and found no similar feature requirement.

Use case
When going through my data scope for the Giltab connection, and trying to add a transformation to any of the Gitlab repositories, I only ever get the CI/CD Transformation option.
I can only assume that's a limitation of the connector at the moment, because I do also have issue tracking among my selected scopes, so I would expect this to show up.
So I would like to also add transformations for Giltab issues on those projects.
Description
E.g. currently, when I select transformation for any Gitlab repositories, I see only this:

However, as per documentation, I would like to also apply issue transformations, so I would assume this:

Related issues
No response
Are you willing to submit a PR?

[ ] Yes I am willing to submit a PR!

Code of Conduct

[X] I agree to follow this project's Code of Conduct

In fact, I have all entities selected, but I don't get any of the other transformation types, except for CI/CD.

@Startrekzky @yumengwang03 Can you take a look?

Hi @batjko , sorry for the late reply. May I ask:

what specific types of GitLab issues do you use?
what's your goal of transforming them to standard types?

I asked because there's a default Incident type in GitLab issues, so the DORA metrics should not have been affected without any issue transformations.

@batjko DevLake is not hiding anything in the UI. DevLake doesn't support issue-transformation configuration simply because not many users use GitLab issues to manage requirements/feature requests, so we don't find the necessity of doing it.
On the contrary, DevLake's GitHub plugin provides the issue-transformation configuration based on GitHub's issue labels, as many users use GitHub issues to manage requirements or bugs.
Does it make sense?

Incident that is used to measure DORA metrics is a system issue type in GitLab, unlike Jira issue types or GitHub's issue labels, so it doesn't need to be transformed.
What are the rule to import gitlab incident as devlake issue with type=INCIDENT ?

So, what are the rules to import gitlab incident as devlake issue with type=INCIDENT ?

Hi @clement-igonet . DevLake should collect GitLab incidents and covert them to type = INCIDENTby default. If the actuall behavior doesn't meet this logic, then there's a bug.

I tried it out, and in GitLab, data of the 'incident' type can be successfully collected, but the 'type' field in the 'issues' table remains empty. @Startrekzky

So, could we re-open the current topic ?


Test email

Hi,
Apparently email notifications are not working, so I will not be notified when issues are posted.
I am sorry for the troubles.

Fixed!


Unable to compile gdnative rust on Linux (Manjaro specifically)

I have Rust installed and I am getting a build error.
failed to run custom build command for `gdnative-sys v0.5.0 (/home/Raj/Desktop/godot-rust/gdnative-sys)`
process didn't exit successfully: `/home/Raj/Desktop/godot-rust/target/debug/build/gdnative-sys-310f5d009c902839/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to find libclang: "couldn\'t find any valid shared libraries matching: [\'libclang.so\', \'libclang-*.so\', \'libclang.so.*\'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

@Raj2032 the error is in the message: Unable to find libclang -- Clang/LLVM are a requirement of the rust compiler, this is not an issue related to godot-rust.
pacman -S clang should install all the dependencies you need. See https://wiki.archlinux.org/index.php/Clang for more information.

@rminderhoud I am trying to understand this a bit better, if gcc is already installed which is a C/C++ compiler, how come I need clang, whats the difference?

@Raj2032 That is a question better suited for the Rust forum or IRC. The Rust compiler (rustc) requires LLVM since it generates LLVM byte-code. Installing clang will get you all the dependencies, which includes LLVM. Why it needs libclang specifically is a question better suited for someone knowledgeable in Rust internals. I would recommend you spend some time to learn the basics of Rust before trying to use these bindings, you will get better support elsewhere rather than in these github issues.

@Raj2032 It supposed to be bindgen dependency which requires libclang.so to parse C/C++ API files to generate rust bindings. GCC doesn't have available parser module.

Closed question due to inactivity.
If you still have this question, please feel free to reopen it.


Filter session name input

This session name has some restrictions from AWS: Member must satisfy regular expression pattern: [\w+=,.@-]*
This ensures the string passed in satisfies that constraint.
https://buildkite.com/peakon/infrastructure-terraform-aws-development-eu-west-1/builds/5190#018617c8-845d-45e1-93dd-5f6efcf49983/227-229

Sorry wrong fork...


Allow testing in latest EAP builds

I typically work with EAP builds, and I am accustomed to encountering issues as they arise (which is expected with EAP). However, I have noticed that this plugin is frequently disabled due to the restrictive install limit configuration.
Would it be possible to enable support non breaking EAP builds, not necessarily the latest one?
Thanks!

I thiiiink enabling EAP builds just requires setting the pluginUntilBuild the EAP build number (which now is 241 for 2024.1 version).
So, with the latest release of v0.2.1, you should be able to install the plugin on the EAP build. Can you give that a try?

Yep it worked. Thank you!
Do you know if there is a way to enable the plugin for all EAP builds?


Triage  runtime crash via LLM

Our current triage rules cannot identify all errors caused by our fuzz target.
Meanwhile, LLM can help identify the cause of a crash when I test it manually.
We can automate what I did manually to reduce the workload in the current manual triaging.
For each crash NOT ruled out by our current semantic checks, we can pass its 1) source code, 2) error stack trace, and 3) fuzzing log to LLM and ask LLM to judge the cause of the error.
Then, we can read LLM's response from the report during manual triaging.
This can also be extended by appending the source code of all files in the stack trace to the triage prompt, given Vertex AI has a sufficient 32k context window.
We can only add the relevant functions if some files are too long. Function names and line numbers from the call stack can help identify which function to include.

Once we save some triaging prompts and their manual judgments, we can use them as examples in the training prompt.

Maybe also use:
https://github.com/google/clusterfuzz/blob/d3854a4d00417cdae053b0b36418c5754a67efce/src/clusterfuzz/_internal/crash_analysis/crash_analyzer.py#L271


support to group API

Hello there,
I've being looking for a way to list/describe resources like ingresses, hpa and deployments, but can't find a way to do that using kubeclient.
I found some older issues mentioned what seems to be a confirmation that such API Groups are supported by this project, but couldn't find any example and/or documentation mentioning how to do that:

#350
#176
#278
#227

I even gave a try using pry, noticed that some methods are defined at runtime (after sending a get_pods, for example), but nothing related those API Groups that I already mentioned.
Am I missing something here, or this support is not complete at the moment?
That's the code I'm using for testing:
config = Kubeclient::Config.read("#{ENV['HOME']}/.kube/config")
context = config.context

client = Kubeclient::Client.new(
  context.api_endpoint,
  'v1',
  ssl_options: context.ssl_options,
  auth_options: context.auth_options
)

Thanks in advance,
Alceu

After reviewing more issues like that and some debugging configuration for restclient (RESTCLIENT_LOG=stdout bundle exec ruby test.rb), I could get a working example:
# frozen_string_literal: true

require 'kubeclient'

def k8s_client
  config = Kubeclient::Config.read("#{ENV['HOME']}/.kube/config")
  context = config.context
  puts context.api_endpoint

  Kubeclient::Client.new(
    "#{context.api_endpoint}/apis/extensions",
    'v1beta1',
    ssl_options: context.ssl_options,
    auth_options: context.auth_options
  )
end

client = k8s_client
puts client.get_ingresses(namespace: 'qa')

Does that mean that I need to create a client instance to be able to execute queries with the "old" API and then create a new instance to query the "v1beta1"?
Or is there any shortcut for configure that on the fly (I saw that the client instance has an api Hash, not sure if it's advisable to change any in there).

Yes, you need a separate client object per API group that you want to use.
See https://github.com/abonas/kubeclient/issues/208#issuecomment-412706681 for overview of various proposals we have to improve this in the future.
BTW, extensions v1beta1 is deprecated:
https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/ lists new API groups that replace it, with version ranges when you can/must switch.


Cursorline changed to visual mode when using LSP goto functions

Let's say I'm in Normal mode, then when I use my hotkey to go definition of the symbol under my cursor (vim.lsp.buf.definition()), the cursor line changes to visual mode color even though it's normal mode. If I press ESC, then it goes back to normal mode color.
I think other LSP functions are also affected by this too.

Can you provide reproduction steps? I can't reproduce your issue with CTRL-] or god, my vim.lsp.buf.definition key map

I tried to record it here:
https://asciinema.org/a/wsae78BECGmJWgKOYOcsISeka
My keymap for vim.lsp.buf.definition is 'gd'.
When I press gd quickly, it remains in visual mode (purple).
When I gress g and wait a bit (which key shows up), and then press d, it correctly remains in Normal mode.
My dotfiles if you are interested to check other stuffs: https://github.com/icyrainz/.dotfiles/tree/master/nvim

Can you try the latest (0.2.1) or upstream version? It seems you are using an old version of modes.nvim

Oh awesome. this is fixed in 0.2.1. I was following the install instruction that has the 0.2.0 tag. I think we should update the README. Appreciated you checking this.

I was following the install instruction that has the 0.2.0 tag. I think we should update the README

Sorry for that, I've rarely paid attention to the README, I am working on some bug fixes right now, I'll make sure to update the README to reflect all the changes so far after that


Only ship with one default data source

Reduces compile time, especially when you wouldn't use all sources anyway.

bors r+

bors r+

bors r+


Use more explicit errors and warnings data cleaning

When playing with simulated NIRISS data, I encountered a few corner cases during the cleaning due to the small size (80x80) of the images. The problems were not caught and resulted in error later when the image was re-used:

Using an isz that went out of bounds gave a non-square array and did not warn the user. After discussing with @DrSoulain, we chose to simply raise and error and suggest maximum possible value to the user.
Using a sky subtraction (inner) radius that was out of the image was not caught and resulted in a NaN value for the whole background. Now, there is a warning and the background subraction is skipped (same behaviour as the previous one if an IndexError was caught.
I also added a warning if the outer sky subtraction radius is out of bounds, to let the user know that the outer radius does not restrict the background and that everything beyond r1 is used.

I also added tests for these changes in two new files test_processing.py and test_tools.py.

I also added x and y limits to the show_clean_params function, to restrict the plot to the actual image even if the background radii go out of bounds.

While reviewing this, I added a test for the default behaviour of clean_data. Keeping most keyword arguments to their default None value resulted in many errors in functions called by clean_data. I edited clean_data to do the following:

If a keyword argument is None, the corresponding cleaning step is skipped.
If a cleaning step is set to True (e.g. apod or sky), but requires a keyword argument set to None, a warning is shown and the step is skipped. This could also raise an error, but I felt like warnings would be best suited for the default behaviour of a function.

I decided to add these changes here directly because they are close to the other changes, which aim to make the cleaning step more transparent for users. Also, I felt like having a clearly defined (and tested) default behaviour will make future changes easier to develop and test, so I wanted to add the changes upstream as quickly as possible.


[feature] Batch job to calculate the stats

Use cron jobs to implement the stats API for last_7_days, last_30_days, last_6_months, and last_year.
Cron jobs are run in the day past the last calendar period. E.g., last_7_days are calculated every monday, last_year are calculated every January 1.
This feature will wait until #9's cron mechanism got merged.
schema
First define a WorkUnit as:
{
"digital": "1:50", //string, clock presentation of times
"hours": 1, //int
"minutes": 50, //int
"name": "sundial", //string, name
"percent": 100, //float
"text": "1 hr 50 mins", //string
"total_seconds": 6654 //int
}

Notice we actually only have to compute and store name, percent and total_seconds. (Maybe percent can also be derived?) Other fields are derived data, and shall be calculated at endpoint server side.

name
content

id
id of the stat

user_id
user's id

username
name

timezone
user's timezone

status
"ok"

best_day
day with longest coding category activities

categories
List[WorkUnit]

languages
List[WorkUnit]

editors
List[WorkUnit]

operating_systems
List[WorkUnit]

projects
List[WorkUnit]

start
start of stat'd duration

end
end.

total_seconds
int

human_readable_total
derived data, shall not be in the DB.

range
one of  last_7_days, last_30_days, last_6_months, and last_year

created_at
creation time of this stat

modified_at
of this stat

"daily_average"
worked seconds

"human_readable_daily_average"
derived data, shall not be in the DB.

"days_including_holidays"
//TODO: for now just assume everyday is workday

"days_minus_holidays"
//TODO: for now assume = everyday

"holidays"
//TODO: for now assume 0. My heart is at work.

Some fields are not yet understood. Do you know their meanings?

{
    "is_already_updating": false,
    "is_coding_activity_visible": false,
    "is_other_usage_visible": false,
    "is_stuck": false,
    "is_up_to_date": true,
    "timeout": 15,
    "writes_only": false
}

Here is a piece of example from WakaTime API:
{
  "data": {
    "best_day": {
      "created_at": "2019-01-04T11:44:57Z",
      "date": "01/02/2019",
      "id": "...",
      "modified_at": null,
      "total_seconds": 6654
    },
    "categories": [
      {
        "digital": "1:50",
        "hours": 1,
        "minutes": 50,
        "name": "Coding",
        "percent": 100,
        "text": "1 hr 50 mins",
        "total_seconds": 6654
      }
    ],
    "created_at": "2019-01-04T11:44:23Z",
    "daily_average": 6600,
    "days_including_holidays": 7,
    "days_minus_holidays": 1,
    "dependencies": [
      {
        "digital": "1:18",
        "hours": 1,
        "minutes": 18,
        "name": "\"github.com/dyweb/sundial/pkg/models\"",
        "percent": 18.49,
        "text": "1 hr 18 mins",
        "total_seconds": 4719
      },
      ...
    ],
    "editors": [
      {
        "digital": "1:50",
        "hours": 1,
        "minutes": 50,
        "name": "VS Code",
        "percent": 100,
        "text": "1 hr 50 mins",
        "total_seconds": 6654
      }
    ],
    "end": "2019-01-04T07:59:59Z",
    "holidays": 6,
    "human_readable_daily_average": "1 hr 50 mins",
    "human_readable_total": "1 hr 50 mins",
    "id": "...",
    "is_already_updating": false,
    "is_coding_activity_visible": false,
    "is_other_usage_visible": false,
    "is_stuck": false,
    "is_up_to_date": true,
    "languages": [
      {
        "digital": "1:50",
        "hours": 1,
        "minutes": 50,
        "name": "Go",
        "percent": 100,
        "text": "1 hr 50 mins",
        "total_seconds": 6654
      }
    ],
    "modified_at": "2019-01-04T11:44:57Z",
    "operating_systems": [
      {
        "digital": "1:50",
        "hours": 1,
        "minutes": 50,
        "name": "Linux",
        "percent": 100,
        "text": "1 hr 50 mins",
        "total_seconds": 6654
      }
    ],
    "project": null,
    "projects": [
      {
        "digital": "1:50",
        "hours": 1,
        "minutes": 50,
        "name": "sundial",
        "percent": 100,
        "text": "1 hr 50 mins",
        "total_seconds": 6654
      }
    ],
    "range": "last_7_days",
    "start": "2018-12-28T08:00:00Z",
    "status": "ok",
    "timeout": 15,
    "timezone": "America/Los_Angeles",
    "total_seconds": 6600,
    "user_id": "...",
    "username": null,
    "writes_only": false
  }
}

@gaocegege


Cc/alerts

Pre-Flight checklist

[x] Testing

[x] Changes have been manually tested

What are the relevant tickets?
#1558
What's this PR do?
This PR uses concourse's job hooks to issue a slack alert when a job is aborted or fails.
How should this be manually tested?
Two options: either don't test it locally—we can test it on rc using our actual slack channel—or test on your own slack organization.
If you would like to test locally:

Create a slack workspace or use a workspace you already own
In the workspace you own, create a slack app and enable incoming webhooks. Use whatever channel you want.
Copy the webhook URL
Checkout this branch, and modify theme-assets-pipeline.yml:

replace ((slack-webhook)) with your webhook url
remove the START NON-DEV and END NON-DEV comments surrounding the webhook stuff. (Or checkout  https://github.com/mitodl/ocw-studio/commit/a1f061567d2a75b7341ee9c2a36176c32570d393, the first commit in this two-commit PR, which does not have those comments.)

docker compose run --rm web ./manage.py upsert_theme_assets_pipeline
In your local concourse ui http://concourse:8080/:

trigger a theme assets build
abort it
check your slack channel for notification

Insert some artificial error into the pipeline definition, re-upsert the pipeline, and start it. The pipeline should fail, and you should get a slack notification.

Codecov Report

Merging #1576 (a20a731) into master (2f1d9c4) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1576   +/-   ##
=======================================
  Coverage   89.20%   89.20%
=======================================
  Files         239      239
  Lines       10138    10138
  Branches     1671     1671
=======================================
  Hits         9044     9044
  Misses        958      958
  Partials      136      136

Impacted Files
Coverage Δ

content_sync/pipelines/concourse.py
89.96% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


AcyclicGraphGenerator + SAM + precision_recall don't work together

from cdt.data import AcyclicGraphGenerator
from cdt.causality.graph import SAM
from cdt.metrics import precision_recall

generator = AcyclicGraphGenerator("gp_mix")

data, graph = generator.generate()

sam = SAM(
        train_epochs=3000,
        test_epochs=300,
        dlr=0.001,
        dagpenalization_increase=0.01,
        gpus=1,
        nruns=1,
        njobs=2,
        verbose=True,
        lambda2=0.001,
        lambda1=10,
        nh=20,
        dnh=200,
)

prediction = sam.predict(data)

print(precision_recall(graph, prediction))

gives
(0.54, [(0.08, 1.0), (1.0, 0.0)])

The problem is that the node names are different for prediction and graph, which breaks metrics.retrieve_adjacency_matrix.

Hello, this should be fixed with the new version of the SAM code.
I'll keep you updated.
Best,*Diviyan

Hello ! The node name issue should be fixed, I'll be releasing 0.5.23 with lots of fixes ! Thanks again for bringing this issue up.
Best,
Diviyan

Hello ! The node name issue should be fixed, I'll be releasing 0.5.23 with lots of fixes ! Thanks again for bringing this issue up.
Best,
Diviyan


upgrade botocore to 1.12.163

Please help keep the CHANGELOG up to date by providing a one sentence summary of your change:
upgrades botocore version to from 1.12.156 to  1.12.163

It seems like CI is broken independently of this change https://dev.azure.com/matthewkmayer/Rusoto/_build/results?buildId=195&view=logs
I'm not up to speed enough on the new azure changes but here's the log
##[section]Starting: Run unit tests
==============================================================================
Task         : Command Line
Description  : Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
Version      : 2.148.0
Author       : Microsoft Corporation
Help         : https://go.microsoft.com/fwlink/?LinkID=613735
==============================================================================
Generating script.
Script contents:
RUST_VERSION=beta make unit_test
========================== Starting Command Output ===========================
[command]/bin/bash --noprofile --norc /home/vsts/work/_temp/02f9cc92-dd69-4111-90a1-0203276e3c48.sh
cargo +$RUST_VERSION test --all
error: toolchain 'beta-x86_64-unknown-linux-gnu' is not installed
make: *** [unit_test] Error 1
Makefile:28: recipe for target 'unit_test' failed
##[error]Bash exited with code '2'.
##[section]Finishing: Run unit tests

The rustup install of default toolchains isn't working on Linux for the past few builds. Checked around and didn't see any issues for that. Works on OSX and Windows though.

@matthewkmayer / @srijs I'm a little less familiar with the recent ci changes.
Are these errors related to this changeset. Let me know if I need todo anything different for botocore upgrades?

@matthewkmayer is there anything I can help with here. I'm eager to try out the new Aurora serverless data api

I just noticed the semaphore job failed for this pull for different reasons https://semaphoreci.com/matthewkmayer/rusoto/branches/pull-request-1436/builds/2
Generated files differ after regenerating them. Make sure you check in changes
       in generated code. Details can be found in service_crategen/README.md.

Regen the current service crates in this pull? That works for me as well

I'll fold those updates into this pull and if that works, close https://github.com/rusoto/rusoto/issues/1435

Looks good to me, https://github.com/rusoto/rusoto/issues/1438 issues aside! 👍

Woot!


FUN3D + TACS interface unsteady derivative tests

make unit tests for fun3d_interface + tacs unsteady interface with unsteady scenarios

duplicate PR closing this one


I can't run the Tests in Visual Studio

Description
Hi,
after cloning the project in Visual Studio 2019 , I wanted to run the tests in TestExplorer.
After hitting the RunAll button, it takes 2 second and then all tests stayed at NotRun status as you can see below :

I have opened this issue to ask you how I can run these tests ?
I have also another question, is it okay to create a xUnit project in the \src\Tests folder and create some tests for Encapsulator in order to making a pull request ?
Or I should make them in current existing nUnit test project ?
I myself prefer using xUnit project if it is acceptable :-)
Regards,
Parsa Lotfy

Hello @parsalotfy ,
You are right. It looks test doesn't run with Visual Studio but using Resharp unit test (which we use), they run without problem.
Sure, it's fine to create test using xUnit in another project.


fixes for Ship of Harkinian

add leading slash to GAMEDIR
before this fix the game did not launch
SDL_GAMECONTROLLER_FILE instead of SDL_GAMECONTROLLER
gptokeyb does not read SDL_GAMECONTROLLER env var, it is called SDL_GAMECONTROLLER_FILE, see gptokeyb.cpp
On my RG40XX H the controls were not assigned correctly without this change

Aw it needs the leading /? Shoot, it launched when I tried it. Darn Tina linux.

reverted second fix, as this problem is most likely specific to RG40XX H and should be resolved by new PortMaster released


Python bindings complain about the public key returned from kas_public_key on the platform

Hi, I'm a new comer evaluating the platform for a larger scale application, I followed the instructions for:

Generating platform keys with init-temp-keys.sh
Running the docker-compose file
Running the keycloak provisioning
Starting the service

The service seems to be running fine, however, I am trying to encrypt/decrypt using the Python bindings and running into issues where it states:
Get kas public key failed, kas public key is: "-----BEGIN PUBLIC KEY-----...
After looking through the client code I can see that it is expecting to find -----BEGIN CERTIFICATE-----
Unsure if this is an issue with my installation, an issue with the platform or the client so I posted here.
Attached debug level logs from the Python client showing the KeyCloak communication and call to kas_public_key returning the public key.
debug_log.txt
Thanks!

OK, I'm revisiting the platform and I can see in the OpenTDF C++ code it is expecting a certificate.
Then reading through the Go for the kas_public_key endpoint there is a point where it sends back either a certificate or a public key based on the algorithm sent with the GET to the kas_public_key.
So I can tell OpenTDF that the KAS URL includes something like /kas/kas_public_key?algorithm=ec:secp256r1 and this platform then gives OpenTDF a certificate.
However, when it attempts to use the cert, it states: RuntimeError: Error code 75497574.  [asym_encryption.cpp:49] Failed to create X509 cert struct.error:04800066:PEM routines::bad end line.
Examining the response from the kas_public_key endpoint, it is one \n short in the certificate output, which would be causing OpenTDF not work correctly.
Also, how does offline encryption work with this? TDFv3 states that it is supported, but I can't for the life of me get it to stop calling the IdP and the KAS.

Python isn't actively being maintained and has been made private. I'd suggest focusing on Go (the core language), Java, or client_web (JS) - those are all public.

Thank you.


Fix/tekton demo

Describe the behavior changes introduced in this PR
Some small improvements to tekton demo script.
Linked Issues
No.
Testing Instructions
Install pelorus operator and create instance and run the script with ./demo/demo-tekton.sh.

There is no citation of tekton demo in our docs, right? (there is the the demo/README.md only, I think) Should we add a citation there?

good news :)
recent:///895cd2d4b98659d82f789eea63bde440

/lgtm


Make bias optional in cudnn.SpatialConvolution

If SpatialConvolution is followed by batch normalization, bias is unnecessary. If you set it to nil, it's no longer computed.

we should add this to nn as well

@szagoruyko I was thinking about re-organizing SpatialConvolutionMM in nn and in cunn, I will add this option as well.

yeah seems like a good idea


webdriver remote driver does not support doubleclick

Hi all,
any info on what adding support for a doubleclick would be greatly appreciated.
Regards.
splinter/driver/webdriver/remote.py
52:        Remote Firefox doesn't support doubleclick.
54:        raise NotImplementedError("Remote Firefox doesn't support doubleclick")

why not just click two times!

Fixed in splinter 0.12.0


Support --observatory-host setting

This tracks b/136008961.
The usecase is to use Flutter Driver to inspect and interact with the UI in end-to-end tests on a remote device. The request is to pass a flag to the embedder to override the default value of <IP_ADDRESS> / ::1.

Fixed in flutter/engine#9485.


[DSPM] Title & URL update

Please always provide the GitHub issue(s) your PR is for, as well as test URLs where your change can be observed (before and after):
Fix #
Test URLs:

Before: https://main--prisma-cloud-docs--hlxsites.hlx.page/
After: https://--prisma-cloud-docs--hlxsites.hlx.page/
Worker: https://prisma-cloud-docs-production.adobeaem.workers.dev/?branch=

Changed title from 'View Access Details to Specific Storage Buckets' to 'Explore Data Asset Access Information' and URL/Adoc file name from 'view-access-details-to-specific-storage-buckets' to 'explore-data-asset-access-information' based on Slack message from Dekel Cohen on 12/24/24.


Problem with createApplication method

I am trying to use FXLauncher with custom process to build setup and executable files using Launch4j and Inno-Setup because javapackager doesn't allow to configure specific process to delete files when uninstall the application.
However when I try to launch my custom project from Eclipse the createApplication method from AbstractLauncher cannot create the new instance of the application because appClass.isAssignableFrom(Application.class) return false. My custom application class is a subclass of JavaFX application class so for me is strange this condition. Should be the opposite?
I think that this condition should be this Application.class.isAssignableFrom(appClass) because appClass should be a subclass of JavaFX Application.
Besides if the current code cannot create the application instance the launcher are trying to run the first dependency that found in the classpath, in my case activation.jar.
Related code
https://github.com/edvin/fxlauncher/blob/03bea5efc6b9d4123fe91837ffe109c2dc12a043/src/main/java/fxlauncher/Launcher.java#L50
FXLauncher version: 1.0.19

@edvin What do you think about this?

Thanks, I've committed a fix and will release a new version shortly :)


[FABCJ-288] fix: simple key end of range

As per Node and Go, permit "" to be used to
indicate the end of the range.
Only for simple keys
Signed-off-by: Matthew B White<EMAIL_ADDRESS>

/azprun


Can this be added to the [linux-surface] arch linux package repo?

From https://github.com/linux-surface/linux-surface/wiki/Installation-and-Setup#arch

NOTE: libwacom-surface is packaged through the AUR, so you need to install it from there.

I was wondering if the package can be added to https://pkg.surfacelinux.com/arch/
Mainly for convenience in not needing to use AUR in provisioning a linux-surface system.

Also I'm curious, when are these patches actually needed? I tried replacing libwacom-surface with just libwacom, rebooting, and touch/pen still seems to behave the same (KDE Plasma & wayland, e.g. playing with Xournal++).

By having it in AUR, people do not have to add our repo. This is especially useful for older devices, which already have good support out of the box. And I don't really want to maintain two versions of the same package :)
Mostly, this package helps discover some user-space applications to discover the tablet. IIRC Gnome's auto-rotation depended on this.


How about RabbitMq exchange tree and covariant types?

Possible use case: interface IEnvelope<out TMessage> with some app specific metadata.

Do you have a little more to go on than what you've shown above?


Generate bindings for a dependency using Spin

There should be a Spin CLI command that generates language bindings for a given dependency.
This would use https://github.com/bytecodealliance/wit-bindgen.

ref #43 #44.
The general functionality described in this issue is still something we wish to achieve — that being said, it might be better suited for a different set of tooling.


Port plugin to Python3

Hi, because Ida is slowly moving to python3, it would be nice to have this plugin ported to python3.
I started working on this (diff), but I have still some unresolved issues which requires deeper debug, like decompilation is failing - probably somebody from authors of this plugin should check diff.

Hi @trib0r3!
Thanks a lot for your contribution. Starting from your diff, I fixed other small bugs, and I've just pushed on the dev-python3 branch an IDA 7.4 - Python3 version of the plugin (ffa6023).
I've tested it on Ubuntu 18.04, IDA 7.4.191112 and Python 3.6.7.
Please, test it, and let me know if it works for you too.

Hi @jimmy-sonny!
I've tested GhIDA on Windows IDA 7.4.191112 and python 3.8.1 -> it works :D


Release azure-cli-batch 3.0.2

This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines

[ ] The PR has modified HISTORY.rst with an appropriate description of the change (see Modifying change log).

Command Guidelines

[ ] Each command and parameter has a meaningful description.
[ ] Each new command has a test.

(see Authoring Command Modules)

Reviewers, please verify the following for this PR:

[ ] The PR title has format Release <component-name> <version>.
[ ] setup.py has been modified with the same version as in the PR title.
[ ] HISTORY.rst has been modified with appropriate release notes.
[ ] If releasing azure-cli or azure-cli-core, __version__ defined in __init__.py should also be modified to match.

Started releasing azure-cli-batch 3.0.2...

Release of 'azure-cli-batch' with version '3.0.2' successful. View at https://pypi.python.org/pypi/azure-cli-batch/3.0.2.

GitHub release created. https://github.com/Azure/azure-cli/releases.

Codecov Report

Merging #3810 into master will increase coverage by 0.16%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3810      +/-   ##
==========================================
+ Coverage   70.75%   70.91%   +0.16%
==========================================
  Files         424      424
  Lines       26895    26895
  Branches     4094     4094
==========================================
+ Hits        19029    19073      +44
+ Misses       6621     6578      -43
+ Partials     1245     1244       -1

Impacted Files
Coverage Δ

src/azure-cli-core/azure/cli/core/prompting.py
19.27% <0%> (ø)
:arrow_up:

...ice/azure/cli/command_modules/appservice/custom.py
73.46% <0%> (+0.24%)
:arrow_up:

...zure-cli-vm/azure/cli/command_modules/vm/custom.py
77.01% <0%> (+0.31%)
:arrow_up:

...ource/azure/cli/command_modules/resource/custom.py
62.41% <0%> (+0.33%)
:arrow_up:

...cli-vm/azure/cli/command_modules/vm/_validators.py
75.59% <0%> (+0.33%)
:arrow_up:

...azure-cli-core/azure/cli/core/commands/__init__.py
69.79% <0%> (+0.44%)
:arrow_up:

.../azure/cli/command_modules/vm/_template_builder.py
85.78% <0%> (+0.49%)
:arrow_up:

...zure-cli-sf/azure/cli/command_modules/sf/custom.py
40.53% <0%> (+0.72%)
:arrow_up:

...re-cli-acr/azure/cli/command_modules/acr/_utils.py
82.82% <0%> (+1.01%)
:arrow_up:

...ure-cli-testsdk/azure/cli/testsdk/vcr_test_base.py
70.08% <0%> (+1.17%)
:arrow_up:

... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 460a9f4...03163cc. Read the comment docs.


Add support for BSD evdev

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

Thank you! I had only one question.

All clear, merged.
Thank you!


Any errors in finetuning scripts?

Hi weihao, very interesting work.
I wonder whether there is a bug in scripts/caformer/finetune_384.sh?
The resolution should be 384×384, but in the scripts there are no relevant command line parameters indicating resolution such as --input-size or --img-size.

@techmonsterwang ,
Many thanks for your report! Another way is to change the model name to "XXX_384" like caformer_s18_384. I have fixed them in the scripts.


Make long parenthesized expressions not always break.

closes #921
The goal of this ticket was to prefer breaking trailing members on a parenthesized expression before breaking the expression.
For example.
// input
(someObject as SomeLongType__________________________________________).CallMethod();

// expected
(someObject as SomeLongType__________________________________________)
    .CallMethod();

// actual
(
    someObject as SomeLongType__________________________________________
).CallMethod();

The way it is currently implemented though results in the following
var asyncMethodsWithToken = (
    from method in asyncMethods
    where method.GetParameters().Any(pi => pi.ParameterType == typeof(CancellationToken))
    select method
)
    .ToList();

// previously
var asyncMethodsWithToken = (
    from method in asyncMethods
    where method.GetParameters().Any(pi => pi.ParameterType == typeof(CancellationToken))
    select method
).ToList();

This does mean things are more consistent with longer chains
var asyncMethodsWithToken = (
    from method in asyncMethods
    where method.GetParameters().Any(pi => pi.ParameterType == typeof(CancellationToken))
    select method
)
    .ToList________________________()
    .ToList________________________()
    .ToList________________________();

Another example where I think the old version was probably better
Assert.Equal(
    CoreStrings.FindValueTypeMismatch(0, "IntKey", "string", "int"),
    (
        await Assert.ThrowsAsync<ArgumentException>(
            () =>
                Finder
                    .FindAsync<IntKey>(cancellationType, context, new object[] { "77" })
                    .AsTask()
        )
    )
        .Message
);

// previously
Assert.Equal(
    CoreStrings.FindValueTypeMismatch(0, "IntKey", "string", "int"),
    (
        await Assert.ThrowsAsync<ArgumentException>(
            () =>
                Finder
                    .FindAsync<IntKey>(cancellationType, context, new object[] { "77" })
                    .AsTask()
        )
    ).Message
);

I'm not sure how much work it would be to keep the tailing call next to the ) if the contents of the parenthsized expression break.
FWIW prettier does not have any logic around this.

Do we have a group type that breaks if its children are longer than its siblings' children?

Do we have a group type that breaks if its children are longer than its siblings' children?

No and the way things work I don't know if it would be possibly.
A ConditionalGroup may accomplish something like that. If the first possible group breaks the children and does not break the siblings and is considered to fit, then it gets printed.


Error when checking/unchecking change in Change List

When trying to check or uncheck a change in the Change List of the Changes tool I get the following error:

GT 0.8.1696

Opened in wrong repo


Make the Service available as a NuGet package

I'm wanting to host KM as a service alongside other services that I have in an application I'm building but currently there's no easy way to do this.
The easiest way to do this is to clone the KM repo and run the service from there, but that means it's disconnected from the project that you're trying to integrate with.
An alternative solution is to copy the Program.cs from the Service project into your own Minimal API project and add the appropriate NuGet packages, but that's a bit risky for if/when the APIs that it consumes change.
Proposal
Another option would be to make the part of the Service project that registers the appropriate services and creates the routes, into a NuGet package.
Then, you as the consumer of the NuGet package you would do builder.Services.AddKernelMemory() and use a fluent API to configure that with the AI services/memory store/etc., and then app.MappKernelMemory() to add the appropriate routes.

@aaronpowell I just merged a PR changing the structure of Service.csproj, who is now depending on nugets instead of having direct references to the code. "Service" is now basically 3 files:

Program.cs: minimal.API
ServiceConfiguration+KernelMemoryBuilderExtensions: parse appsettings.json and create memory instance
HttpAuthHandler: custom code to handle API keys

and the project
<ItemGroup>
    <PackageReference Include="Microsoft.KernelMemory.Core" Version="0.23.231224.1" />
    <PackageReference Include="Microsoft.KernelMemory.Postgres" Version="0.3.231224.1" />
</ItemGroup>

What about using Microsoft.KernelMemory.Core the same way that Program.cs does?  Otherwise, what would the nuget offer?

Another option would be to make the part of the Service project that registers the appropriate services and creates the routes, into a NuGet package.

you would be ok injecting KM minimal API, injecting KM URLs, as they are, into your web service? I think that would work

@dluc I see the changes that you've done, but I was thinking of going even further with it.
I've created #222 as a draft to start what I was thinking about. Let's discuss it more and see if we are aligned in thinking, as I'm happy to keep working away on this as I see some real use cases for it.

Seems reasonable, I need to dig deeper into the code and how that might impact development. As you can see from https://github.com/microsoft/kernel-memory/pull/223 we're moving all extensions to packages, and Service to be a consumer of these, so I need to evaluate the change when all of that is in place. Thanks!

Yes, I see how that will make things more challenging, especially around the idea of "auto-wire up from config".
I actually think it'd be better to not have the auto-wire up mode in the Services.Core project that I proposed, because I'd imagine that if you're integrating into your own ASP.NET Core project you're probably going to care more about configuring the way KM is setup (reusing DB connections, sharing Azure creds, etc.) so just having a AddKernelMemory(memoryBuilder => { ... }) method would do the job.

I was about to raise a similar concern for the Service, keeping in mind that the Service code is copied on my side might evolve differently from your codebase based on different internal development constraints or timelines. Otherwise, maybe shipping the service as a docker container would make sense?
While being able to just use the source code and import it in my project seems to be interesting, it also opens the door for people to start modifying (both the service and potentially the SK plugin) to fit their need (or based on ignorance :) ). It also means, that once in a while, I need to sync code, figure out what changes are mine and which are yours... it also means syncing less often because it might become painful in the long run.

@SimonLuckenuik we published the Docker image a few weeks back, did you have a chance to try?

@SimonLuckenuik we published the Docker image a few weeks back, did you have a chance to try?
Thanks for the follow-up @dluc, considering I am using dotnet, I decided back then to use the serverless version for now.

Thanks for the PR, merged 👍
The nuget should be ready next week


lazyload

is it possible to lazy load videos?

Since Plyr is a wrapper for the HTML5 player it's certainly possible but not built into Plyr.

In case anyone else is looking for a way to do this, here's how I'm accomplishing it.
On my site, there is an image and button that the user clicks to open a modal window with the video, which starts playing immediately.
Here is my HTML and JavaScript. It's simplified to leave out the rest of the stuff specific to my site. (E.g., supporting multiple videos on a page.)
HTML
Note the defer attribute, which prevents the source video request from happening when the page loads.
<button class="video-play-button" data-video-target="video-1">Play</button>

<video id="video-1" defer>
  <source src="video_url.mp4" typr="video/mp4">
</video>

JavaScript
The script reads the target element from the data attribute of the play button, initializes a new Plyr with it, and starts the video.
document.querySelector('.video-play-button').addEventListener('click', function(event) {
  // Get video element to initialize.
  var videoElement = event.target.dataset.videoTarget;

  // Initialize video.
  player = new Plyr(videoElement);

  // Play video once it's ready.
  player.on('ready', () => {
    player.play();
  })
});

To get this to work with multiple videos on a page, you'll need to write code that attaches an event listener to each of the play buttons and move the video-initializing code into a function…

Here's my attempt for youtube:
https://codepen.io/iamrobert/pen/GRWOYNJ
It pulls the image and title from youtube, and only loads plyr on click. You'll need to add a button over the image that loads.

@matthewmcvickar Can defer really be used this way? I thought defer was only usable for script tags. preload="none" is what I'm using for video.

@matthewmcvickar Can defer really be used this way? I thought defer was only usable for script tags. preload="none" is what I'm using for video.

You are correct. Not sure why I did that. I updated my comment accordingly.

You are correct. Not sure why I did that. I updated my comment accordingly.

All good. I'm an amateur at best and your comment helped me find the preload info I was looking for. Also, now that I know more about defer, I can use that too.


[Automation] Generate Fluent Lite from elastic#package-2020-07-01

[Automation] Generate Fluent Lite from elastic#package-2020-07-01

/azp run prepare-pipelines

/azp run java - elastic - ci


Shelf builder

Initial pass at #64.
Besides the shelf_loader module itself, it includes a change to the behavior of:

itemArray on Menu and PopupMenu
popupMenuArray on all controls.

Currently the shelf_loader does take advantage of those changes, they aren't strictly necessary and could be refactored out if needed rather simply.

One thing I forgot to mention, this allows for in-place updating.
Because Maya already serializes shelves, our only other option would be to completely delete and rebuild each time, but that creates the counter-intuitive behavior of deleting any user added buttons.

the delete-resave thing is definitely part of the reason I have not done this before.  If we could get it to work like menuloader, which appends to existing gui, that would be more predictable.

Unrelated, but relevant question:  Maybe swap JSON for YAML?  That would remove an external dependency.  I've also got some code to handle the bitsquid SJSON format, which is less punctuation heavy than JSON but is a purely syntactic transformation

Problem with latebound property is that it caches the value when its done, and we'd want to recreate the array in case a new menu was added.
I tried adding a PopupMenuArrayProperty, but that just expanded the circle, because core needs to import properties, and properties would need to import PopupMenu.

Another idea I had was to move a lighter weight version of gui.derive to the MetaControl class.
The metaclass would keep weakrefs to each class (WeakValueDictionary), and using cmds.objectTypeUI could identify which wrap method to call.
Then it would just be:
def popupMenuArray(self):
 +        # Not a fan of this creating a circular import, but haven't worked out an alternative yet.
 +        return [Control.derive(self.fullPathName + '|' + menu) for menu in self.CMD(self, q=True, popupMenuArray=True) or []]

Ends up being a bit more magical that way though.

This will append to an existing shelf, as long as its not one of the weirdly dynamic builtin ones.
For some reason their contents are lazy-loaded, and adding new buttons seems to break the that. Once the shelf has been loaded though this will append no problem.
User created shelves don't seem to suffer the same problem. Probably because they're serialized out separately.

What I do with menuloader is kick off a runonce, idletime scriptjob to post-edit the main Maya menus after they are loaded.  Would that work here?

Yeah, I do a similar thing.
Doesn't seem to help with stuff like this.
Its similar to how the file menu doesn't exist until the first time its opened.
You can test it by opening maya, and just running cmds.shelfLayout('Polygons', q=True, childArray=True). Once you click on the shelf though, it will return the actual array of children.

Figured out a method for handling this particular edge case.
We just walk through all the tabs, and select them, before adding / updating any new shelves or buttons.
This lets the loader append buttons to existing shelves, and users can add buttons to loader defined shelves.

I pulled the popupMenuArray property off of Control. Seemed easier to just refactor the builder a little bit as I was only using the property in one place.
Can always change it back if we come up with some other method in the future.

Updated to no longer rely on yaml. Instead we hand it a python dictionary, that in this case happens to be loaded from a json file.

I think I've gotten all the kinks out of this. At least it hasn't been giving me any issues for a few weeks.
Any objection to me merging?

Go ahead. I'm very heads down at work so I haven't gotten time to do a lot of careful investigations


TP2000-50 Enable creation of measures for multiple commodities

Updated the create measure wizard so users can select multiple commodity codes to create measures for. There are no changes to the models.

Codecov Report

Merging #492 (020ec0a) into master (e81d75c) will increase coverage by 0.47%.
The diff coverage is 82.72%.

:exclamation: Current head 020ec0a differs from pull request most recent head a794770. Consider uploading reports for the commit a794770 to get more accurate results

@@            Coverage Diff             @@
##           master     #492      +/-   ##
==========================================
+ Coverage   91.79%   92.27%   +0.47%
==========================================
  Files         292      293       +1
  Lines       17897    17986      +89
  Branches     1442     1448       +6
==========================================
+ Hits        16428    16596     +168
+ Misses       1203     1117      -86
- Partials      266      273       +7

Impacted Files
Coverage Δ

measures/views.py
80.62% <0.00%> (+15.46%)
:arrow_up:

measures/tests/test_views.py
96.77% <91.66%> (-3.23%)
:arrow_down:

measures/forms.py
86.38% <100.00%> (+17.18%)
:arrow_up:

measures/tests/test_forms.py
100.00% <100.00%> (ø)

measures/wizard.py
100.00% <0.00%> (ø)

common/models/tracked_qs.py
90.00% <0.00%> (+2.50%)
:arrow_up:

geo_areas/forms.py
72.88% <0.00%> (+27.11%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e81d75c...a794770. Read the comment docs.

Nice work on adding tests to the measures wizard.
It looks like you basically added some of the tests I needed to for
https://github.com/uktrade/tamato/pull/479


Glitchy Column State between Dash Layout repeat

I believe that this issue specifically applies to a very unique use case, based upon how dash operates:
import dash_ag_grid as dag
from dash import Dash, html, dcc, Input, Output, State
import dash_bootstrap_components as dbc
import pandas as pd
import yfinance as yf
import dash

app = Dash(__name__, external_stylesheets=[dbc.themes.DARKLY],
           meta_tags=[{'http-equiv': 'content-security-policy',
                       'content': "default-src 'self'; script-src 'self' 'unsafe-inline';"
                                  " style-src https://* 'self' 'unsafe-inline'; "
                                  "font-src data: https://* 'self' 'unsafe-inline';"
                                  "img-src data: https://* 'self'"}],
            use_pages=True, pages_folder=''
           )

equities = {
    "AAPL": "Apple",
    "MSFT": "Microsoft",
    "AMZN": "Amazon",
    "GOOGL": "Alphabet",
    "TSLA": "Tesla",
    "BRK-B": "Berkshire Hathaway",
    "UNH": "United Health Group",
    "JNJ": "Johnson & Johnson",
}

def get_stock_data():
    return yf.download(tickers=list(equities.keys()), period="2y", group_by="ticker")

stock_data = get_stock_data()

def last_close(ticker):
    return stock_data[ticker]["Close"].iloc[-1]

data = {
    "ticker": [ticker for ticker in equities],
    "company": [name for name in equities.values()],
    "quantity": [75, 40, 100, 50, 40, 60, 20, 40],
    "price": [last_close(ticker) for ticker in equities],
}
df = pd.DataFrame(data)

columnDefs = [
    {
        "headerName": "Stock Ticker",
        "field": "ticker",
        "type": "textAligned",
        "filter": True
    },
    {
        "headerName": "Company",
        "field": "company",
        "type": "textAligned",
        "filter": True
    },
    {
        "headerName": "Shares",
        "field": "quantity",
        "editable": True,
    },
    {
        "headerName": "Last Close Price",
        "field": "price",
        "cellRenderer": "agAnimateShowChangeCellRenderer",
    },
]

defaultColDef = {
    "type": ["rightAligned"],
    "filter": "agNumberColumnFilter",
    "resizable": True,
    "sortable": True,
    "editable": False,
    "floatingFilter": True,
}

table = dag.AgGrid(
    id="portfolio-grid",
    className="ag-theme-alpine-dark",
    columnDefs=columnDefs,
    rowData=df.to_dict("records"),
    columnSize=None,
    defaultColDef=defaultColDef,
    rowSelection="single",
    dashGridOptions={'undoRedoCellEditing':True, 'undoRedoCellEditingLimit': 20},
    getRowStyle={
                "styleConditions": [
                    {"condition": "data.quantity > 50", "style": {"color": "orange"}},
                ]
            },
)

header = html.Div("My Portfolio", className="h2 p-2 text-white bg-primary text-center")

dash.register_page('Home', path='/', layout=table)
dash.register_page('1', layout=table)
dash.register_page('2', layout=table)
dash.register_page('3', layout=table)

app.layout = dbc.Container(
    [
        header,
        dbc.Nav([dbc.NavLink(pg['name'], href=pg['path']) for pg in dash.page_registry.values()]),
        dbc.Row(dbc.Col(dash.page_container, className="py-4")),
    ],
)

if __name__ == "__main__":
    app.run_server(debug=True, port=12345)

As you navigate through the pages using the nav links that are internal, the table's state semi refreshes. Some of the pinning stays, while the column order resets. After the first pin, it doesnt take the second pin immediately when switching between pages. This case would be really on display when a page layout has different variables in the path. (/stocks/<ticker>)
Storing column layouts for utilization between the same layout may be a useful feature, we should look into fleshing this out more to save and load fully when it is the desired outcome. Otherwise, when disabled, this state should be wiped out.

The above is an issue with the updating of column widths upon reordering or resizing the grid to be based upon the columnSize prop.
For the original issue, to maintain the pinning and order when switching between layouts:
dashGridOptions={'maintainColumnOrder':True} works perfectly.
However, the other side of this issue is how to turn off maintaining the pinning.

Providing a defaultColDef={'sortable': True, 'filter': True, 'resizable': True,                                        'editable':edit, 'pinned': False} alleviates the issue because it clears out the arbitrary actions of pinning and other interactions.
However, this is still an issue because in the above, filtering will be maintained on the column is available on the next layout.

@BSd3v and @AnnMarieW, I've seen an issue where when we rapidly update the ag-grid tables, it 'slows' down the app. One workaround we've found when re-creating the tables is to use a new ID. Maybe there is some conflict with the IDs if we are trying to update an existing dash ag grid table with a current ID. This might be related to your issue, so I'm mentioning it here.

@johnkangw,
Thank you for bringing this up. It could be related as the issue is when the grid is the same id.
How are you updating the table, using the rowData? I think that is all that is available currently… In the next release, you’ll be able to update via rowTransaction. Which can pinpoint what row and data you are updating without refreshing all of the data.

@BSd3v Good point! We're recreating the whole table when we change inputs (probably NOT the right way to do this).

It’s not available in this release, but like I said, in the next one you’ll be able to add, delete and update without needing to pass the entire rowData back to the table.

@BSd3v, are Transaction Updates coming in the next release (https://www.ag-grid.com/javascript-data-grid/data-update-transactions/)? Is that equivalent to the rowTransaction method you mentioned?

Hello @johnkangw,
Yes, they will be available via the rowTransaction prop, unless we change it to applyTransaction, but our thoughts are to allow one prop to be either async or synchronous.

@BSd3v Sounds good! Thanks for the heads up.

The workaround is to either pass a columnState or to set resetColumnState=True to send the columnDefs back to the original:
import dash_ag_grid as dag
from dash import Dash, html, dcc, Input, Output, State
import dash_bootstrap_components as dbc
import pandas as pd
import yfinance as yf
import dash

app = Dash(__name__, external_stylesheets=[dbc.themes.DARKLY],
           meta_tags=[{'http-equiv': 'content-security-policy',
                       'content': "default-src 'self'; script-src 'self' 'unsafe-inline';"
                                  " style-src https://* 'self' 'unsafe-inline'; "
                                  "font-src data: https://* 'self' 'unsafe-inline';"
                                  "img-src data: https://* 'self'"}],
            use_pages=True, pages_folder=''
           )

equities = {
    "AAPL": "Apple",
    "MSFT": "Microsoft",
    "AMZN": "Amazon",
    "GOOGL": "Alphabet",
    "TSLA": "Tesla",
    "BRK-B": "Berkshire Hathaway",
    "UNH": "United Health Group",
    "JNJ": "Johnson & Johnson",
}

def get_stock_data():
    return yf.download(tickers=list(equities.keys()), period="2y", group_by="ticker")

stock_data = get_stock_data()

def last_close(ticker):
    return stock_data[ticker]["Close"].iloc[-1]

data = {
    "ticker": [ticker for ticker in equities],
    "company": [name for name in equities.values()],
    "quantity": [75, 40, 100, 50, 40, 60, 20, 40],
    "price": [last_close(ticker) for ticker in equities],
}
df = pd.DataFrame(data)

columnDefs = [
    {
        "headerName": "Stock Ticker",
        "field": "ticker",
        "type": "textAligned",
        "filter": True
    },
    {
        "headerName": "Company",
        "field": "company",
        "type": "textAligned",
        "filter": True
    },
    {
        "headerName": "Shares",
        "field": "quantity",
        "editable": True,
    },
    {
        "headerName": "Last Close Price",
        "field": "price",
        "cellRenderer": "agAnimateShowChangeCellRenderer",
    },
]

defaultColDef = {
    "type": ["rightAligned"],
    "filter": "agNumberColumnFilter",
    "resizable": True,
    "sortable": True,
    "editable": False,
    "floatingFilter": True,
}

table = dag.AgGrid(
    id="portfolio-grid",
    className="ag-theme-alpine-dark",
    columnDefs=columnDefs,
    rowData=df.to_dict("records"),
    columnSize=None,
    defaultColDef=defaultColDef,
    dashGridOptions={'undoRedoCellEditing':True, 'undoRedoCellEditingLimit': 20, "rowSelection":"single",},
    getRowStyle={
                "styleConditions": [
                    {"condition": "data.quantity > 50", "style": {"color": "orange"}},
                ]
            },
    columnState=[{'colId': 'ticker', 'pinned':False}, {'colId': 'company', 'pinned':False},
                 {'colId': 'quantity', 'pinned':False}, {'colId':'price', 'pinned':False}],
    # resetColumnState=True
)

header = html.Div("My Portfolio", className="h2 p-2 text-white bg-primary text-center")

dash.register_page('Home', path='/', layout=table)
dash.register_page('1', layout=table)
dash.register_page('2', layout=table)
dash.register_page('3', layout=table)

app.layout = dbc.Container(
    [
        header,
        dbc.Nav([dbc.NavLink(pg['name'], href=pg['path']) for pg in dash.page_registry.values()]),
        dbc.Row(dbc.Col(dash.page_container, className="py-4")),
    ],
)

if __name__ == "__main__":
    app.run_server(debug=True, port=12345)


Added "Classified Listings Copilot" sample

Q
A

Bug fix?
no

New feature?
no

New sample?
yes

What's in this Pull Request?
This sample implements a Teams message extension that can be used as a plugin for Microsoft Copilot for Microsoft 365. It allows users to post the classified listings of items they want to sell, buy, or rent. Users can search listings posted by others.

Authors:

Nanddeep Nachan
Smita Nachan

Hope it helps the Community. Thank you!

Cool sample; I love the idea of classified ads
Thanks!


Update specs for Mongo.find/4 with error tuple

Resolves https://github.com/zookzook/elixir-mongodb-driver/issues/89
and https://github.com/zookzook/elixir-mongodb-driver/issues/88

Thank you!

Thanks for fast approving and merging! 👍

Would be awesome to have a new release!


Add “GlobalConfig” type.

Summary
This adds a "GlobalConfig" type as a first step to separate configs into a "GlobalConfig" and "ProjectConfig". GlobalConfig works better than SharedConfig because it isn't actually shared – I think the two configs will end up having almost no overlap, if any at all, so that makes more sense.
Right now it is not an exact type yet and it is still exactly the same value as before, this diff only changes typings but I'd like to ship this incrementally in smaller PRs :)
Test plan
yarn typecheck

Codecov Report

Merging #3328 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master    #3328   +/-   ##
=======================================
  Coverage   65.07%   65.07%
=======================================
  Files         178      178
  Lines        6539     6539
  Branches        4        4
=======================================
  Hits         4255     4255
  Misses       2283     2283
  Partials        1        1

Impacted Files
Coverage Δ

packages/jest-cli/src/reporters/NotifyReporter.js
25.92% <ø> (ø)
:arrow_up:

packages/jest-cli/src/reporters/DefaultReporter.js
16.39% <ø> (ø)
:arrow_up:

packages/jest-cli/src/reporters/SummaryReporter.js
26.15% <ø> (ø)
:arrow_up:

packages/jest-cli/src/TestRunner.js
31.32% <ø> (ø)
:arrow_up:

...ackages/jest-cli/src/reporters/CoverageReporter.js
60.52% <ø> (ø)
:arrow_up:

packages/jest-cli/src/reporters/BaseReporter.js
66.66% <ø> (ø)
:arrow_up:

packages/jest-cli/src/reporters/utils.js
61.61% <100%> (ø)
:arrow_up:

packages/jest-cli/src/reporters/getResultHeader.js
37.5% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update abdc425...94fa2c4. Read the comment docs.


fix minor label error in Aiyagari

I happened to find a minor label error in Aiyagari lecture.
This PR fixes it.

Thanks @Shunsuke-Hori