Does Spring Cloud Kubernetes support to disable label filter?

We have A service which has 2 instances:

A1，its labels has version:1.0
A2，its labels has version:2.0

We also have B service has 1 instance with no version label
Now we want to execute KubernetesDiscoveryClient.getServices and getInstances("A") in B instance.
Hope to  retrieve getServices result with [A, B]，retrieve   getInstances("A") with 2 A instances
That means how to disable label filter whatever we add version label. Maybe the answer is "Remove that label", that does not  do any help for us.
Thanks for a lot!

I am not sure based on the information above why the discovery client would be filtering the services.  Maybe you could provide a concrete example?

I am not sure based on the information above why the discovery client would be filtering the services.  Maybe you could provide a concrete example?

Thanks for your response. I will provide an example.
Now here is Another question:
In https://github.com/spring-cloud/spring-cloud-kubernetes/blob/c0e154fb83/spring-cloud-kubernetes-fabric8-discovery/src/main/java/org/springframework/cloud/kubernetes/fabric8/discovery/KubernetesDiscoveryClient.java, in the following method, there is a logic with "withLabels", in my understanding, getInstances(serviceId) will compare local service labels with remote services labels, if they are NOT matched, remote services will be filtered by labels. And if i remove all additional labels, getInstances works fine. If wrong, please correct me.
public List getEndPointsList(String serviceId) {
return this.properties.isAllNamespaces()
? this.client.endpoints().inAnyNamespace().withField("metadata.name", serviceId)
.withLabels(properties.getServiceLabels()).list().getItems()
: this.client.endpoints().withField("metadata.name", serviceId)
.withLabels(properties.getServiceLabels()).list().getItems();
}

Thanks for your response. I will provide an example.
Now here is Another question:
In https://github.com/spring-cloud/spring-cloud-kubernetes/blob/c0e154fb83/spring-cloud-kubernetes-fabric8-discovery/src/main/java/org/springframework/cloud/kubernetes/fabric8/discovery/KubernetesDiscoveryClient.java, in the following method, there is a logic with "withLabels", in my understanding, getInstances(serviceId) will compare local service labels with remote services labels, if they are NOT matched, remote services will be filtered by labels. And if i remove all additional labels, getInstances works fine. If wrong, please correct me.
public List getEndPointsList(String serviceId) {
return this.properties.isAllNamespaces()
? this.client.endpoints().inAnyNamespace().withField("metadata.name", serviceId)
.withLabels(properties.getServiceLabels()).list().getItems()
: this.client.endpoints().withField("metadata.name", serviceId)
.withLabels(properties.getServiceLabels()).list().getItems();
}

Another question, why return null with getMetadata in k8s Registration?

Another question, why return null with getMetadata in k8s Registration?

Refer to the example
https://github.com/CosmosNi/spring-cloud-kubernetes-demo

Refer to the example
https://github.com/CosmosNi/spring-cloud-kubernetes-demo

Right now the DiscoveryClient only returns metadata for the service and not the pod.  If you could get the metadata for the pods, what would you use it for?

Right now the DiscoveryClient only returns metadata for the service and not the pod.  If you could get the metadata for the pods, what would you use it for?

Yes you either need to set spring.cloud.kubernetes.discovery.labels or remove them from your service yaml.

Another question, why return null with getMetadata in k8s Registration?

Can you point me where you see this?

Yes you either need to set spring.cloud.kubernetes.discovery.labels or remove them from your service yaml.

Another question, why return null with getMetadata in k8s Registration?

Can you point me where you see this?

https://github.com/spring-cloud/spring-cloud-kubernetes/blob/c0e154fb83cfec663e73c95dd3dbdd476bb4174a/spring-cloud-kubernetes-fabric8-discovery/src/main/java/org/springframework/cloud/kubernetes/fabric8/registry/KubernetesRegistration.java
@Override
public Map<String, String> getMetadata() {
	return null;
}

https://github.com/spring-cloud/spring-cloud-kubernetes/blob/c0e154fb83cfec663e73c95dd3dbdd476bb4174a/spring-cloud-kubernetes-fabric8-discovery/src/main/java/org/springframework/cloud/kubernetes/fabric8/registry/KubernetesRegistration.java
@Override
public Map<String, String> getMetadata() {
	return null;
}

The only place that class is used is in this class
https://github.com/spring-cloud/spring-cloud-kubernetes/blob/c0e154fb83cfec663e73c95dd3dbdd476bb4174a/spring-cloud-kubernetes-fabric8-discovery/src/main/java/org/springframework/cloud/kubernetes/fabric8/registry/KubernetesAutoServiceRegistration.java
But that class has been deprecated and not used anywhere

The only place that class is used is in this class
https://github.com/spring-cloud/spring-cloud-kubernetes/blob/c0e154fb83cfec663e73c95dd3dbdd476bb4174a/spring-cloud-kubernetes-fabric8-discovery/src/main/java/org/springframework/cloud/kubernetes/fabric8/registry/KubernetesAutoServiceRegistration.java
But that class has been deprecated and not used anywhere

Thanks for your answer. Another 2 question:

which one should I select? spring.cloud.kubernetes.discovery.labels or spring.cloud.kubernetes.discovery.serviceLabels?

those configs are set to Spring Boot application.properties or yml? It means they are INSTANCE Label(MetaData), not related with k8s pod . Everyone Instance has its own metadata? Am I right?

Thanks for your answer. Another 2 question:

which one should I select? spring.cloud.kubernetes.discovery.labels or spring.cloud.kubernetes.discovery.serviceLabels?

those configs are set to Spring Boot application.properties or yml? It means they are INSTANCE Label(MetaData), not related with k8s pod . Everyone Instance has its own metadata? Am I right?

Sorry i meant spring.cloud.kubernetes.discovery.serviceLabels
yes in application configuration properties or environment variables or configmaps etc.  These are labels from the metadata of the service not the pod

Sorry i meant spring.cloud.kubernetes.discovery.serviceLabels
yes in application configuration properties or environment variables or configmaps etc.  These are labels from the metadata of the service not the pod

If i set spring.cloud.kubernetes.discovery.serviceLabels.abc=1, it can not be found via the method of  getInstances of KubernetesDiscoveryClient, you can refer to my example. In Spring Cloud i set
spring.cloud.consul.discovery.metadata.abc=1
It can be got via ConsulDiscoveryClient getInstances.
Is it different with Spring Cloud Kubernetes and Spring Cloud Consul or Eureka?

If i set spring.cloud.kubernetes.discovery.serviceLabels.abc=1, it can not be found via the method of  getInstances of KubernetesDiscoveryClient, you can refer to my example. In Spring Cloud i set
spring.cloud.consul.discovery.metadata.abc=1
It can be got via ConsulDiscoveryClient getInstances.
Is it different with Spring Cloud Kubernetes and Spring Cloud Consul or Eureka?

In consul and eureka, those values get set in the registry, kubernetes is service discovery only since "registration" is part of the platform.

In consul and eureka, those values get set in the registry, kubernetes is service discovery only since "registration" is part of the platform.

Thanks very much

Thanks very much

My personal opinion
Spring Cloud Kubernetes can keep the same behavior with Consul, Eureka, Nacos. Users use spring.cloud.kubernetes.discovery.metadata(NOT labels) to Etcd, they can resolve their features via Spring Cloud, and no need to know more too much k8s technology, some people which use consul, euraka have no more difficult to switch to Spring Cloud Kubernetes and use MetaData they define to do gray or blue green relalease as hope

My personal opinion
Spring Cloud Kubernetes can keep the same behavior with Consul, Eureka, Nacos. Users use spring.cloud.kubernetes.discovery.metadata(NOT labels) to Etcd, they can resolve their features via Spring Cloud, and no need to know more too much k8s technology, some people which use consul, euraka have no more difficult to switch to Spring Cloud Kubernetes and use MetaData they define to do gray or blue green relalease as hope

The problem is those values need to be in your deployment yaml, that is what is informing the registry.  Unless Spring Cloud Kubernetes modified things on startup, which is not something I think we should do, there is no working around this.

The problem is those values need to be in your deployment yaml, that is what is informing the registry.  Unless Spring Cloud Kubernetes modified things on startup, which is not something I think we should do, there is no working around this.

But why not keep Spring Cloud MetaData and Kubernetes Labels with two different things?That means:

Service instances can be filtered by Kubernetes Labels in deployment yaml, that is Kubernetes platform function. ServiceInstance class can expose getLabels
Service instances can be filtered by Spring Cloud MetaData in application.properties, that is Spring Cloud native SDK function. ServiceInstance class can expose getMetaData

People who use Consul or Eureka would like to do their business logic via java coding and NOT CARE ABOUT Kubernetes Technology. For example I want to resolve somethings in Spring Cloud layer rather than in Kubernetes layer, the code in Spring Cloud Consul can be re-used in Spring Cloud Kubernetes, NOT write it again. Just write once, run anywhere

But why not keep Spring Cloud MetaData and Kubernetes Labels with two different things?That means:

Service instances can be filtered by Kubernetes Labels in deployment yaml, that is Kubernetes platform function. ServiceInstance class can expose getLabels
Service instances can be filtered by Spring Cloud MetaData in application.properties, that is Spring Cloud native SDK function. ServiceInstance class can expose getMetaData

People who use Consul or Eureka would like to do their business logic via java coding and NOT CARE ABOUT Kubernetes Technology. For example I want to resolve somethings in Spring Cloud layer rather than in Kubernetes layer, the code in Spring Cloud Consul can be re-used in Spring Cloud Kubernetes, NOT write it again. Just write once, run anywhere

ServiceInstance is a common interface, what would getLabels mean in the context of other service regustries?  Labels are very much a Kubernetes concept.
Additionally now you are mixing concepts.  spring.cloud.kubernetes.discovery.metadata is used to add metadata to the registry when the service is registered.  But in the context of Spring Cloud Kubernetes is means something different?  It is something used to filter ServiceInstances?  It doesn't make sense to me.

ServiceInstance is a common interface, what would getLabels mean in the context of other service regustries?  Labels are very much a Kubernetes concept.
Additionally now you are mixing concepts.  spring.cloud.kubernetes.discovery.metadata is used to add metadata to the registry when the service is registered.  But in the context of Spring Cloud Kubernetes is means something different?  It is something used to filter ServiceInstances?  It doesn't make sense to me.

This filtering occurs ever if you don't set spring.cloud.kubernetes.discovery.serviceLabels?

This filtering occurs ever if you don't set spring.cloud.kubernetes.discovery.serviceLabels?

I means whatever servicelabels are set or not, I want to have a config to enable/disable filtering. Let customers to determine filter work or not, just like spring.cloud.kubernetes.discovery.filter.enabled=false

I means whatever servicelabels are set or not, I want to have a config to enable/disable filtering. Let customers to determine filter work or not, just like spring.cloud.kubernetes.discovery.filter.enabled=false

Doesn't leaving spring.cloud.kubernetes.discovery.serviceLabels blank do that already?

Doesn't leaving spring.cloud.kubernetes.discovery.serviceLabels blank do that already?

Removal labes can fine, but customers want to use labels to do another, for examle they want to add
label.version, label.email, label.telephone etc to store customization information to etcd. Those can help them to query service instances with customization via Etcd Open API. Dose it make sense?

Removal labes can fine, but customers want to use labels to do another, for examle they want to add
label.version, label.email, label.telephone etc to store customization information to etcd. Those can help them to query service instances with customization via Etcd Open API. Dose it make sense?

At least we do that in Consul server. If this requirement impacts Spring Cloud Kubernetes, I think let us stop the discussion. I have a lot of thanks for you all

At least we do that in Consul server. If this requirement impacts Spring Cloud Kubernetes, I think let us stop the discussion. I have a lot of thanks for you all

I didn't say don't set labels, I said don't set spring.cloud.kubernetes.discovery.serviceLabels  which would filter on labels.

I didn't say don't set labels, I said don't set spring.cloud.kubernetes.discovery.serviceLabels  which would filter on labels.

I didn't say don't set labels, I said don't set spring.cloud.kubernetes.discovery.serviceLabels which would filter on labels.

Yes this is what I am saying as well.

I didn't say don't set labels, I said don't set spring.cloud.kubernetes.discovery.serviceLabels which would filter on labels.

Yes this is what I am saying as well.

Sorry, maybe I have not discribed this issue so clearly. The correct labels i say should be "instanceLabels", not "serviceLabels", that means service instances can be filtered with instances level, for example, A Service discovery B service, A has 1 instance with instance label for version=2.0, B has 3 instances with Instance label version=1.0, 2.0, 3.0. So the logic will be A only can discovery B Instance with version=2.0(because A Instance version also is 2.0), B 1.0 and 3.0 will be filtered.
So the requirement is

i want to get instance labels in ServiceInstance
i want to filter instances in Spring Cloud Kubernetes LoadBalance by Instance lables

I think the behavior will be same with Consul or Eureka mode

Sorry, maybe I have not discribed this issue so clearly. The correct labels i say should be "instanceLabels", not "serviceLabels", that means service instances can be filtered with instances level, for example, A Service discovery B service, A has 1 instance with instance label for version=2.0, B has 3 instances with Instance label version=1.0, 2.0, 3.0. So the logic will be A only can discovery B Instance with version=2.0(because A Instance version also is 2.0), B 1.0 and 3.0 will be filtered.
So the requirement is

i want to get instance labels in ServiceInstance
i want to filter instances in Spring Cloud Kubernetes LoadBalance by Instance lables

I think the behavior will be same with Consul or Eureka mode

So that is how to get Instance MetaData(labes) or how to get pod MetaData(labels)?

So that is how to get Instance MetaData(labes) or how to get pod MetaData(labels)?

The Kubernetes DiscoveryClient implementation uses metadata from the Kubernetes service, not the individual pods.  The logic is that you will not be sending requests directly to the pods but instead through the Kubernetes service.  So there is no way to get the DiscoveryClient to retreive the pod metadata.
There was a similar question here https://github.com/spring-cloud/spring-cloud-kubernetes/issues/719
I don't understand how you would then use the pod metadata to tell the Kubernetes service to target certain instances.

The Kubernetes DiscoveryClient implementation uses metadata from the Kubernetes service, not the individual pods.  The logic is that you will not be sending requests directly to the pods but instead through the Kubernetes service.  So there is no way to get the DiscoveryClient to retreive the pod metadata.
There was a similar question here https://github.com/spring-cloud/spring-cloud-kubernetes/issues/719
I don't understand how you would then use the pod metadata to tell the Kubernetes service to target certain instances.

for example, A Service discovery B service, A has 1 instance with instance label for version=2.0, B has 3 instances with Instance label version=1.0, 2.0, 3.0. So the logic will be A only can discovery B Instance with version=2.0(because A Instance version also is 2.0), B 1.0 and 3.0 will be filtered
How to support this feature in Spring Cloud Kubernetes, It is easy to support in Consul. Please tell me

for example, A Service discovery B service, A has 1 instance with instance label for version=2.0, B has 3 instances with Instance label version=1.0, 2.0, 3.0. So the logic will be A only can discovery B Instance with version=2.0(because A Instance version also is 2.0), B 1.0 and 3.0 will be filtered
How to support this feature in Spring Cloud Kubernetes, It is easy to support in Consul. Please tell me

I understand what you are trying to do....
Say it is possible to do and you are able to get the metadata from the pods....how then do you make a request from service A to service B when the request needs to go through the kubernetes service for B?

I understand what you are trying to do....
Say it is possible to do and you are able to get the metadata from the pods....how then do you make a request from service A to service B when the request needs to go through the kubernetes service for B?

Sorry, i dont understand your question. But let me guess it. My answer will be:
When A and B deploy into Kubernetes, A invokes B through Feign or RestTemplate, before the invoking, A should do the Kubernetes Loadbalancer to filter the   B instances by "instance label". So I think it has two things

instance label or metadata must should be store into Etcd server, they are template.metadata.label in yaml?
serviceInstance class should provide get instance labels by method "getMetadata()", that will be same with all other Spring Cloud Discovery Middlewares(consul,euraka, zookeeper, nacos). That means getMetadata should be return Instance MetaData(not service MetaData).

I think Spring Cloud Kubernetes must follow all Spring Cloud Common RULE, so people are easy to accept Spring Cloud Kubernetes when they transfer from Spring Cloud Consul, Spring Cloud Eureka...
Spring Cloud Kubernetes is just an implementation of Spring Cloud Common, people are easy to learn Kubernetes via Spring Cloud Kubernetes and no need to know more Kubernetes technology

Sorry, i dont understand your question. But let me guess it. My answer will be:
When A and B deploy into Kubernetes, A invokes B through Feign or RestTemplate, before the invoking, A should do the Kubernetes Loadbalancer to filter the   B instances by "instance label". So I think it has two things

instance label or metadata must should be store into Etcd server, they are template.metadata.label in yaml?
serviceInstance class should provide get instance labels by method "getMetadata()", that will be same with all other Spring Cloud Discovery Middlewares(consul,euraka, zookeeper, nacos). That means getMetadata should be return Instance MetaData(not service MetaData).

I think Spring Cloud Kubernetes must follow all Spring Cloud Common RULE, so people are easy to accept Spring Cloud Kubernetes when they transfer from Spring Cloud Consul, Spring Cloud Eureka...
Spring Cloud Kubernetes is just an implementation of Spring Cloud Common, people are easy to learn Kubernetes via Spring Cloud Kubernetes and no need to know more Kubernetes technology

Many have been using this project for a long time and this is not a common request.

Many have been using this project for a long time and this is not a common request.

i dont know America or other countries' customers, in China a lot of companies such as banks, educations, they all want that common requirement, and we call it "Gray Release", "Blue Green Release" or "Canary Releases"

i dont know America or other countries' customers, in China a lot of companies such as banks, educations, they all want that common requirement, and we call it "Gray Release", "Blue Green Release" or "Canary Releases"

A invokes B through Feign or RestTemplate

Yup but those HTTP requests are going through the Kubernetes service for B which is doing the load balancing.

A invokes B through Feign or RestTemplate

Yup but those HTTP requests are going through the Kubernetes service for B which is doing the load balancing.

@spencergibb
Please refer to https://github.com/spring-cloud/spring-cloud-kubernetes/issues/496, i guess he maybe has this kind of requirement. Thanks a lot

@spencergibb
Please refer to https://github.com/spring-cloud/spring-cloud-kubernetes/issues/496, i guess he maybe has this kind of requirement. Thanks a lot


text-minimessage: Reduce the API surface of the parse context a little bit

Can more of these methods be removed? The only truly essential one is imo parse(String), but I'm not sure what sort of usecases others might have

It's definitely easier to add methods as-required, versus deprecating and removing methods later on.


fix: update jupyter web app rock

Jupyter Web App ROCK was developed during workshop.
It needed to be brought up to best practices spec.
https://github.com/canonical/kubeflow-rocks/issues/41
Summary of changes:

Added run-user non-root user setup
Remove old non-user setup.
Update sequrity team requirements.
Re-implemented as multi-part rock.

Test run shows that server starts up. It fails due to lack of K8S configuration. This will be addressed in integration stage.
ocker run jupyter-web-app_v1.7.0_20.04_1:v1.7.0_20.04_1 exec pebble exec bash -c 'export PYTHONPATH=/ && gunicorn -w 3 --bind <IP_ADDRESS>:5000 --access-logfile - entrypoint:app'
2023-08-21T18:05:08.084Z [pebble] Started daemon.
2023-08-21T18:05:08.097Z [pebble] POST /v1/exec 12.419942ms 202
2023-08-21T18:05:08.110Z [pebble] GET /v1/tasks/1/websocket/control 12.542605ms 200
2023-08-21T18:05:08.110Z [pebble] GET /v1/tasks/1/websocket/stdio 50.332µs 200
2023-08-21T18:05:08.111Z [pebble] GET /v1/tasks/1/websocket/stderr 36.134µs 200
2023-08-21T18:05:08.126Z [pebble] POST /v1/exec 13.171979ms 202
2023-08-21T18:05:08.138Z [pebble] GET /v1/tasks/2/websocket/control 12.075997ms 200
2023-08-21T18:05:08.138Z [pebble] GET /v1/tasks/2/websocket/stdio 58.352µs 200
2023-08-21T18:05:08.139Z [pebble] GET /v1/tasks/2/websocket/stderr 55.147µs 200
[2023-08-21 18:05:08 +0000] [18] [INFO] Starting gunicorn 21.2.0
[2023-08-21 18:05:08 +0000] [18] [INFO] Listening at: http://<IP_ADDRESS>:5000 (18)
[2023-08-21 18:05:08 +0000] [18] [INFO] Using worker: sync
[2023-08-21 18:05:08 +0000] [25] [INFO] Booting worker with pid: 25
[2023-08-21 18:05:08 +0000] [26] [INFO] Booting worker with pid: 26
[2023-08-21 18:05:08 +0000] [27] [INFO] Booting worker with pid: 27
[2023-08-21 18:05:09 +0000] [25] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/kubeflow/kubeflow/crud_backend/api/apis.py", line 5, in <module>
    config.load_incluster_config()
  File "/kubernetes/config/incluster_config.py", line 118, in load_incluster_config
    InClusterConfigLoader(
  File "/kubernetes/config/incluster_config.py", line 54, in load_and_set
    self._load_config()
  File "/kubernetes/config/incluster_config.py", line 62, in _load_config
    raise ConfigException("Service host/port is not set.")
kubernetes.config.config_exception.ConfigException: Service host/port is not set.

@cjdcordeiro Please give your +1, if this ROCK is acceptable.

from a rockcraft standpoint, it LGTM. App-wise, I recommend having someone else (who knows the application) test it (including scanning for cves).

Thanks! Testing will be done through charm's integration test and we are setting up scheduled workflow for CVE scanning for this repo.


code rafactor

Codecov Report
Base: 62.37% // Head: 62.35% // Decreases project coverage by -0.02% :warning:

Coverage data is based on head (310b497) compared to base (56e6f4f).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #532      +/-   ##
==========================================
- Coverage   62.37%   62.35%   -0.03%
==========================================
  Files          94       94
  Lines        7769     7769
==========================================
- Hits         4846     4844       -2
- Misses       2146     2147       +1
- Partials      777      778       +1

Impacted Files
Coverage Δ

api/module.go
72.46% <100.00%> (ø)

common/string.go
80.00% <0.00%> (-20.00%)
:arrow_down:

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

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.


HL-496: Fix layout height

Description :sparkles:
Issues :bug:
Testing :alembic:
Screenshots :camera_flash:
Additional notes :spiral_notepad:

Codecov Report

Merging #880 (e2f0a11) into develop (54f1179) will decrease coverage by 62.53%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #880       +/-   ##
===========================================
- Coverage    62.53%   0.00%   -62.54%
===========================================
  Files          858      64      -794
  Lines        22926     967    -21959
  Branches      2309     144     -2165
===========================================
- Hits         14336       0    -14336
+ Misses        8203     936     -7267
+ Partials       387      31      -356

Impacted Files
Coverage Δ

...ontend/shared/src/components/content/Content.sc.ts

frontend/shared/src/components/layout/Layout.sc.ts

frontend/kesaseteli/youth/src/pages/index.tsx

backend/benefit/companies/tests/conftest.py

frontend/kesaseteli/handler/src/pages/403.tsx

.../benefit/messages/migrations/0003_add_seen_flag.py

...forms/application/step2/useApplicationFormStep2.ts

...rc/components/application/form/ActionButtons.sc.ts

.../migrations/0005_employee_is_living_in_helsinki.py

...end/benefit/applicant/src/hooks/useCompanyQuery.ts

... and 784 more

Continue to review full report at Codecov.

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


Fix segfaults in Discord_RegisterW in MinGW builds

The first test of my patch provided in issue #102 ended up in a segfault. Turns out strsafe.h substitution was insufficient and could lead to stack corruption. It was caused by a simple lack of size conversion, when wchars in different functions are treated as bytes or as wchars. The aim of this PR is to fix this problem.

Replaced the StringCbPrintfW macro with a proper function for a size conversion could be provided
Replaced the only occasion of StringCbCopyW with a StringCbPrintfW call, as it is used elsewhere in this function, so it's buggy substitute function could be safely removed
Prevented a few possible failures in the RegSetKeyValueW syscall substitute (according to MSDN references)
Fixed indentation in substitute functions

Thank you for this, and sorry for the delay. I'll have the expert take a look, as this is a bit beyond me 😄


Chain with multi-line parent has off formatting of first child

E.g.,
    given(
        r#"
        # Getting started
        ...
    "#,
    )
            .running(waltz)

I would expect .running to be indented once deeper than given. However, even that looks odd because the previous line is shorter than the tab width.

cf. https://github.com/rust-lang-nursery/fmt-rfcs/issues/66#issuecomment-289882009 and https://github.com/rust-lang-nursery/fmt-rfcs/issues/66#issuecomment-289886281


scrollbar is not working

When I drag A towards right and down ,I can view the whole graph by right and bottom scroll bar as follows:

But when I drag B towards left and upper , I can't view the whole graph even the scroll bar disappear as follows :

I have set the 'overflow:auto' style in the graph container. So , I can't fix this case and need some help.

solved


Button to fix issues introduced by auto-matchmaker mod

Once RepairView is released.

Could you be a bit more specific? :smile:

Not sure if this is actually still needed with vanilla match-making being fixed and the auto-matchmaking mod being removed from Thunderstore.
Closing as WONTFIX for now ^^


backport cluster evaluation permissions #1885 to 1.3

Description
Backport of #1885 to 1.3
Issues Resolved
Backport PR #1885
Check List

[x] New functionality includes testing
[x] New functionality has been documented
[x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Codecov Report

Merging #1976 (27306ee) into 1.3 (4b16f90) will decrease coverage by 0.21%.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##                1.3    #1976      +/-   ##
============================================
- Coverage     64.64%   64.43%   -0.22%
+ Complexity     3220     3219       -1
============================================
  Files           247      247
  Lines         17363    17356       -7
  Branches       3086     3074      -12
============================================
- Hits          11225    11183      -42
- Misses         4590     4622      +32
- Partials       1548     1551       +3

Impacted Files
Coverage Δ

...earch/security/resolver/IndexResolverReplacer.java
63.87% <0.00%> (-0.29%)
:arrow_down:

...earch/security/privileges/PrivilegesEvaluator.java
71.57% <100.00%> (+0.09%)
:arrow_up:

...ava/com/amazon/dlic/auth/ldap2/MakeJava9Happy.java
8.69% <0.00%> (-34.79%)
:arrow_down:

...com/amazon/dlic/auth/ldap2/PrivilegedProvider.java
44.26% <0.00%> (-6.56%)
:arrow_down:

...ic/auth/ldap/backend/LDAPAuthorizationBackend.java
53.59% <0.00%> (-4.36%)
:arrow_down:

.../org/opensearch/security/support/ConfigHelper.java
80.39% <0.00%> (-1.97%)
:arrow_down:

...search/security/transport/SecurityInterceptor.java
73.94% <0.00%> (-0.85%)
:arrow_down:

...zon/dlic/auth/ldap2/LDAPAuthorizationBackend2.java
28.35% <0.00%> (-0.38%)
:arrow_down:

...dlic/auth/http/saml/AuthTokenProcessorHandler.java
46.99% <0.00%> (-0.29%)
:arrow_down:

...ch/security/securityconf/DynamicConfigFactory.java
60.92% <0.00%> (-0.26%)
:arrow_down:

... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us.


phpdish:install检查writable的时候最好加上web/media

放生产环境无法上传文件，发现没权限写

嗯嗯，年后新版本发布的时候，会带上这个发自我的华为手机-------- 原始邮件 --------主题：[slince/phpdish] phpdish:install检查writable的时候最好加上web/media (#9)发件人：gouchaoer 收件人：slince/phpdish 抄送：Subscribed 放生产环境无法上传文件，发现没权限写
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/slince/phpdish","title":"slince/phpdish","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/slince/phpdish"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"phpdish:install检查writable的时候最好加上web/media (#9)"}],"action":{"name":"View Issue","url":"https://github.com/slince/phpdish/issues/9"}}}

刚看源码里检查了的，难道我安装有问题。。。过年没事看看源码，别在意

😂有啥好在意的


Ex2, Part 1 Step 9 - The TDMS file created gets deleted by itself after TCRL Host Main.vi stops.

It seems that the TDMS file that gets created. However, when TCRL Host Main.vi stops, the TDMS file gets deleted. Not sure if this is a bug in the TDMS logger (I assume so) or a mis-configuration as explained in the Hands-On.

HI Michael, the file is not being deleted it is being archived. in the Log Rotation tab you can see to what folder it got moved.

We should probably add a note in the Hands On explaining this.

@coolranchdoRITAs  and I also saw this while doing the Hands On last fall and talked about filing an issue for it. If I remember correctly, only 2-3 people out of the total 9-10 doing the training saw it, so there's a sense of intermittency about it.

archiving was intermittent? or people noticing was intermittent?

Only 2-3 people's TDMS file was 'missing' in their expected folder...so I expect the former.


no dependencies

Hoping to start testing out this package w/ Vapor soon and needed a version that supported Swift 4 and didn't have any dependencies.
I know eventually this package should include an HTTP server built on swift-server/transport, but for now having this package import IBM's ecosystem of packages makes it difficult for us to test.
This probably won't get merged, but I thought i'd contribute it back nonetheless.

[x] support Swift 4
[x] remove all dependencies
[x] include CHTTPParser
[x] remove reliance on utils.c

I would support merging the part of this PR which removes the dependency on https://github.com/IBM-Swift/CHTTPParser.git and adds a CHTTPParser target to this package. Or we could create https://github.com/swift-server/CHTTPParser and depend on that.

Hey @tanner0101 . Yes - we should certainly start to remove the dependencies.
In the short term we could do this by bringing everything into the project, i.e. bring in a fork of BlueSocket (stripping it back to just the parts that we're using) etc, and then replace those as TLS and networking comes in.
Would that be reasonable?
Note that @ianpartridge has also raised a PR to add a simple/initial HTTPServer API so users don't have to create a BlueSocketSimpleServer any more.

@seabaylea yup. that sounds perfectly reasonable to me!

Hey @tanner0101 - Please go take a look at #39 and see if you think it resolves this PR's issue to the point that it can be closed.

@tanner0101 I think this work has now been superseded. Are you happy for it to be closed?


Add parameter to activate or deactivate all plugin for install command

what about this @OliverSkroblin ?

closed due to inactivity


Buff Zombie Infection

About the PR
This PR changes the damage numbers of the zombie infection. It also increases the chances of getting infected per bite, with and without clothing.
Why / Balance
Most zombies are created through people getting bit to death, or infecting already dead bodies. Wearing full clothing makes it very unlikely you'll actually get infected before you fall into a critical condition. The zombie infection doing blunt damage means you constantly bleed, making it very obvious you are infected, and makes it very easy to self treat and avoid turning as long as you have Band-Aids. Pure poison damage is much harder to self treat, and overall somewhat slows down the zombie virus from taking hold if you are receiving proper medical care.
Technical details

Media

[X] I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Changelog

:cl:

tweak: Buffed the zombie virus to do purely poison damage, and more likely to spread the infection per bite.

The zombie virus does 10x damage when you're crit. You won't stay crit for long.

Good idea. Usually, players do not run away from zombies, but attack in a crowd, because infection are not dangerous.

why not genetic damage instead of poison? feels more fitting while achieving the same purpose

Good idea. Usually, players do not run away from zombies, but attack in a crowd, because infection are not dangerous.

That's because they're trying to stamp it out rather than letting it spread (and zombies tend to miss their precision attacks)

Hmm, I wonder if perhaps sleeping should increase infection damage?
If you are sleeping on bed you will never turn from infection.
If you are sleeping on medibed you outheal the infection.
Of course being asleep means its easy to bite your neck but still...


Bug: spring.cloud.config.server.encrypt.enabled is not working for spring.cloud.config.server.overrides

Hi,
As exemplified to @spencergibb at https://github.com/spring-cloud/spring-cloud-config/issues/858#issuecomment-397032534 Spring the property spring.cloud.config.server.encrypt.enabled=false is not working when the value to be decrypted is setted on spring.cloud.config.server.overrides.
Best Regards,

I think this comes down to the meaning behind spring.cloud.config.server.encrypt.enabled.  Does this just apply to properties from the environment repository or to the actual config server itself?  spring.cloud.config.server.overrides gets decrypted in EnvironmentDecryptApplicationInitializer when the config server starts up because it is part of the config servers environment properties.  spring.cloud.config.server.encrypt.enabled is used by the config server when supplying the config clients their properties.

The team views this as an enhancement since we will either need to introduce a new property to not decrypt application properties for the application configuration on startup or potentially parse the the existing property and use that.

@mdkhwajams Please open a separate issue as your issue is not related to this one and please learn how to format code on github


update tests to new API

I'd call this done - we added quite a few new tests over time and it'd be more an issue of adding more new tests now that adapting old ones


Exam mode: pressing "override assessment" on an exercise, the button is still enabled. Even if there are not new changes

Describe the bug
When I solve a complaint and involve a new assessment after pressing "override assessment" on an exercise, the button is still enabled. Even if there are not new changes
To Reproduce

Solve a complaint and change the grade (add new feedback)
Check that the override assessment is enable
press it and verify the grade was saved
Verify the button is still enabled even if you didn't add new feedback

Expected behavior
The button should not be enabled if no changes are there.
Screenshots
No response
Which version of Artemis are you seeing the problem on?
7.3.0
What browsers are you seeing the problem on?
Chrome
Additional context
No response
Relevant log output
No response

I agree that this is a better approach, I changed the label as I do not think that this is a bug but rather an additional functionality


Making reporter Cukes compatible

fixes #21

Works with Cucumber JS v6 (not tested on other versions)
Includes tests for flows written
Works with Allure report if useCucumberStepReporter option is set to true
One problem I noticed is when the video file is more than 256 KB, it will only copy 256 KB to the allure report folder. But this is intermittent.
Changed the Travis file to YML file, sorry :)
Travis build is passing here

Hi, please can someone review and give feedback, please

This is great and I can use this to for Cucumber. Can we please get a priority on this :).

I have started to have a look at the code. But I have now way of verifying this since I dont know how to setup a cucumber project.  The previous project someone made for me to check cucumber with wdio-video-reporter doesnt want to run for some reason.
Would you mind forking and converting the template, so that it uses cucumber?
I created a brancher here: https://github.com/presidenten/wdio-template/tree/cucumber, would be nice to have a PR there so I can reference it when people wants to file issues in the future.

I have started to have a look at the code. But I have now way of verifying this since I dont know how to setup a cucumber project. The previous project someone made for me to check cucumber with wdio-video-reporter doesnt want to run for some reason.
Would you mind forking and converting the template, so that it uses cucumber?
I created a brancher here: https://github.com/presidenten/wdio-template/tree/cucumber, would be nice to have a PR there so I can reference it when people wants to file issues in the future.

Thanks for that, I have been testing it on my machine for a project I am working on by using npm link and things work as expected barring one problem which I have fixed but not pushed yet. I will be pushing it during the weekend or early next week as I need to write some tests for the new changes I have made, but you can review the rest or anyone interested in these changes can pull and link it to your project using npm link and run it.

Oups, made a mistake while extracting framework code to separate files. Hold on, fix is coming.

There we go. Should work as intended now :-)
Please insert your changes in ./src/frameworks/cucumber.js

@jonn-set
Managed to get the cucumber example running after all, I put it in a branch here:
https://github.com/presidenten/wdio-template/tree/cucumber
So there is no need for you to fix an example for me.

@jonn-set
I extended the small demo to also run a few cucumber features, all though I cant in any way make it continue running the feature that should pass, after the first feature fails (any ideas?)
 The videos seem to pop up like they should, but if you run yarn report it seems like the yarn report shows the failed feature as broken instead of failed.
Any idea how to fix this?
I think we are pretty close though. Really nice job with the implementation.

@jonn-set
Sorry, lots of spam now. Updated the readme as well.
Please have look at the configuration instructions.
...and it would be great if you could have a look at cucumber demo as well

./demo/wdio-cucumber.conf.js
./demo/cucumber-scenarios

Now Im signing of for a while until you have had time to process the changes :-)

Thanks for looking at this. Sorry, weekends are a bit hectic for me sometimes, I will have a look at this when I get some time, hopefully at least by Monday.
Thanks

Sorry, accidentally hit the wrong button, hence reopened.

Dont worry about it, have a look when you have time. We stress enough at work, lets not stress over hobby stuff as well :-)

Firstly, great work refactoring the whole thing so quickly. Please find answers to your questions below.

@jonn-set
I extended the small demo to also run a few cucumber features, all though I cant in any way make it continue running the feature that should pass, after the first feature fails (any ideas?)

Yes, its because bail is set to 1 in the config file, should be 0, will fix and push this.

 The videos seem to pop up like they should, but if you run yarn report it seems like the yarn report shows the failed feature as broken instead of failed.
Any idea how to fix this?

Yes, this is because of allure limitation, looks like it does not categorise node assert fails as a test failure. I normally use chai assertion and they appear correctly as failed, I wouldn't worry about it, but if you want I can add chai as a dev dependency to demo and edit the steps so that it appears correctly on the report.

I think we are pretty close though. Really nice job with the implementation.

I have pushed my changes, have a go at it and let me know what you think.
Thanks

I have added a fix for cucumber where the onTestSkip function would delete the folder where scenario failed with a few steps still remaining to execute. I have run all the possible tests and they all seem to work as expected. @presidenten if you could check for other frameworks and also do a review of my changes and are happy, then looks like its good to release.

@jonn-set I dived into the 256KB problem you mentioned in your first post and have rewritten the "finished"-handler to be able to handle bigger videos. Silly mistake from my side, but I also found the isSynchronised reporter-getter that allows me to use async functions instead of the ugly wait.
Im doing some refactoring now, then Ill let you test it.
If all looks good, we'll merge to master and make a release.
Also, did you check the changes in readme? Does the configurations section for cucumber look ok?

@jonn-set I dived into the 256KB problem you mentioned in your first post and have rewritten the "finished"-handler to be able to handle bigger videos. Silly mistake from my side, but I also found the isSynchronised reporter-getter that allows me to use async functions instead of the ugly wait.

@presidenten Thanks for looking into the 256KB issue, there seem to be another issue where videos gets copied with a size of a few bytes to the allure-raw folder, The files are generated correctly in the rawSeleniumVideoGrabs folder. I saw it happening for the 2nd browser that it was running the tests in parallel, so for me it was chrome most of the times, the firefox video was fine. This is intermittent and does not seem to happen on all runs. Could be an issue with Windows :)

Im doing some refactoring now, then Ill let you test it.

Sure, will do.

If all looks good, we'll merge to master and make a release.

That would be great, thanks.

Also, did you check the changes in readme? Does the configurations section for cucumber look ok?

I just looked at the readme and I dont think we need to tell users how to configure cucumber in wdio.conf file, I am sure people using cucumber will already know how to configure it, there a lot of boilerplate code for cucumber already on WDIO website. I have done some minor rephrasing of what you had in there for using it with allure, I will push it, you can proof read it and then change it accordingly.

@jonn-set Nice update to readme. This is much better.
These new commits contains a bigger rewrite that should fix alot of problems with allure videos not being updated properly, as well as some more refactoring.
Now >256kb videos work as intended

With the updates to the feature files, I noticed that we get more folders in rawSeleniumVideoGrabs than actual videos. Is

Are we missing something?

@jonn-set Nice update to readme. This is much better.
These new commits contains a bigger rewrite that should fix alot of problems with allure videos not being updated properly, as well as some more refactoring.
Now >256kb videos should hopefully work as intended...

With the updates to the feature files, I noticed that we get more folders in rawSeleniumVideoGrabs than actual videos. Is

Are we missing something?

The last two folders are of passing tests, it does not generate videos for passing tests if saveAllVideos is set to false :-)

Lol! Ofcourse hahhahahaha.
Stayed up to late last night to try to fix the rewrite and got a bit mushy. :-)
You should be able to test the >250kb with this step btw
Given(/^I open Basic Examples tab$/, () => {
  for(let i=0; i<5; i++) {
    browser.url('http://www.seleniumeasy.com/test/');
    $('#btn_basic_example').click();
    browser.pause(300); // avoid animation effect
    $('.list-group-item[href*="basic-first-form-demo"]').click();
    $('#gettotal input').setValue('Presidenten');
  }

  $('#btn_basic_example').click();
  browser.pause(300); // avoid animation effect
});

The problem with the allure file copying is still happening, can you check if you see the same issue intermittently, please?

But I cant seem to get the issue to happen.
Its very strange that it happens, since I dont move on until all ffmpeg-processes have finished. Maybe the videoRenderTimeout is triggered?
Could you set loglevel to debug and send me all wdio logs on a run where it happens?
Also, please list node version so I can try to replicate it.

Since I was on my work computer I ran the cucumber demo a few times on our dev-grid as well.
All desktop browsers are working:

chrome ✓
firefox ✓
safari ✓
ie11 ✓
edge ✓

Our devices are acting up, but they havn't gotten any love for a while, and cant check on them since Im at home. So cant verify that it works.

But I cant seem to get the issue to happen.
Its very strange that it happens, since I dont move on until all ffmpeg-processes have finished. Maybe the videoRenderTimeout is triggered?
Could you set loglevel to debug and send me all wdio logs on a run where it happens?
Also, please list node version so I can try to replicate it.

 The node version I am using is 10.13

Its intermittent and even I cant get it reproduced every single time. The node version I am using is 10.13

Tried in Linux with node v10 and it seems to be working alright, might be a problem with windows then. I wouldn't worry about it until other users also complain about it once released.

Thanks for the env-input.
I managed to replicate the issue consistently on a Win10 virtual machine.
No clue why windows in behaving differently, but I have managed to make a fix that seem to make it work consistently. Just have to update tests.
Will write them later tonight.

Could you check if this solves the 256k and 1k issue?
I noticed a couple of things that needed fixing.

Sometimes (but not always), but especially on jasmine timeouts, there is a severe error and wdio skips the onRunnerEnd callback
Sometimes on win, even though the child_process has finished, the video file is not done being saved when it was time to move the video files to allure.

So I moved the allure code to process.on('exit') to be a bit extra resilient, and I also wrote a newer better piece of code to check that videos were done being written to disk before I copy them into the allure placeholders.
Hopefully it works now :-)
I must admit though, that for what ever reason I couldnt get back to the state where the error happened on my virtual machine this evening. So I cant try the final code, which was refactored while I was writing the tests....

Could you check if this solves the 256k and 1k issue?

Sure will do. Thanks for taking time to fix the issues I report, appreciate it.

All looks good for with the current changes, videos larger than 256 KB generated and all files copied correctly into the allure-raw folder
Good to go from my side, thanks

v2.0.0 is released and published on npm

I just updated and the videos are not .mp4 for my Cucumber tests but instead .png. Am I missing something?

I just updated and the videos are not .mp4 for my Cucumber tests but instead .png. Am I missing something?

@NavinSeth
Probably. Please download the cucumber branch of the template project and run yarn && yarn e2e and make sure that you get videos if you run yarn report afterwards.
https://github.com/presidenten/wdio-template/tree/cucumber
If it works, try comparing wdio.conf.js for differences with yours.
If it doesnt work, please run the tests in the template with loglevel debug and send me the wdio-logs as gists.

@NavinSeth Seems like I had some merge issues on the template project from the master branch. Just fixed it again. So if you forked or downloaded, please update before you try again.

Can you publish a minor version with the new change?

There is no change to the package, only the template projects cucumber branch:
https://github.com/presidenten/wdio-template/tree/cucumber
The demo directory in the package still works fine as well, just yarn in main dir, yarn in demo dir and yarn e2e-cucumber

...the fix in wdio-template was actually to move head back to before the merge with the templates master branch :-)


Fix issue where truncated job names would cause the job to fail.

Fix the issue where truncated job names would cause the job to fail.
Root Cause: When the job name + matrix inputs exceeds 97 characters GHA truncates the job name and appends an ellipsis.
This would cause the match to fail, since the action would build out the absolute path.
Potential issues:
This opens the door to non unique job names (because the "uniqueness" is in what is truncated).
My solution for this was to use the runner name as a second id when filtering.
It was the only other piece of into i could find shared between "workflowRunJobs" and the github context.

@qoomon Please ignore my horrible commit history. If i move the tests into example.yml, things start to break down and that was what i was looking into before i saw you had already replied.

Unfortunately I'll be offline until end of October, I'll get back to this issue then

Instead of find function we should use filter function instead check if matching jobs has a length of exactly 1

I'll implement that and leave it here for you when you get back!

Please squash your commits

@qoomon Now that your back, Ive discovered another issue, it appears that the cut off inst exactly 97 characters it appears to be anywhere between 97 and 99? Im starting to get the impression that https://github.com/actions/runner/pull/3489 is the correct way to fix this. (It was approved).

@qoomon Now that your back, Ive discovered another issue, it appears that the cut off inst exactly 97? Edit: The cut off is 100, and if it exceeds its truncated down. I added tests, for it. However,  https://github.com/actions/runner/pull/3489 is the best and only way to really fix this issue. Im trying to reach out to Enterprise contacts, through my work to get them to review.

Sorry misunderstood your is the best and only way

Sorry i should have said: "Is the Correct solution to this in the long term"


Create genth-schule.txt

genth-schule.de

@hyWse Pull request merged. Please notice that free educational license for JetBrains tools is for high and higher schools students, i.e. those who are over 13 of age. Thank you!


Possible syntax validation error?

When tried to compile that jsonnet:
let a = 1;

I've got just "syntax error" in output in any mode.
Using jrsonnet 0.3.1.

This is not an error, you will get same result with C++/Golang impl of jsonnet
let statements are invalid themselves, full syntax for them is
let VAR = VALUE; RESULT
Where second expression runs in scope with specified VAR, and you are missing it.

Oh, and there is no lets in jsonnet, you meant local

Oh, and there is a regression in jrsonnet cli: #26

That's an issue about the output of error messages, not the language itself.


Add initial index template to "getting started"

It would be helpful if there was a "Getting Started" index template instructions present for new/returning users of this addon.
Something simple is all that's required including best practices first template (index) and related items.

Interesting idea, thanks for the suggestion!


Finalize 7.48.0 release

What does this PR do?

Motivation

Additional Notes

Review checklist (to be filled by reviewers)

[ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
[ ] Changelog entries must be created for modifications to shipped code
[ ] Add the qa/skip-qa label if the PR doesn't need to be tested during QA.

Labeler job failure bug ticket AITS-2


Unable to enter data in RETextItem or any item

I am made a demo project and added 50 RETextItems

When i want to enter data beyond 43rd Item. I am unable to do so. As keyboard covers its up.

I have made a demo project
(Source Code  :https://www.dropbox.com/s/gqzi7a4pgfui46u/TestKeyBoardManager.zip )
using : https://github.com/hackiftekhar/IQKeyboardManager -
I got expected result as follows:

Please inform how to achieve above result using your control.

i have a same question


"Prefix unused value with underscore" code fix should not appear on double ticked names

Lol

Speaking more generally: we should filter suggestions that lead to invalid identifiers.

I don't think it's a good strategy, it would hide bugs in suggestions.

I'm fine with handling these incrementally whenever we see one appearing

Fixed in https://github.com/Microsoft/visualfsharp/pull/2424


Article on how to run a masternode from A to Z

Estimated time: 5h

What:
Step by step guide on how to run a masternode on Digital Ocean with tmn.
From creating a droplet to the node being elected.

@DuqueKarl You can find the contribution guidelines for the docs repo in the readme.
I'm of course available for any question!

@etienne-napoleone Please find below a draft of the article. Let me know if there is anything you would like me to add or change. Thank you!
https://docs.google.com/document/d/17Lg0cD8PyFZIf_0pGpIp7f-bKgkUhm_lC2wijCtL8_4/

@etienne-napoleone
I have prepared the article for publishing on Medium. Please, find below a draft of the writing. Let me know your suggestions to add or change to improve the article. Thank you!
https://medium.com/p/3793752dc3d1/

The article content is now ok. @alex9121 you can enhance and publish it when you want


Initial state-machine changes to add support for session-tickets

Initial (dummy) changes to start adding support for session-tickets in
S2N.  I will start sending more incremental PRs on top of this

Rebasing to latest master should pass the build


[FLINK-17036] Datadog EU site parameter

Please note I am a current Datadog employee.
What is the purpose of the change
This pull request adds the option to specify the EU site param for Datadog.
Brief change log

Adds an additional param for this

Verifying this change
This change is already covered by existing tests, such as DatadogHttpClientTest.java.
Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): (yes / no)
The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
The serializers: (yes / no / don't know)
The runtime per-record code paths (performance sensitive): (yes / no / don't know)
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / no / don't know)
The S3 file system connector: (yes / no / don't know)

No to all.
Documentation

Does this pull request introduce a new feature? Yes, Datadog docs and also Apache docs need updated and if this goes through will need to be done.
If yes, how is the feature documented? not documented yet.

Thank you for the pull request.
Since you mentioned that you are not a software engineer: Do you still want to go through an actual review cycle (with me making suggestion and you implementing them), or wish for someone else to take over?

Do you know whether we expect that other data centers, or even just domains, may be opened in the future?

There will only ever be the two considerations on this US and EU, .com and .eu
Those changes look good to me thanks!


querySelector in InteractiveCanvas.tsx is generating type errors

https://github.com/excalidraw/excalidraw/blob/9e0bfd178e77e7a524496aa4fa22d81dd3b4e526/src/components/canvases/InteractiveCanvas.tsx#L108-L110
The approach in the code above does not seem compatible with having multiple instances of Excalidraw in the same window (like in Obsidian)

Can you create a repro case on codesandbox? I'm rendering two instances and it works fine.


Problem running the Evaluation using my personal dataset

Hi everyone,
I'm using my own personal dataset, but I can't understand in the evaluation code (present below), what I should replace ['baseline']. Do you know how to help me?
from ragas import evaluate
result = evaluate(
fiqa_eval["baseline"].select(range(3)),    <---------
metrics=[
context_precision,
faithfulness,
answer_relevancy,
context_recall,
],
)

Hi @MattiaBaldinetti , please refer to https://docs.ragas.io/en/latest/howtos/applications/data_preparation.html

Hi @MattiaBaldinetti , please refer to https://docs.ragas.io/en/latest/howtos/applications/data_preparation.html

Hi @shahules786
I would like to use the train.csv file present in my dataset uploaded to HuggingFace:
https://huggingface.co/datasets/mattobaldo/personal_dataset/tree/main
Loading the dataset using load_dataset("mattobaldo/personal_dataset") returns:
DatasetDict({
train: Dataset({
features: ['question', 'ground_truths', 'answer', 'contexts'],
num_rows: 30
})
})
Loading metrics is fine.
The problem is when I launch the Evaluation, as a reference code I am using the one written in the problem above.
Do you know how I can solve it?
Thank you

Hi @shahules786 and thanks for the reply
I tried to use this code, but I get this error:
ValueError: Dataset feature "contexts" should be of type Sequence[string], got <class 'datasets.features.features.Value'>
What should I do?


[stable/prometheus-operator] Bump Grafana version to 5.2.0

Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

[x] DCO signed
[x] Chart Version bumped
[x] Variables are documented in the README.md
[x] Title of the PR starts with chart name (e.g. [stable/mychartname])

/retest

/lgtm

/lgtm


After terraform import the charm channel isn't correctly recognised

Terraform Version
$ terraform -v
Terraform v1.3.0
on linux_amd64
+ provider registry.terraform.io/juju/juju v0.4.1

Affected Resource(s)
I'm not quite sure, but it affects terraform import of a juju_application resource.
Terraform Configuration Files
resource "juju_application" "redis_cache" {
  name  = "redis-cache2"
  model = juju_model.staging.name

  charm {
    name = "redis-k8s"
    channel = "edge"
  }

  units = 1
}

Debug Output
Here's my juju status output confirming the redis-cache2 application is using the edge channel already:
$ juju status redis-cache2
Model       Controller          Cloud/Region        Version  SLA          Timestamp
stg-events  microk8s-localhost  microk8s/localhost  2.9.34   unsupported  11:27:21+02:00

App           Version  Status  Scale  Charm      Channel  Rev  Address         Exposed  Message
redis-cache2  7.0.4    active      1  redis-k8s  edge      18  <IP_ADDRESS>  no

Unit             Workload  Agent  Address       Ports  Message
redis-cache2/0*  active    idle   <IP_ADDRESS>

I ran the following:
terraform import juju_application.redis_cache stg-events:redis-cache2

This reported a successful output. However, when running terraform plan I see:
  # juju_application.redis_cache will be updated in-place
  ~ resource "juju_application" "redis_cache" {
        id     = "stg-events:redis-cache2"
        name   = "redis-cache2"
        # (4 unchanged attributes hidden)

      ~ charm {
          ~ channel  = "latest/stable" -> "edge"
            name     = "redis-k8s"
            # (2 unchanged attributes hidden)
        }
    }

Panic Output
N/A
Expected Behavior
This should recognise something is deployed with the channel specified in the terraform configs.
Actual Behavior
It says it's going to switch it from the stable channel to the edge channel.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:

juju deploy redis-k8s --channel=edge
terraform import (with relevant application name)
Check the output of terraform plan.

Important Factoids
N/A
References
N/A

I've also noticed that charm config isn't imported/recognised. Let me know if I should file a separate issue for this. I confirmed this by applying juju config similar to how it's defined in my terraform plan, and then doing a terraform state rm $juju_application, re-running a terraform import of the same juju application and confirming that terraform plan was still reporting that it would change that config item.

Thanks Tom - if you could file a separate issue for config that would be useful!

Have created https://github.com/juju/terraform-provider-juju/issues/96.


Allows overriding PIP_EXISTS_ACTION environment variable (it was forced to w)

This should fix #3737

This is nice to speed up the installation process

Thanks for the pr :) would you mind adding a news entry to news/3738.feature.rst describing the new functionality?

Thanks for the pr :) would you mind adding a news entry to news/3738.feature.rst describing the new functionality?

Done.

thanks!


Scala-style Optional 'when' & 'unless' constructors

🚀 Feature request
Scala-style Optional when and unless constructors
Current Behavior
import * as O from 'fp-ts/lib/Option'

const isTrue: boolean = ...
const value: number = ...
const valWhenTrue: O.Option<number> = isTrue ? O.some(value) : O.none
const valUnlessTrue: O.Option<number> = isTrue ? O.none : O.some(value)

Desired Behavior
const valWhenTrue: O.Option<number> = O.when(isTrue)(value)
const valUnlessTrue: O.Option<number> = O.unless(isTrue)(value)

Suggested Solution
Option 'when' and 'unless' have been a feature in Scala since Scala 2.13
The scala community's reasoning
Who does this impact? Who is this for?
For users of the Option typeclass
Describe alternatives you've considered
The current behavior is relatively clear and concise. This is a minor upgrade that makes intent clearer and piping syntax nicer.
Additional context
I love fp-ts!
Your environment

Software
Version(s)

fp-ts
2.6.5

TypeScript
3.9.5

addressed https://github.com/gcanti/fp-ts/pull/1240


Sync client hierarchy changes from autorest.csharp

Sync changes from autorest.csharp https://github.com/Azure/autorest.csharp/pull/4745

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


[EMB-115] Fix institutions landing page styling

Purpose
make institutions/styles.scss and institutions/template.hbs comply with how we are now doing styling
Ticket
https://openscience.atlassian.net/browse/EMB-115
Reviewer Checklist

[ ] meets requirements
[ ] easy to understand
[ ] DRY
[ ] testable and includes test(s)
[ ] changes described in CHANGELOG.md

Coverage remained the same at 56.936% when pulling 31152b4e6f5fd90a935428c5850f260322a3045c on hmoco:fix_style into 99e7307a84a84a8cfccbea3f3ae258aa672ff76c on CenterForOpenScience:develop.


Simplifying the use of Templ components with HTMX

I was working on an HTMX project with Templ and I was wondering if there was a simpler way to use Templ components with HTMX.
In my application, to avoid reinventing my button everywhere, I created a Component like this :
type AppButtonParams struct {
  Variant string
  Size    string
  Class   string
}

templ AppButton(params AppButtonParams) {
  <button
    class={
      templ.SafeClass(appButtonVariants(params.Variant, params.Size)),
      templ.SafeClass(params.Class),
    }
  >
    { children... }
  </button>
}

The challenge now is that I want to use an hx-get attribute for a specific button. With the current syntax of these components, I can't transparently pass new attributes to my AppButton component since it's a function.
Is the only way to pass props to a Templ component by passing values into the function, or is there a syntax sugar I can use to simplify this code ?
type HTMXParams struct {
  Get    string
  Target string
  Swap   string
}

type AppButtonParams struct {
  Variant string
  Size    string
  Class   string
  HTMX    HTMXParams
}

templ AppButton(params AppButtonParams) {
  <button
    class={
      templ.SafeClass(appButtonVariants(params.Variant, params.Size)),
      templ.SafeClass(params.Class),
    }
    if !helpers.IsEmptyOrWhitespace(params.HTMX.Get) {
      hx-get={ params.HTMX.Get }
    }
    if !helpers.IsEmptyOrWhitespace(params.HTMX.Target) {
      hx-target={ params.HTMX.Target }
    }
    if !helpers.IsEmptyOrWhitespace(params.HTMX.Swap) {
      hx-swap={ params.HTMX.Swap }
    }
  >
    { children... }
  </button>
}

Hey @gungun974, I'm just getting to know Templ, but seems you could separate out the attribute rendering and define your own types for HTML params... Haven't tested this, but would it work for to do the following?:
type HTMXParams struct {
  Get    string
  Target string
  Swap   string
}

type AppButtonParams struct {
  Variant string
  Size    string
  Class   string
  HTMXParams           // Embedded
}

func renderAttributes(attrs map[string]string) string {
  var result []string
  for key, val := range attrs {
    if val != "" {
      result = append(result, fmt.Sprintf("%s=\"%s\"", key, val))
    }
  }
  return strings.Join(result, " ")
}

templ AppButton(params AppButtonParams) {
  <button
    class={
      templ.SafeClass(appButtonVariants(params.Variant, params.Size)),
      templ.SafeClass(params.Class),
    }
    { renderAttributes(map[string]string{
        "hx-get": params.Get,
        "hx-target": params.Target,
        "hx-swap": params.Swap,
      }) }
  >
    { children... }
  </button>
}

Hey @gungun974, I'm just getting to know Templ, but seems you could separate out the attribute rendering and define your own types for HTMX params... Haven't tested this, but would it work for to do the following?:
type HTMXParams struct {
  Get    string
  Target string
  Swap   string
}

type AppButtonParams struct {
  Variant string
  Size    string
  Class   string
  HTMXParams           // Embedded
}

func renderAttributes(attrs map[string]string) string {
  var result []string
  for key, val := range attrs {
    if val != "" {
      result = append(result, fmt.Sprintf("%s=\"%s\"", key, val))
    }
  }
  return strings.Join(result, " ")
}

templ AppButton(params AppButtonParams) {
  <button
    class={
      templ.SafeClass(appButtonVariants(params.Variant, params.Size)),
      templ.SafeClass(params.Class),
    }
    { renderAttributes(map[string]string{
        "hx-get": params.Get,
        "hx-target": params.Target,
        "hx-swap": params.Swap,
      }) }
  >
    { children... }
  </button>
}

Thanks for the suggestion.
I was wondering if they could be a way like this where we can pass directly a string in an element but Templ don't implement such thing.
After maybe this is something that can be added to Templ. But not in this form.
It would be very strange to permit inject raw string into an element like this.
A better and simple well would permit to passe in a map[string]string in the element directly.
The Parser will have to recognize this pattern and make the generator generate a simple for range with templ.EscapeString() like it does for simple property. "This should be easy to add"
So this is my suggestion of feature. If you think it's a good idea let me know.
If I'm not the only person interested, I will make a PR.

I was thinking a little bit about this today and I thought something like an element attribute serializer would be kind of nice.
Given your example, we could specify to the serializer how our structure should be serialized into the element:
type HtmxParams struct {
  Get    string `attr:"hx-get,omitempty"`
  Target string `attr:"hx-target,omitempty"`
  Swap   string `attr:"hx-swap,omitempty"`
}

And then in our templ function we could write:
templ AppButton(params HtmxParams) {
  <button { params... } />
}

And templ could desugar this into something that invokes an attribute serializer to write the elements into the button position. I haven't looked at the templ code in detail so here would be a naive interpretation:
// elements == "hx-get=\"/example\" hx-target=\"this\" hx-swap=\"outerHTML\"
var elements string = templ.ElementsSerializer(params)
fmt.Sprintf("<button %s>", elements)

I can see this working, but I usually avoid struct tags like the plague, it would make more sense to me to be a new type that can be used.
I don't think it would remove the need for templ.KV as you still need to discriminate between
,
,
 and

A possibility would be for there to be a new type type Attributes map[string]string, which can be spread as you mentioned into an element:
templ AppButton(attrs templ.Attributes) {
  <button { attrs... } />
}

I can see this working, but I usually avoid struct tags like the plague, it would make more sense to me to be a new type that can be used.
I don't think it would remove the need for templ.KV as you still need to discriminate between
,
,
 and

A possibility would be for there to be a new type type Attributes map[string]string, which can be spread as you mentioned into an element:
templ AppButton(attrs templ.Attributes) {
  <button { attrs... } />
}

I really like this syntax because it's solve HTMX attribute but also generic attribute and is simple and clean.
I can easily imagine write something like this with your code :
@AppButton(templ.Attributes{"data-id": "my-custom-id"}) {
  Click
}

I also think it's could be very simple to implement since we just need to loop the map and do some edit to the parser.
I can create the PR if you want since I really enjoy to but before what should happend if an attribute already exist ?

Should this spread override existing attribute ?
Should this spread merge in someway existing attribute ?
Should this spread just add an other attribute even if one exist ? (So in this case it's the developer responsibility to prevent conflict)

@joerdav Good points. I could see solutions with the tags but as you've said they can become annoying and they aren't in spirit with how the rest of templ looks and functions.
Brief review of how CSS works
Rendering attributes is closely related to how CSS classes are rendered. So I think it's worth taking a brief look at how it works in templ currently.
type SafeCSS string

type CSSClass interface {
   ClassName() string
}

// implements CSSClass
type ComponentCSSClass struct {
   ID string
   Class SafeCSS
}

// implements CSSClass
type ConstantCSSClass string

templ.CSSClass{ templ.ComponentCSSClass{ ID: "foo", Class: ".className{background-color:white;}" } }
// renders: ".className{background-color:white;}"
// identifiable by: "foo"

You can use templ.RenderCSSItems to render the templ.ComponentCSSClass instances.
I wouldn't necessarily call the CSS API easy to use manually. The documentation doesn't even state
how you could even use this API manually.  The real power comes from the CSS template:
css className() {
   // your css here...
   background-color: #ffffff;
   // etc...
}

// gets parsed into this structure:
type CSSTemplate struct {
   Name Expression
   Properties []CSSProperty
}

You then must manually place it into the class attribute for your elements:
// Take note of the function call syntax here. Related to how we should implement Attributes.
<button class={ className() }>

Attributes
I propose that we could offer similar template syntax for attributes as we do for CSS in addition to offering a friendly manual API.
Manual Usage
// Basic case:
templ AppButton(attrs templ.Attributes) {
  <button { attrs... } />
}

// More than one on same element:
templ AppButton(attrs templ.Attributes, moreAttrs templ.Attributes) {
  <button { attrs... } { moreAttrs... } />

  // NOTE: maybe this could be simplified to: { attrs..., moreAttrs... }
  //   but the , is visually non-distinct from the spread

  // Another option: { attrs... moreAttrs... }
}

// More than one on different elements:
templ AppButton(attrs templ.Attributes, moreAttrs templ.Attributes) {
  <button { attrs... } />

}

// Can also reuse:
templ AppButton(attrs templ.Attributes) {
  <button { attrs... } />

}

Template Usage
// Multi line props
// rendered: "hx-get=\"/example\" hx-target=\"this\" hx-swap=\"outerHTML\"
attrs HtmxPropsMulti() {
   hx-get="/example"
   hx-target="this"
   hx-swap="outerHTML"
}

// Single line props
// rendered: "hx-get=\"/example\" hx-target=\"this\" hx-swap=\"outerHTML\"
attrs HtmxPropsSingle() {
   hx-get="/example" hx-target="this" hx-swap="outerHTML"
}

// Private props
// rendered: "autofocus"
attrs propsArePrivate() {
   autofocus
}

templ AppButton() {
   <button { HtmxPropsMulti() } { propsArePrivate() } />
   <button { HtmxPropsSingle() } />
}

One major benefit of this style is that you free up the AppButton function signature.
And also allowing for private attributes for a particular templ body.
I'm not necessarily a fan that it is different syntax within the templ body from the manual API.
So an alternative style proposal could be to drop the parenthesis and make use of the spread once again.
This would bring it inline with the manual api usage but differ in how the CSS template syntax works:
templ AppButton() {
   <button { HtmxPropsMulti... } { propsArePrivate... } />
   <button { HtmxPropsSingle... } />
}

Technical considerations
Proposed answers to some of the questions brought up by @gungun974

Should this spread override existing attribute ?

I'm not aware of how browsers handle precedence for attributes. I'm not even sure there is a standard behavior here.
I propose that values that come last take precendece over values that come before.
For example:
attrs InputPropsA {
   value="First"
}

attrs InputPropsB {
   value="Second"
}

templ FooExample() {
  <input type="text" { InputPropsA() } { InputPropsB() } >
  // renders: <input type="text" value="Second">
}

Should this spread merge in someway existing attribute ?

I think this is a similar question to the previous one. Merging should be possible and any overlapping attributes
between two attribute sets resolve by using the last specified one.
For example:
attrs InputPropsA {
   type="text"
   value="First"
}

attrs InputPropsB {
   value="Second"
}

templ FooExample() {
  <input { InputPropsA() } { InputPropsB() } >
  // renders: <input type="text" value="Second">
}

Should this spread just add an other attribute even if one exist ?

Again. I think this is similar to the first two questions. The last most specified attribute should be the
one that takes precedence. This would imply that the renderer walks the attribute sets and eliminates
duplicates.

Thanks for this suggestion @xgalaxy but I don't understand how your new keyword attrs works from the first glance.
With the example you show it's like a map of string but it's not really a map cause it's call like a function ???
I think it's maybe too complex and sophisticated for Go and Templ. I think add this syntax will just make Templ more complex to maintain for not a lot of benefits against a regular map that everyone know (or templ.Attributes).
For the CSS templ class stuff I'm not qualify to speak or even understand since I don't use that. (Regular CSS class work great for me)
For my question I didn't think first about multiple spread attribute but I think it's a good idea (I said that cause I think it's will be easy to have multiple than only one in the parser)
For the merge conflict of attribute override seem to be the more logical solution but for what i see of the go generator code. We just write a plain text of attribute without really know what the previous was. That could impact runtime performance if we need to replace those plain text to a map and do some override with the spread.
But this is an implementation detail so I guess I will begin to implement a prototype of this feature in a draft PR.

The syntax is derived from how templ already does CSS components. I personally don't think its too complex. See: https://templ.guide/syntax-and-usage/css-style-management#css-components

The syntax is derived from how templ already does CSS components. I personally don't think its too complex. See: https://templ.guide/syntax-and-usage/css-style-management#css-components

Yes it's true templ support that but I don't see how this syntax is superior to a regular struct well supported by golang compiler.
Templ is a superset of go. We should really a maximum of what golang give to us.
And for the css keyword. I think it's was made for the first place to be able to write CSS with LSP and code completion since we can't add this into a map or struct but we don't need that for an attribute since we can't known what element will get this attribute.
Finally I don't think a sugar like attrs give enough DX over the complexity to make the parser recognize this than the generator generate a map[string]string.

I've finished creating my draft pull request.
It was simpler than I imagined to create the parser given the current project structure.
However, as for the generator, I have no real idea how to overwrite an attribute that was previously written since the generator knows neither the past nor the future, and it only writes text.
We would need to completely move the attribute system into the runtime when a spread attribute is used, but this is costly and very specific case.
If you have technical ideas or suggestion, please say that in PR #237.
If you think it's impossible or too costly at runtime, we could skip this kind of verification and revisit it later.

Agreed, I think it's up to the developer to not write duplicates, and up to the browser to handle the cases where duplicates are present.
@xgalaxy I have to agree with @gungun974 here that the attrs syntax is potentially a bit too much sugar in this case. One thing I like about templ is how familiar it is to writing Go code, so I think using patterns from Go where possible is ideal.

Sorry, I haven't had a chance to really absorb the comments and thinking on this yet. From a quick look at the PR, I can see that the templ.Attributes is a map[string]string.
Doesn't this mean that we can only spread constant attributes, when we might also want to spread Go expression attributes, CSS scripts, etc.?
The full set of allowed attributes is at https://github.com/a-h/templ/blob/faa36c1ee5722bd4992d67156b984537906777ce/parser/v2/elementparser.go#L265-L282

Other than that, I think I can state the requirement as being that we want a templ component to be able to accept "rest parameters" which are applied to one or more children.
templ Component(name string, attrs ...templ.Attribute) {

     { name }

}

This probably works OK at a single level of nesting, but if I want to pass conditional attributes from a parent to child components, there's no syntax in templ to help, so it would be this monstrosity.
templ Component(name string, attrs ...templ.Attribute) {

     { name }

}

templ Higher(name string, a, b int) {

     @component(name, templ.ConditionalAttribute{Expression: templ.Expression{ Value: "a < b" }, Then: templ.ConstantAttribute("title", name)})

}

This makes me think that we'd have to update the @component syntax to have a HTML style implementation to make this workable.
templ Component(name string, attrs ...templ.Attribute) {

     { name }
     { ...children }

}

templ Higher(name string, a, b int) {

     <Component name={ name }
          if a

Inside the "Component".

     </Component>

}

This adds a bit of complexity because in this view, the attribute "name" becomes an input to the "Component" function. The LSP could be updated to work that out.
All attribute names in the templ component would need to be mapped to function inputs (name, a, b). I think this would need to be quite strict to ensure that function parameter ordering is not a problem.

If I understand correctly what you said:
You'd rather handle dynamic attributes using a slice instead of a map (and then we can utilize some variadic functions).
And your Slice is not an array of key-value pairs, but instead an instance like ExpressionAttribute ?
Personally, I believe it's not a good idea to create an array-like structure of ExpressionAttribute since we never expose any Expression or ConditionalAttribute to the runtime.
If we were to proceed in this manner, within the generator, we would need to implement a loop to check if an element is a ConditionalAttribute, ExpressionAttribute, ConstantAttribute, or BoolExpressionAttribute.
However, the generator should only produce the absolute minimum and shouldn't maintain the parsing tree.

templ Component(name string, attrs ...templ.Attribute) {

     { name }

}

templ Higher(name string, a, b int) {

     @component(name, templ.ConditionalAttribute{Expression: templ.Expression{ Value: "a < b" }, Then: templ.ConstantAttribute("title", name)})

}

After for this code, the issue is not about a spread operator or passing attribute but rather, templ component are go function and we can't put in a go function parameter a if statement or ternary (RIP ternary)
If I wanted to write "hoi" in name if a is superior to b. I can't in the current version of go and templ.

templ Component(name string, attrs ...templ.Attribute) {

     { name }
     { ...children }

}

templ Higher(name string, a, b int) {

     <Component name={ name }
          if a

Inside the "Component".

     </Component>

}

Finally the idea of using a pure HTML attribute rather than @component syntax is interesting.
It could be a breaking change and also strange since behind the scene component are go function.
But this is a debate for an other issue.

I think for this issue what we need is something more simple and more go idiomatic.
If you look into #237 and the doc I wrote :

Spread attributes
Use the { attrMap... } syntax in the open tag of an element to append a dynamic map of attributes, where attrMap is of type templ.Attributes.
templ.Attributes is a map[string]string type definition.
templ component(attrs templ.Attributes) {

}

templ usage() {
  @component(templ.Attributes{"data-testid": "paragraph"})
}

Text

The idea here is to make templ just spread a simple go map (but we can also change this to a slice).
For what is inside of this map or not it's not to templ to decide but to what value is pass to my function.
The example you showed before about conditional attribute is possible but using real go code to create a map that correspond of what you want to do.
func getAttributes(a int, b int) templ.Attributes {
   if a < b {
       return templ.Attributes{"title": "name"}
   }
   return templ.Attributes{}
}

templ Component(name string, attrs templ.Attributes) {

     { name }

}

templ Higher(name string, a, b int) {

     @component(name, getAttributes(a, b))

}

@a-h I'm also not sure I follow on why you would pass a conditional attribute this way, or a bool expression. If you wanted to conditionally add something this way you wouldn't add it to the map/slice, is what I was thinking.
As a parallel, with react props I believe you would reconcile any expressions before passing as props, rather than a conditional that is reconciled every time it's used.
I may be missing the point!

Ah, OK, I think I understand now, and why it makes sense that it's a map! Thanks.

You should add gungun974 conditional attribute example as part of the documentation to show people how they can use it with conditionals.

You should add @gungun974 conditional attribute example as part of the documentation to show people how they can use it with conditionals.

The example I show is a pattern that templ force me to do. Contrary in JS with JSX, we can't write go code in the rendering function.
We can't for example jus't create a variable in the templ element and reuse it. So in this case I got two possibility.

Externalize it and pass to my component argument.
Create inside the same package (file) a function that compute and return exactly what I want.

So if we need to add something in the docs related to this, it's more about this pattern to remember in templ files, we can write Go code like function ^^
(But then I want to say it would be simpler and more obvious for people if we could directly insert go code in templ elements like in JSX. Normally given the code generated by the generator this should not be impossible to make Expression insert raw go code but this is the subject for another issue...)

Literally ran into this exact issue when I created my first component a few minutes ago, also with HTMX hx-* attributes!
#237 is a great solution as it aligns with the way of many (probably all) existing JS frameworks and that makes it fairly easy to adapt to Templ when coming from JS frameworks. attrs spreading is the way to go imho.
I'd offer help but I am just starting out with Go and am probably more of a blocker right now, however, I really wanted to say thanks to all of you for working on this, it looks great, and can't wait until the PR gets merged!
Looking forward to shill Templ even more in the future :)

#237 is a great solution as it aligns with the way of many (probably all) existing JS frameworks and that makes it fairly easy to adapt to Templ when coming from JS frameworks. attrs spreading is the way to go imho.

Thanks the proposal change of my PR is great. I don't want to rush anyone to merge it but it's true I'm hype to get some news from a-h.

I'd offer help but I am just starting out with Go and am probably more of a blocker right now, however, I really wanted to say thanks to all of you for working on this, it looks great, and can't wait until the PR gets merged!

I just want to tell you something about this.
People don't believe enough to themself or have the envy to learn new thing the hard way.
It's not cause you had just started with Go you can't read the Templ code, in fact when I made my first contribution to this project. I only knew golang  for 3 days !
Okay maybe you could failed to contribute but there is not really a looser. You try your best and learn something new. The author maybe lost a tiny amount of time reading your code for nothing but even here. You show how you care about this project to the author and the willing of helping. This is something I think beautiful.
That's why I help some FOSS project, I really want to help them build what could be the best for they project !
Okay I write a lot of text, and maybe it's a little strange but it's important as a person to always try and I wanted to share this here !

Time to close this now the PR has been merged. Thanks for all the input on this!


Failed to run spcomp. program path has no file name

Basic informations

OS: [Windows 10]
VSCode version: Latest
Extension version: Latest

Further Information
When the Language server starts up, everything is usual, until you restart the server, then the error message pops up Failed to run spcomp. program path has no file name.

Before restarting the first time, I've tried to compile my plugin and the terminal/output box will pop up, but nothing happens.
To Reproduce

Let the language server start up.
Restart the language server.
Error message will appear.

Code to reproduce the behaviour

Expected behaviour
It shouldn't error since the file path is correct.
Error messages
Failed to run spcomp. program path has no file name

The latest update has fixed this issue.


chore(package): use react 16.4 in docs and tests

Needed by #3032.

Codecov Report

Merging #3068 into master will decrease coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #3068      +/-   ##
==========================================
- Coverage   99.96%   99.92%   -0.04%
==========================================
  Files         163      163
  Lines        2738     2738
==========================================
- Hits         2737     2736       -1
- Misses          1        2       +1

Impacted Files
Coverage Δ

src/modules/Dropdown/Dropdown.js
99.75% <0%> (-0.25%)
:arrow_down:

Continue to review full report at Codecov.

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