Having some trouble with the docker version

Here's the docker version:
https://github.com/tom-doerr/TecoGAN
So I installed a fresh ubuntu 20.04 on an SSD and installed the latest updates and drivers for it.
After running the docker build command, it seemed to have built everything successfully, however when I try and run it, it gives me an error:
~/Desktop/TecoGAN$ docker run --gpus all -it --mount src=$(pwd),target=/TecoGAN,type=bind -w /TecoGAN tecogan_image bash
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container: context canceled

Anyone know what that means and how to solve it? Is there a problem with the nvidia drivers?
If I remove the --gpus all it seems to work and brings me inside of the bash interface of the docker container, however if I run python3 runGan.py 1
then it gives me this error:
Testing test case 1
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 10, in <module>
    import tensorflow as tf
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/usr/lib/python3.5/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

# From https://github.com/NVIDIA/nvidia-docker
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

Does it work after running this?

Ah yes it works, thanks.

Glad it worked, thanks for reporting the issue with the setup instructions.
Regarding the RTX cores: My guess would be that it depends on the software versions, but in any case it only uses the RTX cores for speeding up the computation and not for improving the image quality. Using it to improve the image quality is not possible, since the model only operates on pictures and not on 3D models.

Glad it worked, thanks for reporting the issue with the setup instructions.
Regarding the RTX cores: My guess would be that it depends on the software versions, but in any case it only uses the RTX cores for speeding up the computation and not for improving the image quality. Using it to improve the image quality is not possible, since the model only operates on pictures and not on 3D models.

I was just wondering if my RTX cores are being used cause I have a 2060 super and wanted to know if RTX helps in speed performance.


Support SemVer v2 for Chart version

Hello
I've successfully init my helm repo and pushed my chart in my repo.
When done, I can see my chart in the bucket with the associated index.yaml file.
But helm search repo my-repo returns:
No result found.
How can I debug what's wrong ?
helm version
version.BuildInfo{Version:"v3.1.2", GitCommit:"d878d4d45863e42fd5cff6743294a11d28a9abce", GitTreeState:"clean", GoVersion:"go1.13.8"}
Helm-gcs Plugin version : 0.3.1
Thanks for the help

I've tested with helm 3.2.1 too. Same result

Hi,
Figured out that the version of my chart is not supported:
version: 4.1.7-1059-alpine.3.11-apache.2.4+Chart.448
Is it possible to support our version that is commatible with SemVer ?
 ::=
|  "-"
|  "+"
|  "-"  "+"

Helm Best practices suggest the following for Chart versioning:
Version Numbers
Wherever possible, Helm uses SemVer 2 to represent version numbers. (Note that Docker image tags do not necessarily follow SemVer, and are thus considered an unfortunate exception to the rule.)
When SemVer versions are stored in Kubernetes labels, we conventionally alter the + character to an _ character, as labels do not allow the + sign as a value


[BUG] webview_flutter

Describe the bug
Hello,
i have this issue on web. while using the package version youtube_player_iframe 4.0.2 .
My issue is quite simple. i tried to implement a simple youtube video but i got the following error :
The following assertion was thrown building YoutubeVideoReader(dirty, state:
_YoutubeVideoReaderState#adc4d):
Assertion failed:
file:///Users/badrou/.pub-cache/hosted/pub.dev/webview_flutter_platform_interface-2.0.1/lib/src/platform_navigation_delegate.dart:35:7
../…/src/platform_navigation_delegate.dart:35
WebViewPlatform.instance != null
"A platform implementation for webview_flutter has not been set. Please ensure that an
implementation of WebViewPlatform has been set to WebViewPlatform.instance before use. For unit
testing, WebViewPlatform.instance can be set with your own test implementation."
The relevant error-causing widget was:
YoutubeVideoReader
To Reproduce
nothing. just followed the basics to test it.
  late final YoutubePlayerController _controller =
      YoutubePlayerController.fromVideoId(
    videoId: YoutubePlayerController.convertUrlToId(
        'https://www.youtube.com/watch?v=ZqbflgG55Lk')!,
    autoPlay: false,
    params: const YoutubePlayerParams(
      mute: false,
      showControls: true,
      showFullscreenButton: true,
    ),
  );

Widget build(BuildContext context) {
    return Container(
      child: YoutubePlayer(
        controller: _controller,
        aspectRatio: 16 / 9,
      ),
    );
}

Expected behavior
youtube video to play?
Technical Details:

Chrome

Additional context
i don't think there is any relevant context.
it's a very basic project where i try some packages.
thanks for your help!

Thanks for raising the issue.
Published v4.0.3 with the fix.

it's all good now.


Crop error fix

Le calcule de la hauteur et largeur de l'image posait problème

It changes function signature, so, it is not just "fix"
Have you tried to run that code? It has typo and shouldn't work
What did you wanted to fix here? You should likely open issue first and describe exactly what is going wrong with test case so that anyone else will be able to reproduce and confirm it
Please, use English, otherwise many people are not able to understand what do you want to say, especially in commit message

Closing due to no response. Please comment with additional info for further consideration.


how to update more filed？

Please use the following questions as a guideline to help me answer
your issue/question without further inquiry. Thank you.
Which version of Elastic are you using?
[ ] elastic.v5 (for Elasticsearch 5.x)
Script(NewScript("ctx._source.tags += tag").Params(map[string]interface{}{"tag": "blue"}).Lang("groovy"))
the code can only update the filed “tags”，if i want update two filed，how to coding？

Feel free to look up the Update API documentation. In your case, updating via a partial document might be the solution.
Sometimes, the tests are also quite helpful to get used to the Go-like syntax, update_test.go in this case.


Create /read page

With curated suggest reading, et al

[x] Needs content

[x] About this page, paragraph or two
[x] List titles and items (of pages / articles in that list)

[x] Add links to years

[x] Add links to categories

[x] Add links to authors

[x] Add links to tags
[x] Add links to issues

Moving that comment to #125.

Moving that comment to #125.


Expose slot metrics to the user APIs

I'm trying to plot via metrics how much overhead we have vs useful data in Billy. For that I need to expose the gap count in the shelves. The PR exposes a few more things for completeness sake.

... but maybe a less intense solution would be go make the shelves track these stats via atomic counters, and similarly make the db track the sum total via atomic counters too?

How about something like this? https://github.com/holiman/billy/compare/stats?expand=1


Query: Where is cdflib used in SciPy code?

Yesterday, when we were discussing the cdflib on the LFortran repo, I noticed that these are a lot of tiny functions that can be written quickly in Cython. I know we were supposed to switch to Boost implementation at some point but I could not resist anyways so already wrote half of it. I can finish it tonight and send a PR.
So question is how can I test the implementation against our own code? I can't find any entry points to the fortran code other than the wrappers for C code. Is that it? Can anyone help me with this?
CC: @steppi @ev-br

At a guess it's used a lot in stats

I see, I somehow couldn't find the import point in stats.

For example, digamma is already in its own place in special and psi_fort.f is not as good. So probably we already have most of this library available elsewhere. And I can quickly get the remaining parts to Cython so you guys can take over to C++ conversion or switching to Boost.
How does that sound?

I actually wonder how much breaks in scope if cdflib is completely removed temporarily. This could give a useful data point on what is used and what isn't. The latter I guess can possibly just keep deleted, is it not internal anyway.

Ah OK some special ufuncs are coming from that library. I'll try to make a list out of them

Removing cdflib from meson.build and making the test run pass collection stage,  https://github.com/ev-br/scipy/pull/new/rm_cdflib, generates a bunch of missing function errors. In stats, $ python dev.py test -s stats, the fallout is https://gist.github.com/ev-br/de296468e24ccd2671accf70e69f2521.
ISTM this looks scarier than it actually is: apparently we're using less than a dozen distributions from cdflib.
At a danger of sounding like a broken record, I'd think that the most productive approach could start from checking which of these functions are already available elsewhere (ndtr is essentially erf from faddeeva, beta functions should be available from boost etc).
It's full well possible that replacements have glitches in corner cases or some parameter regions.
Then it becomes a matter of what is the best strategy -- -basically it's LBYL vs EADP: do we try to iron out all possible wrinkles first, or do we replace them and see what breaks downstream.
Maybe it's best to do the latter, starting early in the release cycle.

The fallout from your stats has only these
btdtr
chndtr
chndtrix
stdtrit
tklmbda
pdtrik

so indeed not so bad. Whatever these are I can create the Cython versions. But I also know that some of them are still in Boost waiting to be implemented.

Checking scipy/special/functions.json, it looks like there are 31 functions that come from cdflib
bdtrik
bdtrin
btdtria
btdtrib
chdtriv
chndtr
chndtridf
chndtrinc
chndtrix
fdtridfd
gdtria
gdtrib
gdtrix
nbdtrik
nbdtrin
ncfdtr
ncfdtri
ncfdtridfd
ncfdtridfn
ncfdtrinc
nctdtr
nctdtridf
nctdtrinc
nctdtrit
nrdtrimn
nrdtrisd
pdtrik
stdtr
stdtridf
stdtrit
tklmbda
Some of this is pretty niche, so not sure how much of it would be available elsewhere.

In my experiment mentioned above, https://github.com/scipy/scipy/compare/main...ev-br:scipy:rm_cdflib?expand=1, I simply removed them all from functions.json. Apparently, not all of them are used, in scipy.stats at least.

In my experiment mentioned above, https://github.com/scipy/scipy/compare/main...ev-br:scipy:rm_cdflib?expand=1, I simply removed them all from functions.json. Apparently, not all of them are used, in scipy.stats at least.

It makes sense we wouldn't be using a lot of oddball things internally. I wonder how much use they get downstream.

I checked statsmodels (just with grep), and it looks like it only uses chndtr, chndtrinc, ncfdtr, ncfdtri, ncfdtrinc, nctdtr, and stdtr,

This is very puzzling for me. So there are

some ufuncs directly wrapped from Fortran to C.
Some in stats in a strange way that I have not figure out yet
And downstream because these are apparently public

But say
https://github.com/scipy/scipy/blob/80c81df56fa118e9a86b9e0283bf79c3dfbd3969/scipy/special/cdf_wrappers.c#L459
This is not a fortran file so my apologies for my stupidity, I can't understand how things are called yet.

Looking at the meson.build for special it looks like cdflib gets compiled as a static library and the functions are called directly from C.
cdflib_lib = static_library('cdflib',
  cdflib_sources,
  fortran_args: [
    _fflag_Wno_maybe_uninitialized,
    _fflag_Wno_unused_label,
    _fflag_Wno_intrinsic_shadow
  ]
)

I think things look a little more complicated then they are because of the macros to add error handling, make sure Fortran gets the arguments by reference like it wants them, and to deal with the vagaries of what the Fortran functions should be called when calling from C.

Some in stats in a strange way that I have not figure out yet

For all but btdtr in the list
btdtr
chndtr
chndtrix
stdtr
stdtrit
tklmbda
pdtrik

It seems like these are just calls to special.chndtr etc...
btdtr isn't even in cdflib, it's in cephes. Not sure what's going on there. It's pretty weird.

btdtr isn't even in cdflib, it's in cephes. Not sure what's going on there. It's pretty weird.

Oh, wait. Is it just a false positive? I think btdtr is just mentioned in the fallout as part of the suggestion
AttributeError: module 'scipy.special' has no attribute 'stdtr'. Did you mean: 'btdtr'?

Is it just a false positive?

Yes I think so.
I guess some functions are used internally in Cephes and then cephes is providing this stuff to special and in turn in stats.

statsmodels is using some of the special functions like non-central directly from special because the boost implementation used in stats are (or were) buggy for our cases.
The other nice thing is that cdflib has inverse functions (rootfinding for one of the parameters).
AFAIR, that is only used in a few cases in statsmodels (because my power and sample size computation are only for the standard test distributions, normal, t, F, chi2 and their non-central versions.)
Most other distribution special functions are indirectly accessed by statsmodels through stats.distributions.
(Aside: one disadvantage of normal cdf in special used by scipy.stats is that it does not evaluate for complex number, while erf does.)

OK I'm almost done with them anyways so let's see what we can do with such code. Then we can remove the ones we don't need. Probably we would use some pxd header and pass it to cephes somehow and make it available through public API at the same time.
Strangely enough Cython version is quite fast compared to Fortran (at least in a Jupyter notebook with %%cython cells).
I should stop looking at fortran code in the evenings, they are too appealing for killing time.

another aside:  I have not looked at the scipy distribution refactor.
If the distribution classes loose args in the methods, then I plan to add several wrapper functions for statsmodels to use scipy.special direcctly.

If you want to play with them, a single cython file with no build infra is found at
https://github.com/ilayn/scipy/blob/remove_cdflib/scipy/special/_cdflib.pyx
Tested some of the functions (betaln, erf, erfc, erfc1, and psi ->which I think is special.digamma) and they agree with Wolfram Alpha digit by digit all the way occasionally the last two digits are off and they are quite fast. So I don't think these ones are buggy ones. Or if we had any issues with them probably it is the remaining ones. Don't know how it compares with cephes or Boost.
The files starting with c are missing because they are mostly Fortran subroutines and not functions. Not very difficult but tedious GOTO sphagetti as usual. I'll try to complete the suite as soon as possible. In the meantime, if you can let me know what we should do with these or how to integrate if we are keeping them, that would be great.

Awesome @ilayn. Yeah, down the line we should compare these with what's in cephes and Boost and pick the best options to use internally, but it might be better to try to get cdflib out of Fortran as as soon as we can, and just stick with using these for now. As soon as you have something rewritten that is exposed as a public ufunc in special, I can help test it and put together a PR to get it in. After that, if you want to make PRs for  others, I can test and then review and merge. I think we can keep a good pace that way.

Awesome, looks like a lot of progress.

https://github.com/ilayn/scipy/blob/remove_cdflib/scipy/special/_cdflib.pyx

This looks pretty good. Just to note that I did check for the absence of fused types and Tempita templating, because that is a bit of a headache (C++ would be preferable for that).

The library is just written for doubles so I didn't do any floats. If we can filter out the parts we want to keep I can rearrange things for the remaining set.

After that, if you want to make PRs for others, I can test and then review and merge. I think we can keep a good pace that way.

Sure thing will do. Just trying to tame the subroutines to functions conversion without hurting the essence of signatures.

Just venting; Found the source of the algorithm, this is the flowchart of gaminv.f :)

On other news, sorry for the delay I wasn't expecting this much madness, 10 complicated functions left.

Just venting; Found the source of the algorithm, this is the flowchart of gaminv.f :)

On other news, sorry for the delay I wasn't expecting this much madness, 10 complicated functions left.

Wow. That flowchart is just amazing. It’s crazy how far structured programming takes us in terms of managing complexity, and how obvious it seems only in hindsight. Awesome work.

OK finally, I am done with the translation and I understand how cdflib is used in SciPy. So basically, the fortran files that start with cdf have a which parameter that selects the knowns and unknowns. Example from cdfbet
https://github.com/scipy/scipy/blob/20d3047ac50c85f9319f63df548698a5473a44d4/scipy/special/cdflib/cdfbet.f#L16-L25
Option 3 and 4 here then becomes separately btdtria and btdtrib and first 2 are not wrapped (not sure why not, maybe wrapped from cephes).
This separation is happenning in the cdf_wrappers.c and cdf_wrappers.h and they are renamed into more cryptic names that I think you guys understand their meaning like btdtria.
We can get rid of all that by wrapping cdf###.f functions into different functions so we don't need all that
https://github.com/scipy/scipy/blob/20d3047ac50c85f9319f63df548698a5473a44d4/scipy/special/cdf_wrappers.c#L31-L52
wrapping mechanism. But I don't quite sure how ufuncs want the results. In fact I can write the functions with their wrapped names as separate kernels and don't use any cdf###
What do you think?

OK finally, I am done with the translation and I understand how cdflib is used in SciPy. So basically, the fortran files that start with cdf have a which parameter that selects the knowns and unknowns. Example from cdfbet
https://github.com/scipy/scipy/blob/20d3047ac50c85f9319f63df548698a5473a44d4/scipy/special/cdflib/cdfbet.f#L16-L25
Option 3 and 4 here then becomes separately btdtria and btdtrib and first 2 are not wrapped (not sure why not, maybe wrapped from cephes).
This separation is happening in the cdf_wrappers.c and cdf_wrappers.h and they are renamed into more cryptic names that I think you guys understand their meaning like btdtria.
We can get rid of all that by wrapping cdf###.f functions into different functions so we don't need all that
https://github.com/scipy/scipy/blob/20d3047ac50c85f9319f63df548698a5473a44d4/scipy/special/cdf_wrappers.c#L31-L52
wrapping mechanism. But I am not quite sure how ufuncs want the results. In fact I can write the functions with their wrapped names as separate kernels and don't use any cdf###
What do you think?

I think we don’t need any of that wrapping nonsense now. If you make a PR just adding the library I can push some commits to your branch setting up the rest of the stuff up later this week if you like.

Ah let me clarify. As you might have guessed these are Fortran subroutines, hence things are modified in place so you allocate some output vars o1, o2 and send it together with inputs i1, i2, i3
CALL mysubroutine(i1, i2, i3, o1, o2)

And o1, and o2 are populated. C/Python does not support this in place modification unless we use arrays or dicts or whatever that has an internal data structure. When we convert these to functions we can make 4 different funcs or have one and changing input output signatures.
That's what I meant

I see, sorry. Was focused on something else when I wrote that. My vote is just to have 4 functions.

separate function sounds fine to me (as it is also currently)
alternative if there are too many extra parameters:
IIUC, my related usage (for inverting cdf function with respect to a parameter argument)
In power and sample size computation, I have one main power method (corresponding to cdf or diff of cdf values) and a solve_power method, that inverts wrt all other available arguments using rootfinding.
Exactly one keyword has to be None.
It'still a function with arguments and returns and no inplace modification (in python). My rootfinding is not vectorized, the power function itself is (through using scipy.stats or special).
AFAIR, some R packages use something similar where the parameter to solve for has to be nan.
https://www.statsmodels.org/dev/generated/statsmodels.stats.power.TTestPower.solve_power.html

Ah yes, this is exactly the behavior we are trying to get away from. Not only it introduces lots of acrobatics in the code, but also gets very difficult to guess what is input and what is output.
Separate function it is then.

I tested many of the functions but it is not that trivial to generate good tests for all of them. Hence if you have any ideas how to test these things I'd be happy to include.

I planned to write very thorough tests as part of the review process, since this is a big change. Or I can write a few first and paste them here and you can follow the same recipe for the others maybe.

I planned to write very thorough tests as part of the review process, since this is a big change. Or I can write a few first and paste them here and you can follow the same recipe for the others.

That sounds great. So then let me finish completely with the cdfs and we do it in one go. I'm really relieved to hear that 😄

This saved me from writing a large number of methods, but users need to keep track of what arguments they are using.

True but that's very tricky to do it with typed signatures of Cython. All kinds of weird stuff is going on especially if we want to use them for ufuncs.


Install shellcheck from trusty-backports over cabal

No need to maintain an install script, less $PATH hackery, less CircleCI
cache faff

I saw a post about how y'all are installing shellcheck on CircleCI, came up with a way that, broadly speaking, felt simpler and thought y'all might find it useful (though it's not objectively better, e.g. if you care about specific version!)

Thanks a ton for this contribution @doismellburning! Great to see that ShellCheck is finally available via the proper channels. Happy to get rid of our complicated and crufty way to set it up manually before.
What do you think @charlierudolph?

Looks good to me

Awesome, cheers both!

I'm going to revert this in a new PR because this locks us to version 0.3.3. We had previously been on 0.4.1 and I want to update us to 0.4.5

Bleh, completely understand. I guess I've always wanted to learn how to get stuff into Backports!


fix: Updated BRGREWRITEAOF.md

Fixes #787
Updated documentation based on the code for BGREWRITEAOL

HI @Madraceee Thanks for the changes. Can you please add an Error example as well?

@AshwinKul28 the command does not take any arguments. It is a standalone argument. Can you provide me more details ? Should i elaborate on the errors sub heading?

Hmm, Maybe to achieve an error scenario we may need to either run on High System Load or reach Configuration Limitation, That's okay we can skip this command.
Thanks a lot for the changes. LGTM 🚀


Possibility to set up config in relation's definition

Is there a way to set default params for current relation? I want to be able not to include these kind of lines
.with_base_path('users')
.add_params(expand: 'account,account_details')

everywhere in current relation...

This is not supported yet, you can just handle it on your own for now by storing a pre-configured relation somewhere and use that at run-time. We could add a feature that would make this simpler.

Got it. So for now I think I'll use it as:
  class UsersRelation < ::ROM::Relation[:http]
    # schema definition goes here
    def by_id(id)
      base.with_path(id.to_s)
    end

    def all
      base.to_a
    end

    private

    def base
      with_base_path('users')
        .add_params(expand: 'account,account_details')
    end
  end

I'll try to help, maybe with PR, when I get more time.


Problem using Html-Elements in gridrows

Hi,
first of all, thank you for this project, it can solve one of my biggest problems.
I want to use jstreegrid, to add additional custom data to the objects in my tree. For testing purpose i created one row which should display html input elements, but the result is not as expected.
I only got the html elements for the root elements of the tree. When i expand the tree no new input fields are displayed. Moreover the one which were there at initialization did not move down with the root elements.
As the screenshot shows, there are 7 input elements for the 7 root elements. They did not move with these elements on expanding and no new input elements are addeed.

I´m using jstree and jstreegrid within aps.net core. So here is the js code of my view:
jsTree 3.2.1
jsTreeGrid 3.9.3
`$(function () {
        $(".search-input").keyup(function () {

            var searchString = $(this).val();
            $('#treeview').jstree('search', searchString);
        });

        $('#treeview').jstree({
            'core': {
                "themes": {

                },
                'data': {
                    'url':'/TreeView/GetRoot',
                    'data': function (node) {
                        return { 'id': node.id };
                    }
                }
            },
            "checkbox": {
                "keep_selected_style": false,
                "three_state": false
            },
            "types": {

                "Object": {
                    "icon": "glyphicon glyphicon-object-align-horizontal"
                },
                "Variable": {
                    "icon": "glyphicon glyphicon-ok"
                }
            },
            "search": {
            },
            "grid": {
                columns: [
                    { width: 400, header: "Nodes" },
                    {
                        width: 150, header: "TextBox", value: function (node) {
                            if (node.data.value == 'txtBox') {
                                console.log("return");
                                return ("<input type=\"text\" style=\"width: 120px;\" />" );
                            }
                        },}
                ],
                "resizable": true
            },
             "plugins": ["checkbox", "search", "types", "search", "grid"]
        }).bind("loaded.jstree", function (event, data) {
            $(this).jstree("open_all");
        });`

The elements  displayed by jstree are generated with respect to an input and handed to the view in json.
I don´t know why it is only working for the root elements and not for all or on expanding. I´m hoping for some help and have to add that web development is not my main domain.
Thank you in advance :)

Hmm... can you out this up in a jsfiddle with it reproducing the problem? I don't have your source data here. It probably doesn't matter, but if you can put up a "working copy" (well, a "failing copy" :-) ), can take a look.

Okay i just created an example with jsfiddle. It doesn´t implement the whole functionality but shows the problem: https://jsfiddle.net/m6wazy2w/

OK, recreated. I know it worked at some point, so let's see where/how it broke.

I found it. You are using illegal IDs in the nodes:
  {
    "id": "0;2253",
    "parent": "#",
    "text": "Server",
    "type": "Object",
    "data": {
      "value": "txtBox"
    }
  },
...

The IDs need to be legitimate html node IDs (or part of them), while ; is an illegal character, which is causing lots of things to break.  See this issue


Update µWS (0.10.9)

It's a rewrite. Run on Linux for perf.

However, the C++ server is also the most verbose and the most complex implementation. The language is an enormous multi-paradigm conglomeration that includes everything from the low-level memory management, raw pointers, and inline assembly to classes with multiple inheritance, templates, lambdas, and exceptions.

Seems about right for someone that puts JSON parsing in the hot path of a WebSocket benchmark :wink:
This is the interface of 0.10:
#include <uWS/uWS.h>

int main() {
    uWS::Hub h;

    h.onMessage([&h](uWS::WebSocket<uWS::SERVER> ws, char *message, size_t length, uWS::OpCode opCode) {
        // either echo it
        ws.send(message, length, opCode);
        // or broadcast it
        h.getDefaultGroup<uWS::SERVER>().broadcast(message, length, opCode);
    });

    h.listen(3000);
    h.run();
}

No but seriously, you do realize JSON parsing kind of taints the whole benchmark? There are about 5 million different JSON parsers available for C++. Parsing JSON is an O(n) operation while parsing a WebSocket frame is an O(1) operation. You could instead just change the benchmark so that you simply differentiate between echo and broadcast based on the length of the message.

However, the C++ server is also the most verbose and the most complex implementation. The language is an enormous multi-paradigm conglomeration that includes everything from the low-level memory management, raw pointers, and inline assembly to classes with multiple inheritance, templates, lambdas, and exceptions.

Seems about right for someone that puts JSON parsing in the hot path of a WebSocket benchmark :wink:

The intent of the shootout isn't only to be a benchmark of performance. The goal is also to compare how much effort, skill, and knowledge is required to develop in the various languages and frameworks. I don't think it is controversial to say it takes more effort, skill, and knowledge to be effective in C++ than any other popular language in use today.
To be honest, I actually wanted the shootout to be even further from a strict performance metric of just the websocket libraries. What I would have liked was a simple pubsub with channels/rooms to subscribe and broadcast to and clients continuously connecting and disconnecting, rather than just broadcasting to all connections. That would get a little closer to real-world application complexity and performance. However, that substantially increases the amount of time and difficulty required to write a server implementation. So to be pragmatic, I chose to just to include decoding and encoding the messages in JSON.

No but seriously, you do realize JSON parsing kind of taints the whole benchmark? There are about 5 million different JSON parsers available for C++. Parsing JSON is an O(n) operation while parsing a WebSocket frame is an O(1) operation.

I don't think JSON parsing impacts benchmark results near as much as you might think. For the broadcast test the received message is decoded,  the message to broadcast is encoded, and the broadcast complete message is encoded. That is 1 JSON decode and 2 JSON encodes per broadcast. For the exact test results published, the test conditions were 4 concurrent broadcasts with a max of 500ms per broadcast at the 95th percentile. Basically, that boils down to 8 broadcasts a second. So that means when the test was straining the websocket implementations the hardest, it is only doing 8 JSON decodes and 16 JSON encodes per second. Compared to the 200,000+ websocket messages being sent per second, I don't think that JSON performance makes a substantial difference is the benchmark results.
Obviously, it would make more of a difference in an echo benchmark, but we didn't publish those (initial results seemed more indicative of how the OS handled hundreds of thousands of open connections rather than differentiating the server implementations).
As far as upgrading to 0.10.x, I have a couple questions. Do you expect multi-threading to bring any performance advantages? I implemented it for the previous version (you may recall my question on thread safety https://github.com/uWebSockets/uWebSockets/issues/244), but only found a marginal performance difference. It spends almost all its time in kernel so it appears to be OS or network bound even with a single thread. Second, if yes, can you provide documentation or examples? (the previous multi-threaded example is gone -- https://github.com/uWebSockets/uWebSockets/blob/master/examples/multithreaded_echo.cpp)

There is no documentation written yet but a bright person like you will have no problem just reading the header file.

Sadly, I'm not as bright as you think... 😉
Finally, kudos on µWS performance. I haven't finished round 2 testing yet, but at the moment, even on the previous version it's faster with a single-thread than any of the other contestants running multi-threaded or multi-process.

Obviously, it would make more of a difference in an echo benchmark, but we didn't publish those (initial results seemed more indicative of how the OS handled hundreds of thousands of open connections rather than differentiating the server implementations).

This is kind of the core of my opinion about benchmarking websocket servers. If doing any kind of echo, one needs to make sure to send multiple websocket messages per TCP chunk in order to really stress the websocket server and not just the operating system's polling/event implementation. All websocket servers are TCP servers, but they are also parsers of the websocket protocol.
If you look at µWS, it doesn't really do anything special in terms of networking - it simply calls the regular old syscalls that the operating system exposes. The special part, and the part that differs between websocket implementations is by far the parser.
If you send multiple websocket messages per chunk, you will separate the weak servers from the strong ones. It also makes a lot more sense to send multiple websocket messages per TCP chunk since that is what is going to happen in any real world application anyways. If you look at games like Agar.io they send massive amounts of websocket messages all the time, there it makes a huge difference if you have a server that can handle the parsing of them, or if it simply breaks down.
If you then take this opinion into account, you can also see why I feel including JSON into the mix is a big deal. I know that if I would include JSON parsing into my benchmarks (which are much more centered around the websocket parser performance), it would completely mess with the numbers.
Anyways, as long as we both get roughly the same conclusion I guess I'm pleased. You should definitely see a very big difference in memory usage between µWS and the rest at least.
I wouldn't care about multithreading, it should probably only be used when you really have to / knows explicitly why it would make sense.

If I send one message per TCP chunk, I can get maybe 6x difference compared to ws. If I send 10 messages per TCP chunk I get about 30x difference. If I send 1000 messages I can get about 150x. Sending more messages than this does not improve performance (now we have fully stressed the parser, it has become the bottleneck). I'm not saying it makes sense to send 1000 messages per TCP chunk, but it certainly makes sense to send 5 or 10 - that way you tell a lot more about the server than what you tell about the operating system (which of course is the same for all servers).

Updated to 0.10.9 in 796e4975a3a1168dd705d85ab390948095677491.


Editor crashes after opening a second file from the search

How to reproduce:

Download fresh onivim 0.4.0
Open "Find in Files" search and search something
Open Search Result in File 1 (.js file)
Open Search Result in File 2 (.js file)
Editor crashes and closes

OS info:
xate@xate:~$ uname --all
Linux xate 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux

I had to delete a bunch of the log because the comment is too long otherwise, full log is available here (expiry 1 month): https://cl1p.net/onivim

Editor Log
xate@xate:/file/path$ onivim -f --debug
                                                                                [INFO]     +0ms Oni2.Syntax.Client : Received token update
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [INFO]    +14ms Oni2.Syntax.Client : Received token update
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [INFO]    +10ms Oni2.Syntax.Client : Received token update
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [INFO]     +9ms Oni2.Syntax.Client : Received token update
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [INFO]    +14ms Oni2.Syntax.Client : Received token update
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [INFO]     +0ms Oni2.Syntax.Client : Received token update
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (Syntax TokensHighlighted {bufferId = 3; tokens = })
                                                                                rejected promise not handled within 1 second: TypeError: vscode.workspace.onDidRenameFile is not a function
                                                                                stack trace: TypeError: vscode.workspace.onDidRenameFile is not a function
                                                                                at new UpdateImportsOnFileRenameHandler (/tmp/.mount_onivim5oO6oK/usr/bin/extensions/typescript-language-features/out/features/updatePathsOnRename.js:33:41)
                                                                                at ConditionalRegistration.dependentRegistration_1.VersionDependentRegistration [as _doRegister] (/tmp/.mount_onivim5oO6oK/usr/bin/extensions/typescript-language-features/out/features/updatePathsOnRename.js:244:103)
                                                                                at ConditionalRegistration.update (/tmp/.mount_onivim5oO6oK/usr/bin/extensions/typescript-language-features/out/utils/dependentRegistration.js:23:42)
                                                                                at VersionDependentRegistration.update (/tmp/.mount_onivim5oO6oK/usr/bin/extensions/typescript-language-features/out/utils/dependentRegistration.js:51:28)
                                                                                at new VersionDependentRegistration (/tmp/.mount_onivim5oO6oK/usr/bin/extensions/typescript-language-features/out/utils/dependentRegistration.js:41:14)
                                                                                at Object.register (/tmp/.mount_onivim5oO6oK/usr/bin/extensions/typescript-language-features/out/features/updatePathsOnRename.js:244:12)
                                                                                at TypeScriptServiceClientHost.Promise.resolve.then.then.module (/tmp/.mount_onivim5oO6oK/usr/bin/extensions/typescript-language-features/out/typeScriptServiceClientHost.js:66:118)
                                                                                at process._tickCallback (internal/process/next_tick.js:68:7)
                                                                                [INFO]   +988ms Exthost.Client : Sending message: Exthost_Protocol.Message.Outgoing.ReplyOKEmpty {requestId = 176}
                                                                                [DEBUG]    +0ms Revery.App : Upshifting into active state.
                                                                                [DEBUG]  +258ms Revery.App : Upshifting into active state.
                                                                                [INFO]   +266ms Exthost.Client : Sending message: Exthost_Protocol.Message.Outgoing.ReplyOKEmpty {requestId = 177}
                                                                                [DEBUG]    +0ms Revery.App : Upshifting into active state.
                                                                                [INFO]   +267ms Oni2.Store.dispatch : (DiagnosticsSet (
                                                                                { Uri.scheme = Uri.Scheme.File;
                                                                                path =
                                                                                "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoardVC.js";
                                                                                query = None },
                                                                                "typescript", ))
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (DiagnosticsSet (
                                                                                { Uri.scheme = Uri.Scheme.File;
                                                                                path =
                                                                                "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoardVC.js";
                                                                                query = None },
                                                                                "typescript", ))
                                                                                [INFO]     +0ms Exthost.Client : Sending message: Exthost_Protocol.Message.Outgoing.ReplyOKEmpty {requestId = 178}
                                                                                [DEBUG]    +0ms Revery.App : Upshifting into active state.
                                                                                [INFO]   +262ms Oni2.Store.dispatch : (DiagnosticsSet (
                                                                                { Uri.scheme = Uri.Scheme.File;
                                                                                path =
                                                                                "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoardVC.js";
                                                                                query = None },
                                                                                "typescript", ))
                                                                                [DEBUG]    +1ms Oni2.Store.dispatch : After: (DiagnosticsSet (
                                                                                { Uri.scheme = Uri.Scheme.File;
                                                                                path =
                                                                                "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoardVC.js";
                                                                                query = None },
                                                                                "typescript", ))
                                                                                [INFO]     +0ms Exthost.Client : Sending message: Exthost_Protocol.Message.Outgoing.ReplyOKEmpty {requestId = 179}
                                                                                [DEBUG]    +1ms Revery.App : Upshifting into active state.
                                                                                [INFO]   +274ms Oni2.Store.dispatch : (DiagnosticsSet (
                                                                                { Uri.scheme = Uri.Scheme.File;
                                                                                path =
                                                                                "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoardVC.js";
                                                                                query = None },
                                                                                "typescript", ))
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (DiagnosticsSet (
                                                                                { Uri.scheme = Uri.Scheme.File;
                                                                                path =
                                                                                "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoardVC.js";
                                                                                query = None },
                                                                                "typescript", ))
                                                                                [INFO]     +0ms Exthost.Client : Sending message: Exthost_Protocol.Message.Outgoing.ReplyOKEmpty {requestId = 180}
                                                                                [DEBUG]    +1ms Revery.App : Upshifting into active state.
                                                                                [DEBUG]   +45ms Revery.App : Upshifting into active state.
                                                                                [INFO]    +73ms Oni2.Store.dispatch : (OpenFileByPath (
                                                                                "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoard.js",
                                                                                None, (Some { line = 0; column = 32 })))
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (OpenFileByPath (
                                                                                "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoard.js",
                                                                                None, (Some { line = 0; column = 32 })))
                                                                                [DEBUG]    +0ms Oni2.Store.StoreThread : Running effect: Batch:
                                                                                vim.openFileByPath
                                                                                [INFO]     +0ms Oni2.Store.dispatch : BufferEnter {id = 4; fileType = (Some "javascript"); lineEndings = <opaque>;
                                                                                filePath =
                                                                                (Some "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoard.js");
                                                                                isModified = false; version = 0; buffer = <opaque>}
                                                                                [INFO]     +0ms Oni2.Service_Syntax : Starting buffer subscription for: 4
                                                                                [INFO]     +0ms Service_Exthost : Starting buffer subscription for: 4
                                                                                [INFO]     +0ms Oni2.Service_Syntax : Stopping buffer subscription for: 3
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: BufferEnter {id = 4; fileType = (Some "javascript"); lineEndings = <opaque>;
                                                                                filePath =
                                                                                (Some "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoard.js");
                                                                                isModified = false; version = 0; buffer = <opaque>}
                                                                                [DEBUG]    +0ms Oni2.Store.Vim : Buffer update: 4
                                                                                [INFO]     +0ms Oni2.Store.dispatch : BufferUpdate {update = <opaque>; oldBuffer = <opaque>; newBuffer = <opaque>}
                                                                                [DEBUG]  +102ms Oni2.Store.dispatch : After: BufferUpdate {update = <opaque>; oldBuffer = <opaque>; newBuffer = <opaque>}
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (EditorCursorMove (2, <opaque>))
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (EditorCursorMove (2, <opaque>))
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (EditorScrollToLine (2, 0))
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (EditorScrollToLine (2, 0))
                                                                                [INFO]     +0ms Oni2.Store.dispatch : BufferEnter {id = 4; fileType = (Some "javascript"); lineEndings = <opaque>;
                                                                                filePath =
                                                                                (Some "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoard.js");
                                                                                isModified = false; version = 2; buffer = <opaque>}
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: BufferEnter {id = 4; fileType = (Some "javascript"); lineEndings = <opaque>;
                                                                                filePath =
                                                                                (Some "/file/path/sub/dir/dir2/dir3/kanban/KanbanBoard.js");
                                                                                isModified = false; version = 2; buffer = <opaque>}
                                                                                [DEBUG]    +0ms Oni2.Store.StoreThread : Effect complete: Batch:
                                                                                vim.openFileByPath

                                                                                [DEBUG]    +0ms Revery.App : Upshifting into active state.
                                                                                [DEBUG]    +8ms Oni2.Store.StoreThread : Running effect: Batch:
                                                                                scm.getOriginalUri
                                                                                indentation.detectAndSet
                                                                                title.update

                                                                                [INFO]     +0ms Oni2.Store.dispatch : (BufferSetIndentation (4, <opaque>))
                                                                                [DEBUG]    +1ms Oni2.Store.dispatch : After: (BufferSetIndentation (4, <opaque>))
                                                                                [INFO]     +0ms Oni2.Store.dispatch : (SetTitle "KanbanBoard.js - client - Onivim 2")
                                                                                [DEBUG]    +0ms Oni2.Store.dispatch : After: (SetTitle "KanbanBoard.js - client - Onivim 2")
                                                                                [DEBUG]    +0ms Oni2.Store.StoreThread : Effect complete: Batch:
                                                                                scm.getOriginalUri
                                                                                indentation.detectAndSet
                                                                                title.update

                                                                                [DEBUG]    +0ms Oni2.Store.StoreThread : Running effect: Batch:
                                                                                Batch:


feat: promote error info field in http error

Keep debug experience consistency between GAPIC and REGAPIC.
Parse fallback error and promote the ErrorInfo field. Two type fallback decoder in gax:

fallbackProto:: decodeReponse
fallbackRest:: decodeReponse

Add integration test for Rest client
Open questions: Do we need to rename details field to statusDetails in Rest Client error object.
In GAPIC, the details fields has been occupized, so when decode google.rpc.status details field, we rename as statusDetails.
Good to change the name is keep consistency with GAPIC.
Bad to change the name is that it is considered as break change.
@alexander-fenster @bcoe Can I have your opinion on this? Thank you.
Example call translate rest client with receiving http error:
before:
Error: Cloud Translation API has not been used in project ...
{
  code: 403,
  status: 'PERMISSION_DENIED',
  details: [
    { '@type': 'type.googleapis.com/google.rpc.Help', links: [Array] },
    {
      '@type': 'type.googleapis.com/google.rpc.ErrorInfo',
      reason: 'SERVICE_DISABLED',
      domain: 'googleapis.com',
      metadata: [Object]
    }
  ]
}

after
{
  code: 403,
  status: 'PERMISSION_DENIED',
  details: [
    { '@type': 'type.googleapis.com/google.rpc.Help', links: [Array] },
    {
      '@type': 'type.googleapis.com/google.rpc.ErrorInfo',
      reason: 'SERVICE_DISABLED',
      domain: 'googleapis.com',
      metadata: [Object]
    }
  ]
  reason: 'SERVICE_DISABLED',
  domain: 'googleapis.com',
  errorInfoMetadata: {
      consumer: 'projects/...',
      service: 'translate.googleapis.com'
  }
}

Open questions: Do we need to rename details field to statusDetails in Rest Client error object.
In GAPIC, the details fields has been occupized, so when decode google.rpc.status details field, we rename as statusDetails.
Good to change the name is keep consistency with GAPIC.
Bad to change the name is that it is considered as break change.
@alexander-fenster @bcoe Can I have your opinion on this? Thank you.


Using on Android

Hi when loading the library on android i get the following error.
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.nio.file.Paths"
When i do this call.
        Importer importer = new Importer();
        AiScene scene = importer.readFile(new URI(path), 1 | 8);

Are you using raw or assets?

Im doing something weird and i cant remember why...
`            AssetFileDescriptor assetFileDescriptor = assetManager.openFd("cube.obj");
FileDescriptor fileDescriptor = assetFileDescriptor.getFileDescriptor();
FileInputStream raw = new FileInputStream(fileDescriptor);
final File tempFile = File.createTempFile("cube", ".obj");
tempFile.deleteOnExit();
try (FileOutputStream out = new FileOutputStream(tempFile)) {
IOUtils.copy(raw, out);
}
        Model plain = new Model(tempFile.getAbsolutePath(), false);`

Model just calls
            Importer importer = new Importer();             AiScene scene = importer.readFile(new URI(path), 1 | 8);

Try this

This Importer importer = new Importer(); doesnt support an input stream...

So, apparently there are some classes, such as java.nio.files.*, that are not present on Android..
I am investigating for a solution...
Would you prefer loading your meshes from your res or assets folder?

Yea its a pain at times.
Either, currently I'm trying use assets folder but either are fine.

Ok, I am evaluating to make a branch for Android.
In the meanwhile, could you confirm me that the lenght you get on the files loaded from assets it's not UNKNOWN for you? If you test one of your assets file length, do you get the right size?
For reference

An update, I am planning to pass the AssetManager to the readFile together with the path of the main file in order for assimp to read additional adjacent files. Is this compatible with your app?

You do as you see fit, I will modify my app to sit in with your changes. :-)

Has there been a solution for this? We are using assimp-all.jar and are getting the Didn't find class "java.nio.file.Paths" error also. I don't see any AssetManager support in readFile() as of yet.


3.7: Order/Filter > Clipboard usability issue

Hi,
The feature that allows you to right click a column > order/filter > from clipboard is now tucked away in "column_name = .." > clipboard > ok, which is several more clicks. I can understand that the contextual menu can get too long, but could we get a setting to keep it in the menu instead of in the dialog ?

Ok, I'll just bring it back.
Apparently many people used this feature. Although context menu is a bit bigger than I hoped it will - but I can't make a better UI solution. Making extra config for it is too non-obvious.


Pod get re-created after it exited and get garbage collected

We are using tf-operator in a large k8s cluster and thousands of TF jobs will be running every day.  Completed jobs (TFJob CRD) will be kept for 15 days. Recently, we found that  after the job completed, occasionally its worker get re-created and the job will re-run.
We investigated it and found out the root cause:

tf-operator is using the pod's status to change the TFJob‘s status to Failed or Succeed.
While the worker exits, its status becomes Completed.
The pod will be GCed by controller-manager before tf-operator handles the job. Our cluster is very busy,  completed pods get GCed very soon.  The time between two reconsilation for the same job is about 1 min when threadiness is 20 for tf-operator.
When tf-operator handles this job, it find the pod is missing and will re-create it. The related code is https://github.com/kubeflow/tf-operator/blob/master/pkg/controller.v1/tensorflow/pod.go#L109:

            else if len(podSlice) == 0 {
			logger.Infof("Need to create new pod: %s-%d", rt, index)

			// check if this replica is the master role
			masterRole = tc.IsMasterRole(replicas, rtype, index)
			// TODO: [should change to CreateNewPod]
			err = tc.createNewPod(tfJob, rt, strconv.Itoa(index), spec, masterRole, replicas)
			if err != nil {
				return err
			}
             }

I think it should not re-create the pod if the job's status is Running. Maybe we should set the job's status to new status called Completed, as the pod is GCed and we don't know its actual status.

Em.  Thanks for reporting this issue. this might be a little bit tricky.

Our cluster is very busy, completed pods get GCed very soon.

Do you have an estimate on this? Usually how long the pods will be GCed right before job is reconciled?

I think it should not re-create the pod if the job's status is Running.

For some of the case, this is desired, otherwise, any interruption to the pod results in losing pod forever.

I am interested in your use case.
So tf-operator decide whether the job is Failed or Success based on worker0Completed, chiefCompleted or even allWorkerComplete.
We assume when the worker0 or Chief completed and exits with 0, the pod will be there for a while so we can check the exit code to make sure it exists with 0 to say the job succeed
In your case, it seems like the pod will be GCed immediately and the controller will have no chance to check the exit code and even recreate the pod.
But my question is, does that mean in your case, you don't care whether the pod exit with error or not (exit 0 successfully)
Then how do you decide the job is successful or failed?

Do you have an estimate on this? Usually how long the pods will be GCed right before job is reconciled?

It depends, we observed pods in some hosts get GCed very soon, about less than 60s.

But my question is, does that mean in your case, you don't care whether the pod exit with error or not (exit 0 successfully)
Then how do you decide the job is successful or failed?

We care the exit code. We will use the conditions to show the status of TFJob.
Currently, if the pod is missing  we will just mark the job succeed. We will check the collected log of the pods to find out if it succeeds or fail.

I am wondering why the job is running when the pod is completed. is it caused by frequent gc?
I think the job should be succeeded if the pod is completed.

@gaocegege I think this is a common issue as there is a similar KEP for k8s job: https://github.com/kubernetes/enhancements/tree/master/keps/sig-apps/2307-job-tracking-wihout-lingering-pods
We can also use finalized to solve the problem.

/reopen

Gotcha. LGTM


Please provide a head start for cli/api context-history management, suggestion provided here.

Hello. I just signed up for Mistral api, it is very exciting.
And at docs.mistral.ai/
I saw the provided code for connecting with the api is not so verbose; one block of the curl.
It may be helpful for your python-using users to have a user-friendly way to get started with the AI
and the longer road of managing context history. So
Here is a colab for basic history management and recording. Sorry it is very crud but,
please use it if people find it useful.
https://github.com/lineality/simple_mistral_api_context_history_manager
You are very important, thank you for your work.

Sorry, I cannot tell if the file on github saved correctly, a colab link is here:
https://colab.research.google.com/drive/1cRQNH0JrM9IkiOgOy9kQijUSEtwlYNj1

Thanks so much for the example. Would you be interested in submitting your example to our cookbook? It'd be great for our cookbook: https://github.com/mistralai/cookbook


The s3 storage backend leaks a new https connection every 10 seconds

Every time s3 is queried (over a https connection) a new Transport object is created which is not automatically garbage collected. This leads to one new established connection every 10 seconds! After some hours/days there are too many connections open and every call to s3 fails.
There is an old open issue in net/http for this here: https://github.com/golang/go/issues/24739
Consider reusing the same Transport object or closing the idle connections in a deferred function.
https://github.com/openshift/cluster-image-registry-operator/blob/99ec5c4ce27f090221f5d6c751942c2852468ebc/pkg/storage/s3/s3.go#L170

/assign @ricardomaraschini
might be related to https://bugzilla.redhat.com/show_bug.cgi?id=1902091

/assign @ricardomaraschini
might be related to https://bugzilla.redhat.com/show_bug.cgi?id=1902091

@webner What version have you used to verify this leak?

@webner What version have you used to verify this leak?

The verified the issue with 4.6.8 and 4.6.12.
sh-4.4$ echo $RELEASE_VERSION
4.6.12
sh-4.4$ date; lsof -ni | wc -l
Thu Jan 21 14:12:28 UTC 2021
11066
sh-4.4$ date; lsof -ni | wc -l
Thu Jan 21 14:12:43 UTC 2021
11067
sh-4.4$ date; lsof -ni | wc -l
Thu Jan 21 14:12:57 UTC 2021
11069

The verified the issue with 4.6.8 and 4.6.12.
sh-4.4$ echo $RELEASE_VERSION
4.6.12
sh-4.4$ date; lsof -ni | wc -l
Thu Jan 21 14:12:28 UTC 2021
11066
sh-4.4$ date; lsof -ni | wc -l
Thu Jan 21 14:12:43 UTC 2021
11067
sh-4.4$ date; lsof -ni | wc -l
Thu Jan 21 14:12:57 UTC 2021
11069

@webner The code you mentioned got added 18 days ago through https://github.com/openshift/cluster-image-registry-operator/pull/648 and should be present only from 4.7 on. There must be something else.

@webner The code you mentioned got added 18 days ago through https://github.com/openshift/cluster-image-registry-operator/pull/648 and should be present only from 4.7 on. There must be something else.

@ricardomaraschini This referenced line is already in 4.6.
https://github.com/openshift/cluster-image-registry-operator/blob/be99ea05e4a6c527dedfb222e95e5fbef0a57d83/pkg/storage/s3/s3.go#L148
I guess the issue surfaced with an go update or some other change in the operator.

@ricardomaraschini This referenced line is already in 4.6.
https://github.com/openshift/cluster-image-registry-operator/blob/be99ea05e4a6c527dedfb222e95e5fbef0a57d83/pkg/storage/s3/s3.go#L148
I guess the issue surfaced with an go update or some other change in the operator.

Is your an IPI installation or there is something special about it? I have tried again to reproduce this but I could not:
sh-4.4$  date; lsof -ni |wc -l
Wed Mar 17 16:12:32 UTC 2021
6
sh-4.4$  date; lsof -ni |wc -l
Wed Mar 17 16:14:09 UTC 2021
5
sh-4.4$  date; lsof -ni |wc -l
Wed Mar 17 16:19:24 UTC 2021
6
sh-4.4$  date; lsof -ni |wc -l
Wed Mar 17 16:20:20 UTC 2021
5
sh-4.4$

We can reproduce this in IBM Cloud.  Added more notes in the bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=1959563

The problem is fixed in 4.8. The backporting process can be tracked in the BZ.


Handle a null properly in SelectedItem set

Okay - I think I did the pull request properly.  Let me know if not.  Anyway, it's a simple fix - the old SelectedItem set routine in ListBox tried to find the value in the list box which, of course, wouldn't work if you were trying to turn off the selection by setting it to null.  This explicitly happens in the code if you delete the currently selected object which is how I saw it.  So I just check for null there and do the right thing - else, I run the old code intact.

Fixes #169
Thank you for the pull request 👍 It looks good, though it should be targeted to the develop branch, but that is on me. I need to add a PR template that informs you and others of that 😄 I'll still accept it and rebase my code on it.
Thanks again!!!

I realized later that I should have made a branch.  The first thing I saw and slavishly followed did it on the main branch.  Then after I was done I saw another thing that said “If you want to make future changes (which I probably will) then make each change on a separater branch”.  Whoops!  Ah well – live and learn.  Loving the product and using it in an ascii editor which I think is coming along nicely.
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: SadConsole<EMAIL_ADDRESS>Sent: Wednesday, December 12, 2018 12:38:11 PM
To: SadConsole/SadConsole
Cc: Darrell Plank; Author
Subject: Re: [SadConsole/SadConsole] Handle a null properly in SelectedItem set (#172)
Fixes #169https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSadConsole%2FSadConsole%2Fissues%2F169&data=02|01||08ae4dfb48d4440649fd08d66071bbf8|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636802438926942701&sdata=viPCZCzkF912DFnl2StSKzympec10KPmLhbON%2ByGHVI%3D&reserved=0
Thank you for the pull request 👍 It looks good, though it should be targeted to the develop branch, but that is on me. I need to add a PR template that informs you and others of that 😄 I'll still accept it and rebase my code on it.
Thanks again!!!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FSadConsole%2FSadConsole%2Fpull%2F172%23issuecomment-446735213&data=02|01||08ae4dfb48d4440649fd08d66071bbf8|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636802438926942701&sdata=oAtRIHrgYSizT4h1qjEiqphQ1fbWIbs%2BlyhUt06R%2FrE%3D&reserved=0, or mute the threadhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAmSxfxb0H8C4blDb268Dxu_6JQ9X00Tks5u4WkzgaJpZM4ZOy9X&data=02|01||08ae4dfb48d4440649fd08d66071bbf8|84df9e7fe9f640afb435aaaaaaaaaaaa|1|0|636802438926942701&sdata=rHhAZfe%2F71pj6Ocp47bgRYuEeXoKLuWDpWBrDwVum1o%3D&reserved=0.


Vpc UUID clusters

Added the ability to specify VPC UUID for a database cluster
Added an output for the VPC UUID

OH, interesting.
OK could we do that at the variable level?  As in set the default to null here

@JohnDzialo if you do it at the variable level then terraform registry will believe that this variable is required and will show in the module's page that 7 variables are required instead of 6, so it is better to do it in the resources and not at the variable level

Got it!   Thanks!
Updated the PR with a local variable.


Save json output for future use

Save json file for future use in reports

I'm doing my chaos test for microservices and with this new feature, it's easy to save a test report
package osvScanner

import (
  "github.com/helmutkemper/chaos/factory"
  "testing"
  "time"
)

func TestLinear(t *testing.T) {

  primordial := factory.NewPrimordial().
    NetworkCreate("test_network", "<IP_ADDRESS>/16", "<IP_ADDRESS>").
    Test(t)

  factory.NewContainerFromGit(
    "osv:latest",
    "https://github.com/helmutkemper/osv-scanner.git",
  ).
    ReplaceBeforeBuild("Dockerfile", "./Dockerfile").
    Volumes("/scan", "../../").
    Create("osv", 1).
    Start()

  if !primordial.Monitor(3 * time.Minute) {
    t.Fail()
  }
}

it is standard for some programs to use -o together with the --output option

it is standard for some programs to use -o together with the --output option

Sorry my question was unclear!
Would osv-scanner .... -json > output.json work equally well for you here, as opposed to osv-scanner ... -o output.json  which this PR adds? Are there reasons why adding an explicit flag for this is helpful for users?

make the option clear and standardized


Choice of hex tile size in examples prevents pixel-perfect tiling

The hex tiles are 15x17 pixels. Since when hex-tiling the rows or columns are offset by half a tile and neither the width nor the height are integer-divisible by 2, you necessarily get a pattern where every other "column" or "row" looks somewhat off. It took me a while to figure out that this was not some rendering deficiency but simply a matter of choosing even numbers for the sizes.

An important information to be considered in this context is that bevy automatically calculates a scale factor for each window, which may be something like 1.08333 if you have exotically sized screens. You can override that thing:
app.add_plugins(
            DefaultPlugins
                .set(WindowPlugin {
                    primary_window: Some(Window {
                        title: String::from("Hexagon Column Example"),
                        resolution: WindowResolution::default().with_scale_factor_override(1.0),
                        ..Default::default()
                    }),
                    ..default()
                })...

Furthermore, you probably want to turn off anti-aliasing:
app.insert_resource(Msaa::Off);
I'm preparing a patch that gets rid of the sqrt(3) calculations and rather calculates the tile offsets from the given grid size using divisions by 2 and 4. That way a nicer grid size (like 28x32, for example) actually has an effect. If you do the sqrt(3) calculations, the calculation errors add up and your pixels will still be "off" in some places.


[21.05] nvidia_x11: 470.57.02 → 470.63.01

Motivation for this change
Nvidia driver build failure as documented in #132840.
Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[x] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
21.11 Release Notes (or backporting 21.05 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module

[ ] Fits CONTRIBUTING.md.

I've been running this exact change for a few days without any issues. FWIW, since I only use the driver to turn off the nvidia gpu in my laptop.
I'm using linuxPackages_latest. If somebody could confirm that it works with plain linuxPackages then I'd be happy to merge.

I'll give it a test run on linuxPackages this weekend if nobody else gets around to it, also running _latest, of course, otherwise I wouldn't have noticed the breakage :)

I've been running with linuxPackages since Friday evening, and not seen any issues, even running some games. I've not tested cuda or a variety of GPUs of course, but I don't think we've been trying to assert function for the whole range of GPUs/features supported by the driver in the past.

Thanks! I think that is good enough 👍


CLOUDP-209403 Update error message regarding credentials for atlas in local dev

Proposed changes
Update error message regarding credentials for atlas in local dev

Jira ticket: CLOUDP-209403

Checklist

[ ] I have signed the MongoDB CLA
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] I have added any necessary documentation in document requirements section listed in CONTRIBUTING.md (if appropriate)
[ ] I have addressed the @mongodb/docs-cloud-team comments (if appropriate)
[ ] I have updated test/README.md (if an e2e test has been added)
[ ] I have run make fmt and formatted my code

Further comments

in this branch
./bin/atlas deployments ls -P dev
NAME        TYPE    MDB VER   STATE
local7886   LOCAL   7.0.2     STOPPED
Error: failed to retrieve Atlas deployments: https://cloud-dev.mongodb.com/api/atlas/v2/groups/5e429f2e06822c6eac4d59c9/clusters GET: HTTP 500 Internal Server Error (Error code: "") Detail:  Reason: Server Error. Params: []

I was under the impression the goal was to stop doing the API call

this is on the prod build
atlas deployments ls -P dev
Could not refresh access token: session expired

To login, run: atlas auth login
NAME        TYPE    MDB VER   STATE
local7886   LOCAL   7.0.2     STOPPED
Error: failed to retrieve Atlas deployments with: https://cloud-dev.mongodb.com/api/atlas/v2/groups/5e429f2e06822c6eac4d59c9/clusters GET: HTTP 500 Internal Server Error (Error code: "") Detail:  Reason: Server Error. Params: []

in this branch
./bin/atlas deployments ls -P dev
NAME        TYPE    MDB VER   STATE
local7886   LOCAL   7.0.2     STOPPED
Error: failed to retrieve Atlas deployments: https://cloud-dev.mongodb.com/api/atlas/v2/groups/5e429f2e06822c6eac4d59c9/clusters GET: HTTP 500 Internal Server Error (Error code: "") Detail:  Reason: Server Error. Params: []

I was under the impression the goal was to stop doing the API call

I decided to not avoid doing API call, there is a bit of state management involved that we would need to change, the way we deal with auth basically happens at the builder/persistentprerun as opposed to in each command which made things complicated.
I decided to catch the 401 error and make a better message, in your original post you were suffering from auth issues, this time you won't get this confusion. On your current example you are not having any auth issues so the message is not the same.

@gssbzn I've updated the approach now you will see
atlas deployments ls -P dev
Could not refresh access token: session expired

To login, run: atlas auth login
NAME        TYPE    MDB VER   STATE
local7886   LOCAL   7.0.2     STOPPED

instead of
atlas deployments ls -P dev
Could not refresh access token: session expired

To login, run: atlas auth login
NAME        TYPE    MDB VER   STATE
local7886   LOCAL   7.0.2     STOPPED
Error: failed to retrieve Atlas deployments with: https://cloud-dev.mongodb.com/api/atlas/v2/groups/5e429f2e06822c6eac4d59c9/clusters GET: HTTP 500 Internal Server Error (Error code: "") Detail:  Reason: Server Error. Params: []


integrated terminal - powershell command colors with light theme

The default input color (of type command) in PowerShell is yellow. Obviously this is unreadable inside the integrated terminal when using a light theme.
The color may be changed by
Set-PSReadlineOption -TokenKind Command -ForegroundColor Black
however, this does not yield the expected result: Commands seem to be "hidden" (invisible, indeed). Instead, with
Set-PSReadlineOption -TokenKind Command -ForegroundColor White
the typed command is shown as (somewhat bold!) black.
So it seems white and black are (kind of) reversed.
While blue and green are not correct as well (in some themes), this may depend on the actual theme. However, black and white are wrong in lots of light themes, so I would assume it's a bug. Sorry if I'm wrong...

I think this is as designed as AFAIK it's the default for powershell (was it not designed to ever show on a light terminal?) and themes are meant to provide enough contrast to make out yellow on white.
/cc @tylerl0706

Here's the issue you're looking for:
https://github.com/lzybkr/PSReadLine/issues/464

The real problem for me wasn't the yellow characters, but instead that White is bold black, and Black is invisible. But DarkGray is dark gray (what I'm using now).
Nevertheless, that PSReadline related discussion is interesting - for some reason I had only looked for issues in PowerShell archives.


[doc] Split button with popper z-index issue

Duplicates

[X] I have searched the existing issues

Latest version

[X] I have tested the latest version

Current behavior 😯

In the image, View code icon is visible even after options are visible.
Expected behavior 🤔

The issue can be fixed if we add z-index 1 to popper
Steps to reproduce 🕹
Steps:

Go to split button section
Click on v button to see options

Context 🔦
No response
Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Same kind of issue was also reported couple of days ago - 33730
I made a fix here directly at the component.
However my PR was closed without merge.

I think the ideal fix would be to add z-index to Material UI Popper but maybe it makes sense to do it in v6.
diff --git a/packages/mui-material/src/Popper/Popper.tsx b/packages/mui-material/src/Popper/Popper.tsx
index 5f622187f6..26dedc46b7 100644
--- a/packages/mui-material/src/Popper/Popper.tsx
+++ b/packages/mui-material/src/Popper/Popper.tsx
@@ -16,7 +16,9 @@ const PopperRoot = styled(PopperUnstyled, {
   name: 'MuiPopper',
   slot: 'Root',
   overridesResolver: (props, styles) => styles.root,
-})({});
+})({
+  zIndex: 1,
+});

 /**
  *

One note on the stacking context, we had to revert changes similar to this one in the past, If I recall correctly on the checkbox. But 👍 to explore this path, only want to mention that sometimes, it creates other conflicts (since it's a priority problem at the root)


Readme updates

#249  👈
main

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @rbro112 and the rest of your teammates on  Graphite


Update pinvoke-source-generation.md

Summary
In the differences to DllImport section, add a comment that LibraryImport requires the project to be marked unsafe.

Internal previews

📄 File
🔗 Preview link

docs/standard/native-interop/pinvoke-source-generation.md
Source generation for platform invokes

closing and reopening for a fresh build


Add ability to configure and use tls with grpc traffic

This PR is to add ability to encrypt GRPC traffic.  I also split the grpc setup code to a grpc.go file for each the server and agent.  If you prefer not to have that done I can work to undo it.
At a minimum the following is required to be configured:
Server

DRONE_GRPC_CERT_FILE
DRONE_GRPC_KEY_FILE

Agent

DRONE_GRPC_TLS_ENABLE

This code can also be used to configure another layer of authentication using server/client cert/key verification.  The following additional options are also provided to help facilitate that.
Server

DRONE_GRPC_CA_FILE
DRONE_GRPC_VERIFY_MODE

Agent

DRONE_GRPC_CERT_FILE
DRONE_GRPC_KEY_FILE
DRONE_GRPC_CA_FILE

Finally, on the agent you can also specify DRONE_GRPC_SERVERNAME to override the hostname to use to match the certificate on the server.  This is primarily for testing purposes.
I have done some manual testing of this with a private drone instance built from source.

Testing failed but I think it pulled old code after I force pushed updates.

Some logs from my manual tests:
server
...
drone-server    | [GIN-debug] GET    /version                  --> github.com/drone/drone/server.Version (12 handlers)
drone-server    | [GIN-debug] GET    /healthz                  --> github.com/drone/drone/server.Health (12 handlers)
drone-server    | time="2018-02-28T16:20:06Z" level=debug msg="grpc: Configuring TLS"
drone-server    | time="2018-02-28T16:20:06Z" level=debug msg="agent connected: 434cc4feecbe: polling"
drone-server    | time="2018-02-28T16:20:06Z" level=debug msg="agent connected: 434cc4feecbe: polling"
drone-server    | time="2018-02-28T16:20:07Z" level=debug msg="user feed: connection opened"

agent
drone-agent     | {"time":"2018-02-28T16:20:06Z","level":"debug","message":"grpc: Configuring TLS"}
drone-agent     | {"time":"2018-02-28T16:20:06Z","level":"debug","message":"request next execution"}
drone-agent     | {"time":"2018-02-28T16:20:06Z","level":"debug","message":"request next execution"}

\o/ this was exactly what I've been looking for. Drone is so goofy with the whole jsonrpc2 calls. Thanks for this.

Drone is so goofy with the whole jsonrpc2 calls. Thanks for this.

drone no longer uses jsonrpc2.  It uses grpc as the transport protocol. This pull requests adds tls to the existing grpc implementation.

@bradrydzewski without this PR we cannot upgrade Drone to avoid sending possibly sensitive information on the wire unencrypted, any reason not to accept it, beside the conflict ?

It's not merged because 0.9 will get lots of improvements.

Will these improvemets include encrypted build log streaming ?

@pyry the next drone release removes support for grpc in favor of rest. So if ssl is enabled for your drone server the agent-to-server connection will be encrypted. The next version should land in a few weeks.

Great news! Will it be feasible/easy to upgrade
from 0.5 to such a new release ?

The pipeline schema will entirely change, but at least it will be version than.

Closing this issue since GRPC goes away with 0.9


Update The MenuIcon path in ButtonAppBar.js

[ButtonAppBar.js]
the path import MenuIcon from '@material-ui/icons/Menu'; throw an error : Module not found: Can't resolve '@material-ui/icons/Menu'
by changing  the path [ import MenuIcon from '@material-ui/core/Menu'; ] it works.

@pierrelstan You need to add the @material-ui/icons NPM package. Now, I try to have as many contributors as possible, I'm continuing your pull request to do a minor improvement.


Update reader.py

Random neg_item and random neg_cat is not paired,  as usual even neg_item and neg_cat should be paired,

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

可以装pre-commit修一下代码风格的问题：

可以装pre-commit修一下代码风格的问题：

我在本地check是OK的，提交上来还是这样，搞不懂哦


Fixes #189 - Improve Consul TTL Check management

Remove spring.cloud.consul.discovery.heartbeat.fixedRate property and use a TaskScheduler (with FixedRateTrigger) to send Consul checks

Merged with some polish via cf998fffae4f3b90cd0209f0383efc29a9b0a25e


WIP: Add content type validation header

Added header for header validation.
The only case that isn't covered is in case the body can be empty, in this case, the validation won't be smart and will fail if the header is missing.
I think this is an edge case but it's still work in progress, I will try to solve it.

Pull Request Test Coverage Report for Build 107

4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.02%) to 99.355%

Totals

Change from base Build 103:
0.02%

Covered Lines:
188

Relevant Lines:
188

💛  - Coveralls

Pull Request Test Coverage Report for Build 107

4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.02%) to 99.355%

Totals

Change from base Build 103:
0.02%

Covered Lines:
188

Relevant Lines:
188

💛  - Coveralls

Pull Request Test Coverage Report for Build 107

4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
No unchanged relevant lines lost coverage.
Overall coverage increased (+0.02%) to 99.355%

Totals

Change from base Build 103:
0.02%

Covered Lines:
188

Relevant Lines:
188

💛  - Coveralls

@igor-savin-ht you can review, If you have any good idea to handle the last open issue feel free to share.

Basically, I think everything is ready for review, I solved all the issues by not setting the content-type header as required and using a regex for validation.
@igor-savin-ht @kibertoad can you please review?

@idanto Would it be possible to skip validation in case body is empty? That sounds to be a more valid approach.

@kibertoad It's much harder to implement, cause the whole idea behind ajv is the pre-compiled schema and currently the body and all other parameters are two different schemas.
I can check if there is a conditional check in Ajv and think how to indicate that there is something in the body but it will take me some time to solve

@idanto Probably the easiest solution at this point is to make this check optional and disable by default, so that no existing requests start failing, and whoever needs this check, could opt-in.

Please do not merge this one, I found an issue with the code - it is application/json specific and doesn't fully support the swagger spec.
I would like also to make this optional as @kibertoad suggested

@idanto Can we move the validation outside of ajv call and check the header manually?

@kibertoad Please review again:

Added content-type validation as an options
Added validation only if content-length is higher than 0
Added Support in multiple content-types (Supported by Swagger Spec)
A small refactor to the code
Added more tests to more edge cases

@idanto Can I merge it?


Poll: Would you prefer that the DetachedAction button style match the Nova primary button?

We had an early contribution from @milewski posing the question/asserting his opinion about whether we should match the style of the default primary button style in Nova or whether we should use a 'secondary' color based on the navigation menu background color as we've done in the first iteration of the package.
Option 1: Switch to Nova primary button and provide css classes allow developer to create styles in a custom theme
We could switch to btn-primary but keep the package css class, .btn-detached-action. Instead of actually providing css styles for those classes, we would remove them and allow developers to style using the existing custom theme documentation. @milewski also argued that it wasn't worth the extra HTTP request for the styles. He may have a point.
Option 2: Keep the button style as is and still allow the developer to theme
Since we already use .btn-detached-action, developers could still easily provide styles via a custom theme.
Vote
If you care about either option, please leave a vote below, just write Option 1 or Option 2 if you would like to leave your opinion too, that's definitely appreciated.
If you don't want to write a comment, feel free to just add a reaction:
❤for Option 1
👍for Option 2
I'll leave the issue open for a while to see if we can get some votes in.
Thanks!

Hey among that changes mentioned above I have also made 3 other improvements on my fork that you could incorporate in here:
1 - https://github.com/dcasia/nova-detached-actions/blob/master/src/DetachedAction.php#L13 implements PotentiallyMissing interface to remove itself from the main action filter menu from nova (current behavior shows the action button and it is still available within the action select input in nova.. this fix that)
2 - https://github.com/dcasia/nova-detached-actions/blob/master/resources/js/components/CustomIndexToolbar.vue#L41 simplify the js code by reusing most of the functionality already written on the nova HandlesActions mixin.. and overriding only what needs to be changed
3 - Fix a bug where the handle method wouldn't be called

@milewski Awesome suggestions, thanks!
Are you interested in submitting a pull request?

Well, my fork incorporates all the changes you are waiting for votes on this thread... if that`s what people want I can submit that as a PR otherwise I have to re-do the changes again from this repo master branch and submit these changes individually...

Your call, if you want to wait to see if people bother to vote on this, I understand.
I have some changes in the works too that I think will be pretty useful, I’d love to get yours and mine together for the next release but I get it if you don’t want to make atomic commits for each one.
I can always make the changes myself too if you don’t have time.
Thanks again for contributing.

My preference is to have the detached action buttons look different than the create button, but more importantly, I'd like it if we could customize the class by passing one or more classes via withMeta

My preference is to have the detached action buttons look different than the create button, but more importantly, I'd like it if we could customize the class by passing one or more classes via withMeta

This right here! Also, I'd like to add an image or an icon.

My preference is to have the detached action buttons look different than the create button, but more importantly, I'd like it if we could customize the class by passing one or more classes via withMeta

This right here! Also, I'd like to add an image or an icon.

I agree an icon would be pretty awesome. It's not so simple to implement though, once you afford the ability to add an icon, the expectations change a little. Which icon set? The "official" is the heroicons set. Are they sufficient? Do you expect to be able to use any icon you want? What format? SVG or an Image or both? How do you pass the icon into the component from the Nova action in PHP? Do you really want to pass in big HTML string?
I have a branch to add support for classes. Any interest In trying it out?

I vote for Option 1, as I would like detached actions to follow Nova, but be able to specify classes to customize that behavior.
Any support to make it easier to style buttons would be most appreciated!
Icon support would be fantastic, but like @eoghanobrien mentioned... how best to implement? SVG is most useful IMHO as it lets anyone use any icon they can get in SVG format, which is pretty easy nowadays.

Added in v1.1.0

@949mac @babul v1.1.1 added icon support and some other useful updates, check the README.md


[release-1.2] Bug fix for initServiceAccount in push_context

This is an automated cherry-pick of #16769

CLA approved in original PR.


Use default branch

I'm not entirely sure what this PR was, but I guess it was an attempt to open a PR for this commit, which ended up being pushed directly to main: 6fcd3d2d1d39dac66abf9f41e19675a9806958bf


chore: build all packages and add them to SC

Motivation

Changes

Testing

[ ] Local
[ ] Staging
[ ] Unit
[ ] End to end

I have gone over the contributing documentation.

Current dependencies on/for this PR:

main

PR #3

PR #4   👈

This comment was auto-generated by Graphite.