Runtime Exception in IntelliJ when enabling the DDEV Integration plugin

Is there an existing issue for this?

[X] I have searched the existing issues

Are you sure that this bug is related to this DDEV Integration Plugin?

[X] I am sure

Enter your error report ID (If available)
32a32fd501cf4f48ac46f1a361f253a1
Describe the bug
MacOS, v12.5.1
DDEV Integration v1.1.1
IntelliJ 2023.2.4 (Ultimate Edition).
Colima v0.5.5
When enabling the plugin or restarting the IDE, an error occurs as follows:
java.lang.RuntimeException: Cannot invoke (class=AutoConfigureNodeInterpreterListener, method=onDescriptionChanged, topic=DDEV description changed)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:676)
	at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:422)
	at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:401)
	at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:460)
	at jdk.proxy11/jdk.proxy11.$Proxy195.onDescriptionChanged(Unknown Source)
	at de.php_perfect.intellij.ddev.state.DdevStateManagerImpl.checkChanged(DdevStateManagerImpl.java:100)
	at de.php_perfect.intellij.ddev.state.DdevStateManagerImpl.initialize(DdevStateManagerImpl.java:49)
	at de.php_perfect.intellij.ddev.state.DdevStateManagerImpl.initialize(DdevStateManagerImpl.java:33)
	at de.php_perfect.intellij.ddev.InitPluginActivity.lambda$execute$0(InitPluginActivity.java:19)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:272)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: Cannot invoke "de.php_perfect.intellij.ddev.dockerCompose.DdevComposeFileLoader.load()" because the return value of "de.php_perfect.intellij.ddev.dockerCompose.DdevComposeFileLoader.getInstance(com.intellij.openapi.project.Project)" is null
	at de.php_perfect.intellij.ddev.node.AutoConfigureNodeInterpreterListener.onDescriptionChanged(AutoConfigureNodeInterpreterListener.java:30)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:699)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:663)
	... 19 more

The DDEV terminal feature of the plugin works
The auto configuration of the datasource is not available.
The link on the DDEV status icon only shows the option to 'Open Website'.
The DDEV status message does not sync with the current state of ddev. I.e. if I run ddev stop the status message still reads 'Running'

Steps to reproduce

Close Docker, Colima
Stop all instances of ddev
Restart IntelliJ
Open IntelliJ and previously configured ddev project
colima start
ddev start
Notifications in IntelliJ say 'Docker is not running. To use the DDEV Integration Plugin, please make sure that Docker is running.' Click 'Reload Plugin' link.
Error appears in IDE.

Additional context
There is a warning in the Docker > Tools setting for Docker Compose Executable, don't know if this is relevant.

Seeing this as well on DDEV 1.2.0 and Docker Desktop.

Colima user here.
I came here because I was getting the following error with the node.js interpreter setup:
com.intellij.docker.agent.ApiTaskException: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (Details: [2] No such file or directory)

Looking into the Docker settings I don't actually have this executables. I found one in my homebrew bin using whereis docker, but I don't seem to have docker-composer.
So this is as far as I've managed to get...

Unsure what to do now?

@graham73may I imagine your experience is related to

https://github.com/php-perfect/ddev-intellij-plugin/issues/258

And docker-compose is in ~/.ddev/bin/docker-compose - that's the one to use.

I can't confirm this issue with the current versions. The DDEV status is detected correctly for me, and the PHP remote interpreter works as well.
colima 0.7.3
docker version
Client:
 Version:           26.1.3
 API version:       1.45
 Go version:        go1.21.10
 Git commit:        b72abbb
 Built:             Thu May 16 08:30:38 2024
 OS/Arch:           darwin/arm64
 Context:           colima

Server: Docker Engine - Community
 Engine:
  Version:          27.1.1
  API version:      1.46 (minimum version 1.24)
  Go version:       go1.21.12
  Git commit:       cc13f95
  Built:            Tue Jul 23 20:00:07 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.7.19
  GitCommit:        2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc:
  Version:          1.7.19
  GitCommit:        v1.1.13-0-g58aa920
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

ddev version
 ITEM             VALUE
 DDEV version     v1.23.4
 architecture     arm64
 cgo_enabled      0
 db               ddev/ddev-dbserver-mariadb-10.11:v1.23.4
 ddev-ssh-agent   ddev/ddev-ssh-agent:v1.23.4
 docker           27.1.1
 docker-api       1.46
 docker-compose   v2.29.1
 docker-platform  colima
 global-ddev-dir  /Users/xxx/.ddev
 mutagen          0.17.2
 os               darwin
 router           ddev/ddev-traefik-router:v1.23.4
 web              ddev/ddev-webserver:v1.23.4

docker compose v2.27.3
PhpStorm 2<IP_ADDRESS>
DDEV IntelliJ Plugin dev-main


[AKS] Fix error that msi client always get managed identity in ctx's sub

Currently, the MSI client is created using current context's subscription, which is incorrect when the identity is in another subscription. This PR fix the error.

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

For new extensions:

[ ] My extension description/summary conforms to the Extension Summary Guidelines.

About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your PR is merged into master branch, a new PR will be created to update src/index.json automatically.
The precondition is to put your code inside this repo and upgrade the version in the PR but do not modify src/index.json.

@fengzhou-msft could you please help merge the PR?


[PE-D][Tester B] Addleave: able to add a outdated date

Users are allowed to add leave dates for a contact with dates that are already over, rather dates past the current date

Labels: severity.Medium type.FeatureFlaw
original: Angelyxx/ped#4

can limit earliest date to first day of current year


[SPARK-43893][PYTHON][CONNECT] Non-atomic data type support in Arrow-optimized Python UDF

What changes were proposed in this pull request?
Support non-atomic data types in input and output of Arrow-optimized Python UDF.
Non-atomic data types refer to: ArrayType, MapType, and StructType.
Why are the changes needed?
Parity with pickled Python UDFs.
Does this PR introduce any user-facing change?
Non-atomic data types are accepted as both input and output of Arrow-optimized Python UDF.
For example,
>>> df = spark.range(1).selectExpr("struct(1, struct('John', 30, ('value', 10))) as nested_struct")
>>> df.select(udf(lambda x: str(x))("nested_struct")).first()
Row(<lambda>(nested_struct)="Row(col1=1, col2=Row(col1='John', col2=30, col3=Row(col1='value', col2=10)))")

How was this patch tested?
Unit tests.

Merged to master, thanks all!


chore(ui): setup e2e test suite

Setup e2e test suite
Type: Chore
Description: Setup Playwright to work with Supabase and auto-authenticate for tests. Write initial set of tests for existing features.
Acceptance Criteria:

[x] Playwright runs against a local supabase instance (for now, we may want to run against a deployed version in the future)
[x] All Playwright tests authenticate the user before running
[x] Sidebar features and chat are E2E tested

clo

Closed by PR #13, currently unable to autolink, suspected due to not being in monorepo yet


Feat: Contact Us section UI design CSS style improving.

#1264  solved.
#1264
Feat: Contact Us section UI design CSS style improving.
Description
I improved the CSS styling of the UI of Contact section.
@arghadipmanna101
I improved the CSS styling of the contact section, Here I add blinking effect to the contact section.
Now it looks good.
Type of PR

[x] Bug fix
[x] Feature enhancement
[x] Documentation update
[x] Other (specify): _______________

Screenshots / videos (if applicable)
Video -
https://github.com/arghadipmanna101/Flipkart_Clone/assets/136844498/fb06f55f-8fad-4976-acfa-2a5a24ce0b81
Checklist:

[x] I have performed a self-review of my code
[x] I have read and followed the Contribution Guidelines.
[x] I have tested the changes thoroughly before submitting this pull request.
[x] I have provided relevant issue numbers, screenshots, and videos after making the changes.
[x] I have commented my code, particularly in hard-to-understand areas.

Additional context:
[Include any additional information or context that might be helpful for reviewers.]

@arghadipmanna101
Please merge this PR

@arghadipmanna101
You have not given labels on this PR.  Why ?

@arghadipmanna101
Respected PA,
You didn't give the Labels on this PR and also didn't mention the gssoc labels. Please give labels.


abstract constants

!ci-build-me

Just a remainder -> I believe we should be merging against master instead of develop


Is it necessary to skip the root commit in process_commits()

Original comment
        # First ever commit, we don't need to store this as it'll be present in any distro
        # TODO revisit, maybe check against set hash of first commit?
        # Get code some other way? Unsure if first commit matters or not.

This skips commits if they don't have parent, i.e. root commit. There's no checking to make sure the root commits match and other mechanisms should filter out the root commit if it even comes up, so this probably isn't necessary. Technically, in the current state, it would be wrong if compared against an empty repo.

Determined there should be no downside in skipping this. Completed in #67


Fix duplicate code in OAuthPrompt and OAuthInput

https://github.com/microsoft/botbuilder-dotnet/blob/master/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/OAuthInput.cs
and
https://github.com/microsoft/botbuilder-dotnet/blob/master/libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs
Have many identical blocks of code.  In R10, an update was made to OAuthPrompt but not OAuthInput.  These two are now out of sync (OAuthInput's timeout will not function properly,and OAuthInput does not have EndOnInvalidMessage)

Investigate why the OAuthPrompt is sending the CancellationToken as the InvokeResponse:
https://github.com/microsoft/botbuilder-dotnet/blob/master/libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs#L518
and
https://github.com/microsoft/botbuilder-dotnet/blob/master/libraries/Microsoft.Bot.Builder.Dialogs/Prompts/OAuthPrompt.cs#L525

This will fall within the refactor effort for Adaptive. We should take into consideration the adapter refactoring.

This is the first step towards fixing #4729 for the oauth prompt


jah-1922 Update monasca-api-spec.md

looks good

Thank you for contributing to stackforge/monasca-api!
stackforge/monasca-api uses Gerrit for code review.
Please visit
http://docs.openstack.org/infra/manual/developers.html#development-workflow
and follow the instructions there to upload your change to Gerrit.


Document MaterialX mimetype

Can documentation for the MaterialX mimetype be written?
Possible options are image/mtlx and image/materialx

I believe this should technically be possible, but I'd be curious as to what benefits this would provide to developers or artists working with MaterialX content.  Did you have a specific use case in mind?

Let me write up the details, the simplest example was I wanted to include into gltf like png. Might require a single xml doc though and of course I could use the xml mimetype

prior art.
svg has a external mode where there is a avg and external files like svg and png or svgz which is a singular file.

The mimetype precedent for material files is the Wavefront MTL file. Its mimetype is model/mtl. Reasonable mimetypes would include model/matx, model/material-x, and the like.
https://www.digipres.org/formats/mime-types/

@fire I'll close this issue for now, but we're open to future discussions in this area.


coordinate first set of whitepapers and blog posts

coordinate first set of whitepapers, and posts regarding a reference architecture re: security.

close as this is dup of #76


File Upload Component

Refactor suggestion
The file upload component should be better designed.
Both with cropping, but also the file upload itself.
It should also be able to upload multiple files within the same component.

Hmm, i think i need a better explanation here, as i am not familiar with the banner image upload. Will talk to you at the meeting @MadsNyl .

We will look at this as inspiration together at the meeting:
https://dribbble.com/search/file-upload


Cannot run llama3.1 models with ollama

I've installed ipex-llm with llama.cpp and ollama support following the instructions:
pip install --pre --upgrade ipex-llm[cpp]
init-llama-cpp
init-ollama

I'm trying to use model llama3.1:8b-instruct-q4_K_M with ollama and langchain. When downloading the model with ollama I get an error:
$ ollama pull llama3.1:8b-instruct-q4_K_M

Error: pull model manifest: 412:

The model you are attempting to pull requires a newer version of Ollama.

Please download the latest version at:

        https://ollama.com/download

ipex-llm version is 2.2.0b20240822
Minimal reproducer:
from langchain_community.llms import Ollama

llm = Ollama(model="llama3.1:8b-instruct-q4_K_M")

q = "What is the capital of Spain?"
print(f"Query: {q}")
response = llm.invoke(q)
print('Response:')
print(response)

Execution:
pip install langchain langchain_community
./ollama serve &
python test.py

Hi @tkarna ,

$ ollama pull llama3.1:8b-instruct-q4_K_M

Error: pull model manifest: 412:

The model you are attempting to pull requires a newer version of Ollama.

Please download the latest version at:

        https://ollama.com/download

Maybe try it again with  $ ./ollama serve /  $ ./ollama pull llama3.1:8b-instruct-q4_K_M under your ollama directory ?
The error looks like you are not using ipex-llm's ollama, instead of an old community ollama.

Thanks, an older version of ollama was indeed interfering. Fixed that now. I can pull the model correctly. But when I run the example, I get an error:
llama_model_load: error loading model: done_getting_tensors: wrong number of tensors; expected 292, got 291

Can you reproduce this?
Possibly related: https://github.com/abetlen/llama-cpp-python/issues/1646

Here is a related user issue: https://github.com/intel-analytics/ipex-llm/issues/11836
But I think we have fixed it. Could you please check it again ?

Glad to hear to that : )


5.2.1: Child container creates new instances when resolving concrete class with hierarchical lifetime

Behaviour of HierarchicalLifetimeManager changed from 5.2.0 to 5.2.1.
The test below passes with 5.2.0 but fails with 5.2.1.
A new instance of Something is created like if it is transient, this has been changed, before it was a single instance in the child container.
    interface ISomething
    {
    }

    class Something : ISomething
    {
    }

    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            IUnityContainer rootContainer = new UnityContainer();
            rootContainer.RegisterType<ISomething, Something>(new HierarchicalLifetimeManager());

            using (IUnityContainer childContainer = rootContainer.CreateChildContainer())
            {
                Something a = childContainer.Resolve<Something>();
                ISomething b = childContainer.Resolve<ISomething>();

                Assert.AreSame(a, b);
            }
        }
    }

This is due to this bug fix. I've added explanation to the Release

The test indeed passes, but I still run into problems, so i think the behaviour is not exactly the same as before. I will see if i can come up with another test to show what i mean.

I am looking into similar issue with ContainerControlledLifetimeManager. It could be that not all edge cases are handled. Will let you know...

You might want to look at this issue. It might be what you are looking for.


Build error on UWP

There is an issue for the UWP build of ros2_dotnet. In particular, the error is on fastrtps and the problem seems to be related to perhaps some differences in libraries and non-compatibility with UWP as it gives some syntax errors:
e.g., error C2332: 'struct': missing tag name (compiling source file ros2-uwp\src\eProsima\Fast-RTPS\src\cpp\transport\TCPAcceptorSecure.cpp)
Some context for the compilation:

this is the command I am running colcon build --merge-install --packages-ignore rmw_fastrtps_dynamic_cpp rcl_logging_log4cxx rcl_logging_spdlog ros2trace tracetools_launch tracetools_read tracetools_test tracetools_trace --cmake-args -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.17134 -DTHIRDPARTY=ON -DINSTALL_EXAMPLES=OFF -DBUILD_TESTING=OFF -DRCL_LOGGING_IMPLEMENTATION=rcl_logging_noop  --event-handlers console_cohesion+
I am running this with the repos file for UWP: https://github.com/ros2-dotnet/ros2_dotnet/blob/master/ros2_dotnet_uwp.repos thus I am using the Fast-RTPS fork (https://github.com/ros2-dotnet/Fast-RTPS)
I am compiling on Windows 10 with Visual Studio 2017.

Note that the Desktop ros2_dotnet compiles fine. My sense is that the problem might be on the ASIO library, and I tried to get the uwp version with vcpkg .12.2-2, but still without success.
(Split from comments on issue #55)

@quattrinili were you able to resolve this issue? I've got the same problem.

Hey @quattrinili and @mcevoyandy
Quick thought from my side -- have you used ROS2 on Windows before (and thus, have you installed all the nuget package dependencies necessary for the Desktop install?). I've noticed that if cmake can find them, then ASIO will not source its own copies, and you'll end up pulling in the non-UWP libraries to the build which can cause build and/or runtime errors.
Uninstall all ROS2 third party dependencies that the ROS2 installation instructions had to install (libasio, tinyxml, log4cxx, etc). The repos files (for UWP) are completely standalone, and the -DTHIRDPARTY=ON flag is specifically for FastRTPS - it checks out and builds its own copy of all dependent libraries. Doing it this way ensures the dependencies are also UWP ready.

Oh and uninstall OpenSSL as well -- my memory is foggy but I believe if OpenSSL is not present, FastRTPS will not build with security enabled (and your build error is in something called "TCPAcceptorSecure")

@quattrinili @mcevoyandy yes, @theseankelly is right, uninstall OpenSSL for now. The reason for this failing is that TCPAcceptorSecure uses interface as a variable name, but that is defined in windows.h as a typedef for something else. However, because we don't install OpenSSL in CI, we didn't see this issue.
I'm updating our fork of Fast-RTPS to not build the security stuff if targeting UWP.

I've disabled support for the security extensions in FastRTPS if building for UWP in https://github.com/ros2-dotnet/Fast-RTPS/commit/40072bb821e567d96e389d6180960416257a7c0e
@quattrinili @mcevoyandy could you try again with an updated copy of our fork of FastRTPS?
Thanks!

Thanks for the fast response! This enabled fastrtps to build properly :)
Here's the steps I followed:

Windows > Add or Remove Programs > OpenSSL > uninstall
in cmd: > choco uninstall asio
Remove build, install, log folders from previous build attempts
Repeated install instructions

I forgot that I had OpenSSL and I uninstalled it. The error related to it disappeared. However, unfortunately, I am still having problems, this time with linking with a link with foonathan_memory. I am digging into it.
foonathan_memory-0.6.2.lib(virtual_memory.obj) : error LNK2019: unresolved external symbol __imp_VirtualAlloc referenced in function "void * __cdecl foonathan::memory::traits_detail::allocate_node<class foonathan::memory::virtual_memory_allocator>(struct foonathan::memory::traits_detail::full_concept,class foonathan::memory::virtual_memory_allocator &,unsigned __int64,unsigned __int64)" (??$allocate_node@Vvirtual_memory_allocator@memory@foonathan@@@traits_detail@memory@foonathan@@YAPEAXUfull_concept@012@AEAVvirtual_memory_allocator@12@_K2@Z)

Ok, found the problem: it is in the foonathan/memory, which uses VirtualAlloc, however UWP does not support it. Instead, VirtualAllocFromApp should be used, and that works also for Windows Desktop app (see https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualallocfromapp). I modified it in my fork https://github.com/quattrinili/memory -- I plan to submit a pull request for foonathan/memory, but you are welcome to use it if you would like in the meanwhile.
This allowed me to fully compile ros2_dotnet for UWP. I tried with a talker and a listener in a simple UWP app, and at least right now it is not crashing; though for some reasons, they are not able to communicate. I still get some DLLNotFoundException on rcl_dotnet_common. I will check a couple of other things.

@quattrinili

This allowed me to fully compile ros2_dotnet for UWP

That's great! Fast-RTPS introduced foonathan_memory as a dependency, but it's weird that our CI hasn't caught that. In any case. thanks! :-)

Maybe it was working with a previous version of MSVC? I submitted the pull request upstream for foonathan memory, but I see that it fails with MSVC 14 (should be Visual Studio 2015). On my system, both VS 2017 and 2019 work. All these versions make it hard to ensure things work properly... :)


Added download button for pdf

Added download button at the end of website which download pdf from assests folder

[X] I have read the Code Of Conduct.
[X] I have followed all the steps of submission properly.

I have created a PR please review it


Expose the user-agent in the preferences - so that the user can copy-paste from other references without needing to know javascript and edit the js file

Is your feature request related to a problem? Please describe.
I see a lot of issues related to user agent string; and references to open up the user.js or webview.js file. Imo, as the structure of the js object changes over time, the old setting/syntax might not work.
Describe the solution you'd like
Instead of the Ferdi user being tech-savvy to edit the js file, can we instead expose this as a setting/preference? Then a wiki page that lists different user agents for different browsers would be enough for lay-people (non-techies) to copy-paste and try out the settings that works for them.
Describe alternatives you've considered
I have followed the references to override the user agents in javascript snippets - and have also faced issues where that was malformed due to js syntax issues.
Additional context
Add any other context or screenshots about the feature request here.

The main problem is that different services need different User-Agent headers (or other tricks, like https://github.com/getferdi/recipes/pull/308). Afaik there's also at least two ways to override the User-Agent (one for specific requests only, and one for all requests of a service), and there may be situations where different requests for a service need different spoofed User-Agent headers (if we claim to Google that we're Chrome, it'll ran more fingerprinting and conclude that we're not, blocking login, but some other features specifically need a Chrome user agent).  It's kind of an "arms race" between Ferdi and services that want to limit user logins to "official" browsers (maybe they can track users more effectively that way?).
The problem is that we're sorely lacking the manpower to participate in the arms race successfully.
A text field to override the user agent may be a stopgap measure, but it's a poor one (see the need for different headers for different requests as above). Maybe we could have a way to obtain a user-agent header for

The latest version of Firefox / Chome / Chromium / Edge / Safari, or the actual version of Chromium (with cloaking of browser plugins).
Running on the actual operating system, or the latest version Ubuntu Linux / macOS / Windows / Android / iOS.

Then the recipes only have to include criteria for these, and they are kept somewhat up to date. Maybe something like https://www.npmjs.com/package/user-agents could help, but without the randomization. Thus the recipe could obtain and apply a user agent header for the specific requests it needs.
Also, we could have a user-level override (textbox, or selection from the criteria above) as a blanket fallback override, should the recipe become out of date.
However, these solutions always remain imperfect. In the limiting case, a service could use some (unpatchable) spectre vulnerability to perform an arbitrary memory read to determine the browser binary being used. Let's hope the arms race never gets to that point.

@kris7t - thanks for the insights. I have only ever encountered the issue with users being asked to navigate to the recipes folder, and edit the modifyRequestHeaders method to change the user-agent in the headers json section. What's a good example of the other style of user-agent-overrides that you can point me to?
IF there's 2 different patterns for the above 2 styles, we could introduce 2 text boxes - one for the global (within the service context), and another for per-request overrides along with other metadata across requests.
I was not thinking of having the actual UA string being hardcoded in the packaged app - its a free-flow text-box which can be entered by the user from searching the web. wdyt?

The problem with the free flowing text box is that the value there inevitably goes out of date, and then the service will stop working. If we ship a hardcoded set of user agent strings (or a user agent generator) that always generates the latest version, we can work around at least that. Having users copy-pase user agent string isn't very scalable, and I think should be reserved for a last resort.
This of course doesn't help if the service figures out how to fingerprint us (like how Skype did, although it wasn't specifically aimed at Ferdi, but any open-source browser including Chromium, but not including Chrome or Edge).
Compare e.g.
https://github.com/getferdi/recipes/blob/master/recipes/msteams/index.js
which uses overrideUserAgent to change the user agent in the webview vs
https://github.com/getferdi/recipes/blob/master/recipes/gmail/index.js
which applies it to all possible requests.
Btw, it seems Google gets special handling in
https://github.com/getferdi/ferdi/blob/e3898e2f47db4d056c03708221901d58eb47c8f5/src/models/Service.js#L265-L278
because neither of the APIs provided in recipe.js can handle all user agent sniffing it employs.

Closed due to #1535


Investigate SSL hostname verification

We currently run the SSL tests with hostname verification disabled: https://github.com/redis-rb/redis-client/blob/9ffd07649e1c79c04490fa5da6b229d0b12583b8/test/support/redis_server_helper.rb#L40
We should have a look at how we could enable it on local and CI, to make sure it works in production.
https://github.com/redis/redis-rb does have some test for it, so it should be doable.

Fixed in 4ec3e98f53f57b22770e21d48937da9f63d74cdd


Dynamic Scheme

Hi!
I'm trying to integrate pggen into an existing project and am very happy with it so far. But now I have experienced a problem and dont know if it's even possible to be handled by pggen.
For specific data, I'm using dynamic schemes. Every user has its own scheme in the database to kind of separate the data. Before using pggen, my solution was using fmt.Sprintf() and not the prepared statements by pgx:
row = tx.QueryRow(ctx, fmt.Sprintf(`
			INSERT INTO blumo.instance_%v.activities (user_id, category, created_at, outcome, message_id, affected_document_id)
			VALUES ($1, $2, $3, $4, $5, $6)
			RETURNING id
		`, request.InstanceId), request.AuthorId, request.Category.Number(), insertTimestamp, request.Outcome.Number(), request.Message, request.DocumentId)

but trying it with the following sql:
-- name: InsertDocumentActivity :one
INSERT INTO instance_pggen.arg('InstanceId').activities
(user_id, category, created_at, outcome, message_id, affected_document_id)
VALUES
(pggen.arg('UserId'), pggen.arg('Category'), pggen.arg('CreatedAt'), pggen.arg('Outcome'), pggen.arg('MessageId'), pggen.arg('AffectedDocumentId'))
RETURNING id;

I only get ERROR: relation "instance_$1.activities" does not exist (SQLSTATE 42P01), while running pggen, back. And I can understand the problem, but my question is, if there is even a chance to solve this or if pggen is just "not made for this special case". I already tried it with a custom connection string, but didn't manage to solve it with it either.
Does anybody has an idea? Is there any possibility to work-around the prepared statements and inject a variable otherwise? I know it's a bleeding edge case and probably you never heard of anything like that, so I appreciate any help, even the slightest.

Under the hood, pggen only supports prepared queries. Prepared queries are limited to values and you can't use them for identifiers.
I'd eventually like support dynamic identifiers. There's a few outstanding requests for it. I think I'd make it something like pggen.relation to enable passing in either an identifier or subquery.
For your specific scenario, I'd recommend wrapping the dynamic part in a plpgsql function and call it like so. Calling it in the FROM clause is important so that we get a row containing all the columns instead of 1 row with a single column of a Postgres composite type (a_user1,a_category,"2022-07-17 01:48:40.917932+00",a_outcome,a_message_id).
-- name: InsertDocumentActivity :one
SELECT *
FROM tmp.insert_activity_for_instance(
  _instance := pggen.arg('instance'),
  _user_id := pggen.arg('user'),
  _category := pggen.arg('category'),
  _created_at := pggen.arg('created_at'),
  _outcome := pggen.arg('outcome'),
  _message_id := pggen.arg('message_id')
  );

Here's the test code I used to validate the idea. Each Postgres table also declares a type of the same name which is what we're returning.
CREATE TABLE tmp.instance_foo_activities (
  user_id    text PRIMARY KEY,
  category   text,
  created_at timestamptz,
  outcome    text,
  message_id text
);

CREATE OR REPLACE FUNCTION tmp.insert_activity_for_instance(
  _instance text,
  _user_id text,
  _category text,
  _created_at timestamptz,
  _outcome text,
  _message_id text
) RETURNS setof tmp.instance_foo_activities AS $fn$
DECLARE
  -- NOTE: SQL injection possible here.
  _tbl text = 'tmp.instance_' || _instance || '_activities';
BEGIN
  -- Using %s instead of %I because %s doesn't work with dotted paths with
  -- schemas.
  RETURN QUERY EXECUTE format($$
    INSERT INTO %s (user_id, category, created_at, outcome, message_id)
    VALUES ($1, $2, $3, $4, $5)
    RETURNING *
  $$, _tbl)
    USING _user_id, _category, _created_at, _outcome, _message_id;
END;
$fn$ LANGUAGE plpgsql VOLATILE;

SELECT *
FROM tmp.insert_activity_for_instance(
  _instance := 'foo',
  _user_id := 'a_user',
  _category := 'a_category',
  _created_at := now(),
  _outcome := 'a_outcome',
  _message_id := 'a_message_id'
  );

Returns the following row:

column
value

user_id
a_user

category
a_category

created_at
2022-07-17 01:43:00.480676 +00:00

outcome
a_outcome

message_id
a_message_id

Damn, that was fast. I was a bit scared when the email notification just arrived, because its middle in the night in germany... anyway, thanks for your time. I never got in touch with plpgsql, but will have a look tomorrow. From my first sight that looks very promising. I was messing around with sed the last hours, because I didn't see any other way. Using the native functions of pgsql didn't come to my mind, but like I said, looks promising. Thanks again for your time!

But the plpgsql sits on the scheme level as I understand

It should work okay no matter where the function is defined. The function takes in the table path so you can pass in whatever schema qualified table you want as a string. The function blindy interpolates _instance into an insert statement (hence the comment about sql injection).
SELECT *
FROM tmp.insert_activity_for_instance(
  _instance := 'any.arbitrary.schema.you.want.foo',
  -- rest of the args
  );

Setting the search_path also works but I suspect passing in the schema is easier to manage.


[multidelegation] feat: multidelegation strategy

Changes proposed in this pull request:

Added support for users to delegate to multiple addresses

Hey guys, i feel like this is too heavy for us, we stopped adding new strategies that depend on other voters https://github.com/snapshot-labs/snapshot-strategies#code do you think of any other alternatives? maybe you can run this on our side and use api strategy to return the voting power?


duplicate metabolites identified

Description of the issue:

Reported by Han, Yichao<EMAIL_ADDRESS>There seems two metabolites suspected as duplicates: s_3948  and s_0557
I hereby confirm that I have:

[x] Tested my code with all requirements for running the model
[x] Done this analysis in the develop branch of the repository
[x] Checked that a similar issue does not exist already
[x] If needed, asked first in the Gitter chat room about the issue

Basically s_0557(D-fructose 6-phosphate) contains s_3948(beta-D-Fructose 6-phosphate) and another alpha isomer. So technically, they are not 100% same. In the future, I think we will add all isomers in the model, so for now, it is ok to keep both now as far as I know. But it is good that to document that we have noticed this issue.


test: e2e golden testing for csv command

Set up golden file testing for go-licenses csv command on example modules.
Update golden files by running: go test --update .
The example modules are copied from https://github.com/google/go-licenses/pull/82/files#diff-94148d1a2f964b0818fb803205c7eeb784f34bdb714da3d3feda7706d18cfd17.

@wlynch for review


KeyError: '0 is not registered'

I do my first steps with commitizen and decided to use the docker-image.
In one of my repos I hit errors, now I created a fresh git repo with only one file in it.
I get stuff like:
docker run --rm -v $(pwd):/app -v ~/.gitconfig:/etc/gitconfig -u $(id -u) commitizen/commitizen:latest /bin/sh -c 'cz --debug init'
Warning: Input is not a terminal (fd=0).
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 265, in _add_reader
    key = self._selector.get_key(fd)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/selectors.py", line 192, in get_key
    raise KeyError("{!r} is not registered".format(fileobj)) from None
KeyError: '0 is not registered'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/input/vt100.py", line 176, in _attached_input
    loop.add_reader(fd, callback_wrapper)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 340, in add_reader
    self._add_reader(fd, callback, *args)
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 267, in _add_reader
    self._selector.register(fd, selectors.EVENT_READ,
  File "/usr/local/lib/python3.11/selectors.py", line 359, in register
    self._selector.register(key.fd, poller_events)
PermissionError: [Errno 1] Operation not permitted

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/cz", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/commitizen/cli.py", line 407, in main
    args.func(conf, vars(args))()
  File "/usr/local/lib/python3.11/site-packages/commitizen/commands/init.py", line 29, in __call__
    config_path = self._ask_config_path()
                  ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/commitizen/commands/init.py", line 68, in _ask_config_path
    ).ask()
      ^^^^^
  File "/usr/local/lib/python3.11/site-packages/questionary/question.py", line 70, in ask
    return self.unsafe_ask(patch_stdout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/questionary/question.py", line 92, in unsafe_ask
    return self.application.run()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 978, in run
    return loop.run_until_complete(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 885, in run_async
    return await _run_async(f)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 737, in _run_async
    with self.input.raw_mode(), self.input.attach(
  File "/usr/local/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/prompt_toolkit/input/vt100.py", line 185, in _attached_input
    raise EOFError
EOFError

context:
sgw in testrepo (main) [🗃 ×1]  ✗  ls -la
insgesamt 4
drwxr-xr-x.  3 sgw  sgw   80 10. Jän 14:14 .
drwxrwxrwt. 29 root root 700 10. Jän 14:15 ..
drwxr-xr-x.  7 sgw  sgw  220 10. Jän 14:14 .git
-rw-r--r--.  1 sgw  sgw   10 10. Jän 14:14 README.md
sgw in testrepo (main) [🗃 ×1]  ❯ git status .
Auf Branch main

Noch keine Commits

Zum Commit vorgemerkte Änderungen:
  (benutzen Sie "git rm --cached <Datei>..." zum Entfernen aus der Staging-Area)
	neue Datei:     README.md

This is on a Fedora 37 workstation, if that matters.
I randomly tried that with an older tags of the image, same issues.
Do I have some mistakes in my approach, what can I do? Thanks.

Have you tried with the latest versions?

I'm having the same issue (kind of intermittent depending on the commit). I am using commitizen image 3.21.3. Any news on that? Tks!

What were you running?

Not sure I got your question, but will try to give more details. I am running it inside a bamboo agent using the docker image 3.21.3
docker run --rm --volume "$(pwd):/app" --user "$(id -u):$(id -g)" commitizen/commitizen:3.21.3 bump --dry-run
I got the error twice (in different moments). It seems intermitent because If I rerun the pipeline over the same commit it works.

I'm getting this same error with v3.25.0.  I have the commit hooks installed as directed here, and when running git commit I get the following error trace:
Traceback (most recent call last):
  File "/Users/btsomogyi/.asdf/installs/python/3.11.5/lib/python3.11/asyncio/selector_events.py", line 265, in _add_reader
    key = self._selector.get_key(fd)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/.asdf/installs/python/3.11.5/lib/python3.11/selectors.py", line 192, in get_key
    raise KeyError("{!r} is not registered".format(fileobj)) from None
KeyError: '0 is not registered'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/bin/cz", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/commitizen/cli.py", line 607, in main
    args.func(conf, arguments)()
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/commitizen/commands/commit.py", line 103, in __call__
    m = self.prompt_commit_questions()
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/commitizen/commands/commit.py", line 56, in prompt_commit_questions
    answers = questionary.prompt(questions, style=cz.style)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/questionary/prompt.py", line 78, in prompt
    return unsafe_prompt(questions, answers, patch_stdout, true_color, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/questionary/prompt.py", line 223, in unsafe_prompt
    answer = question.unsafe_ask(patch_stdout)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/questionary/question.py", line 89, in unsafe_ask
    return self.application.run()
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 978, in run
    return loop.run_until_complete(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/.asdf/installs/python/3.11.5/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 885, in run_async
    return await _run_async(f)
           ^^^^^^^^^^^^^^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 737, in _run_async
    with self.input.raw_mode(), self.input.attach(
  File "/Users/btsomogyi/.asdf/installs/python/3.11.5/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/Users/btsomogyi/Library/Caches/pypoetry/virtualenvs/commitizen-demo--3a4COU6-py3.11/lib/python3.11/site-packages/prompt_toolkit/input/vt100.py", line 176, in _attached_input
    loop.add_reader(fd, callback_wrapper)
  File "/Users/btsomogyi/.asdf/installs/python/3.11.5/lib/python3.11/asyncio/selector_events.py", line 340, in add_reader
    self._add_reader(fd, callback, *args)
  File "/Users/btsomogyi/.asdf/installs/python/3.11.5/lib/python3.11/asyncio/selector_events.py", line 267, in _add_reader
    self._selector.register(fd, selectors.EVENT_READ,
  File "/Users/btsomogyi/.asdf/installs/python/3.11.5/lib/python3.11/selectors.py", line 522, in register
    self._selector.control([kev], 0, 0)
OSError: [Errno 22] Invalid argument

@btsomogyi Have you found a solution for this?

I am getting apparently the same error with a different Python package.
36-141% radian
R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
Platform: powerpc-apple-darwin10.0.0d2 (32-bit)

unexpected error was caught.
please report to https://github.com/randy3k/radian for such error.
[Errno 22] Invalid argument
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/selector_events.py", line 269, in _add_reader
    key = self._selector.get_key(fd)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/selectors.py", line 192, in get_key
    raise KeyError("{!r} is not registered".format(fileobj)) from None
KeyError: '0 is not registered'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/radian/console.py", line 99, in _read_console
    text = session.prompt(add_history=add_history)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/radian/prompt_session.py", line 71, in prompt
    text = super().prompt(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/radian/lineedit/prompt.py", line 228, in prompt
    result = super().prompt(inputhook=self._inputhook, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prompt_toolkit/shortcuts/prompt.py", line 1035, in prompt
    return self.app.run(
           ^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 978, in run
    result = loop.run_until_complete(coro)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 886, in run_async
    return await _run_async(f)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prompt_toolkit/application/application.py", line 734, in _run_async
    with self.input.raw_mode(), self.input.attach(
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prompt_toolkit/input/vt100.py", line 165, in _attached_input
    loop.add_reader(fd, callback_wrapper)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/selector_events.py", line 344, in add_reader
    self._add_reader(fd, callback, *args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/selector_events.py", line 271, in _add_reader
    self._selector.register(fd, selectors.EVENT_READ,
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/prompt_toolkit/eventloop/inputhook.py", line 112, in register
    return self.selector.register(fileobj, events, data=data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/selectors.py", line 523, in register
    self._selector.control([kev], 0, 0)
OSError: [Errno 22] Invalid argument

Is there any solution?


Security Vulnerability - possible to read arbitrary files via socket

Patched gem version: v2.5.2
PR with patch: https://github.com/guard/guard-livereload/pull/158
Affected versions: v2.5.1 and below
Credits: @mikeycgto
Use cases affected:

multiuser servers running livereload
websocket address listening on non-local address
websocket port forwarded to untrusted/multiuser remote machines
?

Basically, anyone who can connect to the port can read files available to the user running the livereload server.
Stuff left to do:

[x] Prevent files other than ./livereload.js to be loaded via socket
[x] Release 2.5.2 with file serving disable (other than ./livereload.js)
[x] Add info to Readme
[x] Add websocket spec (none yet) (#160)
[x] Refactor websocket for filesystem related specs  (#160)
[ ] CVE - none yet
[ ] Decide which files should be allowed (if any)

A CVE was assigned for this issue: CVE-2016-1000305
https://github.com/distributedweaknessfiling/DWF-Database-Artifacts/blob/158c10cf11bc7d6ad728c1a8dd213f523ecfca52/DWF/2016/1000305/CVE-2016-1000305.json

A CVE was assigned for this issue: CVE-2016-1000305
https://github.com/distributedweaknessfiling/DWF-Database-Artifacts/blob/158c10cf11bc7d6ad728c1a8dd213f523ecfca52/DWF/2016/1000305/CVE-2016-1000305.json

Do you know status of this CVE?


STORM-2781: Refactor storm-kafka-client KafkaSpout Processing Guarantees

Define processing guarantees as AT_LEAST_ONCE, AT_MOST_ONCE, NONE
Refactor method name from setForceEnableTupleTracking to setTupleTrackingEnforced
Throw IllegalStateException instead of IllegalArgumentException if spout attempts to emit an already committed message
Update documentation to reflect these changes

@HeartSaVioR for 1.x-branch

+1 (I missed it.)


Version selection assumes etcd image versions will begin with "v"

The code that constructs the etcd image version from the CRD spec prefixes the image version with a "v". This assumption breaks in some contexts where the released etcd images from quay.io are not beins used, and it would be useful to have a way to tell the operator to take the image version as-is, without inserting the extra "v" into the versioning scheme.
https://github.com/coreos/etcd-operator/blob/7fbe23cf50900e6282255978ae9930a7750d9238/pkg/util/k8sutil/k8sutil.go#L138

Looks like #1970 addresses this.

made a PR for the v addition to the version : https://github.com/coreos/etcd-operator/pull/2079


queries with $size:length are ignored.

I have docs with key tags which is an array.
When performing the following query, I end up getting all tags instead of only the ones with length 0.
var query = {
        selector: {
          tags: {
            $size: 0
          }
        },
        fields: ["tags"]
 };

Am I doing anything wrong?

Could you try something like.
var query = {
        selector: {
         _id: {$gt: null},
          tags: {
            $size: 0
          }
        },
        fields: ["tags"]
 };

That seems to work. Also, I have noticed that without the _id key, most operators are not respected. Thank you.

This might help, from the Cloudant Docs:
You cannot use combination or array logical operators such as $regex as the basis of a query when using indexes of type json. Only equality operators such as $eq, $gt, $gte, $lt, and $lte (but not $ne) can be used as the basis of a query for json indexes.


Automated Package Upgrade

:tada: This PR is included in version 2.2.372 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


GSD Request

--- GSD JSON ---
{
  "vendor_name": "Linux",
  "product_name": "Kernel",
  "product_version": "versions from v4.3 to before v4.9.300",
  "vulnerability_type": "unspecified",
  "affected_component": "unspecified",
  "attack_vector": "unspecified",
  "impact": "unspecified",
  "credit": "",
  "references": [
    "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=47dceb8ecdc1c3ad1818dfea3d659a05b74c3fc2",
    "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bfce19548a2ba1e007c84fe725d70a9c3caf46a1"
  ],
  "extended_references": [
    {
      "type": "commit",
      "value": "47dceb8ecdc1c3ad1818dfea3d659a05b74c3fc2",
      "note": "introduced"
    },
    {
      "type": "commit",
      "value": "bfce19548a2ba1e007c84fe725d70a9c3caf46a1",
      "note": "fixed"
    }
  ],
  "reporter": "joshbressers",
  "reporter_id": 1692786,
  "notes": "",
  "description": "af_packet: fix data-race in packet_setsockopt / packet_setsockopt\n\nThis is an automated ID intended to aid in discovery of potential security vulnerabilities. The actual impact and attack plausibility have not yet been proven.\nThis ID is fixed in Linux Kernel version v4.9.300 by commit bfce19548a2ba1e007c84fe725d70a9c3caf46a1, it was introduced in version v4.3 by commit 47dceb8ecdc1c3ad1818dfea3d659a05b74c3fc2. For more details please see the references link."
}
--- GSD JSON ---

This issue has been assigned GSD-2022-1000087


Fix mismatched parentheses in cel.md

There are mismatched parentheses in the example CEL expressions. This PR tries to fix them.

/sig api-machinery
/lgtm
/approve


tenacity.RetryError: RetryError[<Future at 0x7f3a022638b0 state=finished raised ValidationError>]

Command executed: python startup.py "my_prompt"
Setup: python3.9.5, node v20.5.0, npm v 9.8.0, Ubuntu 20.04
OpenAI models tried: GPT3.5-turbo and GPT3.5-turbo-16k
Result expected: The code finishes with the code generated according to the prompt
Result obtained: The code stops because of an error -> tenacity.RetryError: RetryError[<Future at 0x7f3a022638b0 state=finished raised ValidationError>].
Tried to run the code multiple times, always the same result.
Error traceback:
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/tenacity-8.2.2-py3.9.egg/tenacity/_asyncio.py", line 50, in __call__
    result = await fn(*args, **kwargs)
  File "/home/user/Documents/metagpt/metagpt/actions/action.py", line 62, in _aask_v1
    instruct_content = output_class(**parsed_data)
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 5 validation errors for prd
Requirement Pool -> 0
  value is not a valid tuple (type=type_error.tuple)
Requirement Pool -> 1
  value is not a valid tuple (type=type_error.tuple)
Requirement Pool -> 2
  value is not a valid tuple (type=type_error.tuple)
Requirement Pool -> 3
  value is not a valid tuple (type=type_error.tuple)
Requirement Pool -> 4
  value is not a valid tuple (type=type_error.tuple)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/Documents/metagpt/startup.py", line 42, in <module>
    fire.Fire(main)
  File "/usr/local/lib/python3.9/dist-packages/fire-0.4.0-py3.9.egg/fire/core.py", line 141, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/usr/local/lib/python3.9/dist-packages/fire-0.4.0-py3.9.egg/fire/core.py", line 466, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/usr/local/lib/python3.9/dist-packages/fire-0.4.0-py3.9.egg/fire/core.py", line 681, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/home/user/Documents/metagpt/startup.py", line 38, in main
    asyncio.run(startup(idea, investment, n_round, code_review, run_tests))
  File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/user/Documents/metagpt/startup.py", line 26, in startup
    await company.run(n_round=n_round)
  File "/home/user/Documents/metagpt/metagpt/software_company.py", line 60, in run
    await self.environment.run()
  File "/home/user/Documents/metagpt/metagpt/environment.py", line 67, in run
    await asyncio.gather(*futures)
  File "/home/user/Documents/metagpt/metagpt/roles/role.py", line 240, in run
    rsp = await self._react()
  File "/home/user/Documents/metagpt/metagpt/roles/role.py", line 209, in _react
    return await self._act()
  File "/home/user/Documents/metagpt/metagpt/roles/role.py", line 168, in _act
    response = await self._rc.todo.run(self._rc.important_memory)
  File "/home/user/Documents/metagpt/metagpt/actions/write_prd.py", line 145, in run
    prd = await self._aask_v1(prompt, "prd", OUTPUT_MAPPING)
  File "/usr/local/lib/python3.9/dist-packages/tenacity-8.2.2-py3.9.egg/tenacity/_asyncio.py", line 88, in async_wrapped
    return await fn(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/tenacity-8.2.2-py3.9.egg/tenacity/_asyncio.py", line 47, in __call__
    do = self.iter(retry_state=retry_state)
  File "/usr/local/lib/python3.9/dist-packages/tenacity-8.2.2-py3.9.egg/tenacity/__init__.py", line 326, in iter
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x7f3a022638b0 state=finished raised ValidationError>]

Question: Is this behaviour due to a bug in the code or can I do something to solve it on my side?

I ended up having the same issue, and was resolved by install mermaid-js as described in the README file.

Refer to #176 please.

I ran into the same error.  Installing mermaid-js as described in the README file does not help

This problem actually comes from the poor Instruction Following of gpt-3.5-turbo. gpt-4 basically does not have this problem


KinematicBody2D.can_move_to always returns true

KinematicBody2D.can_move_to always returns true, even when it's not possible because it's blocked by another kinematic body
https://github.com/okamstudio/godot/wiki/class_kinematicbody2d#can_move_to

I have the same issue on this. Always returning True, even when colliding.
I can't figure how to use it properly.
I tried as first argument :
Vector2(1,0)
get_pos() + Vector2(1,0)
get_global_pos() + Vector2(1,0)
and tried with
get_pos().slide(Vector(1,0)) but this give me insane values (like (-46045.6.., -90789.5..) with pos (214.5.., 423,0..)


fix(Menu): Improved skeleton menu item accessibility

Improved skeleton menu item accessibility based on these 2 articles:

https://adrianroselli.com/2020/11/more-accessible-skeletons.html
https://css-tricks.com/a-bare-bones-approach-to-versatile-and-reusable-skeleton-loaders/

Also, fixed JS in HTML demo to not select skeletons.

Can you change line 156 in menu.scss from cursor: auto; to cursor: wait; to match #587?

Can you change line 156 in menu.scss from cursor: auto; to cursor: wait; to match #587?

I am using the same iui-skeleton class that you modified in your PR, so no need as this cursor will be applied everywhere skeleton class is used:

Can you change line 156 in menu.scss from cursor: auto; to cursor: wait; to match #587?

What about that article that you dropped?

Can you change line 156 in menu.scss from cursor: auto; to cursor: wait; to match #587?

What about that article that you dropped?

wait and progress are the same cursor on macOS, are they different on Windows?

Can you change line 156 in menu.scss from cursor: auto; to cursor: wait; to match #587?

What about that article that you dropped?

wait and progress are the same cursor on macOS, are they different on Windows?

Progress:

Wait:


SplitImage Branch Update

The experimental branch, SplitImage, is stale and needs updating. I believe GSoC applicants want to work on this.
See also #160

@smcgregor : I believe this issue can be closed since #201 is merged.


Displaying blank while reading ordinary bitmaps in Ver5 IMGs...

Ordinary bitmaps are also in Ver5 IMGs. Therefore it is also needed to read and extract the ordinary bitmaps in Ver5 IMGs... And when reading ordinary bitmaps, it displays blank.
There are some existing NPK files that ordinary bitmaps are in the Ver 5 IMGs like:
sprite_interface2_window_title_accessory.NPK (CDNF, DFOG, etc)
sprite_interface2_cs_shop.NPK (KDNF only)

这个问题是因为Ver5的IMG中存在ARGB_8888的贴图,这是最近才发现的。过去我认为Ver5只有ARGB_1555的。代码上已经修复了这个问题，但是发行版预计得等一段时间了。
The problem is because of the ARGB_8888 mapping in Ver5's IMG, which was recently discovered. I used to think that Ver5 was only ARGB_1555. The problem has been fixed on the code, but the release is expected to wait for some time.(from Baidu Translate.)


Permission errors occur if OSX .Trashes directory exists

When using dir.files to get an array of file in a dir, and in that dir a .Trashes dir exists, I get the following:
/Users/Sam/Projects/bin/slurp.js:59
                if (err) throw err;
                               ^
Error: EACCES, readdir '/Volumes/Media/.Trashes'

Thanks for the PR.  Looking at #13 it appears that commit 204793b should have fixed this issue.  If this is still an issue for some reason I'll reopen it but I believe we can close this issue now.

Actually I'll need to bump the NPM version number so I'm reopening until that has been published.


Additional response model does not validate response returned by endpoint callable

First Check

[X] I added a very descriptive title to this issue.
[X] I used the GitHub search to find a similar issue and didn't find it.
[X] I searched the FastAPI documentation, with the integrated search.
[X] I already searched in Google "How to X in FastAPI" and didn't find any information.
[X] I already read and followed all the tutorial in the docs and didn't find an answer.
[X] I already checked if it is not related to FastAPI but to Pydantic.
[X] I already checked if it is not related to FastAPI but to Swagger UI.
[X] I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

[X] I commit to help with one of those options 👆

Example Code
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from pydantic import BaseModel
import uvicorn

class Item(BaseModel):
    id: str
    value: str

class Message(BaseModel):
    message: str

app = FastAPI()

@app.get("/items/{item_id}", response_model=Item, responses={404: {"model": Message}})
async def read_item(item_id: str):
    if item_id == "foo":
        return {"id": "foo", "value": "there goes my hero"}
    else:
        return JSONResponse(status_code=404, content={"MESSAGE": "Item not found"})

if __name__ == "__main__":
    uvicorn.run("__main__:app", host="<IP_ADDRESS>", port=8080)

Description

curl localhost:8080/items/fooo
It returns {"MESSAGE":"Item not found"}
500 should be returned as response content is not valid Message.

Operating System
Linux
Operating System Details
No response
FastAPI Version
0.70.0
Python Version
3.9.7
Additional Context
No response

Because in this case, you are directly returning JSONResponse. Here, "responses={404: {"model": Message}}" is for creating response in OpenAPI, not validating the response. It just shows how it supposed to look.

Ok, is there a way to define response model for a specific status code? Here is my use-case (really simple one): when some entity is in db, you return it in some specific structure => response_model passed to api route. When the entity is not found, you return 404 with some error message that should also have some model because I want to have unified error messages accross all endpoints.
something like this (imports and definition of Item and Message omitted):
@app.get(
    "/items/{item_id}",
    response_model=Item,
    responses={
        404: {
            "response_model": Message,
        },
    },
)
async def read_item(item_id: str, response: Response):
    if item_id == "foo":
        return {"id": "foo", "value": "there goes my hero"}
    else:
        # this would be validated with `Message` model, so {"Message": "Itme not found"} would be invalid
        response.status_code = 404
        return {"message": "Item not found"}

Thanks in advance.

In that case, I'd store the exception into a variable and use it across all endpoints.
E.g.
from fastapi import HTTPException, status

NOT_FOUND_ERROR = HTTPException(
    status_code=404,
    detail={"message": "Item not found"}
)

class Item(BaseModel):
    id: str
    value: str

@app.get("/items/{item_id}", response_model=Item)
async def read_item(item_id: str):
    if item_id != "foo":
        raise NOT_FOUND_ERROR
    return {"id": "foo", "value": "there goes my hero"}

Ok, thanks, it's clean now.


[bug]: Errors and warnings on browser's console

Description
There are some errors and warnings on the browser's console when index page/website is loaded. We need to fix it.
Screenshots

Enviroment:

OS: Windows
Browser: Chrome

Record

[x] I agree to follow Code of conduct and Contributing Guidelines
[x] I am a GSSoC'23 contributor
[x] I want to work on this issue

Please assign me this issue under GSSoC'23.
Thanks

Yep! please fix it @harmeetsingh11


MRG, FIX: Fix reading of old TFRs

Closes #7849
@virvw can you see if this fixes your problem?

@virvw can you try:
pip install -U https://github.com/mne-tools/mne-python/archive/master.zip
and confirm it fixes you pb?


feat(material): allow rc versions

What kind of change does this PR introduce? feature

This change is

Codecov Report

Merging #570 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #570   +/-   ##
=======================================
  Coverage   94.06%   94.06%
=======================================
  Files          16       16
  Lines         724      724
  Branches      208      208
=======================================
  Hits          681      681
  Misses         43       43

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 ed97148...cb2fa90. Read the comment docs.


Color doesn't seem to be applying in SE Voting Fix

color: var(#babfc4) !important; seems to be getting ignored/overridden in .js-voting-container button.bar-pill.fc-black-700.

As a workaround, I added opacity: .30; to it:

(Yeah, I should probably have added !important but, given that it's my own tweak on a thing I had to copy-paste to get Stylus's Firefox style importer to kick in, it'll help me to remember to go check for updates manually if it breaks.)

color: var(#babfc4) !important; didn't work because it's invalid CSS. #babfc4 is a raw hex value and not a CSS variable, so calling it with var() doesn't do anything.
My PR #4 corrects this issue properly. Instead of using opacity to fix the color, it now sets a variable and uses that instead.

*facepalm* Just goes to show how badly I'd slept on June 1st that I didn't immediately see that.


Explore more obvious section headers in quick pick

The right-aligned label text has always been slightly confusing to me as a pattern to separate sections in quick pick lists. I think it's worth exploring how we might make these more obvious while still using vertical space efficiently.
Current

Examples
GitHub

Raycast

cc @lychung7 @misolori

Sharing another example
Runner Pro
https://docs.sketchrunner.com/search-commands/run

A couple of possible solutions within the current quick pick design:

This could also be extended into an idea I had for a "comfortable" density mode for the quick pick/command palette.

Extending these explorations to include ideas for actions in the section header rows. Some early ideas:
With Inline Icon Actions

With Icon Action Labels
We could also use labels here since the inline icons alone would be a downgrade in terms of understanding what the command is—today we use the plain text as a quick pick entry so this could retain some of that clarity.

cc @misolori

I like that the separator buttons could have text to them though I'm sure the first feature request once that lands is to allow buttons in the normal quick pick items to have text :) not a bad idea but I am concerned about space in the quickpick...

I think starting with icons (no labels) is a good start to match most of our inline actions. I also wonder if we can have the section header actions/toolbar appear when you are on a section, just like views?

Agreed.

I also wonder if we can have the section header actions/toolbar appear when you are on a section, just like views?

By that do you mean like if you're navigating via keyboard we should up the parent actions? 👍 if so!

Right now we show the toolbar whenever you are hovering in a view and then it hides when you are off, as opposed to only showing it when you are hovering over the section title.

Oh ok even better. Great idea.

Love the iterations. The blue color title seems to have a function or embedded link it it at the first glance. It worked when it was on the same line with a quickPick item, but it becomes a little confusing with the separation between section title and pickPick items.

The blue color title seems to have a function or embedded link it it at the first glance

That's a fair point. Darker or lighter greys can in some ways make it harder to distinguish between sections. Maybe some spacing above each section would help here:

Incoroporated a few bits of feedback and fixes:

Added dedicated divder rows to help distinguish between sections
Added @misolori's suggestion to show the actions on hover/focus of children

@daviddossett two questions:

Do you think we should keep the existing look if no separators have buttons?
If only a single separator has buttons, should they the UI of separators be aligned to all take up an entire row?

Do you think we should keep the existing look if no separators have buttons?

My gut feeling is that it should be a global change. There are a bunch of differences in font, spacing, etc. that makes me think it would be confusing for users to see different formats across different lists. Here's how it would look on a regular grouped quick pick list:

Some inspiration from Safari for those worried about keyboard interactions. Feels super natural to arrow up/down across sections:

I like the latest iteration. Although I think the section headers are too bold -- the blue stands out and draws the eye much more than the actual choices. I would prefer a style closer to the safari example where the headers are more muted, so the focus stays on the choices themselves.

I like the grey headers too, at least in this particular default theme. I've landed on that for now. We're also looking at how to better integrate section-specific actions. Today they're often placed at the bottom of a long quick pick list and can be easily missed.
Header w/ Toolbar
Shows up on hover anywhere in that section. Advantages here are the similarities to a view toolbar and reduced noise in the list. Possible makes it difficult to have a natural-feeling keyboard navigation. We also lose the descriptive list item labels + search capability we have today.

Header with Pinned Action Items
We could have section-specific actions rendered at the top of the relevant section as normal list items. This could be achieved today but it would obviously need to be done manually. Maybe there's a way to pin items per section?

Any chance of keeping headers even after typing? For example, Theme Picker with empty input shows:
──────────────────────────────────────────────────────────── light themes
...
GitHub Light
GitHub Light Colorblind
Light (Visual Studio)
Light+ (default light)
...
──────────────────────────────────────────────────────────── dark themes
...
Dark (Visual Studio)
Dark+ (default dark)
GitHub Dark
GitHub Dark Colorblind
...

After filtering they are no longer grouped (input content - github):
GitHub Dark
GitHub Light
GitHub Dark Colorblind
GitHub Light Colorblind
...

Ideally, groups should persist:
──────────────────────────────────────────────────────────── light themes
GitHub Light
GitHub Light Colorblind
──────────────────────────────────────────────────────────── dark themes
GitHub Dark
GitHub Dark Colorblind

@usernamehw I think that's a reasonable proposal but I'd need to see how to approach quick picks that show something different after typing. There are some examples of presenting other content instead of the filtered list.

@usernamehw that sounds like a bug to me because I get that rough experience:

Can you open a new issue and we can get that looked at?

It does look like there is some strangeness going on here.

@aeschli is this feedback for you? ^

Agree that this looks strange. Filtering & sorting doesn't go with the separator header.
It's probably a bug with quick fix dialog to still show the separator labels when filtering (and sorting)
Only when sortByLabel: false is set the separators can be shown while filtering. That what is done in the remote indicator menu:

Is sortByLabel available to extension api?


GetPages should stream asynchronously

ToggleClient.GetPages: Instead of reading all results into memory, stream them to the caller, probably using an observable sequence

Solved via f10fb40de7bb47b3e5632a4fc26a5cc103f8a4fc


QueryParam() doesn't throw error, when trying to cast non numerical value into number

For example:
Get('/products') async list(@QueryParam('categoryId') categoryId: number)
categoryId will become NaN with ?categoryId=someString instead of throwing casting error

Param type is only used to transform and validate if it's a class type. For arrays and primitive values there is no automatic validation. You should consider using @QueryParams with class-validator decorators.

Param type is only used to transform and validate if it's a class type.

Then shouldn't it left categoryId as it is? Instead it tries to cast someString to a number what is obviously will result in NaN.

Casting is because query params are always a string in express/koa but they might be a number or boolean, like test-endpoint?param1=someString&param2=123&param3=true. But there was also an issue that multiple params (arrays) are not casted - test-endpoint?param=1&param=2&param=3 should have param: number[] but have string[].

I think we can add error throw if validation is failed - no need to use class-validator for such simple use case. Ideally param: number[] must not be a string[] but we cannot understand using reflect-metadata that its a number array and not string array since it does not emit array type metadata.

For me this case works as intended - dev expect number, client send string = you receive NaN because string is not a number. For other cases like casting "5" to boolean we should throw NormalizeError as it looks like the request is invalid.
I would like to to the PR with extended and better normalization than the one we have now - it was discussed already.
So to sum up:

when boolean, we parse "true" and 1 to true, "false" and 0 to false, otherwise throw error
when string, we do nothing (or undefined on empty string (result of parsing ?param)
when number, we try to parse to number and throw an error if NaN
for params like ?param we convert to true for boolean, "" for string and error for number
we use @Type in declaration of class for @QueryParams to set the type of array to normalize them, and if single params has been send, we wrap it into array

Does it makes sense, @pleerock @NoNameProvided? 😉

Sounds good. I want to comment only last proposal:

we use @Type in declaration of class for @QueryParams to set the type of array to normalize them, and if single params has been send, we wrap it into array

no need to introduce a new decorator, we can do @QueryParams({ type: X }) just like what we did in all other decorators(Body, QueryParam, BodyParam, etc.)

As I commented on the PR as well:

for params like ?param we convert to true for boolean, "" for string and error for number

?param this should be null if  param exists in the query, undefined if param doesn't exists on the query

Yes I agree there. Its too risky to automatically convert ?param to true`.

no need to introduce a new decorator, we can do @QueryParams({ type: X }) just like what we did in all other decorators(Body, QueryParam, BodyParam, etc.)

I am talking about this:
class ReuqestQuery {

    @IsPositive()
    limit: number;

    @IsPositive({ each: true })
    @Type(() => Number)
    cityId: number[];

}

Here we need type decorator because generic Array isn't enough to normalize it.
request?cityId=2&cityId=55&limit=10

I really like the direction this discussion is headed. Just wanted to note that this is very similar to what was discussed in my original proposal #122, the key difference being that here only the query parameters are being taken into account. I'd suggest that we should in fact introduce a new decorator that allows you to populate parameters from anywhere in the request object (perhaps something like @RequestModel() or just @Request()).
For a given property the default lookup order could be req.params || req.body || req.query but we would also reuse the existing decorators to explicitly declare which request options are allowed to populate a given property.
export class GetAllUsers {
  // uses: req.params['q'] || req.body['q'] || req.query['q']
  @Request("q") // <- "catch all" property decorator
  search: string;

  // uses: req.params['customer'] || req.body['customer'] || req.query['customer']
  // (default behavior with no decorator is equivalent to using "catch all")
  customer: string;

  // uses: req.query['skip']
  @QueryParam("skip")
  from: number;

  // uses: req.query['limit']
  @QueryParam("limit")
  size: number;

  // uses: req.query['number']
  @QueryParam()
  @Type(() => Number)
  flags: number[];
}

So, while I agree support for @QueryParams({ type: X }) should be added, I think we should go ahead and add a new decorator for the use case described above. For consistency with existing decorators, the new decorator would also support being used on properties (as demonstrated above) or method parameters (below).
@JsonController()
export class UserController {

    @Get("/users")
    getAll(
      // transform request object into class
      @Request({ type: GetAllUsers }) request: GetAllUsers,
      // pull `foo` field from anywhere in the request
      @Request('foo') data: string,
    ) {
       console.log(data === (req.params['foo'] || req.body['foo'] || req.query['foo'])) // -> true
       console.log(request instanceof GetAllUsers) // -> true
    }

}

  // uses: req.params['q'] || req.body['q'] || req.query['q']
  @Request("q") // <- "catch all" property decorator

I think tat this is really misleading for users.
The #122 proposal was much better but since we have @Params and @QueryParams which can validate easily, there so need for this kind of feature, so no rush with implementing it now.
The generic client idea is good but I think that we should go by the more flexible way which is generating classes code. The classes would have matching name, so no need for client.send(new GetAllUsers({, just usersService.getAllUsers(options) that would convert the object to different ways of transporting data to rest api by http under the hood. And of course we need an inverse decorators function that instruct how to convert value to request so it would work also with 3rd-party decorators.

I think that this is really misleading for users [...] since we have @Params and @QueryParams which can validate easily, there so need for this kind of feature, so no rush with implementing it now.

@19majkel94 I think support for extracting parameters from various request options is pretty important. If we can find a way to support multiple decorators on the same property I'd be fine with that, but I think it would pose challenges in certain cases. Consider:
export class GetAllUsers {
  @Param("q", { required: true })
  @QueryParam("q", { required: true })
  search: string;
}

The above scenario leads to some ambiguity as to how the parameters will be validated. We want the q request parameter to be required, while allowing it to be populated from either req.params.q or req.query.q.
export class GetAllUsers {
  @Request("q", {
    required: true,
    allow: [ ParamType.Param, ParamType.Query ]
  })
  search: string;
}

This allow parameter would specify both which param types to look at as well as the order in which to do so. As mentioned previously, this would probably default to [ ParamType.Param, ParamType.Body, ParamType.Query ]. Behind the scenes, all existing param decorators could be written as special case wrappers around the new @Request() decorator. This seems like a cleaner approach to me.
@QueryParam("q")
// equivalent to:
@Request("q", { allow: ParamType.Query })

@Param("id", { required: true })
// equivalent to:
@Request("id", { required: true, allow: ParamType.Param })

@Request is also a misleading name as someone may use it as a express request object:
import { Request } from "routing-controllers";
import { Request } from "express";
//...
method(@Request() request: Request) {
   const user = request.user;
   //...
}

And I think that using the same name for query/body/route parameter is an awful idea. I don't know who does it and in what use cases it might help.

@19majkel94 totally open to suggestions on the name, I agree @Request() is ambiguous.

And I think that using the same name for query/body/route parameter is an awful idea. I don't know who does it and in what use cases it might help.

We do this a lot, actually. Examples include:

search endpoints that respond to GET requests with query parameters and POST requests with more complex, but overlapping, filtering options in the body
GET requests where path and query params are interchangable

i.e. GET /products/:foo/:bar and GET /products?foo=...&bar=...

PATCH, PUT, and POST endpoints where the document id can either be a route param or in the request body
token based auth schemes where your "API key" can be included as a header, query param, etc

That said, I agree using the exact same name for various param types is probably the less common case, so I think the signature should be something like this instead:
@Request({
  required: boolean,
  allow: ParamType | ParamType[] | { [key: ParamType]: string | string[] | boolean }
})

class {
  @Request({
    required: true,
    allow: ParamType.Query
  })
  public apiKey: string; // req.query.apiKey

  @Request({
    required: true,
    allow: {
      [ParamType.Query]: true
    }
  })
  public apiKey: string; // req.query.apiKey (same as previous)

  @Request({
    required: true,
    allow: {
      [ParamType.Query]: [ 'api_key', 'apiKey' ],
      [ParamType.Body]: true
      [ParamType.Header]: 'X-Auth-Api-Key',
    }
  })
  public apiKey: string; // req.query.api_key || req.query.apiKey || req.body.apiKey || req.header('x-auth-api-key')
}

We do this a lot, actually. Examples include:

I would call that a bad design, everything should have one source of truth. Encouraging to mix things up is not a good idea in my opinion.

I would call that a bad design, everything should have one source of truth. Encouraging to mix things up is not a good idea in my opinion.

A better example than the ones I originally provided is when you need to support both nested and top-level routes that map to the same request:

GET /foos/:foo_id/bars
GET /bars?foo_id=...

@NoNameProvided as mentioned above, I agree that this is not the common case. I think the modified proposal above (https://github.com/pleerock/routing-controllers/issues/234#issuecomment-328226209) better encapsulates all use cases by allowing you to specify the allowed name(s) for each param type. By omitting the optional "name" parameter, it no longer "encourages mixing things up", but does still support that use case when needed.

totally open to suggestions on the name, I agree @Request() is ambiguous.

With #289 the @Param decorator might be reused.
So your use case is that you have resource (e.g. category) and some other resource (e.g. product) has a many-to-one relation with this category. So your rest api support two ways of fetching data:
GET /category/5/products
GET /products?categoryId=5

where both endpoints return the list of product of category with id 5.
And you create controllers not per path but per feature, so you would like to achieve:
@JsonController()
class ProductsController {

    @Get("/products")
    @Get("/categories/:categoryId/products")
    getProductsByCategory(
        @Param("categoryId", {
            required: true,
            allow: [ParamType.Query, ParamType.Path],
        })
        categoryId: number,
    ) {
        return this.productsRepository.getAll({ categoryId });
    }
}

I think it's a good use case that allow us to reuse controllers actions. @marshall007 go ahead and create a proposal in new issue where we could discuss details.

Closing this via #289. Will be released in 0.8.0-beta.1 - routing-controllers@next, stay tuned! 😉


BUG: Fix video alpha on Windows

Closes #531.
One possible fix -- actually request the alpha channel in the data. It seems to fix the issue. Another option would be just to set explicitly the alpha channel to 1 (or 255?) in ImageData after creation, but this solution should be faster since it relies on Microsoft's C code to do it for us.

This should be OK.
The WMF video decoder is not accellerated, so one possible downfall would be if this causes a performance impact.
Generally speaking the WMF decoder is suitable for smaller videos. For larger resolutions, FFmpeg is preferred.
I don't have a physical Windows machine at the moment, but if possible could you test this change with a larger video? (1080p should do it).

I tested a 1080p clip on a Windows VM and it played smoothly on pyglet-1.5-maintenance and on this branch

Thank you for taking the time to test it.
Merged!


Don't build therubyracer into the appliance

therubyracer should not be built into the appliance.
therubyracer was landing in the gemset. @jrafanie informed me it does not
need to be in the appliance.
@jrafanie @kbrock @Fryguy - Please review

Even the upstream appliance?   I don't think we ship nodes in upstream,  but I could  be wrong.

@Fryguy and @jrafanie Seems we have nodejs in the upstream kickstart. see:
https://github.com/ManageIQ/manageiq/blob/master/build/kickstarts/base.ks.erb#L91

Sorry @jvlcek, it looks like it failed because we're excluding development gems on Travis and a sass gem needs v8, proved by this gem/nodejs. I guess we know now that it has to be no group.

yea. get rubyracer out of there.
thought node was in rails travis builds

I've moved therubyracer out of group :development
@Fryguy, @jrafanie & @kbrock; please review

@Fryguy We definitely ship nodejs on the appliance.
I don't want rubyracer on my dev box. Wish there was a better way for travis.
all macs should be set and nodejs on linux is easy


[$500] Android - Attachment- App crashes on opening specific image

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Version Number: 1.3.98-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:

Launch app
Tap on a report
Tap plus icon near compose
Tap Add attachment
Upload specific image attached below
Tap send
Tap on the image

Expected Result:
Tapping on specific image app must not crash
Actual Result:
Tapping on specific image app crashes
Workaround:
Unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[x] Android: Native
[ ] Android: mWeb Chrome
[ ] iOS: Native
[ ] iOS: mWeb Safari
[ ] MacOS: Chrome / Safari
[ ] MacOS: Desktop

Screenshots/Videos
Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/e6326f9d-9d2e-436d-a4c3-e7b79bb09b0f
log.txt
View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~01e0a96dfdf9f4a360
Upwork Job ID:<PHONE_NUMBER>082819072
Last Price Increase: 2023-11-10

You can utilize Coil to display an image by providing the URL. Upon clicking the image, navigate to the attachment using the passed image link. If the image loads successfully, it will be displayed; otherwise, show a circular progress indicator.  https://www.upwork.com/freelancers/ahmeda86

Contributor details
Your Expensify account email<EMAIL_ADDRESS>Upwork Profile Link: https://www.upwork.com/freelancers/~01f65412f3e14305bf

@lanitochka17  could add that specific image here

I have't checked the stackoverflow link according to video and logs.txt. this is samsung device. i have few questions here:
is it happening on samsung device only or every other device?
What are u trying to do in webview?

@pradeepmdk Hello

I think for this one we do want the image to be resized and/or a warning is included that the image is too large with specified dimensions

@adelekennedy Please let me know on the image dimension requirements I can update my proposal to include it.

Proposal Updated with addition to image to be resized

Contributor details
Your Expensify account email<EMAIL_ADDRESS>Upwork Profile Link: https://www.upwork.com/freelancers/~01f65412f3e14305bf

Taking this as C+

This is a dupe https://github.com/Expensify/App/issues/24337. We can close this one @adelekennedy


use partial variant as default export

update sources and tests to use partial variant as default export,
update readme,
remove esmock.partial and partial export definitions to reduce typescript maintenance burden
resolve error when using partial mocking with modules not found on filesystem

I intend to post a draft of the release notes w/ migration steps here later

please review

closes https://github.com/iambumblehead/esmock/issues/121


 It also shows that the expression typer currently has trouble typing variables from a previous working graph (p.name :: NULL), so we'll need to use the graph type annotations for more than just pattern matching.
Another issue is UNNAMED166 :: :IS RELATIONSHIP @ prod. It seems that assigning patterns to the working graph by default is not correct and we should instead assign the QGN of the graph that is constructed by the pattern.

The current approach also has a weakness: In order to properly re-tag relationships we'll need to track what graph the start/end nodes are from. That's cumbersome, so I wonder if there's an alternative.

@pstutz Relationships aren't allowed to span graphs, so the tags used for their start/end nodes will be the same as for the graph of the relationship itself. I think we can use a uniform scheme for tags on nodes and relationships and not track these separately to keep things simple.

@Mats-SX When we create relationships in a CONSTRUCT ON, then it can refer to nodes that have different start/end tags. They're all in the same graph, but a graph can contain multiple tags.

Remaining issues:

Move alias code to CAPSRecords
Use physical planner to plan aliasing
Track start/end QGN on relationship type (if we don't come up with an alternative approach)
Improve typer so it can type variables from outside the scope of the working graph
Track QGN/schema mappings of constructed graphs and access graph schemas in a way such that the schemas of constructed graphs an be resolved in the same way as catalog graphs
Assign correct constructed graph QGN to new nodes created in CONSTRUCT

I'm not quite following. The start/end slots in the RecordHeader are typed as CTNode as well, so they would already contain a QGN reference and be treated the same as "normal" nodes would. Sure, they could have different tags between them, but that's not a more complicated if case than if they were separated vertically (across rows) instead of horizontally (across columns), is it?


Don't suppress regular ArgumentError exceptions

Account specifically for the following scenario:
  expose :foo, &:bar

Note that :bar.to_proc.parameters always returns [[:req], [:rest]].
We should not swallow ArgumentError exceptions in any other instance.
See spec for an example.

:wave: @LeFnord Do you mind reviewing this PR? :pray:

@splattael … please, can you run bundle exec rubocop --auto-gen-config

@LeFnord Whoops, done :heavy_check_mark: Thanks for the heads-up :bow:

avoid calling of SimpleCov stuff
and you can also change ruby-version: ['2.6', '2.7', '3.0', head, jruby, truffleruby] into ruby-version: ['2.6', '2.7', '3.1', head, jruby, truffleruby]

@LeFnord

avoid calling of SimpleCov stuff

What do you mean by this? :thinking:

and you can also change ruby-version: ['2.6', '2.7', '3.0', head, jruby, truffleruby] into ruby-version: ['2.6', '2.7', '3.1', head, jruby, truffleruby]

So, should we replace 3.1 with 3.0? Why should we remove 3.0 or should we only add 3.1? :thinking:

@LeFnord

avoid calling of SimpleCov stuff

What do you mean by this? 🤔

sorry … mean it here spec_helper.rb

and you can also change ruby-version: ['2.6', '2.7', '3.0', head, jruby, truffleruby] into ruby-version: ['2.6', '2.7', '3.1', head, jruby, truffleruby]

So, should we replace 3.1 with 3.0? Why should we remove 3.0 or should we only add 3.1? 🤔

replace

sorry … mean it here spec_helper.rb

I still don't follow. Should I delete SimpleCov? :thinking:

replace

OK, done but honestly I don't understand why we stop testing on Ruby 3.0 :shrug: It is still being maintained.

sorry my fault … yes you are right 3.0 is maintained … so re-add 3.0
and comment out the SimpleCov stuff here spec_helper.rb so the checks will be green and I can mörge it

sorry my fault … yes you are right 3.0 is maintained … so re-add 3.0

No worries, done :+1:

and comment out the SimpleCov stuff here spec_helper.rb so the checks will be green and I can mörge it

Oh now I saw it fails on Ruby >= 3.1 due to https://github.com/simplecov-ruby/simplecov/issues/1003 and thus cancels all other runs :facepalm:
I've disabled SimpleCov on Ruby >= 3.1 then so checks should pass soon :crossed_fingers:


Tools: add separate jmavsim_run.sh script

It is useful to run jmavsim separately, for example when debugging mainapp
separately, or running some other external tool on mainapp (like heap analysis)

Fails on Mac OS:
72048 Added driver 0x7f8d9b700370 /dev/led0
INFO  LED::init
INFO  Not using /dev/ttyACM0 for radio control input. Assuming joystick input via MAVLink.
INFO  Waiting for initial data on UDP port 14560. Please start the flight simulator to proceed..
Buildfile: build.xml does not exist!
Build failed
./Tools/jmavsim_run.sh: line 7: cd: out/production: No such file or directory
Error: Unable to access jarfile jmavsim_run.jar

What does it say before? do you have the readlink -f command?

I think readlink -f is different on OSX. Some other bash scripts in Tools use this.
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )

Thanks @dagar! I updated it accordingly, can someone with OSX give it a try?

@LorenzMeier can you test this please on OSX?

@bkueng I rebased this and it's working on Linux and OSX.

Thanks @dagar! Applied to master


Borrow patches from Ubuntu for OpenSSL3

Here I borrow Ubuntu's patches to serf from:
https://git.launchpad.net/ubuntu/+source/serf/log/?h=applied/ubuntu/devel
The test suite still doesn't entirely pass, so I've left it disabled, but I can successfully build a local version of Subversion against the serf built with these patches on linux_64_openssl3. (And, re-checking, the build fails if I use the current conda-forge version.)
Supersedes #5, closes #4.
See also:

https://issues.apache.org/jira/browse/SERF-202
https://bugs.launchpad.net/ubuntu/+source/serf/+bug/1956040
https://src.fedoraproject.org/rpms/libserf/tree/rawhide

Hi! This is the friendly automated conda-forge-linting service.
I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@h-vetinari @zklaus How does this look to you? I think it will unblock the migration of Subversion.

@h-vetinari @zklaus How does this look to you? I think it will unblock the migration of Subversion.

@h-vetinari @zklaus How does this look to you? I think it will unblock the migration of Subversion.

LGTM thanks for tackling these!

@pkgw, just wanted to drop in quickly to say a big thank you. My main need for this subversion stuff was an internal svn->git migration and after that, I did not have time to follow up here, so I am very happy and grateful that you tackled all of this.


Fatal glibc error: Cannot sort array of size 30.

Array size of 30 causes the following error:

Fatal glibc error: malloc.c:2599 (sysmalloc):
assertion failed: (old_top == initial_top (av) && old_size == 0) ||
((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)
Aborted (core dumped)

Testing with other sizes worked correctly. Array sizes of 29 and 31 both worked without fail. Likely not the only source of this issue.
Seen with sizes starting at 10 and in increments of 20. 10, 30, 50, 70, 90... all fail.
Seen with size starting at 14 and in increments of 20.
Also seen with sizes starting at 6 and in increments of 20.
First noticed in commit: 6b72ef2

Fixed
Fix given in commit 79480d1.
Before:
This code doesn't subtract one from the size of the array causing an out-of-bounds index.

    int n = arr.size();

    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            if (arr[j+1] > arr[j])
            {
                swap(arr[j], arr[j+1]);
            }
        }
    }

After:

    int n = arr.size() - 1;
    for (int i = 0; i < n; ++i)
    {
        for (int j = 0; j < n - i; ++j)
        {
            if (arr[j] < arr[j + 1])
            { // Compare and swap if out of order
                swap(arr[j], arr[j + 1]);
            }
        }
    }


update to latest sqle.v0 api (NULL support)

adapt to latest sqle.v0 api (NULL support)
use NULL for target/hash in references table
cmd: in pretty printing, print strings quoted
to distinguish NULL and "NULL"

This PR depends on https://github.com/sqle/sqle/pull/25

Codecov Report

Merging #121 into master will increase coverage by 0.23%.
The diff coverage is 96.07%.

@@            Coverage Diff             @@
##           master     #121      +/-   ##
==========================================
+ Coverage   85.23%   85.46%   +0.23%
==========================================
  Files          11       11
  Lines         325      344      +19
==========================================
+ Hits          277      294      +17
- Misses         42       44       +2
  Partials        6        6

Impacted Files
Coverage Δ

internal/format/pretty.go
100% <100%> (ø)
:arrow_up:

tags.go
82.22% <100%> (ø)
:arrow_up:

blobs.go
77.14% <100%> (ø)
:arrow_up:

objects.go
77.14% <100%> (ø)
:arrow_up:

tree_entries.go
83.33% <100%> (ø)
:arrow_up:

commits.go
82.97% <100%> (ø)
:arrow_up:

references.go
83.33% <91.66%> (+1.11%)
:arrow_up:

Continue to review full report at Codecov.

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


refactor: drop dependency 'jboss-logging'

Checklist

[x] the [contributor license agreement][] is signed
[x] commit message follows [commit guidelines][]
[ ] tests are included
[ ] screenshots are included showing significant UI changes
[ ] documentation is changed or added

Description of change
It seems the dependencies of jboss-logging are not used anywhere so we can drop these deps.
I tested locally to make sure logs are still correctly generated. Now let's wait for CI.

Seems safe to proceed.