pre-stage test libs on the machine for parallel case

In PR https://github.com/adoptium/aqa-tests/pull/4902, it missed the parallel case.
Add the parallel case support.
This PR needs to be merged with https://github.com/adoptium/TKG/pull/479
related: https://github.com/adoptium/aqa-tests/issues/4500
resolves: https://github.com/adoptium/TKG/issues/478

Windows:

parallel: https://openj9-jenkins.osuosl.org/job/Grinder/3105/ (win2012-x86-3)
serial: https://openj9-jenkins.osuosl.org/job/Grinder/3106/

xlinux:

parallel: https://openj9-jenkins.osuosl.org/job/Grinder/3108
serial: https://openj9-jenkins.osuosl.org/job/Grinder/3107


test(CL): TestAuthzMsg for CL module

Background
We need a test for authz serialization de-serialization for CL module messages.
Suggested Design
Add a test similar to: https://github.com/osmosis-labs/osmosis/blob/f611e01c7fb9ab9d5348250cb0b65e08f3ec651b/x/swaprouter/types/msgs_test.go#L277
for all CL module messages
Acceptance Criteria

tests added
pass

Blocked on: https://github.com/osmosis-labs/osmosis/pull/3913
Once #3919 is complete, this issue is available for pick up

hello @p0mvn. I see #3913 is merged, may I pick this one?

Sounds great, thanks


System relative time

I tried getting the current time as the RelativeTime, which looked promising initially as I was able to get such a value from some places, but then in other places I kept going down a rabbit hole and wasn't able to get to the point where a RelativeTime representing the current time was available.

HardForkLedgerConfig
PerEraLedgerConfig
WrapPartialLedgerConfig
PartialLedgerConfig
HasPartialLedgerConfig
instance ShelleyBasedEra era => HasPartialLedgerConfig (ShelleyBlock era)
ShelleyPartialLedgerConfig
ShelleyLedgerConfig
CompactGenesis
ShelleyGenesis


[Proposal] distributed lock api design

中文版在下面
0. tl;dl
Add TryLock and Unlock API. The Lock Renewal API is controversial and will not be added into the first version
1. Evaluation of products on the market

System
try lock
Blocking lock(based on watch)
Availability
Write operations are linearizable
sequencer(chubby's feature)
Lock renewal

Stand-alone redis
yes
x
unavailable when single failure
yes
yes(need poc)
yes

redis cluster
yes
x
yes
no. Locks will be unsafe when fail-over happens
yes(need poc)
yes

redis Redlock
yes

nacos
×

consul
yes

eureka
×

zookeeper
yes
yes
yes. the election completes within 200 ms
yes
yes use zxid as sequencer
yes

etcd
yes
yes
yes
yes
yes use revision
yes lease.KeepAlive

There are some differences in feature supporting.
2. High-level design
2.1. API
2.1.0. Design principles
We are faced with many temptations. In fact, there are many lock related features that can be supported (blocking locks, reentrant locks, read-write locks, sequencer, etc.)
But after all, our goal is to design a general API specification, so we should be as conservative as possible in API definition.Start simple, abstract the simplest and most commonly used functions into API specifications, and wait for user feedback before considering adding more abstraction into API specification.
2.1.1. TryLock/Unlock API
The most basic locking and unlocking API.
TryLock is non-blocking, it return directly if the lock is not obtained.
proto:
// Distributed Lock API
rpc TryLock(TryLockRequest)returns (TryLockResponse) {}

rpc Unlock(UnlockRequest)returns (UnlockResponse) {}

message TryLockRequest {
  string store_name = 1;
  // resource_id is the lock key.
  string resource_id = 2;
  // client_id will be automatically generated if not set
  string client_id = 3;
  // expire is the time before expire
  int64 expire = 4;
}

message TryLockResponse {

  bool success = 1;

  string client_id = 2;
}

message UnlockRequest {
  string store_name = 1;
  // resource_id is the lock key.
  string resource_id = 2;

  string client_id = 3;
}

message UnlockResponse {
  enum Status {
    SUCCESS = 0;
    LOCK_UNEXIST = 1;
    LOCK_BELONG_TO_OTHERS = 2;
  }

  Status status = 1;
}

Q: What is the time unit of the expire field?
A: Seconds.
Q: Can we force the user to set the number of seconds to be large enough(instead of too small)?
A: There is no way to limit it at compile time or startup, forget it
Q: Why not add metadata field
A: Try to be conservative at the beginning, wait until someone feedbacks that there is a need, or find that there is a need to be added in the process of implementing the component
Q: How to add features such as sequencer and reentrant locks in the future?
A: Add feature options in the API parameters,and the component must also implement the Support() function
2.1.2. Lock Renewal
Solution A: add an API "LockKeepAlive"
rpc LockKeepAlive(stream LockKeepAliveRequest) returns (stream LockKeepAliveResponse){}

message LockKeepAliveRequest {
  string store_name = 1;
  // resource_id is the lock key.
  string resource_id = 2;

  string client_id = 3;
  // expire is the time to expire
  int64 expire = 4;
}

message LockKeepAliveResponse {
  enum Status {
    SUCCESS = 0;
    LOCK_UNEXIST = 1;
    LOCK_BELONG_TO_OTHERS = 2;
  }
  string store_name = 1;
  // resource_id is the lock key.
  string resource_id = 2;

  Status status = 3;
}

The input parameters and return results of this API are all streams. App and sidecar only need to maintain one connection. Each time the lock needs to be renewed, the connection is reused to transfer the renewal request.
Q: Why not put the lock renewal as a stream parameter into tryLock?
A: Many businesses do not need to renew leases, so we want trylock to be as simple as possible;
Single responsibility principle.When we want to add a blocking lock,the renewal API can be reused;
Q: The renewal logic is too complicated, can we make it transparent to users?
A: sdk shields this layer of logic, starts a thread/coroutine/nodejs timing event, and automatically renews the lease
Solution B: Users do not perceive the renewal logic, and automatically renew the lease. App and sidecar maintain a heartbeat for failure detect
Disadvantages/difficulties:

If you reuse a public heartbeat, it is difficult to customize the heartbeat interval

The solution is to ensure that the heartbeat interval is low enough, such as 1 time per second

How to ensure reliable failure detection?

For example, the following java code, unlock method may fail:
try{

}finally{
  lock.unlock()
}

If it is a lock in JVM, unlock can guarantee success (unless the entire JVM fails), but unlock may fail if it is called via the network. How to ensure that the heartbeat is interrupted after the call fails?
This requires the app to report some fine-grained status to the heartbeat detection.
We can define the http callback SPI, which is polled and detected by the Layotto actuator, and the data structure returned by the callback is as follows:
{
  "status": "UP",
  "details": {
    "lock": [
      {
        "resource_id": "res1",
        "client_id": "dasfdasfasdfa",
        "type": "unlock_fail"
      }
    ],
    "xxx": []
  }
}

The application has to handle status collection, reporting, cleaning up after the report is successful, and limiting the map capacity (for example, what if the map is too large when report fails too much times?), which requires the app to implement some complex logic, and it must be put in the SDK.

This implementation is actually the same as lease renewal. It opens a separate connection for status management, and user reports the status through this public connection when necessary.

API spec relies on heartbeat logic. It relies on the heartbeat interval and the data structure returned by the heartbeat. It is equivalent to that the API spec relies on the implementation of Layotto, unless we can also standardize the heartbeat API (including interval, returned data structure, etc.)

in conclusion
At present, everyone has different opinions on the solution of lease renewal, and the lease renewal function will not be added in the first version.
Personally I prefer the solution A.Let the SDK shields the renewal logic. Although users have to directly deal with the lease renewal logic when using grpc, lease renewal is a common solution for distributed locks, and it is not hard for developers to understand.
I put it here to see everyone's opinions
3. Future work

Reentrant Lock

There will be some counting logic.We need to consider whether all locks support reentrancy by default, or add a feature option in the parameter to identify that the user needs it to be reentrant

Blocking lock

sequencer

4. Reference
How to do distributed locking
The Chubby lock service for loosely-coupled distributed systems

chinese version of this design doc:
1. 调研

系统
能否实现分布式锁
阻塞锁(基于watch)
可用性
写操作线性一致
sequencer(chubby论文里提出的feature)
续租

单机redis
yes
x
单点失效时，锁服务不可用
yes
yes(need poc)
yes

redis集群
yes
x
yes
no. 故障转移可能导致丢锁
yes(need poc)
yes

redis Redlock
yes

nacos
×

consul
yes

eureka
×

zookeeper
yes
yes
yes 有fo能力,200 ms内完成选举
yes
yes 使用zxid作为sequencer
yes

etcd
yes
yes
yes
yes
yes use revision
yes lease.KeepAlive

可以看到能力还是有一定差异
2. High-level design
2.1. API
2.1.0. 设计原则
我们面临着很多诱惑，分布式锁其实有很多feature可以做（阻塞锁，可重入锁，读写锁，sequencer等等）
但是毕竟我们的目标是设计一套足够通用的API规范，那么在API制定上还是尽量保守些，start simple，先把简单、常用的功能抽象成API规范，等用户反馈后再考虑将更多功能抽象成API规范
2.1.1. TryLock/Unlock
最基础的加锁、解锁功能。TryLock非阻塞，如果没有抢到锁直接返回
proto:
// Distributed Lock API
rpc TryLock(TryLockRequest)returns (TryLockResponse) {}

rpc Unlock(UnlockRequest)returns (UnlockResponse) {}

message TryLockRequest {
  // resource_id is the lock key.
  string resource_id = 1;
  // client_id will be automatically generated if not set
  optional string client_id = 2;
  // expire is the time before expire
  int64 expire = 3;
}

message TryLockResponse {

  bool success = 1;

  string client_id = 2;
}

message UnlockRequest {
  // resource_id is the lock key.
  string resource_id = 1;

  string client_id = 2;
}

message UnlockResponse {
  enum Status {
    SUCCESS = 0;
    LOCK_UNEXIST = 1;
    LOCK_BELONG_TO_OTHERS = 2;
  }

  Status status = 1;
}

Q: expire字段的时间单位？
A: 秒。
Q: 能否强制让用户把秒数配大点，别配太小？
A: 没法在编译时或者启动时限制，算了
Q: 为啥不加metadata
A: 一开始尽量保守一些，等有人反馈有需求再加，或者实现组件过程中发现确实有需要再加
Q: 以后要支持sequencer、可重入锁之类的feature咋加？
A: 入参增加feature option，组件也要实现Support()接口
2.1.2. 续租
Solution A: add an API "LockKeepAlive"
rpc LockKeepAlive(stream LockKeepAliveRequest) returns (stream LockKeepAliveResponse){}

message LockKeepAliveRequest {
  // resource_id is the lock key.
  string resource_id = 1;

  string client_id = 2;
  // expire is the time to expire
  int64 expire = 3;
}

message LockKeepAliveResponse {
  enum Status {
    SUCCESS = 0;
    LOCK_UNEXIST = 1;
    LOCK_BELONG_TO_OTHERS = 2;
  }
  // resource_id is the lock key.
  string resource_id = 1;

  Status status = 2;
}

续租的入参、返回结果都是stream,这里参考etcd的实现，app和sidecar只需要维护一个连接，每次用锁需要续租的时候都复用该连接传递续租请求。
Q: 为啥不把续租作为一个stream参数塞到tryLock里？
A: 很多业务不用续租，让trylock尽量简单；
尽量单一职责，后续加上阻塞锁，可以公用续租API；
把带stream的部分拆开成一个接口，以便http实现简单。
Q:续租逻辑太复杂，能否让用户不感知？
A: sdk屏蔽掉这层逻辑，开个线程/协程/nodejs定时事件，自动续租
Solution B: 用户不感知续租逻辑，自动续租，App和sidecar维持统一心跳
缺点/难点：

使用统一心跳的话，难以定制心跳间隔

解法是保证心跳间隔低，比如1秒1次

如何保证可靠的故障检测？

例如以下java代码，unlock可能失败：
try{

}finally{
  lock.unlock()
}

如果是单机锁，unlock能保证成功（除非整个jvm故障），但是unlock走网络调用的话可能失败。调用失败后，怎么保证心跳断掉？
这就要求业务在开发时要往心跳检测里上报一些细粒度的状态。
我们可以定义http callback接口,由actuator轮询检测，约定callback返回的数据结构为：
{
  "status": "UP",
  "details": {
    "lock": [
      {
        "resource_id": "res1",
        "client_id": "dasfdasfasdfa",
        "type": "unlock_fail"
      }
    ],
    "xxx": []
  }
}

应用要处理状态收集、上报、上报成功后清理、限制map容量（比如上报失败次数多了，map太大OOM怎么办），总归要求app实现一些复杂逻辑，也要放sdk里

这个实现其实和续租一样的，都是开一个单独的连接做状态管理，使用过程中有需要就通过这个公用连接上报状态。
API spec依赖心跳逻辑。依赖心跳间隔、心跳返回的数据结构。相当于API spec依赖了Layotto的实现，除非我们能把心跳实现也标准化掉（包括间隔、返回的数据结构等）

结论
目前大家对续租方案有不同意见，一期先不实现续租功能。
个人倾向A方案,sdk屏蔽掉续租逻辑。虽然用grpc直接调需要处理续租逻辑，但是续租算是分布式锁常用方案，开发者的理解成本低。
抛出来看大家意见
2.2. 组件
2.2.1. 如何处理“组件不支持某个feature option”
模拟>运行报错>ignore
特殊情况才ignore，比如consistency传了是eventual consistency,但是存储系统本身是强一致的，可以ignore这个option
2.2.2. 如何处理“组件不支持某个API”
模拟>运行报错
以事务API举例
2.2.3. 选型
一期选择单机redis实现
2.2.4. "运行时报错"式设计会破坏可移植性，如何让用户更简单的评估能否移植？
A. 提供文档，文档上每种组件给的保证、feature不同，让用户自己评估
B. 在sidecar的配置里声明API支持的feature option,如果sidecar启动发现组件不match，启动时报错
C. sidecar打运行时日志，自动统计app用了哪些feature，待需要移植时进行日志分析
D. 先不管
E. 做一个静态分析工具，自动分析可移植性
结论：选A，因为简单
3. Future work

可重入

会有一些计数逻辑。需要考虑是所有锁默认支持可重入，还是传参里面加个feature option、标识用户需要可重入

阻塞锁
sequencer

4. Reference
How to do distributed locking
The Chubby lock service for loosely-coupled distributed systems
https://www.jianshu.com/p/6e72e3ee5623
http://zhangtielei.com/posts/blog-redlock-reasoning.html
http://zhangtielei.com/posts/blog-redlock-reasoning-part2.html

Do we use the client_id to indicate the lock owner? What would happen if different applications pass the same client_id?

Do we use the client_id to indicate the lock owner?

@nobodyiam yes,we use the client_id to indicate the lock owner.

What would happen if different applications pass the same client_id?

case 1. If two apps with different app-id pass the same client_id,they won't conflict because client_id is grouped by 'app-id ',while 'app-id' is configurated in sidecar's static config(configurated in config.json or passed as parameters at startup)
case 2.If two apps with same app-id pass the same client_id,they will conflict and the second app will obtained the same lock already used by the first app.Then the correctness property will be broken.
So user has to care about the uniqueness property of client_id.
We let client_id field optional.If client_id is blank,the sidecar will generate a  uuid for the request.
why I don't remove this field in the request struct
The reason why I don't remove this field in the request struct is that when reentrant lock is needed,the existing client-id is required to identify client and check "whether this client can reenter this lock "

Again,this design assumes that every lock belongs to an 'app-id',like the configuration API.
But I do know that in some legacy systems,different apps with different 'app-id' use same redis to share same lock.
Although the scenarios exist,the use case is dangerous and not reasonable.So we won't take these scenarios into consideration currently.

Is it better to use the name lock_owner instead of client_id?

Is it better to use the name lock_owner instead of client_id?

Ok,I will change it to lock_owner if you guys think the name client_id is weird.
By the way,the client_id (or lock_owner) is  per request,not per process,so it is different for each request,which aims to prevent multi-thread in the process want the same lock concurrently.
I will add these conversation as comment in the proto file.

Hi guys,I submit a pull request to implement this API.
There are some changes:

change 'client_id' to 'lock_owner'
The 'lock_owner' in TryLockRequest is not optional again.User must generate it themselves (or our sdk will generate a uuid automatically)
remove 'client_id' in TryLockResponse

I put the reason in the comment:
message TryLockRequest {
  string store_name = 1;
  // resource_id is the lock key.
  string resource_id = 2;
  // lock_owner indicate the identifier of lock owner.
  // This field is required.You can generate a uuid as lock_owner.For example,in golang:
  //
  // req.LockOwner = uuid.New().String()
  //
  // This field is per request,not per process,so it is different for each request,
  // which aims to prevent multi-thread in the same process trying the same lock concurrently.
  //
  // The reason why we don't make it automatically generated is:
  // 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
  // This name is so weird that we think it is inappropriate to put it into the api spec
  // 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
  // we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
  // 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
  // So this field in the request shouldn't be removed.
  string lock_owner = 3;
  // expire is the time before expire.The time unit is second.
  int32 expire = 4;
}

message TryLockResponse {

  bool success = 1;
}


Missing credentials in config

Hi @vbudilov,
Thanks again for providing the Ionic2 Library, I believe this is more of a bug that I am doing wrong, however I am trying to setup my user pools within AWS console and I think im doing something wrong which is why im getting "Missing credentials in config", when using your credentials it works fine.
I followed this guide (only for the aws console setup) https://www.hawatel.com/blog/aws-cognito-authentication-in-ionic-framework
Is there something blazingly obvious im doing wrong?
Im using this region if it makes any difference?
export let _REGION = "eu-west-1";

Try following these steps in setting your Cognito User Pool and let me know if that doesn't work:
http://docs.aws.amazon.com/cognito/latest/developerguide/create-new-user-pool-console-quickstart.html
http://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-integrating-user-pools-with-identity-pools.html

The region doesn't matter, as long as you have cognito setup in that particular region (and cognito federated identity)

Hi Again @vbudilov,
Thanks for the quick response.
I have gone through the documentation and setup different identity and user pools multiple times but with no luck :(
Here is a step by step process of what im doing can you see what im doing wrong? Am i missing a vital stage out?
==========
User Pools
Pool name
- ionic_user_pool
Attributes
- email (no alias ticked)
- no custom attributes added
Policies
- 8 min length
- all four required tick boxes checked
Verifications
- MFA - OFF
- require verification - Just Email checked
- no custom addresses added
Devices
- remember devices - Always
Apps
- app name - myNewIonicApp
- App client id - (saved string for later use within app) e.g. 719s43jcbXXXXXXXXXXXXXXXXX
Triggers
- all set to none
Pool id
- saved string for later use within app e.g. eu-west-1_QHYXXXXXX
====================
Federated Identities
step 1: create identity pool
- Identity pool name* - ionic_identities
- Unauthenticated identities - NOT ticked
- Authentication providers (cognito tab selected)
- user pool id - eu-west-1_QHYXXXXXX
- App client id - 719s43jcbXXXXXXXXXXXXXXXXX
- Identity pool ID - (saved string for later use within app) eu-west-1:d4711388-8a31-XXXX-XXXX-XXXXXXXXXXXX
Your authenticated identities would like access to Cognito.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"mobileanalytics:PutEvents",
"cognito-sync:",
"cognito-identity:"
],
"Resource": [
"*"
]
}
]
}
Your unauthenticated identities would like access to Cognito
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"mobileanalytics:PutEvents",
"cognito-sync:"
],
"Resource": [
""
]
}
]
}
=================================
APP Code in properties.service.ts
export let _REGION = "eu-west-1";
export let _IDENTITY_POOL_ID = "eu-west-1:d4711388-8a31-XXXX-XXXX-XXXXXXXXXXXX";
export let _USER_POOL_ID = "eu-west-1_QHYXXXXXX";
export let _CLIENT_ID = "719s43jcbXXXXXXXXXXXXXXXXX";

Also when i look at the response in chrome devtools I get this.
{"__type":"NotAuthorizedException","message":"Unauthenticated access is not supported for this identity pool."}

Ok so I have done more digging around the "NotAuthorizedException" and it looks like when i created the identity pool within AWS i had not ticket the box "Enable access to unauthenticated identities".
Just curious as to why we would need to enable access for authenticated users for a user to signup and register when we only want to allow autherised users into the app?
Only reason I can think of is that with the aws-javascript sdk we cannot create secrets against the App within the user pool?

Sometimes you want to merge your guest with your auth user (once that guest authenticates).
http://docs.aws.amazon.com/cognito/latest/developerguide/switching-identities.html
"Users can begin their life in an application as unauthenticated guests. Eventually they may decide to log in using one of the supported identity providers. Amazon Cognito will ensure that an old identity retains the same unique identifier as the new one, and the profile data will be merged automatically."


Reproduce the +test Unlimiformer setup

Hi I want to reproduce the results of the +test Unlimiformer from the paper. Based on my understanding this setup does not require training, so is it possible to load an available checkpoint (like this) and convert it to Unlimiformer like the example demonstrated in inference-example.py? Are there any settings that I omitted here? Thanks!

Hi @Leonard907 ,
Thank you for your interest in our work!
Yes, to reproduce these experiments, follow this section of the README.

Let us know if you have any issues or questions!
Best,
Uri

Hi @Leonard907 , Thank you for your interest in our work!
Yes, to reproduce these experiments, follow this section of the README.
 Let us know if you have any issues or questions!
Best, Uri

Hello, I take the main command line you listed, but get "srcIndex < srcSelectDimSize" issue, when I delete "--eval_max_source_length 999999", the issue is addressed, what should I do while using this command?

Hi @Leonard907 , Thank you for your interest in our work!
Yes, to reproduce these experiments, follow this section of the README.
 Let us know if you have any issues or questions!
Best, Uri

Hello, I take the main command line you listed, but get "srcIndex < srcSelectDimSize" issue, when I delete "--eval_max_source_length 999999", the issue is addressed, what should I do while using this command?

is it necessary to set "use_ Datastore=True" ?

Hi @Leonard907 ,
It works for me,
the only thing that was missing was adding --tokenizer_name facebook/bart-base, but we will add the tokenizer to the model so it won't be needed in the future.
Setting --use_datastore is useful with extremely long inputs, but it should work either way.

Following up on the above: tokenizer should now be added to the model! It should now run without explicitly setting tokenizer_name

Closing due to inactivity, feel free to re-open or create a new issue if you have any questions or problems.


Response streaming and SW lifetime

With https://github.com/yutakahirano/fetch-with-streams/ by @yutakahirano Response objects can have their bits streamed from some logic in the SW. However, if this is done e.g. for media files that would mean the SW would be kept alive for potentially hours, which is not exactly what SW is designed for.
Curious what the thinking is on this.

It's a deep question, and not one we have an answer to today.
On one hand, SWs are lighter-weight (by design) than an iframe, so the price of having it open to service interactive content seems low. We're currently getting to a place where we can get real-world data about memory/cpu/latency from deployed SWs.
On the other hand, in cases where the SW might be (naively) allocating memory over the long period of time, we might be forced to kill it regardless and that behavior will look bad. E.g., the SW will need to handle a future range request when the video plays, issuing a new onfetch.
I think the bigger issues here are likely to be down to responsiveness. How do we make sure such a video-serving worker doesn't starve other requests for time? Maybe this is a case where we should find a way to use a sub-worker from the SW or a parallel SW (second, third, whatever).
Also, I think we have pretty much this exact issue when dealing with websockets. I've punted on both so far. Thoughts from others would be most helpful.

What about if we don't make stream hold the SW alive, but instead add the waitUntil() function we've talked about before?

@wanderview I think even in the face of waintUntil() the plan was not for a SW to be alive quite that long though.

I think I understand better what is being asked now.  We want javascript in a worker to stream data to a consumer in the main thread.
Maybe we need stream transferability here.  So you can create a pipe oriented stream, pass the reader side to respondWith(), and then transfer the writer side of the pipe to a Worker.

Yeah, the SW should be able to shut down as soon as the promise passed to respondWith resolves.

Yeah, the SW should be able to shut down as soon as the promise passed to respondWith resolves.

I agree the spec should make this possible.  Implementations may need to keep it alive longer.  For example, if respondWith(cache.match(req)) I need to keep the worker alive until the body is fully streamed across because of how IPC works.

Yeah that's fine. The browser's allowed to keep the SW open as long as it wants. Memory-constrained devices are expected to kill SW more aggressively, high-memory devices may keep it around for minutes to avoid the startup lag.

ahem now I've read the OP properly, I agree with @slightlyoff - having the SW alive for hours seems ok here, it's lighter than an iframe. But should playback pause, the SW can shutdown, and on resume, do a fetch with a range request.
Yeah, I basically have nothing new to add.

We added fetchEvent.waitUntil too. But keeping SW alive for requests seems fine.


Add satisfiesOnlyOnce to ObjectEnumerableAssert

Check List:

Fixes #2675
Unit tests : YES
Javadoc with a code example (on API only) : YES
PR meets the contributing guidelines

I wasn't sure which version to add for @since

Thank you for the review. :) Will work on the required changes in the next few days. They all make sense to me.

Integrated thanks @StefanBratanov!
FYI the javadoc alignment issue was due either to some non visible characters I believe, deleting them and adding spaces accordingly fixed it.

Integrated thanks @StefanBratanov! FYI the javadoc alignment issue was due either to some non visible characters I believe, deleting them and adding spaces accordingly fixed it.

Perfect. Thank you! :)


Updated discord links in the docs

Changelog / Overview
Replaced the old https://discord.gg/mMRrZQW to https://www.manim.community/discord/ in the docs
Motivation
The contributors can find and access the right discord link.
Explanation for Changes
updated docs with the new discord links
Checklist

[x] I have read the Contributing Guidelines
[x] I have written a descriptive PR title (see top of PR template for examples)
[x] I have written a changelog entry for the PR or deem it unnecessary
[x] My new functions/classes either have a docstring or are private
[x] My new functions/classes have tests added and (optional) examples in the docs
[x] My new documentation builds, looks correctly formatted, and adds no additional build warnings

Reviewer Checklist

[ ] The PR title is descriptive enough
[ ] The PR is labeled correctly
[ ] The changelog entry is completed if necessary
[ ] Newly added functions/classes either have a docstring or are private
[ ] Newly added functions/classes have tests added and (optional) examples in the docs
[ ] Newly added documentation builds, looks correctly formatted, and adds no additional build warnings

Can you please check??

LGTM, in the future you should push changes to your branch rather than creating a new PR.


2/3 MFA options are broken in v2.0.0 release

I updated to v2.0.0 today and now MFA does not work for Push & SMS, however Verify (TOTP) still works.
If I rollback to 1.0.10, all three MFA options still work.
Here's my tests in v2.0.0.
Verify (TOTP) - WORKING
----snippet----
| => okta-aws test-okta-verify sts get-caller-identity
Username: myusername
Password:

Multi-Factor authentication is required. Please select a factor to use.
Factors:
[ 1 ] : Okta Verify (Push)
[ 2 ] : SMS Verification
[ 3 ] : Okta Verify (TOTP)
Selection: 3

OKTA Token Factor Authentication
Enter 'change factor' to use a different factor
Token:
646498

Please choose the role you would like to assume:
----snippet----

Verify (Push) -  BROKEN
----snippet----
okta-aws test-okta-push sts get-caller-identity
Username: myusername
Password:

Multi-Factor authentication is required. Please select a factor to use.
Factors:
[ 1 ] : Okta Verify (TOTP)
[ 2 ] : SMS Verification
[ 3 ] : Okta Verify (Push)
Selection: 3

Push Factor Authentication
Exception in thread "main" org.json.JSONException: JSONObject["poll"] not found.
    at org.json.JSONObject.get(JSONObject.java:566)
    at org.json.JSONObject.getJSONObject(JSONObject.java:778)
    at com.okta.tools.authentication.OktaMFA.handlePushPolling(OktaMFA.java:293)
    at com.okta.tools.authentication.OktaMFA.verifyAnswer(OktaMFA.java:285)
    at com.okta.tools.authentication.OktaMFA.pushFactor(OktaMFA.java:242)
    at com.okta.tools.authentication.OktaMFA.getSessionToken(OktaMFA.java:103)
    at com.okta.tools.authentication.OktaMFA.promptForFactor(OktaMFA.java:64)
    at com.okta.tools.authentication.OktaAuthentication.getOktaSessionToken(OktaAuthentication.java:87)
    at com.okta.tools.saml.OktaSaml.getSamlResponse(OktaSaml.java:47)
    at com.okta.tools.OktaAwsCliAssumeRole.doRequest(OktaAwsCliAssumeRole.java:132)
    at com.okta.tools.OktaAwsCliAssumeRole.run(OktaAwsCliAssumeRole.java:102)
    at com.okta.tools.WithOkta.main(WithOkta.java:30)
----snippet----

SMS -  BROKEN
----snippet----
okta-aws test-okta-sms sts get-caller-identity
Username: myusername
Password:

Multi-Factor authentication is required. Please select a factor to use.
Factors:
[ 1 ] : Okta Verify (TOTP)
[ 2 ] : SMS Verification
[ 3 ] : Okta Verify (Push)
Selection: 2

SMS Factor Authentication
Enter 'change factor' to use a different factor
Exception in thread "main" org.json.JSONException: JSONObject["sessionToken"] not found.
    at org.json.JSONObject.get(JSONObject.java:566)
    at org.json.JSONObject.getString(JSONObject.java:851)
    at com.okta.tools.authentication.OktaMFA.verifyAnswer(OktaMFA.java:287)
    at com.okta.tools.authentication.OktaMFA.smsFactor(OktaMFA.java:166)
    at com.okta.tools.authentication.OktaMFA.getSessionToken(OktaMFA.java:97)
    at com.okta.tools.authentication.OktaMFA.promptForFactor(OktaMFA.java:64)
    at com.okta.tools.authentication.OktaAuthentication.getOktaSessionToken(OktaAuthentication.java:87)
    at com.okta.tools.saml.OktaSaml.getSamlResponse(OktaSaml.java:47)
    at com.okta.tools.OktaAwsCliAssumeRole.doRequest(OktaAwsCliAssumeRole.java:132)
    at com.okta.tools.OktaAwsCliAssumeRole.run(OktaAwsCliAssumeRole.java:102)
    at com.okta.tools.WithOkta.main(WithOkta.java:30)
----snippet----

Thank you for your report. This is unanticipated. I will investigate.

An immediate workaround is OKTA_BROWSER_AUTH=true which delegates all authentication to an embedded browser.
I don't have access to Okta Push MFA or time to test SMS MFA. I use neither. A motivated developer who needs those MFA methods is encouraged to contribute a fix.

I am having the same problem after upgrade besides setting OKTA_BROWSER_AUTH=true in my ./okta/config.properties.

Multi-Factor authentication is required. Please select a factor to use.
Factors:
[ 1 ] : Okta Verify (TOTP)
[ 2 ] : Okta Verify (Push)
Selection: 2
Push Factor Authentication
Exception in thread "main" org.json.JSONException: JSONObject["poll"] not found.
at org.json.JSONObject.get(JSONObject.java:566)
at org.json.JSONObject.getJSONObject(JSONObject.java:778)
at com.okta.tools.authentication.OktaMFA.handlePushPolling(OktaMFA.java:293)
at com.okta.tools.authentication.OktaMFA.verifyAnswer(OktaMFA.java:285)
at com.okta.tools.authentication.OktaMFA.pushFactor(OktaMFA.java:242)
at com.okta.tools.authentication.OktaMFA.getSessionToken(OktaMFA.java:103)
at com.okta.tools.authentication.OktaMFA.promptForFactor(OktaMFA.java:64)
at com.okta.tools.authentication.OktaAuthentication.getOktaSessionToken(OktaAuthentication.java:87)
at com.okta.tools.saml.OktaSaml.getSamlResponse(OktaSaml.java:47)
at com.okta.tools.ListRoles.main(ListRoles.java:43)

I submitted a PR to fix Browser and console problems:
https://github.com/oktadeveloper/okta-aws-cli-assume-role/pull/303
please try and test

@hecsalazar thank you for your PR!
@AlainODea could we get a new release with already merged fixes? v2.0.0 is currently unusable :-)

@pschiffe I’m not maintaining this anymore. Okta seems open to accepting a new community maintainer. #292

@AlainODea sorry, I missed that. Thanks for pointing it out :-)

I released 2.0.2 https://github.com/oktadeveloper/okta-aws-cli-assume-role/releases/tag/v2.0.2.

The 2.0.2 release does not seem to have fixed the issue with the Okta Verify (Push) method:
Multi-Factor authentication is required. Please select a factor to use.
Factors:
[ 1 ] : Okta Verify (Push)
[ 2 ] : SMS Verification
[ 3 ] : Google Authenticator
[ 4 ] : Okta Verify (TOTP)
Selection: 1

Push Factor Authentication
Exception in thread "main" org.json.JSONException: JSONObject["poll"] not found.
        at org.json.JSONObject.get(JSONObject.java:566)
        at org.json.JSONObject.getJSONObject(JSONObject.java:778)
        at com.okta.tools.authentication.OktaMFA.handlePushPolling(OktaMFA.java:293)
        at com.okta.tools.authentication.OktaMFA.verifyAnswer(OktaMFA.java:285)
        at com.okta.tools.authentication.OktaMFA.pushFactor(OktaMFA.java:242)
        at com.okta.tools.authentication.OktaMFA.getSessionToken(OktaMFA.java:103)
        at com.okta.tools.authentication.OktaMFA.promptForFactor(OktaMFA.java:64)
        at com.okta.tools.authentication.OktaAuthentication.getOktaSessionToken(OktaAuthentication.java:87)
        at com.okta.tools.saml.OktaSaml.getSamlResponse(OktaSaml.java:47)
        at com.okta.tools.OktaAwsCliAssumeRole.doRequest(OktaAwsCliAssumeRole.java:132)
        at com.okta.tools.OktaAwsCliAssumeRole.run(OktaAwsCliAssumeRole.java:102)
        at com.okta.tools.WithOkta.main(WithOkta.java:30)

there is still an issue with push notification.
Also, readme states to use Java 1.8, but POM.XML uses Java 11

I can confirm too, that this is still broken, with the same stack-trace.

Hi @oaksenov I sent a PR to update the README to mention Java 11.
As for the MFA issues unfortunately my setup does not include those, so I haven't had the chance to reproduce and fix.
I you have the chance that might be a good thing.

@hecsalazar , let me know what I can do to help to troubleshoot.

I guess you need to talk to your Okta admin to figure out a setup with push
notifications for the account you use to test and reproduce.
Unfortunately I can't give you more directions since I fixed the tool for
AWS related work but kind of test is out of the scope of my current
project. I'm not even part of the team responsible for Okta integration
withing the company.
Hector
On Mon, Jun 10, 2019 at 1:55 PM oaksenov<EMAIL_ADDRESS>wrote:

@hecsalazar https://github.com/hecsalazar , let me know what I can do
to help to troubleshoot.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/oktadeveloper/okta-aws-cli-assume-role/issues/284?email_source=notifications&email_token=ACSBHDKVGCVI6OV3OOFCUALPZ2IQTA5CNFSM4HAOH4RKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXKUGPA#issuecomment-500515644,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACSBHDOAF4BMBNPWO4HYARLPZ2IQTANCNFSM4HAOH4RA
.


QEventLoopPolicy to manage multiple event loops (one per thread)

see: #23
A custom event loop policy has the possibility of making QThreadExecutors more useful as you could run coroutines in them, with a per-thread event loop with less. Even more useful, the .execute could check if a coroutine or a regular function is being passed in, and a coroutine could be wrapped in asyncio.async()' (The policy would then need to manage thread affinity)
see: http://qt-project.org/doc/qt-4.8/threads-qobject.html (tricky but potentially useful)
A custom event loop policy will likely lead to even more platform specific stuff, and is one more moving part that can go wrong. (well the baseclass will need to be different on windows & unix)
Example code:

@asyncio.coroutine
def async_job():
     yield from asyncio.sleep(.1)

def threaded_job():
    local_loop = asyncio.get_event_loop()  # with standard policy, this will raise an Exception
    asyncio.async(async_job())

    local_loop.run_until_complete(async_job())

asyncio.set_event_loop_policy(quamash.QEventLoopPolicy(app))
loop = asyncio.get_event_loop()
with QThreadExecutor(5) as exec:
   yield from loop.run_in_executor(exec, threaded_job)

I've only just discovered quamash, so I may be missing some context, but IMO, it should absolutely provide an event loop policy. That is the standard interface for switching event loop implementations, not simply setting one specific event loop as is expected now.

As it's the standard, some async frameworks (asphalt is the one I happen to be working with at the moment) explicitly support passing or registration of event loop policies.
Not having a policy creates an error-prone situation where the currently-set event loop policy may create loops of other types, leading to breakage (this situation is only saved for most current cases by pure coincidence, as the "default" event loop policy in the stdlib doesn't implicitly create event loops for additional threads beyond the main one, but that may not be, and probably isn't, the case for other third-party event loop implementations). If all event loop implementations just used the one, true, intended (by Guido) interface for selecting event loop implementations, these kinds of conflicts will be prevented.


Fix "method_lines" issue in src/components/Stocks/DetailsPageItems/ShoppingButtons.js

Function ShoppingButtons has 51 lines of code (exceeds 25 allowed). Consider refactoring.
https://codeclimate.com/github/dictyBase/Dicty-Stock-Center/src/components/Stocks/DetailsPageItems/ShoppingButtons.js#issue_5dae47545324ef0001000191

dupe of #335


How to delete amplify content via amplify function?

Amplify CLI Version
12.4.0
Question
Background ⏲

I created a Next.js web app and created Amplify backend in it using CLI.
Then using the CLI I created a GraphQL API of three models User, Portfolio, and Wallet, and now I have the queries, mutations, and subscriptions in the app and I can use them.
Inside Amplify Studio's Content section, I can see there are three tables User, Portfolio, and Wallet. But on DynamoDB I can see four tables User, Portfolio, Wallet, and 4th one is Datastore (of which I have no idea).
I also created a function using Amplify using which I want to delete these table's items. I gave the lambda permission to access API and DynamoTables.
These are the env variables I am getting inside the function automatically.

/* Amplify Params - DO NOT EDIT
	API_ROAD2CRYPTOGRAPHQLAPI_GRAPHQLAPIENDPOINTOUTPUT
	API_ROAD2CRYPTOGRAPHQLAPI_GRAPHQLAPIIDOUTPUT
	API_ROAD2CRYPTOGRAPHQLAPI_PORTFOLIOTABLE_ARN
	API_ROAD2CRYPTOGRAPHQLAPI_PORTFOLIOTABLE_NAME
	API_ROAD2CRYPTOGRAPHQLAPI_USERTABLE_ARN
	API_ROAD2CRYPTOGRAPHQLAPI_USERTABLE_NAME
	API_ROAD2CRYPTOGRAPHQLAPI_WALLETTABLE_ARN
	API_ROAD2CRYPTOGRAPHQLAPI_WALLETTABLE_NAME
	ENV
	REGION
Amplify Params - DO NOT EDIT */

Requirement 🧾
I want a function which can delete any instance (item) of any of these tables, Now how should I do this?
I guess I have two options and I tried both:

Delete items directly from dynamoDB via aws-sdk.
Delete items by running delete mutations of GraphQL API inside lambda.
(Now this is what I know so far, maybe you guys have  better solution)

Problems faced 😕
These are the problems I faced with both of the solutions:
1. Delete items directly from dynamoDB via aws-sdk.
const AWS = require('aws-sdk');
const dynamo = new AWS.DynamoDB();

dynamo.deleteItem(params);

Already provided required permissions to the lambda.
When I tried this solution, it is not working properly, I tried to scan the tables also and sometimes I can see the data inside Amplify Studio's Content section but Lambda is not fetching any data. And If I try to delete an item, lambda will indicate that it is deleted successfully but I can still see the item inside Amplify Studio's Content section, like not working properly, I have a doubt about Datastore table, maybe it has something to do with data, but via Lambda I cannot access it.
So this solution was not working 👎. Then I moved to another solution (next one).
2. Delete items by running delete mutations of GraphQL API inside lambda.
Using the endpoint API_ROAD2CRYPTOGRAPHQLAPI_GRAPHQLAPIENDPOINTOUTPUT I tried to make a delete request (Already provided permissions to lambda), but it is not working and giving 401 error.
"message": "Request failed with status code 401",
I tried providing "Authorization": "Bearer <token>" inside headers, tried both tokens idToken and accessToken, but it is not working.
Please let me know, if there is any solution about deleting items of Amplify Studio's Content section using an Amplify function.
Thanks!

Hey @aahmedfaraz :wave: thanks for raising this! This would be recommended to perform via the GraphQL mutation as it will also ensure the subscribed clients (if any) are updated. From your note regarding the 401, can you verify your auth VTL resolvers for the model contains the function name as an "adminrole"? There is an active issue in our API repo where granting a Lambda Function access to your GraphQL API does not immediately regenerate the resolvers, and your function will not have access https://github.com/aws-amplify/amplify-category-api/issues/679

Closing due to inactivity


[Storage] Adjust dev_requirements and tests.yml

This change includes minor adjustments to all of our dev_requirements files to bring them in line with each in terms what packages are installed and where interactive mode is used.
Also removes azure-storage-blob-changefeed from our tests.yml as all changedfeed tests are currently playback only so it doesn't make sense to run the Live test pipeline on that package. This should save some Storage account resources.

API change check
API changes are not detected in this pull request.

API change check
API changes are not detected in this pull request.

API change check
API changes are not detected in this pull request.

API change check
API changes are not detected in this pull request.


Fix isHTMLBRElement test

Summary
In the Facebook repo mirror, modules in Jest tests are not mocked, but on GitHub they are (as seen from package.json). That led to D18831442 passing internally in Sandcastle but failing on Travis. Not a huge deal, we can just add jest.disableAutomock().
We might want to see if we can remove "automock": true, from the Jest config in package.json to have a more similar environment to Facebook's Jest config.
Test Plan
Travis CI should pass now.

Good catch, thanks @yangshun!


Create or update API does removes Web Service URL

When the release is run through Azure DevOps task. The web service url is cleared and shows empty on an existing API.
The only workaround is  in the Policy section.
Will this be fixed?

could you please let us know the wokaound you ae using, we are facing the same issue and we might have to switch to terraform since the project is not curently maintained but would like to use the wokaound in the meantime.


remove txpool because it will not communicate with TG only with Sentry

Don't think it needs to be removed, but it needs to be refactored / rewritten

Don't think it needs to be removed, but it needs to be refactored / rewritten

i don’t know what methods needed here. RpcDaemon will call this methods?


Update PR template with branch info.

Just an update on our PR Template.

A new build for this PR has been completed. As a result a NuGet has been created which allows you to verify this fix or try out the new feature! Download here

A new build for this PR has been completed. As a result a NuGet has been created which allows you to verify this fix or try out the new feature! Download here


Add seifrajhi as approver and reviewer for Arabic localisations docs

This commit will add seifrajhi  as an owner (approver) and reviewer for Arabic content on the website.

/assign @adowair
/assign @mboukhalfa

/approve

/lgtm

/approve
Thank you @seifrajhi


Using constructors as tag names

I'd like to start a discussion on how one might be able to do the following:
import { html, render } from 'lit-html';
import MyComponent from './my-component';

render(html`<MyComponent></MyComponent>`, document.body);

There's some nice things we get from this.
Explicit usage
I stumbled across this while converting the Skate website to use Lit. It was previously using Preact, and I was doing something like the following to render my components.
<MyComponent.is />

In doing this, I was explicitly using the imported constructor to render components. When moving to Lit, I had to start explicitly defining my custom element names. More on why later. I had to do this because I couldn't infer the name from the constructor, I had to hard code it in the template literal.
My code ended up looking like:
import { html, render } from 'lit-html';
import `./my-component';

render(html`<my-component></my-component>`, document.body);

The problem here is that, in one file I could define a name. Since I'm not using the constructor, it may slip my mind to even import the component at the top. This actually caused a few weird issues because there were no errors about the constructor not being defined. The hardcoded name is valid, there's just no definition in the registry for it.
Dynamic custom element names
This is fantastic for testing components that don't have pre-defined names or apps that don't package their components to consumers, and simply use them internally. For example, in the Skate tests, we don't explicitly define the names of components. They're dynamic and we just new the constructor to use them. This way, we don't have to keep track of the names and manually ensure their uniqueness.
Similarly, apps don't need to worry about custom element names and they can just pass around constructors that they import. For these components, it'd be nice to not have to worry about naming. Though, the positive upside to naming is that you get better debugging.
However, when using Preact, we used to simply generate the name of the component from the class name of the custom element. We also have a { name } utility that will generate a unique name, given an optional hint. This allows us to have a base class that does something like:
import { name } from 'skatejs';

class Base extends HTMLElement {
  static get is() {
    return name(this.name);
  }
}

class Hello extends Base {}

// Registers: `x-hello`.
customElements.define(Hello.is, Hello);

We were doing this up until minifying the code broke the expected custom element name. The names were still valid when registered, but were different than what was being used in the literals.

having a generated name you register with customElements seems a bit dangerous to me
why not just do something like this?
import { html, render } from 'lit-html';
import MyComponent as MyOther from './my-component'; // only es6 class
customElements.define('my-other', MyOther);

render(html`<my-other></my-other>`, document.body);

That’s a lot of unnecessary ceremony for apps where you’re only using some
components internally. You literally never need to care about the name.
Sure, externalised components you’d probably not predefine. This is just a
nice-to-have. People coming from React-land will feel at home here.
I don’t want this use case to distract from the other point, though. Being
able to do this makes components easier to reason about because imports are
directly correlated to where they’re used.
On Wed, 6 Dec 2017 at 8:56 pm, Thomas Allmer<EMAIL_ADDRESS>wrote:

having a generated name you register with customElements seems a bit
dangerous to me
why not just do something like this?
import { html, render } from 'lit-html';
import MyComponent as MyOther from './my-component'; // only es6 class
customElements.define('my-other', MyOther);
render(html<my-other></my-other>, document.body);
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/PolymerLabs/lit-html/issues/217#issuecomment-349590255,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAIVbBS5Pic9dPTzMUyomUY32zRzIikKks5s9mTGgaJpZM4Q3XIk
.

I’m also interested in why you think this is dangerous. You shouldn’t use it for components you package and ship to other consumers. Using it internally is no more dangerous than doing it manually. It’s actually safer because it will make sure that it’s unique.

I like the idea. I'm not sure that this can work though, right?
render(html`<MyComponent></MyComponent>`, document.body);

The string there is a string. Is this what you really wanted or did you mean to instead to have:
render(html`<${MyComponent}></${MyComponent}>`, document.body);

Yeah, there's a real implementation challenge here, give how lit-html works. The literal parts of a template have to form valid HTML, otherwise we'll get strange parsing behavior.
html`<${MyComponent}></${MyComponent}>`

Is not a valid lit template, because the HTML it produces is:
<{{}}></{{}}>

One way to fix this is with a static directive (and special support for it in core) that indicates a value should be interpolated before building the HTML string, so you could do:
const tagName = 'my-element';
html`<${static(tagName)}></${static(tagName)}>`

Then you'd need a way to map from a constructor to a tag name. I think this is a bit out of scope for lit-html, but with static in place you could build it:
const tag = (ctor) => static(tagNameMap.get(ctor));

Then you could do:
html`<${tag(MyComponent)}></${tag(MyComponent)}>`

That isn't very ergonomic, but I think it's about the limit for what lit can do. Something that parses templates could compile to lit-html of that form. Once you do that, you might want to use JSX, which can be made to compile to lit-html like this: https://www.npmjs.com/package/polyestr-tsx-lit-transform

To sketch out the idea, I've created a wrapper that essentially does what static would do internally. If static were a thing, you could even have a small wrapper like this that wraps constructors in ...args with static(tag(Ctor)) to reduce the API friction.
If static were a thing, the complexity would also be reduced because You wouldn't have (I think) O(n log n) + whatever lit is doing, you'd just have lit's overhead.
// Or lit-extended, of course.
import { html } from 'lit-html';

// This then wraps lit-html.
export function preLit(parts, ...args) {
  const newArgs = [];
  const newParts = parts.concat();
  const joinIndicies = [];

  // This creates a new list of parts and args to pass to Lit.
  for (let a = 0; a < args.length; a++) {
    const possibleCtor = args[a];
    if (possibleCtor && possibleCtor.is) {
      newParts[a] = newParts[a] + possibleCtor.is;
      joinIndicies.push(a);
    } else {
      newArgs.push(possibleCtor);
    }
  }

  // This joins where the names were inserted.
  // A possible optimisation here is to incorporate what's in this
  // loop back into the first one to reduce the complexity.
  for (let a = 0; a < joinIndicies.length; a++) {
    const join = joinIndicies[a] - a;
    newParts[join] = newParts[join] + newParts[join + 1];
    newParts.splice(join + 1, 1);
  }

  // Calls out to Lit.
  return html(newParts, ...newArgs);
}

We could also change the marker used when we create the initial HTML string: remove the {{}} in the marker. AFAIK they don't serve a real purpose as we always use the complete marker string in regular expressions. If we then change the _getHtml function to also use the marker instead of nodeMarker if the current string ends with < or </, we'd end up with valid HTML.
The resulting HTML for the template of
html`<${MyComponent} some-attr="${someValue}">${someContent}</${MyComponent}>

would then be
<lit-01234567 some-attr="lit-01234567"><!--lit-01234567--></lit-01234567>

At clone time we need to create the correct element with the correct static attributes, and at update time we need to properly handle changes to the tag as those changes mean we need to create a new element:

We have to reparent childnodes
We have to set the static attributes again
We need to handle node changes in attribute parts.

We'll need to take special care here because changing the node of a part could easily lead to memory leaks, e.g. in the EventPart of lit-extended where listeners won't get removed anymore if the node gets changed.

@treshugart
That's a really interesting snippet. I think it'll have to have it's own caching behavior to only do the setup work once, and it may be helpful to expose the interal litTag function: https://github.com/PolymerLabs/lit-html/blob/master/src/lit-html.ts#L45 which let's you provide your own tempalte cache.
I really like that this could be done on top of lit-html. I'd like to see more opinion and experiments layered this way. It's one reason why I made the lit-html vs lit-extended split - to signal that it's encouraged to make your own variant with different choices.
Would you be interested in experimenting with this in Skate?

If static were a thing, you could even have a small wrapper like this that wraps constructors in ...args with static(tag(Ctor)).

I was thinking that a tag() function would auto-wrap in static() internally, so all a wrapper would have to do is call tag().
I'll bump up the priority of static() since it has yet another use now.
@bgotink I think fixing up tag names at clone time it's going to be expensive and lead to some problem with custom elements reactions. We really want the tree to be as close to it's final state when constructors and connected callback hooks run. We may be able to do the fixup at template prep time, but that still involves more reparenting that it's be good to avoid. If we have the requirement that tag names must be known at template prep time, which seems fine to me, we can do less work.

Would you be interested in experimenting with this in Skate?

I don't see why not. I was hoping to at least put this into the website, but it could be an export from @skatejs/renderer-lit-html. Customisation can become a slippery slope, though. We used to have soooo many patches on top of IncrementalDOM that it became not worth it to use it anymore. Have to strike that balance.
I've also been entertaining the idea of your JSX -> Lit transform idea. Essentially, it could just transform from <MyComponent /> to <${MyComponent}></${MyComponent}>. You could go further and lookup the bindings for MyComponent and grab the name from it to get around having to interpolate it, but implementing static makes this simpler.

Customisation can become a slippery slope, though. We used to have soooo many patches on top of IncrementalDOM that it became not worth it to use it anymore. Have to strike that balance.

True, but I'd like to kick off more experimentation outside of lit proper and see what people come up with. lit could be used as a built-your-own-HTML-in-JS-template-system library, rather than the single source of truth on how that should be done. Already someone made an Angular-template flavored version with (foo) and [bar] attribute names. I think it'd be great to see even more opinionated extensions. Ultimately that either lets there be lots of different options, or things could be folded back into lit.
Another thing this idea here highlights is that we really need somewhat a reproducible benchmark setup so we can all have an idea whether a change/wrapper like this hurts perf.

We're dealing with the XY problem here; the core idea of the issue is the fact that we get no warning when <my-custom-component> isn't defined within the scope due to a missing import. Using a constructor as a tag name is just one of the possible solutions, and one that would probably work with most existing tools.
However that's a syntax error, and as such should be dealt with on an IDE / compiler / linter level. A standalone, runtime-only library isn't a place to deal with such problems, and any solution (like @treshugart's wrapper) wouldn't be framework-independent - if the imported component doesn't expose the tag name variable, we can't have html`<${static(tagName)}>` . Maybe a generic web components analyser like Polymer Analyzer? It could be as simple as checking for presence of customElements.define('tag-name', Component) within the imported JavaScript for all custom tags used in a HTML file / template literal.

@HitkoDev I think you misunderstand my intentions. The core of the issue is not definition ordering and delayed upgrades, linting / etc, or the fact that my example utilises a non-standard static property. I'm fairly well versed in the world of web components and understand the intricacies.
What I want is a more explicit, declarative way to use a custom element that solves the common use case. Sure, you need a hardcoded name for deferred upgrades but I've never needed them. I've written hundreds of custom elements. Maybe someday I'll need to use it that way, but I've yet to have a need for it.
Global names have a long, problematic history. While it's due to the implementation detail of the HTML parser, libraries can provide better ergonomics for this. While opinions about web components from the React camp can be controversial depending on where you sit, Ryan has a great point in this thread. He's not wrong and lays out the obvious prior art here: React.
Jason Miller (Preact) and Sean Larkin (Webpack) have had similar ideas in various tweets and gists , that I've shamelessly modified and haphazardly hacked together about using HTML imports for scoping names. Basically:
<import href="./my-element" as="my-element">
<my-element></my-element>

My snippet above, referred to as not being framework independent is severely hacked together and the concrete usage of is is meant to serve as an example. I raised an issue awhile back about being able to do the reverse of customElements.get() I think Lit providing a hook for interpolation prior to invoking the HTML parser would allow this and many other ideas that we haven't been able to think of yet.
To your point about linters and such, they could help but they'd suffer from the same amount of inference issues that a runtime library would in that you can't reliably tell if an element will ever eventually be defined. I think this orthogonal to the discussion, though.

The way DOM works simply doesn't allow elements without unique tag names, and that most certainly won't change. The best we may hope for is the ability to use shadow root as a scope for custom elements (see https://github.com/w3c/webcomponents/issues/716).
The problem with solutions from other frameworks is they all require specific component structure / compilation / virtual DOM / exposed variables / incompatible framework libraries / ..., often making it hard or even impossible to use those components independently. When you're working on a project and don't expect components to be reused outside the project scope, or when you're okay with compilation, there are plenty of options for dealing with this problem. On the other hand, what online community expects is the ability to do this:
<script type="module" src="/node_modules/external_component/ex-component.js"></script>
<ex-component></ex-component>
<script type="text/javascript">
    var exComp = $('ex-component');
    /**
     * Use some old jQuery code with the component,
     * like binding existing button action to a custom button
     */
</script>

A pre-parse hook is a good addition to lit-html, and it brings us closer to solving the problem when dealing with internal and framework-specific components, where it's possible to hook into the component registration and obtain or change the tag name.
In case of independent components, we still have the problem of global and scoped tag names, and no way to tell whether a component is already present in the custom element registry. Hacking a way around this shouldn't become a part of lit-html. Instead there should be a proposal to integrate it into the WC API, otherwise lit-html will turn into just another opinionated framework with a load of browser-specific hacks no-one can maintain.

@justinfagnani so to be clear, I'm a 1000% on board with a static() directive that interpolates prior to parsing. Shall I open a separate issue referencing this one so we can hash it out?

@treshugart Bede filed an issue a while back: https://github.com/PolymerLabs/lit-html/issues/78
It's a pretty simple one to do

Alrighty. Closing in favour of #78 then!

Hey, @justinfagnani, mentioning here as this issue is the most relevant place for it, even if it's closed. @thysultan just mentioned me about unique names in Dio and I wrote up some stuff regarding it in https://github.com/thysultan/dio.js/pull/52#issuecomment-372111041.
Something to point out there, when we were discussing styling and unique names at the web components f2f in Tokyo, is that you most likely don't need to select by tag name. You can probably just add a class to the element and select using that. There's some edge cases to that, but I think most of the time that would work and I just didn't think of it at the time (not sure why).
Mostly just an FYI.

@treshugart Would that eliminate being able to do something like :theme(my-fancy-button) in CSS? (Assumption that :part and :theme are progressing). I do not know how realistic using :theme to style a custom element would be in a shadow DOM world but the use case might be there.

@silenceisgolden not necessarily, because you could use the [hopeful] customElements.getName(Constructor) as detailed in https://github.com/w3c/webcomponents/issues/566 to do something like: :theme(${customElements.getName(Ctor)}). I would think this is the most defensive way to code it anyways, as then you have only one place that hinges on the hardcoded name.

@treshugart That would assume styles are aways in an environment where template literals are available, i.e. a .js/.ts file though I believe. I would hope that the first documented use case for styling with :theme would be :theme(fancy-button) and the backup or framework-specific use case to that would be :theme(${customElements.get(Ctor)}).

@silenceisgolden sure, that's my thoughts, too. My use case for dynamic tag names is an app where you have full control of the components you're using. Using shared custom elements should mean that you also have the opportunity to define them with your own name, also having control. This isn't for the component developer's use case. Component developers should never export a pre-defined custom element, or make assumptions about it's own name.

A bit smaller if the tag name is already known.
export function tagRef(html) {
  return (s, ...e) => {
    const tagIndex = (t, i) =>
      // checks for '*<' or '*</' and a valid tagname
      (/[^>]*<\/?$/.test(t) && /[\w-]+/.test(e[i]) && i) || -1;

    const indices = s.map(tagIndex).filter((i) => i !== -1);
    if (indices.length === 0) return html.call(null, s, ...e);

    const isTagIndex = (i) => indices.indexOf(i) !== -1;
    const strings = s.reduce((acc, token, i) =>
      isTagIndex(i-1) ? acc : // if prev was tag skip token, it was joined below
      isTagIndex(i) ? acc.concat([token, s[i+1]].join(e[i])) :
      acc.concat(token)
    , []);

    const exps = e.filter((_, i) => !isTagIndex(i));
    return html.call(null, strings, ...exps);
  };
}

Note that constructs like this disable the ability of lit-html to effectively cache your templates, which means that on every re-render, it will destroy the DOM and rebuild it from template. Dynamic tags are not supported by lit-html for this reason.
Just leaving this warning here since people seem to keep finding this thread. I strongly recommend NOT to do anything like this, unless you have a VERY good reason to do so. Your rendering performance will degrade significantly when you do this.

@ruphin as far as I understand it it all depends on the strings argument of the template function. If this is the same reference (not a newly created array) then lit-html should be able to use its cache.
html.call(null, strings, ...exps)

In the above you'll have to make sure that strings is the same reference on subsequent calls. One easy way to do this is by using a WeakMap and set the key to the original strings array and the value to the newly create strings array and use that as a cache...

Yes, it is possible to a degree, but this requires a specific implementation that none of the above examples include.
It also means that when the dynamic tag changes, the entire template is re-rendered, which is not what developers expect coming from React or similar environments. This is why I think it is a bad idea to promote this pattern in general, because it breaks expectations of what lit-html does.
Experienced developers with very specific use cases may find a purpose for this, but for general public this pattern should not be promoted in any way.

@ruphin I agree that current implementations including mine in carehtml are naive, my bad. But this is not impossible as @luwes pointed out above. I already made a few local tests proving that runtime performance will not decrease significantly when using a cache like explained above (still need to publish an update with tests somewhere), so there will be at least a choice for developers if they want this tradeoff between flexibility and performance.
Also for even better performance it will be possible to transpile code for production to fully remove runtime costs (in a similar fashion to awesome htm by @developit who made use of babel for that here https://github.com/developit/htm/tree/master/packages/babel-plugin-htm). I'm gonna investigate this as well. This will be optional of course.

It also means that when the dynamic tag changes, the entire template is re-rendered, which is not what developers expect coming from React or similar environments.

Can you please elaborate on that?
For the note, in carehtml I was thinking a lot about the need to reuse existing registered names for encountered classes to not double register them and hence change the name. This is possible and is partially implemented there already. Probably still needs a bit of rework, but conceptually I don't see any gotchas to not offer it to general public.

The reason LitHTML is fast is because it uses mostly native capabilities to do rendering, and does not have to build virtual trees. However, there is no Element.changeTag()-like API in the platform. If you want to change a node type, you have to re-render that node and all it's content. Even the most advanced implementation using some form of templateString-caching as suggested by @luwes is indistinguishable performance-wise from switching between different static templates (when the dynamic tag changes).
VirtualDOM lends itself to this type of rendering, and if you wish to use dynamic tags, you will probably get more efficiency out of VirtualDOM rendering techniques.
If you want to get that same level of efficiency with LitHTML, you will have to implement a more complex re-parenting scheme as described higher up in the thread, at which point you are essentially re-implementing functionality from VirtualDOM-like renderers. It is not technically impossible, but implementing something like that is way beyond the capabilities of most users, and far more advanced than the solutions suggested in this thread.
As an aside, the performance cost of naive implementations right now is probably not very high, but this is because of a bug in Safari that causes the object ID of StringsArrays to occasionally change. To solve this we have a fallback key mechanism that checks for string equality, which means that naive implementations get "caching" for free right now (the key comparison/lookup is still strictly slower). Once Safari has been fixed and the workaround is removed from LitHTML, these implementations will suddenly stop working and lose all caching capabilities, which means they will fully re-build the templates and re-render the DOM on every render call, even if the tag stays the same.
Even when some kind of cache is implemented correctly (which is not trivial), changing the value of a tag will still cause all the nodes in the template to re-render, including the static ones, which breaks user expectation. This breaks all templates with input elements in their static content. Right now this is safe because regardless of dynamic values inserted by LitHTML, the static parts of the template are unchanged. If you have a dynamic tag anywhere inside the template, all nodes will be destroyed and recreated when the dynamic tag changes, which destroys all state of the input elements (like the value, or the fact that they may currently be the active/selected element).
These are all implementation details which normal users are not expected to be aware of or understand. This is why I think it is important that average users don't get the idea that using dynamic tags is "fine" or even a consideration. The risk is average users googling how to use dynamic tags, landing on a thread like this with naive implementations that seem to solve their problem, and them using it without understanding the implications. There are other solutions than dynamic tags to solve the problems that users have, and they should look into those instead.

Good points! It should definitely be used with caution and probably good to keep out of lit-html core, though I do still see merit to have these kind of pre-transform utilities.
Also I think most of the people like @bashmish on this thread were not looking for "dynamic" tags that could change in every render (going from a <b> tag to <i> tag and back again), rather a one off pre-compile step in which after the template strings passed to lit are set in stone.
To that point I think people coming from React have the concept of defining an exportable component as a class or function and this is used in the template of another component in another file. You should see it more as a reference or an alias, not a variable that changes at runtime.
Would love to see a pug-lit-html 😄

Very nice explanation of the idea on the conceptual level @luwes 👍
On the implementation level carehtml ignores any other types besides Custom Element classes and just passes them directly to lit-html, while for encountered classes it registers or reuses previously registered tag names, keeping them static. So there is no "dynamic" tag change in the implementation as well, and even more importantly there is no support for a value containing a tag name in a string.
import { html } from 'lit-html';
import takeCareOf from 'carehtml';

// works in carehtml
html`<${MyCustomElement}></${MyCustomElement}>`

// DOES NOT work
html`<${'tag-name'}></${'tag-name'}>`

As an aside, the performance cost of naive implementations right now is probably not very high, but this is because of a bug in Safari that causes the object ID of StringsArrays to occasionally change. To solve this we have a fallback key mechanism that checks for string equality, which means that naive implementations get "caching" for free right now (the key comparison/lookup is still strictly slower).

The cache I'm working on has exactly the same string references as an output, because it implements similar algorithm that lit-html has for Safari internally. Let me finish my work and publish it, then you can judge a non-naive implementation.

Hi, in our team we have solution like carehtml, but  with important additional point: we caching templates by TemplateStringsArray.
https://gist.github.com/AStaroverov/56448f9baa560b4b7489ecf8ca0c36c8

for anyone interested, here's an update to @AStaroverov's gist with better caching, it makes sure that the tag names are also the same.
https://gist.github.com/darionco/823817008596bb7a518821e7b8201478

A bit late to the party... I just released some of my private helpers for working with scoped registries (it has also a version of the gist from @darionco which will define the custom element if it's not already defined or just use the tag under which the element is defined)
furthermore the lib has a custom template factory to deal with scoped custom elements in the lit-html render function (no need to decorate/replace  lits' html) (see README)
https://www.npmjs.com/package/lit-html-scoped-registry-helper


Cannot save CSI data from device log

Hi, i have a problem where i cannot save the CSi raw data using ctrl+t , ctrl+l after command "csi -o". can you give more details step on how to save the data. and from the photo actually i clicked ctrl+T but it says ctrl+J. hope you guys can help me

I usually use the minicom tool for log saving, the commands I use are as follows:
minicom -c on -D /dev/cu.usbserial-1430 -b 921600 -C test.log

Hello, @syahirseth
Closing this issue, feel free to reopen with more updates. Thanks.


[BUG] forecasting in sample and out of sample with prediction intervals in ARIMA/AutoARIMA

Describe the bug

There's a small problem with ARIMA/AutoARIMA when forecasting in sample and out of sample with prediction intervals. In the _pmdarima adapter, when return_pred_int is False, _predict_in_sample returns a pd.Series but when it's True, it returns a tuple (pd.Series, pd.DataFrame) which raises the append error.

To Reproduce

from sktime.forecasting.arima import ARIMA
import pandas as pd
import numpy as np

y_train = pd.Series(np.arange(1,21), index=pd.date_range(start='1/1/2021', end='20/1/2021'))

arima_forecaster = ARIMA(order=(1, 1, 1), suppress_warnings=True)
arima_forecaster.fit(y_train)
arima_forecaster.predict(np.array([-18, -14, -10, 5]), return_pred_int=True)

Expected behavior

To return predictions with prediction intervals

Additional context

Traceback :
AttributeError                            Traceback (most recent call last)
<ipython-input-10-d49673c473fc> in <module>()
----> 1 arima_forecaster.predict(np.array([-18, -14, -10, 5]), return_pred_int=True)

1 frames
/usr/local/lib/python3.7/dist-packages/sktime/forecasting/base/_base.py in predict(self, fh, X, return_pred_int, alpha)
    240             X=X_inner,
    241             return_pred_int=return_pred_int,
--> 242             alpha=alpha,
    243         )
    244

/usr/local/lib/python3.7/dist-packages/sktime/forecasting/base/adapters/_pmdarima.py in _predict(self, fh, X, return_pred_int, alpha)
     69             y_ins = self._predict_in_sample(fh_ins, **kwargs)
     70             y_oos = self._predict_fixed_cutoff(fh_oos, **kwargs)
---> 71             return y_ins.append(y_oos)
     72
     73     def _predict_in_sample(

AttributeError: 'tuple' object has no attribute 'append'

Versions

I've run this one on a clean colab notebook after a !pip install sktime[all_extras]

Thanks for raising the issue @IlyasMoutawwakil - we're currently working on refactoring the interface for probabilistic forecasting interval x(see #1421). Help would be much appreciated for fixing the individual forecasters once #1421 is merged.

fixed by #1442.


Add License

Awesome content and love your videos. Could you add a license to this project?

Done :)


Launch Party - Resolve Gelato to Arrakis renaming

As mentioned by Alex, Gelato was renamed to Arrakis https://www.arrakis.finance/, so we need to update the links; and the links to the pool specifically, otherwise people won't be able to buy LP tokens.

Update links
Make sure pools are accessible

https://github.com/ubiquity/ubiquity-dollar-development/issues/177 would make this issue obsolete

Alright closing this one since we're gonna do #177


Crash on creating request in non-existent directory

If I try to create a new request and, in the directory field, put something different than . and this directory does not exist I get a huge stacktrace but it sums up to this error:

Can you share what directory you put?
I think this is fixed in the upcoming release, but would appreciate if you can share the exact thing you wrote in the field.

Seems to be fixed on the new version, 1.11.0. Feel free to re-open if you're still having issues!


User create page has Error notification on bottom

Notification Red Box still appears, even if no error.
Reproduction

Go to user create page

Fixed


Python not being identified.

Hi Folks,
I was looking to attempt to start using your plugin but I keep getting the error:
"Error executing the code, please make sure you have Python3 (3.6 or higher) with the relevant packages (diagrams) and Graphviz installed. You may refer to the Requirements section for more information."
I have Python 3.6 installed on my laptop and VS code has Graphviz / Diagrams Interpreter and Python plugins.
Python plugin has path the Python installed listed in the "Python: Default Interpreter Path".  Diagrams plugin has the setting "Python Command: VS Code Python Interpreter".
Not sure what is going wrong here, any help would be appreciated.
Regards,
Ed.

I have a similar problem, but in my case I have Python and everything installed locally in a virtualenv. VS Code detects this and uses the right Python interpreter, with all the installed packages, but this plugin does not understand this for some reason.

From what I could understand from the source code, the extension parses the original diagram python file, tries to change the parameters of with Diagram(...) to include filename="previewDiagram", show=False and creates a new python file inside its docs directory.
In my case, this parse did not work, so the final python file has syntax errors. Since the error message is the same for any error during execution, this was masked by the error message you mentioned in the original post.
I'm using for now a simplified version of the plugin, in which I ignore this parse part and only copy the original file to the targetSrcFile. I made sure I put the right parameters in the original python file, so as to the plugin code to work.
I will take a look if I can help making the parser a little bit more robust than it is now, and I'll send a PR if I'm successful...

Hey nogara,
I dug a bit deeper on this and I believe it may be tied to the version of Python - 3.6.  The original error called for that as a minimum so I had that installed (Work laptop).
THe Python debugger plugin only works with vesion 3.7 or greater.  I am waiting for a 3.11 install and will test again.
I would be interested to know where the only Diagrams Previewer setting and value for windows of: VS Code Python Interpreter pulls the Python version for it - The Python plugin or the debugger.  If it is the debugger, the version I am using may be the issue.


Code simplified

why  "Your tests failed on CircleCI" ->
#!/bin/bash -eo pipefail
scripts/ftl_setup.sh
GCLOUD_SERVICE_KEY env variable is empty. Exiting.
Exited with code 1

This change is only one line simplify. 😢

@XinyueZ we just turned the feature for building forked PRs and are tweaking the settings.  Apologies for the false test failure.

Hi @XinyueZ can you pull in the latest code? There are some CI changes that should fix forked CI builds.  Thank you!

I abolish this PR for some problems of the relocation of my working computer, something goes wrong.


AMCFOC – Study how to make the AMCBLDC/Supervisor general enough to cope with 2 motors

This activity will be mainly performed by Team FIVE but @mfussi66 will be contributing as well.
@mfussi66 will be the main developer.

Completed 🎉


Added the PrintReverseOfAStringByRecursion.java class

Why:

Closes #561
What's being changed:
Added the PrintReverseOfAStringByRecursion.java class which includes a method that returns the reverse of the string passed into it using recursion.

I accidentally requested review from you @anandfresh only and removed the review request from the others. How can I fix it.


Including jq as a default systemPackages

I am not sure it is a good idea as it might increase the size of the box.
Anyhow while working on distributing a devbox, I have had to fight with regex quite a bit to achieve what I wanted without jq:
https://github.com/CIRB/devbox/commit/82f851e37a25832b5176bf0f1befbc2e80fed27c
What do you think ?
Of course I can always build a custom box with packer ( I have been trying to avoid that until now). So really not a big deal either way.

Sure I don't mind adding it. One issue that you might encounter would be that because the installation replaces the current system, the new configuration.nix must make sure to also include jq. Alternatively you could fetch and parse the version using ruby and inject that somehow into the install script.

I am OK with that. I will PR the change.
What I do in my shell package provisioner (vagrantFile) is to replace configuration.nix so it is clear that the old one has no impact after the 'bootstrap phase'.
It looks cleaner to me : I have one configuration.nix that represent the state of the devbox I want. The only file that is not replaced is hardware-configuration.nix

Thanks!


Fix delay option in browser

This PR addresses #1799. It feels a bit weird to special-case the delay option like this, but it looks like that's the only option that's read from mocha.options prior to mocha.run() being called.
Totally open to better suggestions though.

Thanks for the PR, and appreciate the specs! :) While it might be odd to have a special case, it's pretty understandable that some order could be implied in these invocations. That for loop just seems like a convenient and terse shortcut.

Cool. Made those changes. Do the browser tests get run as part of npm test? It doesn't seem like it, but I might be missing something. I tried just opening the delay.html file in a browser though and the tests pass.

Not right now. I've got a local branch I started that will run them with phantomjs, so what you have is perfect!

@jRiest is it possible that the test file broke after the change? I'm getting
passes: 0failures: 0duration: 0s

Hmm, that's strange. It seems to still be working for me when I just open up delay.html in my browser. I did have to run make all in order to re-build the mocha.js in the root of the repo, since it looks like all of the web tests use that file.
I assumed I wasn't supposed to commit updates to the built file, is that correct?

Although I guess your comment raises a concern that if the delay functionality did break, the tests may just never be run and we may never know it broke.
I suppose if I move the "should have waited..." test outside of the setTimeout that would catch that error. I'll update the PR.

I assumed I wasn't supposed to commit updates to the built file, is that correct?

That's right. My mistake - I must have checked out HEAD after rebuilding mocha.js without paying attention.

I suppose if I move the "should have waited..." test outside of the setTimeout that would catch that error. I'll update the PR.

That would be perfect :) It would be great if the test failed when the delay didn't correctly run,

@jRiest what's the status of updating this PR? We also need this fix. I can look into it too, if needed.

Sorry for dropping this. We ended up not needing it so it slipped my mind. Just pushed a change that should make the tests fail without this fix.
It's a little strange since the original issue was that the run function to start the tests wasn't defined so the tests didn't run at all if the delay option was enabled. In order to make sure the tests ran and failed appropriately without this fix, I just manually invoke mocha.suite.run() if the run function isn't defined. Totally open to suggestions if there's a better option though.

@danielstjules, is this mergeable now?

This is a valid issue. @natlibfi-arlehiko, @jRiest - closing this for now due to age, added pr-please to #1799 so this can be updated.

@hollomancer I think this PR has addressed all of the comments. Is there something else that needs to be done before it can be merged?

@jRiest Thanks.  It wasn't your fault this was closed; sorry about that.
I have some comments if you are willing to work on this further:

Mocha.prototype.delay() accepts no parameters; if it is called, the option is enabled, so,
calling mocha.setup({delay: false}) here would actually enable the delay
test/browser/** is not run by CI--it's unclear if we can even do that--but tests in this directory are of marginal value as they stand.

A good test for this would actually run Mocha (via karma-mocha) with a delay option, which would then attempt to execute a test. The test run should fail if a test was not executed.  You'd want to add probably a new target in the Makefile which would run Karma with an environment variable present; then karma.conf.js would need to pick this up, set the appropriate option(s) and execute (only) the test file.
So I think, perhaps, if you're unable or unwilling to embark on that, then modifying the code in browser-entry.js to assert truthiness of the delay option would be good enough to merge, as this is a low-risk change.

test/browser/** is not run by CI--it's unclear if we can even do that--but tests in this directory are of marginal value as they stand.

Tests in test/browser-unit/ should be run once #2900 is merged, but in the case of using specific mocha.setup options I'm not sure that will cut it -- I'm pretty sure we would need to come up with a way to run browser integration tests (i.e. do the mocha.setup and mocha.run type stuff, run each file in a separate instance of Karma if using Karma for them)...


Feature - Serve json response in http

Please check if the PR fulfills these requirements

[ ] Tests for the changes have been added (for bug fixes / features)
Not yet

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature to serve json over HTTP.

What is the current behavior? (You can also link to an open issue here)
Serve's text over HTTP

What is the new behavior (if this is a feature change)?
Server's json over HTTP. Utilize this HTTP endpoint to do cron jobs https://github.com/ossf/scorecard/blob/main/cron/projects.txt which would easier to scale.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
None

Other information:

Tests with httpie
http --json  http://localhost:8080\?repo\=github.com/ossf/scorecard

{
    "Checks": [
        {
            "CheckName": "SAST",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        },
        {
            "CheckName": "Fuzzing",
            "Confidence": 10,
            "Details": null,
            "Pass": false
        },
        {
            "CheckName": "CII-Best-Practices",
            "Confidence": 10,
            "Details": null,
            "Pass": false
        },
        {
            "CheckName": "Security-Policy",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        },
        {
            "CheckName": "Signed-Releases",
            "Confidence": 10,
            "Details": null,
            "Pass": false
        },
        {
            "CheckName": "Frozen-Deps",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        },
        {
            "CheckName": "Signed-Tags",
            "Confidence": 10,
            "Details": null,
            "Pass": false
        },
        {
            "CheckName": "Packaging",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        },
        {
            "CheckName": "Branch-Protection",
            "Confidence": 0,
            "Details": null,
            "Pass": false
        },
        {
            "CheckName": "Contributors",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        },
        {
            "CheckName": "CI-Tests",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        },
        {
            "CheckName": "Code-Review",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        },
        {
            "CheckName": "Active",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        },
        {
            "CheckName": "Pull-Requests",
            "Confidence": 10,
            "Details": null,
            "Pass": true
        }
    ],
    "Date": "2021-02-14",
    "Repo": "github.com/ossf/scorecard"
}

ah, i should have seen this auto-merge. @naveensrinivasan fyi on these review changes, can do in any other cl.

ah, i should have seen this auto-merge. @naveensrinivasan fyi on these review changes, can do in any other cl.

No more auto-merge, I think that would solve the problem. Also, if you are looking for a change, then request for a change, will prevent auto merging

ah, i should have seen this auto-merge. @naveensrinivasan fyi on these review changes, can do in any other cl.

No more auto-merge, I think that would solve the problem. Also, if you are looking for a change, then request for a change, will prevent auto merging

Sounds good, lets just remove auto-merge. for small things, i dont like request changes, since it save me a a review iteration :)

ah, i should have seen this auto-merge. @naveensrinivasan fyi on these review changes, can do in any other cl.

No more auto-merge, I think that would solve the problem. Also, if you are looking for a change, then request for a change, will prevent auto merging

Sounds good, lets just remove auto-merge. for small things, i dont like request changes, since it save me a a review iteration :)

Agreed! Thanks


Swate "Pick directories" not funktional

Contact Details
frsommer
What happened?
Tried to pick directories in Swate/ARCitect
Button does not work, no reaction.
The file picker works...

What did you expect?
select directory and insert path
Host
Applies to All
Host Details
Arcitect 0,41
swate 1000 8beta
Win10
Swate version
1.0.0.beta.08

just two more comments:

does not work when using the file picker from the ArCitect menu as well.
maybe rephrase "...insert their names into Excel" Excel to SWATE?

Can replicate this using Swate Release Version v1.0.0-beta.11 while running the ARCitect

@ZimmerD @frsommer
Hey sorry for the late investigation. This was actually an ARCitect issue, will fix it there 👍

Fixed and done!


possibility to undo setOnNdefDiscoveredListener

after you add a listener with setOnNdefDiscoveredListener you can't remove it.
it would be a nice implementation.
if I'm not wrong, an android you have only to set onNdefDiscoveredListener = null;
and on iOS to call invalidate() on that session

Doesn't setOnNdefDiscoveredListener(null) removes the listener?

sure, my fault... did not seen


Examples in documents must be complete

Currently, examples in documents lack details to compile and execute. The examples must be complete as a whole so that users can simply copy and paste the code without running into problems

I tried generating an examples page under the Files tab, but Doxygen generates broken hyperlinks.  See #70


token 2022: upgrade sdk to 1.17.13

Due to a breaking change, confidential transfers are currently broken and require a newer SDK.
Details: https://github.com/solana-labs/solana-program-library/issues/6146

Thanks for your contribution!


Update Rubies

https://github.com/rspec/rspec-support/pull/406
https://github.com/rspec/rspec-mocks/pull/1323
https://github.com/rspec/rspec-expectations/pull/1175
https://github.com/rspec/rspec-core/pull/2714

http://rubies.travis-ci.org/ubuntu/14.04/x86_64/ruby-2.4.10 is not yet in place, let's wait for a few more days.

Thanks. Feel free to use the updated rake command when pushing this to other repos.

Feel free to use the updated rake command when pushing this to other repos.

Will do. I couldn't quickly figure out how to do that though 😆

Filed https://github.com/travis-ci/travis-rubies/issues/73


Gmail - Supporting Rich Text in Message body

This enhances the gmail connector to support HTML content in message body. The sendMail, createDraft and updateDraft methods have been enhanced with this support. The change requires the format to be passed into the connector action where
it is defaulted to text/plain. To switch on to rich text, 'html' must be set as the format parameter. The code explicitly checks for 'html' and adds the 'Content-Type: text/html' header to the email message. The resultant message body will be encoded using Base64 Alphabet safe for URLs and filenames (https://tools.ietf.org/html/rfc4648#page-7).
The Readme.md and samples have been updated according to the changes to the Connector action and additional tests have been added to GmailConnector_test.bal

@viduras This repository is no longer used, so if this PR is required, please send a new PR to relevant repository in https://github.com/wso2-ballerina organization and close this PR

Isn't this PR now out of date?

This PR is outdated. I'll close the PR.


router not work as expected

I add some test code in the test file  https://github.com/beego/mux/blob/master/mux_test.go#L21
t.Run("router with wildcard pattern2", func(t *testing.T) {
	assert := assert.New(t)

	mux := New()

	mux.Get("/a/:a/b", func(w http.ResponseWriter, r *http.Request) {
		params := Params(r)
		w.WriteHeader(200)
		w.Write([]byte(params[":a"]))
	})
	mux.Get("/a/:a/b/:b", func(w http.ResponseWriter, r *http.Request) {
		params := Params(r)
		w.WriteHeader(200)
		w.Write([]byte(params[":a"]))
	})
	mux.Get("/a/:a/b/:b/c", func(w http.ResponseWriter, r *http.Request) {
		params := Params(r)
		w.WriteHeader(200)
		w.Write([]byte(params[":a"]))
	})

	ts := httptest.NewServer(mux)
	defer ts.Close()

	res, err := Request("GET", ts.URL+"/a/a1/b/b1/c", nil)
	assert.Nil(err)
	assert.Equal(200, res.StatusCode)
	body, _ := ioutil.ReadAll(res.Body)
	assert.Equal("a1", string(body))
	res.Body.Close()
})

1 .It didn't pass the test,   "/a/a1/b/b1/c"  not match pattern "/a/:a/b/:b/c"
2. I change the route order,  let pattern "/a/:a/b/:b/c" to be first defined router, and it matches, but
"/a/a1/b/b1"  not match pattern "/a/:a/b/:b"
It just passes ok in  httprouter , is that a bug of mux?

my code is update to the latest, this bug has been fixed

@sundy-li thanks for the update


CODEGEN_SCHEMA_NO_NAMESPACES is not working

Reproduction
On Windows and using GraphLOC as an example, if I ran cross-env CODEGEN_SCHEMA_NO_NAMESPACES=true CODEGEN_PRINT_TIME=true gql-gen --schema https://api.graphloc.com/graphql --template typescript --out ./typings/types.ts, not only the time is printed, but the namespace is still generated.

@ardatan can you please take a look? I think it's related to your work there

Maybe, it is related how env variables works on Windows. Could you try to set env variables in Windows way ( using set )?
AFAIK, Windows doesn't allow defining env variables like you do, so it'd better to use gql-gen.json instead of using env variables.

@stevefan1999-personal I've had the same problem on OSX either via cross-env or setenv or export.
I finally got it working with the file gql-gen.json in root :
{
  "generatorConfig": {
    "noNamespaces": true
  }
}

I think the name of env variable is wrong in the documentation. It's supposed to be CODEGEN_NO_NAMESPACES.


[f5bigip] - Bugfix: Remove requests dependency

Please ensure your pull request (PR) adheres to the following guidelines:

Please refer to our contributing documentation for any questions on submitting a pull request, link: Contribution Guide

Pull Request Checklist
Please check if your PR fulfills the following requirements:

[x] Testing of all the changes has been performed (for bug fixes / features)
[x] The manual_readme_content.md has been reviewed and added / updated if needed (for bug fixes / features)
[x] Use the following format for the PR description: <App Name>: <PR Type> - <PR Description>
[x] Provide release notes as part of the PR submission which describe high level points about the changes for the upcoming GA release.
[x] Verify all checks are passing.
[x] Do NOT use the next branch of the forked repo. Create separate feature branch for raising the PR.
[x] Do NOT submit updates to dependencies unless it fixes an issue.

Pull Request Type
Please check the type of change your PR introduces:

[ ] New App
[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, renaming)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation
[ ] Other (please describe):

Security Considerations (REQUIRED)

[x] If you are exposing any endpoints using a REST handler,
please document them in the manual_readme_content.md.

N/A

[x] If this is a new connector or you are adding new actions

N/A

[x] Are you introducing any new cryptography modules? If yes, please elaborate their purpose:

N/A

[x] Are you are accessing the file system? If yes, please verify that you are only accessing paths returned through
the Vault API.

N/A

[x] Are you are marking code to be ignored by Semgrep with nosemgrep?

N/A

Release Notes (REQUIRED)

Remove the requests dependency, instead using the one built into the SOAR platform

Thanks for contributing!

Whoops!! Will fix when I’m back on Tuesday.
Scott Odle
he/him/his what's this?
https://hrc-prod-requests.s3-us-west-2.amazonaws.com/files/assets/resources/TalkingAboutPronouns_onesheet_FINAL.pdf?mtime=20200713142932&focal=none
Senior Site Reliability Engineer | Platform Observability
Splunk Inc.
+1<PHONE_NUMBER>  |  @.***
Boulder | AMER | EMEA | APAC
[image: Splunk: Resilience. Let's build it together.]
https://www.splunk.com/
This message is intended only for the personal, confidential, and
authorized use of the recipient(s) named above. If you are not that person,
you are not authorized to review, use, copy, forward, distribute or
otherwise disclose the information contained in the message.
On Thu, Mar 28, 2024 at 17:32 alexa-phantom @.***>
wrote:

[ External sender. Exercise caution. ]
@.**** commented on this pull request.
In release_notes/unreleased.md
https://github.com/splunk-soar-connectors/f5bigipltm/pull/9#discussion_r1543841252
:

@@ -1 +1,2 @@
Unreleased
+* Remove requests dependency and use the one built into the platform instead

Ticket number?
—
Reply to this email directly, view it on GitHub
https://github.com/splunk-soar-connectors/f5bigipltm/pull/9#pullrequestreview-1967537742,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BABUYCZUIOTG54SPTHGA773Y2SSBBAVCNFSM6AAAAABFHMDNYWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSNRXGUZTONZUGI
.
You are receiving this because you authored the thread.Message ID:
@.***>