cmd/go: use go.sum hashes from all downloaded modules

This proposal is an alternative to #24117 (CC: @rsc @FiloSottile).
Rather than maintaining a global go.sum file, I propose to merge in the go.sum files from all modules that provide packages in the transitive import graph of the main module.
Specifically:

Whenever we load the source code from a module, we should also load the contents of its go.sum file.
If the new go.sum file contains a conflicting checksum for some other entity (a module or go.sum file) loaded in the course of the same go command invocation, the build should fail.
Conflicts for entities that are not loaded in the course of the same go command invocation should not cause the build to fail: we have no way to report which of the conflicting checksums (if any) is correct, and the fact that the conflict exists is (by the previous rules) immaterial to the actual operation requested by the user.

Here is my rationale:
go.sum files may contain errors. For example, they may contain an erroneous checksum due to a bug in the go command (such as #26794 or #27868), or due to memory or disk corruption (of the go.sum file itself or on the machine of the user who created the go.sum file).
To allow such errors to be corrected over time, it is important that we ignore the contents of go.sum files for modules (and versions of modules) that do not contribute meaningfully to the build: if we load the go.mod file for some version of a module but end up using a newer version instead (or not importing any packages from it at all!), then we should ignore errors in the rest of its code, including its go.sum file.
On the other hand, if we build code from a module using some version of a dependency known to that module, it is important that we use the same version it was (or may have been) tested against. This is especially important for builds performed outside of any module (#24250): in that case there is no root go.sum file that we can check against, and we may be running in a completely clean image (such as in a CI system) and not have anything else to bootstrap against.
In contrast to a “global” go.sum file (#24117), this approach makes checksum failures reproducible: if someone reports an invalid checksum for some module, they can also determine exactly where that checksum came from so that others can investigate and, ultimately, fix the erroneous checksum without specific user intervention.

I like this; checking more just isn't likely to hurt (apart from more CPU & IO burned).
I'm not sure it's really in any way in conflict with a "global" (per-user) go.sum, though. The global go.sum's job is to make the TOFU security property sticky to the user, not to the project. For example, if you start a new project and go get something, a global go.sum would have sums for any modules you've used in other projects previously (even if the actual source had been cleaned from the cache).
Then again, TOFU on this level doesn't prevent a new version from being malware, so the extra assurance is pretty small...

Let's talk at some point about this. I fear it will be abused and would rather establish a good global reference.

Per in-person discussion this morning, this has a clear benefit when operating outside of any main module, but it's much less obvious inside a module (where there is generally already a single, authoritative go.mod file).
For 1.13, I'll send a CL to enable it only in the former case, and we can consider expanding it depending on how that goes.

@bcmills and I talked about this a bit more at some point after my last message. As proposed, this would make it impossible to override a bad go.sum in a dependency. I'm a bit uncomfortable with that, especially now that we have the checksum database available to address many of the same issues. I think we should probably say the checksum database is enough and not do this recursive check.
@bcmills, what do you think?

I agree; given the checksum database and our experience with the difficulty of fixing other transitive module errors (such as path mismatches), I don't think the risk of hard-to-repair errors is worth the marginal-at-best gain in security.

Does anything change with go.sum file as everything runs well in my local windows machine but the moment same go.sum and go.mod files are committed and being build using jenkins, we get checksum error, anything specific to get it fixed? we are using go 1.11 and on mod

@manikesh, see #29278.


Examples runner need to display its status clearly

Right now, when Run button on the example is clicked, nothing visually says about what happens... And then the result appears. However, it may take a long time and it's a bad thing to make the user worry about what is happening.
Thus we need to give a clean visual hints about what's happening, say a spinner with "We process your request blah blah" kind of thing.
The relevant code is at https://github.com/Altai-man/docs.raku.org/blob/master/static/js/core.js#L84-L109

It is also a good idea to have some better UI presentation for stdout and stderr, the current layout is too simplistic.

I wouldn't mind tackling this one! :)

Glad to know! Feel free to PR a solution, instructions on how to setup a local dev environment are in the readme.

I got the environment set up, I had to re-learn some docker but I got it up.  I'm getting "Error occurred: error" for all output when any run button is clicked.  That's not expected behavior is it?

See https://github.com/Altai-man/docs.raku.org#examples-execution
In short, you need to setup another docker container with the server executing examples:
docker pull glot/docker-run:latest
docker pull glot/raku:latest
docker run --detach --restart=always --publish 8088:8088 --volume /var/run/docker.sock:/var/run/docker.sock --env "API_ACCESS_TOKEN=my-token" glot/docker-run:latest

^ please replace my-token with something sensible (though for local development I guess just my-token is fine enough) and then you specify two additional env variables for the website:
DOCKY_EXAMPLES_EXECUTOR_HOST
(and)
DOCKY_EXAMPLES_EXECUTOR_KEY

where the first one is something like http://localhost:8088/run and the second one is the token you specified.

where the first one is something like http://localhost:8088/run and the second one is the token you specified.
I'm guessing it should be some sort of generated UUID or something similar?

I'm guessing it should be some sort of generated UUID or something similar?

I think it is just checked to be equal. I mean, you pass it when starting a docker container with the runner (--env "API_ACCESS_TOKEN=my-token" bit in the command) and then you need to pass an exactly the same token to the website engine. Something like a random UUID will work, maybe something simpler like foo will work just as good.

I'm not having as much luck on the manual side of things.  I followed the manual instructions but for some reason I don't get service.p6 with it, so I tried just doing a regular clone and running the rest of the example steps but then I get the error

I think I got it lol, had to install.

Ok so I have been fighting with this for a while today, for some reason, when the run buttons are clicked it shoots the POST request to http://localhost:20000 but I have
DOCKY_EXAMPLES_EXECUTOR_HOST and DOCKY_EXAMPLES_EXECUTOR_KEY set

What is the value you set to DOCKY_EXAMPLES_EXECUTOR_HOST?
Also, are you running it with docker or not? If you are running it with docker, the environment variables simply set in shell won't be visible, you need to pass them with --env flag, see e.g. https://stackoverflow.com/questions/30494050/how-do-i-pass-environment-variables-to-docker-containers

I see, I'm not using the --env flag so that's probably it.  I am setting those variables in the shell.  I'm still pretty new to docker, thanks for being patient with me :)

Ok so I tried two main examples from Stack-O and neither worked sadly, but I can show what I did.
Attempt 1:
I followed the manual steps to getting the site running, then I tried
DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' DOCKY_EXAMPLES_EXECUTOR_KEY='foo' DOCKY_PORT=20000 DOCKY_HOST=localhost raku -Ilib service.p6
Attempt 2:
I deleted everything and cloned a fresh copy and followed the docker example.
sudo docker run --env DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' --env DOCKY_EXAMPLES_EXECUTOR_KEY='foo' -p 10000:10000 next-docs
Attempt 2.5:
$ DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run'
$ DOCKY_EXAMPLES_EXECUTOR_KEY='foo'
$ sudo docker run --env DOCKY_EXAMPLES_EXECUTOR_HOST --env DOCKY_EXAMPLES_EXECUTOR_KEY -p 10000:10000 next-docs
Attempt 3:
$ export DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run'
$ export DOCKY_EXAMPLES_EXECUTOR_KEY='foo'
$ sudo docker run --env DOCKY_EXAMPLES_EXECUTOR_HOST --env DOCKY_EXAMPLES_EXECUTOR_KEY -p 10000:10000 next-docs
All of these attempts have the same result for me, the run code button sends a POST request to localhost:10000, and I get this Raku error message:
Use of uninitialized value of type Any in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
  in method parse at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 342
Unable to parse URI '': Malformed scheme
  in method panic at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 202
  in regex URI at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 55
  in regex TOP at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 51
  in method parse at /opt/rakudo-pkg/share/perl6/site/sources/ED8D50D940CE504E69D0DF947069CEA3CDEB0E27 (Cro::Uri) line 344
  in method request at /opt/rakudo-pkg/share/perl6/site/sources/B500D4CDC421AF9AD474418C628D330F36F5FA98 (Cro::HTTP::Client) line 421
  in method post at /opt/rakudo-pkg/share/perl6/site/sources/B500D4CDC421AF9AD474418C628D330F36F5FA98 (Cro::HTTP::Client) line 379
  in block  at /app/lib/Docky/Routes.pm6 (Docky::Routes) line 173
  in block  at /opt/rakudo-pkg/share/perl6/site/sources/45B811289E008CD963B13A97AC3DCA707B5771A6 (Cro::HTTP::Router) line 136
  in block  at /opt/rakudo-pkg/share/perl6/site/sources/45B811289E008CD963B13A97AC3DCA707B5771A6 (Cro::HTTP::Router) line 132

[ERROR] 500 /run - <IP_ADDRESS>

These variables aren't getting set for me.

Woah, what a "beta version" experience. :/
I am sorry you have to tinker too much on this.
I believe it will work if you do the following:
1)Open Dockerfile file and add DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' DOCKY_EXAMPLES_EXECUTOR_KEY='foo' to ENV section of it
2)Re-build an image (maybe deleting previous ones) and docker run it.
This is not very convenient, but I am 99% sure it will work fine.

It's okay, really I'm just happy to be working on the project :)  The Raku language is really cool.  Gonna try it.

Sorry to say no luck here either.  But just to eliminate user error, I want to make sure I have everything correct:
Dockerfile:
ENV PATH=/root/.raku/bin:/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$PATH DOCKY_PORT="10000" DOCKY_HOST="<IP_ADDRESS>" DOCKY_EXAMPLES_EXECUTOR_HOST='http://localhost:8088/run' DOCKY_EXAMPLES_EXECUTOR_KEY='foo'
$sudo docker build -t next-docs -f Dockerfile .
$ sudo docker run -p 10000:10000 next-docs
This should work right?  The site loads fine and all the content is there, it's just sending the request to the wrong place.

Hmm. The difference I see is ' instead of ", but it should not matter.
This is weird, it works for me. Well, another option is to simply inline the address and token at https://github.com/Altai-man/docs.raku.org/blob/master/lib/Docky/Routes.pm6#L168-L170 just to make it going enough until an investigation of this case is possible (I am now optimizing page loading times).

That's what i was thinking of doing next.  But if it works for you, then I'm missing something. Because it works.

I don't know I'm having an issue related to yours, but I've been working on this for the past few hours and thought I'd share a couple things I noticed:
It is totally normal and expected to see that POST go to port 10000 before it goes to port 8088 to access the other container. https://github.com/Altai-man/docs.raku.org/blob/9528de11dfe65c88287735e287fec0c038c6385a/static/js/core.js#L93 sends that POST to the current host (and port) quite deliberately. Otherwise you'd run into XHR cross-origin security policy issues. https://github.com/Altai-man/docs.raku.org/blob/9528de11dfe65c88287735e287fec0c038c6385a/lib/Docky/Routes.pm6#L168 relays that POST from our server to the server running in the glot container.
I haven't even gotten to messing with the environment variables yet, because my first issue appears to be that the glot/docker-run container itself on port 8088 isn't working even when accessed directly. I get valid responses at / and /version, but at /run all I get no matter what I try to execute is:
$ curl --request POST --header 'X-Access-Token: my-token' --header 'Content-type: application/json' --data '{"image": "glot/raku:latest", "payload": {"language": "raku", "files": [{"name": "main.raku", "content": "print(42)"}]}}' http://localhost:8088/run
{
  "error": "coderunner.stdout.decode",
  "message": "Failed to decode json returned from code runner: EOF while parsing a value at line 1 column 0"
}

Which results in the same '"Error occurred: error" for all output when any run button is clicked' behavior reported in this discussion. This means at least my own failure has nothing to do with our work here, but is instead a manifestation of (not entirely explained but closed anyway) https://github.com/glotcode/docker-run/issues/1 but nothing there has worked for me so far. Pretty sure I followed https://github.com/glotcode/docker-run/blob/05fae20d91311a00680fe1e0f082bfd7c8524ba2/docs/install/docker-ubuntu-20.10.md correctly. I tried python and got the same error so it's not specific to the glot/raku image, either. Perhaps there's some extra step or misconfiguration on my end, but it's a totally fresh install of docker by the instructions. I'm running Kubuntu 20.04 (admittedly the instructions are for 20.10, but I'm unaware of a pertinent difference).
That's as far as I've taken this investigation so far. I hope it helps. If nothing else, try that curl line above and make sure your docker-run container is working, unlike mine. You could have this issue on top of your env var problem, complicating your troubleshooting process.

I am getting this as well, I'm pretty much getting the same behavior .

Oh, interesting. You get that while running the same curl line as above, directly to docker-run at :8088? I've been noticing what seem to be huge performance slowdowns with the docs container itself, but I haven't seen it hit an actual timeout at any point so far

because my first issue appears to be that the glot/docker-run container itself on port 8088 isn't working even when accessed directly

Alas, I cannot reproduce it.
➜  ~ curl --request POST --header 'X-Access-Token: 941E8B5F668CB55A4633ABA14EB59' --header 'Content-type: application/json' --data '{"image": "glot/raku:latest", "payload": {"language": "raku", "files": [{"name": "main.raku", "content": "say 42;"}]}}' http://<IP_ADDRESS>:8088/run
{"error":"","stderr":"","stdout":"42\n"}

@raydiak , can you try out exactly this ^ ? This is a temporary server with a container I set up and it seems to work reliably for me.
As for env variables: I am truly sorry, it seems I confused myself and others. --env does not actually change env inside of the container, but seems to affect it at the builds stage, so run --env is too late for this to take place. I think the very dirty workaround is to simply inline host/token as I suggested (you can even go with the ones in my query above) in the code, fix this ticket ??? get some nice results.
And then it will be a separate issue for setting up a nice and reliable way to populate this data during deployment.

@Altai-man see this works for me.

But I also forked the project and hooked it up with my own Glotio account and was able to use their API to achieve the same result lol.  But whatever you did differently let me know so I can replicate it.

@Altai-man that works, it's only my own container which is broken:
$ curl --request POST --header 'X-Access-Token: 941E8B5F668CB55A4633ABA14EB59' --header 'Content-type: application/json' --data '{"image": "glot/raku:latest", "payload": {"language": "raku", "files": [{"name": "main.raku", "content": "say 42;"}]}}' http://<IP_ADDRESS>:8088/run
{"error":"","stderr":"","stdout":"42\n"}

I may not have time to investigate further for a couple days, but I'll let you know if I discover anything useful to add to the instructions. Since nobody else is having my exact problem, at least hopefully nobody else should be affected.
WRT the env vars, I see we're assigning them to constants: https://github.com/Altai-man/docs.raku.org/blob/4e3e4857658e209b02b72fae212047e07bb42525/lib/Docky/Routes.pm6#L19-L20 but https://docs.raku.org/routine/constant says "The value is assigned at compile time. Since Raku modules are precompiled automatically, constants defined in modules are not re-evaluated when the program is run. Please check the section on constants in the Terms page for additional information." So changing those to "my" instead of "constant" may solve it.

@raydiak thanks for your input!
Given there is a setup that works and also a setup that works for local dev, it is not a critical issue to investigate them right now, in fact playing with the original ticket goal is maybe a higher priority.
I fixed another bug in examples execution recently, so it'd be cool to deploy both the UI fix and my bugfix.

@Altai-man sounds good, I'll make a PR for the env var fix when I get back to it. Was just throwing my two cents in here for the debugging. I won't actually be working on this specific issue as @CodeCanna already volunteered and just finally got a working setup :)

Just for future reference what is a PR?

Ping?

Ping?

Update:  I still haven't even gotten the site working with Glot.  Even with the online API, because I don't have CRO installed correctly. I think that's my problem. If anyone wants to step up on this one since I am have so much trouble getting a working environment and ill tag back in when I have it working.  I do apologize for the silence but I was engrossed in trying to get it set up.  I'll post error messages after I get back from work if you want, but I think I'm missing some C libraries that doesn't let CRO work properly.

Sorry to put you into so much trouble over this, thank you for your patience!
Are the problems persistent in Docker env as well?

Sorry to put you into so much trouble over this, thank you for your patience!

This is programming, we literally seek out problems like these to solve :)  I'm having fun.  I just don't want to take forever, I know this is actually supposed to be a small edit.
Problems are persistent no matter what I do really because I'm missing two essential C libraries needed to build Cro or run Cro or something. I went on the Raku IRC and people on there said that it sounded like my version of Rakudo is missing some libs.  They advised installing Rakudo through other means than APT.

So after days of trying to get this running I'm no closer.  So I decided to try and make my own small web page that implements Glot and a run button but i haven't  even got that working.  So it's obviously something I'm doing wrong.  Can't seem to get Glot to work.  I will yield this one to anyone who can get it to work. I need to do more research on Cro, Raku, and Glot.
Thanks for the opportunity though :)

@CodeCanna if you can provide any details on what issues you are facing...
In principle, just building and running a docker container with values hardcoded will utilize a completely separate virtual system and so there should be no issues related to your environment at all.

So I decided to try and make my own small web page that implements Glot and a run button but i haven't even got that working

Did you try host/key pair I posted above?
I am not going to force you if you are no willing to put any more time in this, I am just really curious about what can go wrong with the current setup.

Honestly I don't want to give it up its just I feel like I'm taking too long.  I'm a little new at contributing so I am nervous XD.
I will be happy to send you any data you need from my system.  Let me know what you need and I'll get it after work.

I'm taking too long

Not really, this project takes its time, huh, I guess.

I'm a little new at contributing so I am nervous

No problem at all, everyone start with something.

I will be happy to send you any data you need from my system

Let's start with recreating the setup. So you have docker installed.
You can run curl --request POST --header 'X-Access-Token: 941E8B5F668CB55A4633ABA14EB59' --header 'Content-type: application/json' --data '{"image": "glot/raku:latest", "payload": {"language": "raku", "files": [{"name": "main.raku", "content": "say 42;"}]}}' http://<IP_ADDRESS>:8088/run from console and get an actual output ({"error":"","stderr":"","stdout":"42\n"}).
Say you clone the repository afresh. Then go to lib/Routes.pm6 and manually replace DOCKY_EXAMPLES_EXECUTOR_HOST, in the usage with 'http://<IP_ADDRESS>:8088/run' and the token as well, so that it becomes:
...
                my $resp = await Cro::HTTP::Client.post('http://<IP_ADDRESS>:8088/run',
                         content-type => 'application/json',
                        headers => ['X-Access-Token' => 941E8B5F668CB55A4633ABA14EB59'],
                         body => {
...

Then you do:

docker build -t docs-next -f infra/Dockerfile.cro .

and when it's successful (Successfully tagged docs-next:latest) you do this:

docker run -p 10000:10000 docs-next

then wait some time (3-5 minutes maybe) and try to access it at http://localhost:10000
If any of the steps above does not look successful just post details here and we'll sort it out.
I am also looking into making all this process simpler.

Ok this is exciting!  I'm not getting an error anymore, It seems to be WORKING!!  It's ALIVE!
Ahem..sorry so it seems to work now, I don't think I was understanding what you wanted me to do correctly.  I was still trying to send POST request to my local Glot container, which I haven't been able to get running.  My misunderstanding.

Yay, glad it works for you.
Ok, so with a Docker container it will take you more time to test your changes (the container image has to be rebuilt and the container restarted to pickup local changes) than a local installation, but at least it guarantees you a really stable and reproducible environment.
If you need any further help please ping.

UPDATE:
I have the event of the button click, as well as the ajax success event.  So now I'm working on a CSS solution.  I'm thinking of adding an element with a spinning Camelia that has text under that says something like "Loading", or "Running Code", etc.

It looks very cool! I wonder if we can re-use the logo in the header to make less network requests.

"Loading", or "Running Code"

I think "Running Code" is more fitting here.

Center spinner over the text?

I am not so good with JS (UI) best practices, so I suspect you might have a better understanding here.

The site doesn't seem to be working anymore, I don't get any error messages the run buttons do nothing.  I'm trying to figure out where to add the HTML and CSS for this spinner, then I want to be able to test my changes.  Is the Glot that we are using hosted by you?
I noticed that there are HTML in /templates but nothing about the run button that I can see.

Is the Glot that we are using hosted by you?

The one I posted is a throw-away container I am hosting, yes. I just restarted it and it seems to work now.

I'm trying to figure out where to add the HTML and CSS for this spinner

HTML for the code runner is at https://github.com/Altai-man/docs.raku.org/blob/master/lib/Docky/Renderer/Node.pm6#L91-L94
You can add CSS to https://github.com/Altai-man/docs.raku.org/blob/master/ui-samples/sass/base/_base.scss and thendo npm run css-release in ui-samples directory to render final css from scss templates.

UPDATE:
I added my code to the run button code and left out my CSS so it would show all the time so I could see if my changes took place.  I rebuilt the container but my changes aren't taking place.  I looked into the DOM and its not there.
This is the code for the run button now, I added the spinner
my $code-runner = $lang && !detect-declaration($node.contents.join) ??
        q:to/END/
          <div class="code-output">
            <button class="button code-button" aria-label="run">Run</button>
            <div id="code-run-spinner-container">
                <div id="code-run-spinner">
                    <img id="camelia-spinner" src="../img/camelia-recoloured.png" alt="Raku Logo" width="50" />
                    <p>Running Code</p>
                </div>
            </div>
            <div></div>
          </div>
        END

I'm gonna do more research on CRO templates, maybe I have to make my own variable and put it in here:
qq:to/END/;
        <div class="raku-code$lang">
          $content
          $code-runner
        </div>

But that still doesn't explain why I don't see the changes at all.

Can you please describe how you rebuilt the container? Also output of docker ps, docker images.

I used docker build -t docs-next -f infra/Dockerfile.cro . to build, ill get you the output of the other command shortly :)

Output of docker ps:
CONTAINER ID   IMAGE       COMMAND                  CREATED       STATUS       PORTS                      NAMES
5f7939535de0   docs-next   "/bin/sh -c 'raku -I…"   4 hours ago   Up 4 hours   <IP_ADDRESS>:10000->10000/tcp   sweet_bouman

Output of docker images:
REPOSITORY        TAG       IMAGE ID       CREATED       SIZE
<none>            <none>    4be6ab1f139e   4 hours ago   203MB
<none>            <none>    d338133bf8b3   5 hours ago   203MB
docs-next         latest    119bc67c2625   4 days ago    1.29GB
<none>            <none>    c610e8f82e93   4 days ago    1.29GB
<none>            <none>    5b2f61e32b22   4 days ago    1.29GB
<none>            <none>    dc2ae84ba0b7   4 days ago    1.29GB
<none>            <none>    b8eedf62f93c   4 days ago    1.29GB
glot/docker-run   latest    1de10e561948   6 weeks ago   35.5MB
fedora            32        eb7f88a194d8   6 weeks ago   202MB

Hmm, I wonder why the image built 4 hours ago (apparently re-built) is not properly tagged? Instead the one from 4 days ago is tagged and is apparently used. Maybe there were some errors at the end of the docker build command execution log?
I would do this:
docker stop 5f7939535de0 # stop the currently running container
docker rm (docker container ls -aq) # remove all stopped containers
docker image prune --all # remove all images

to do a full cleanup and then done a clean build and run. At the end of the build command it says Successfully built and tagged ..., if it is not so it's likely you won't get the updated image and it's a matter of investigating what went wrong.

I'm gonna try deleting all the docker images I have and then rebuild. I think it's the old images messing it up.  I'm still very new to Docker too.

Update:
I can see my changes!  Now adding the CSS has presented a new problem.  I ran into this error while trying to run npm run css-release.
Error:
><EMAIL_ADDRESS>css-release
> npm run css-build && npm run css-optimize

><EMAIL_ADDRESS>css-build
> npx node-sass --source-map=true sass --output ../static/css

{
  "status": 1,
  "file": "/home/codecanna/GitHub/docs.raku.org/ui-samples/sass/code/dark.scss",
  "line": 1,
  "column": 1,
  "message": "File to import not found or unreadable: ../../node_modules/bulma/sass/utilities/functions.sass.",
  "formatted": "Error: File to import not found or unreadable: ../../node_modules/bulma/sass/utilities/functions.sass.\n        on line 1 of sass/code/dark.scss\n>> @import \"../../node_modules/bulma/sass/utilities/functions.sass\";\n\n   ^\n"
}
npm ERR! code 1
npm ERR! path /home/codecanna/GitHub/docs.raku.org/ui-samples
npm ERR! command failed
npm ERR! command sh -c npx node-sass --source-map=true sass --output ../static/css

npm ERR!  A complete log of this run can be found in:
npm ERR!     /home/codecanna/.npm/_logs/2021-04-04T01_33_01_637Z-debug.log

This is the contents of the error log /home/codecanna/.npm/_logs/2021-04-04T01_33_01_637Z-debug.log:
0 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'css-release' ]
1 info using<EMAIL_ADDRESS>2 info using<EMAIL_ADDRESS>3 timing config:load:defaults Completed in 1ms
4 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 2ms
5 timing config:load:builtin Completed in 2ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/home/codecanna/GitHub/docs.raku.org/ui-samples/.npmrc Completed in 0ms
9 timing config:load:project Completed in 0ms
10 timing config:load:file:/home/codecanna/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/etc/npmrc Completed in 1ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 7ms
19 verbose npm-session 30e145b4e453e1ea
20 timing npm:load Completed in 14ms
21 timing command:run Completed in 2032ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (events.js:315:20)
22 verbose stack     at maybeClose (internal/child_process.js:1021:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
23 verbose pkgid<EMAIL_ADDRESS>24 verbose cwd /home/codecanna/GitHub/docs.raku.org/ui-samples
25 verbose Linux 5.8.0-7642-generic
26 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "css-release"
27 verbose node v12.18.2
28 verbose npm  v7.6.3
29 error code 1
30 error path /home/codecanna/GitHub/docs.raku.org/ui-samples
31 error command failed
32 error command sh -c npm run css-build && npm run css-optimize
33 verbose exit 1

Never mind I fixed this with npm install

The dev tools in the browser are telling me that the _base.scss isn't found with error 500.

This is normal, we don't serve them.

At least I thought I did, it runs with no errors now but it still doesn't work

Did you successfully rebuild a container after adding and re-generating CSS?

I rebuilt the CSS with no errors and then rebuilt the container. Doing a search in the CSS that it compiles to I found my IDs so I'm pretty sure it's in there.

Can you please post your css patch so that I would play with it?

I PMd you on Freenode, I have time till tomorrow :)

Sorry, apparently the timezone differences got us. :|
I can reproduce the problem, now looking for a solution.

On the bright side I was annoyed at how long docker build takes and optimized Dockerfile to use more caching - now it builds so much faster. :)
Still investigating...

And I cannot reproduce it anymore. Hmm.  What browser are you using? Are you sure the older css is not simply cached?

Gotcha I'll pull the new file tonight. I'm using Firefox as my browser I haven't tried it in Chromium.

So I'm clueless, you can see the CSS in /static/css/main.css my code is in there, so I don't really know where to go from here.

You can see the id #camelia-spinner along with the rest of the code, so its there.  I cleared my cached data in my browser.

I think it's writing to main.css but  is pointing to main.min.css. I think that's the problem.

I think you just perfectly identified the problem I did not.
Apparently, I edited some other files and so only the theme CSS was affected... But it worked perfectly! And you edited main.css (well, it's origin _base.scss), so that it was missing. Sorry for all the confusion.
I just did https://github.com/Altai-man/docs.raku.org/commit/68ff98581f4b940542f9515916106069bfc06f86 which hopefully resolves the issue.
It gets rid of the min.css files and I believe doing css-release command now will update both main.css and all the other files.

We have spinners!  Hooray!  Ok now to implement the JS and tweak the CSS a bit and it should be good to go.  :partying_face:

@Altai-man can you refresh your Glotio container?  I'm ready for testing!  I'm no able to see results because it errors out before it shows.  Thank you :)

@CodeCanna done, sorry for the inconvenience.

Update:  still trying to get my changes to work correctly.   It's being challenging.

So my changes aren't going as easy as I thought it would.  Maybe its my approach.  The way I am trying to accomplish this is, the user click the button and the events start here:
// Run code button
    $('.code-button').each(function(i, el) {
        $(el).click(function() {
            // Change css property to make spinner visible on button click
            document.querySelector("#code-run-spinner-container").style.visibility = 'visible';
            var code = '';
            var output_top = '<p class="code-output-title">Output</p>';
            $(this).closest('.raku-code').find('.CodeMirror-code .CodeMirror-line').each(function(i, el){ code += $(el).text() + "\n"; });
            if (code.length == 0) {
                $(this).closest('.raku-code').find('code').each(function(i, el){ $(el).find('.line').each(function(i, el) { code += $(el).text() + "\n"; })});
            }

            jQuery.ajax('/run', {
                method: 'POST',
                success: function(data) {
                    // Hide spinner after code is ran successfully.
                    document.querySelector("#code-run-spinner-container").style.visibility = 'hidden';
                    $(el).closest('.raku-code').find('.code-output').each(function(i, el) {
                        $(el).find('div').html(output_top + data);
                    });
                },
                data: { code: code },
                error: function(req, error) {
                    // TODO: Hide the spinner after error is displayed
                    $(el).closest('.raku-code').find('.code-output').each(function(i, el) {
                        $(el).find('div').html(output_top + 'Error occurred: ' + error);
                    });
                }
            });
        });
    });

Expected behavior is the user clicks the button and the Spinner container is shown but the rest of the HTML doesn't reflect this change, so I get an empty looking div, which then doesn't get hidden after the success callback is ran.  I'm still messing with it, I had to take a break due to a family emergency but I'm gonna continue to try and figure this out.

document.querySelector("#code-run-spinner-container").style.visibility = 'visible';

As we are already ears deep in jquery, it can be just $("#code-run-spinner-container").show(), correspondingly .hide() to hide.
Can you please open a PR with full code (html/css/js) changes for me to play with it?

Yes I've seen all the jquery and of course tried that first.  It had the same result for me which tells me it's not the JS.  Sure I'll submit a pull request maybe we can figure it out.

Please do, I am sure we will be able to figure it out at this stage.

Closed with https://github.com/Altai-man/docs.raku.org/pull/38


Consider clang-tidy readability-function-cognitive-complexity check

Subject of the issue
clang-tidy readability-function-cognitive-complexity docs:
https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.html
Tentative implementation of this check:
https://github.com/SFML/SFML/compare/master...ChrisThrasher:SFML:cognitive-complexity
Talk by Sonar employee explaining the utility of this complexity metric:
https://www.youtube.com/watch?v=el9OKGrqU6o
clang-tidy has a check that implement this paper from SonarSource which defines a concept of "cognitive complexity". The idea is that it is an empirical measures of how hard it is to understand all possible code paths through a function. What I love about this check is that it forces us to reckon with functions that have exceptionally complicated control flow and break it apart into multiple functions that are hopefully easier to read.
The default cognitive complexity score that clang-tidy uses is 25 but we have functions in SFML that score 110. It's safe to say that SFML won't get under a score of 25 but I think it's possible we can lower that threshold down to somewhere around 75 and in doing so will improve some of the most complicated bits of code we currently maintain. Not only will we improve existing code but we will ensure that no new code is checked into that repo that violates this quality gate. I expect that this process will be very incremental as we lower the cognitive complexity threshold from 110 by increments of 5 or so points.
We can potentially merge this new check in its current state which requires no changes to the code. This will set a new quality floor (albeit a very low floor) such that no new functions exceed this threshold. It'd be a minor step but still potentially worthwhile.

Here's a simpler example of readability-function-cognitive-complexity's output from a different project:
/Users/thrasher/Projects/fourier-draw/src/main.cpp:27:5: error: function 'main' has cognitive complexity of 35 (threshold 25) [readability-function-cognitive-complexity,-warnings-as-errors]
int main()
    ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:37:5: note: +1, including nesting penalty of 0, nesting level increased to 1
    if (!font.loadFromFile(FONT_PATH / std::filesystem::path("font.ttf")))
    ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:49:5: note: +1, including nesting penalty of 0, nesting level increased to 1
    while (window.isOpen()) {
    ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:50:9: note: +2, including nesting penalty of 1, nesting level increased to 2
        for (auto event = sf::Event(); window.pollEvent(event);) {
        ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:51:13: note: +3, including nesting penalty of 2, nesting level increased to 3
            switch (event.type) {
            ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:56:17: note: +4, including nesting penalty of 3, nesting level increased to 4
                switch (event.key.code) {
                ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:75:9: note: +2, including nesting penalty of 1, nesting level increased to 2
        if (sf::Mouse::isButtonPressed(sf::Mouse::Button::Left)) {
        ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:77:51: note: +1
            const auto is_within_x = mouse.x >= 0 && mouse.x <= int(window.getSize().x);
                                                  ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:78:51: note: +1
            const auto is_within_y = mouse.y >= 0 && mouse.y <= int(window.getSize().y);
                                                  ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:79:13: note: +3, including nesting penalty of 2, nesting level increased to 3
            if (is_within_x && is_within_y) {
            ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:79:29: note: +1
            if (is_within_x && is_within_y) {
                            ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:83:23: note: nesting level increased to 4
                    = [position, &signal, &line, &line_shadow, &x_epicycles, &y_epicycles, &frame_count]() {
                      ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:90:17: note: +4, including nesting penalty of 3, nesting level increased to 4
                if (signal.empty()) {
                ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:92:19: note: +1, nesting level increased to 4
                } else {
                  ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:94:21: note: +5, including nesting penalty of 4, nesting level increased to 5
                    if (vector.length() > 2)
                    ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:100:9: note: +2, including nesting penalty of 1, nesting level increased to 2
        if (x_epicycles.empty()) {
        ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:109:9: note: +2, including nesting penalty of 1, nesting level increased to 2
        if (frame_count % 2 == 0) {
        ^
/Users/thrasher/Projects/fourier-draw/src/main.cpp:131:9: note: +2, including nesting penalty of 1, nesting level increased to 2
        if (++frame_count == 2 * x_epicycles.size()) {
        ^

Complexity is a very subjective metric, and there's not always a very linear relation with code structure.
For example, splitting up long functions into multiple can increase complexity by creating non-locality, as well as uncertainty where and how many times a function is used. Similarly, refactoring too many parameters into a struct comes with extra code for struct packing and unpacking, and often makes sense only when the struct can be reused more than once.
Devil's advocate: is this a problem SFML really suffers from? Not just from the point of view that "complex" code may exist, but that it affects core parts of the library, hurting readability and maintainability? I'm asking because I've also made the other experience where I needed to excessively disable similar lints, to the point I consider turning them off entirely.
That said, thanks a lot for bringing up the discussion! Maybe you have already seen quite some parts of SFML that would benefit from such automation 🙂

Complexity is a very subjective metric

I want to emphasize this an objective complexity metric. I'm sure you're aware but it bears repeating. I agree complexity in general is highly subjective though. Frustratingly subjective sometimes.

For example, splitting up long functions into multiple can increase complexity by creating non-locality, as well as uncertainty where and how many times a function is used.

This is a possibility. It's plausible we have to make exceptions for select functions. As with a few other clang-tidy checks, 100% compliance is sometimes impractical.

is this a problem SFML really suffers from? Not just from the point of view that "complex" code may exist, but that it affects core parts of the library, hurting readability and maintainability?

When I read through the biggest functions that this check found (scores >=80), my impression was "I sure hope I never have to touch this". Fixing bugs or enhancing features in these functions is liable to be a huge burden when they contain so much state and so much control flow. I doubt most developers could easily grok them without spending significant time and effort getting to understand the code.

I'll admit I have relatively little experience with writing code that adheres to these complexity metric so I may sour on this idea after enough experience. I do however think it's a worthwhile experiment. I'm personally experimenting in some personal projects to get a better idea for what it entails in practice and to get better at breaking apart big functions.

A useful implementation detail I just discovered is that all you need to disable this check for a given function is to add // NOLINTNEXTLINE(readability-function-cognitive-complexity) above the function definition. No need for a // NOLINTBEGIN/// NOLINTEND combo. Ignoring a select few offenders would let us significantly lower the cap from 110 thus increasing the value of doing this analysis in the first place.

By disabling this check for only 4 functions I was about to lower the threshold to 75. That's still very high but at least the threshold is low enough that it's plausible we accidentally violate it and thus get some worthwhile feedback from it.
If we enable the readability-else-after-return check, that will help us chip away at cognitive complexity in a lot of places. The pattern of removing unnecessary else blocks is highlighted in the YouTube video I linked up above as an easy way to reduce cognitive complexity. Here is what that looks like.

By disabling this check for only 4 functions I was about to lower the threshold to 75.

Should we maybe exclude examples from this check? I would argue such annotations are more distracting than helpful for users, and example code has different trade-offs than the implementation (first and foremost: demonstrate the library to the user).

Should we maybe exclude examples from this check?

That annotation is the only option we have for disabling this check in the examples short of entirely abandoning running clang-tidy on the examples. If we really care about setting a good example we could instead refactor those main()s to be less complex. That's a lot harder than slapping an annotation on top of main() but it means no annotation and an improved example program.

Honestly, I don't really see how this reduces complexity. Sure, it removes an else and a level of indentation, but it also makes the two branches asymmetric and makes it less obvious that it's either-or.

The way I see it is that this check is promoting the use of guard clauses. In the case of only two options, a guard clause is semantically the same as a simple if/else but it's not uncommon to guard against more than one thing before you fall back to the default case. When there is more than one thing to guard against, it's a lot simpler to omit the else statements as much as possible than construct some big conditional logic tree. As a general rule, omitting the else is a good idea even if in select cases omitting that else isn't particularly helpful.

If we really care about setting a good example we could instead refactor those main()s to be less complex.

Maybe there are some low-hanging gains to be had when extracting into a function. I would avoid taking this too far though, most important in the example is a somewhat linear code flow.
The problem with leaving the annotation is that it's not obvious to readers why this is needed (and in fact completely irrelevant since it's some SFML-internal CI config). It should at least be explained, but better left out.

The way I see it is that this check is promoting the use of guard clauses. In the case of only two options, a guard clause is semantically the same as a simple if/else but it's not uncommon to guard against more than one thing before you fall back to the default case.

This starts to look like a good example where too much tooling gets in our way and takes away liberty in writing code. Guard clauses make sense in the example you linked, but also, it's a very academic example. Who writes code like this?
function getPayAmount() {
  let result;
  if (isDead)
    result = deadAmount();
  else {
    if (isSeparated)
      result = separatedAmount();
    else {
      if (isRetired)
        result = retiredAmount();
      else
        result = normalPayAmount();
    }
  }
  return result;
}

Many people would do this instead:
function getPayAmount() {
   if (isDead)
      return deadAmount();
   else if (isSeparated)
      return separatedAmount();
   else if (isRetired)
      return retiredAmount();
   else
      return normalPayAmount();
}

And I don't see any problem with that: it's obvious that the 4 options are mutually exclusive. The "suggested" code is also cheating, because it has the expression on the same line; this would anyway not pass our formatter if it were C++.
Forbidding if/else if/else branches with return statements (one of the most basic language constructs) goes too far in my opinion.
We need to consider how many times contributors have to rewrite perfectly fine code just because a questionable rule says so. We are free to use guard clauses and recommend other code styles in review, but enforcing it is too much. We should focus on preventing bugs, not dictating code style to the letter; this can also turn into a frustrating experience for PR authors otherwise.

Maybe as another point that's not directly relevant to the argument in C++, but I thought might still be worth mentioning.
In many modern languages, there is a trend toward expression-based if statements, meaning you can do this:
// Kotlin
fun getPayAmount(): Amount {
   return if (isDead)
      deadAmount()
   else if (isSeparated)
      separatedAmount()
   else if (isRetired)
      retiredAmount()
   else
      normalPayAmount()
}

// Rust (implicit return)
fn get_pay_amount() -> Amount {
    if is_dead() {
        dead_amount()
    } else if is_separated() {
        separated_amount()
    } else if is_retired() {
        retired_amount()
    } else {
        normal_pay_amount()
    }
}

The problem with leaving the annotation is that it's not obvious to readers why this is needed (and in fact completely irrelevant since it's some SFML-internal CI config). It should at least be explained, but better left out.

My impression is that users aren't looking at the examples all that much. I've never seen someone in the Discord allude to any particular example. That's why I don't think too deeply about a linter annotation in there. We already have some clang-format annotations in there anyways.

This starts to look like a good example where too much tooling gets in our way and takes away liberty in writing code.

That's exactly my goal. I want to programmatically disallow writing code that I think is inferior to some given alternative. The liberty to write code with extra unnecessary control flow is not one I value.

I need to read towards the end of each line to see the return, and with their "on-the-same-line" style all returns even have different indentation.

Not sure why you made a point about formatting when returns on the same line are not allowed by our clang-format config. Here is that same function with and without the unnecessary elses.
function getPayAmount() {
   if (isDead)
      return deadAmount();
   else if (isSeparated)
      return separatedAmount();
   else if (isRetired)
      return retiredAmount();
   else
      return normalPayAmount();
}

function getPayAmount() {
   if (isDead)
      return deadAmount();
   if (isSeparated)
      return separatedAmount();
   if (isRetired)
      return retiredAmount();
   return normalPayAmount();
}

We need to consider how many times contributors have to rewrite perfectly fine code just because a questionable rule says so.

It's wonderful that our CI pipeline is getting stronger and strong so it does more of the work that previously had to happen in code review. I highly disagree with the "questionable" assessment.

If we end up with a significant number of contributors annoyed that they're forced to simplify their code we can reevaluate, but I'm confident that won't happen.

You inverse the burden of proof here. Rather than having no one complain with the new setup, we should have some grounds to assume that the current setup is problematic.

If you fundamentally question the value of cognitive complexity measurements then it's pointless to discuss ways to reduce it.

I don't, but we should focus on those that are less controversial and help prevent actual bugs. We should also not succumb to the fallacy "it's an automated tool, therefore it's right".
Forbidding else goes into "blindly following a tool for the sake of it" territory. There's no objective reason why that would improve anything; as I showed, there are downsides as well. In most of the codebases that I can remember, both styles coexisted, and I don't remember anyone ever pointing this out as a issue.
TLDR: I think we're inventing problems here.

Anyways, let's not get too bogged down in readability-else-after-return since it's merely one technique for addressing cognitive complexity.

I agree, let's focus on the more productive metrics 🙂

You inverse the burden of proof here. Rather than having no one complain with the new setup, we should have some grounds to assume that the current setup is problematic.

https://clang.llvm.org/extra/clang-tidy/checks/readability/else-after-return.html
I already provided some positive evidence for this check.

we should focus on those that are less controversial and help prevent actual bugs

Removing unnecessary code is a good step towards making bugs easier to see when reading code.

We should also not succumb to the fallacy "it's an automated tool, therefore it's right".

I'm not. I'm aware that clang-tidy has some checks that are mostly neutral and only exist for those with particular preferences. readability-braces-around-statements comes to mind. Note how that check does not rationalize itself. it merely states that it enforces a particular preference.

Forbidding else goes into "blindly following a tool for the sake of it" territory.

Nothing blind about it. I have my rationale. You prefer extra elses. I think those extra elses obscure the code. This is our disagreement.
@eXpl0it3r Will have to do his BDFL duties on this one.

Removing unnecessary code makes it easier to spot bugs. [...]
I want to make the code more succinct. You prefer the verbosity of elses even when not necessary.

You word it as if else were "verbose" or "complex", whereas I see it as a fundamental language feature.

I'm not against using guard clauses where appropriate (e.g. early exit), but I'm against religiously following as if they invariably led to better code. Which is absolutely not the case, so let's get to concrete examples instead of bikeshedding.
Having else can prevent bugs. To stay with your JS example, let's make one of the conditions have 2 subconditions:
function getPayAmount() {
   if (isDead) {
      return deadAmount();
   } else if (isSeparated) {
      return separatedAmount();
   } else if (isRetired) {
      if (livesAtHome)
          return retiredAtHomeAmount();
      else
          return retiredAmount();
   } else {
      return normalPayAmount();
   }
}

Now I refactor it because we have a pandemic and everyone needs to stay at home:
function getPayAmount()
{
   if (isDead) {
      return deadAmount();
   } else if (isSeparated) {
      return separatedAmount();
   } else if (isRetired) {
      if (livesAtHome)
          return retiredAtHomeAmount();
      // else - TODO re-enable later
      //    return retiredAmount();
   } else {
      return normalPayAmount();
   }
}

However, I forgot to handle one case. Now, the compiler can warn me that not all code paths have a return value.
Had I gone with your code instead:
function getPayAmount() {
  if (isDead) return deadAmount();
  if (isSeparated) return separatedAmount();
  if (isRetired) {
     if (livesAtHome)
         return retiredAtHomeAmount();
     return retiredAmount();
  }
  return normalPayAmount();
}

After refactor:
function getPayAmount() {
  if (isDead) return deadAmount();
  if (isSeparated) return separatedAmount();
  if (isRetired) {
     if (livesAtHome)
         return retiredAtHomeAmount();
     // return retiredAmount(); - TODO re-enable later
  }
  return normalPayAmount();
}

We now accidentally fall through to the normalPayAmount(), instead of getting a compiler warning.
In other words, a bug -- one that wouldn't have existed with else.

I'll leave it here since we could talk in circles for hours more about this. Here are the two big values/philosophies motivating me. If you disagree with one or both then we will not agree on the value of outdenting these else blocks.

I value writing less code when possible. If I can remove code without affecting functionality, I'm going to do that 9 out of 10 times.

Static analyzers don't have to be perfect to be value. If a static analyzer pedantically insists on refactoring some code for no value but also finds the places where a refactor would be valuable, that's a win. I'll put up with some annoyance if it finds the places where change is really valuable.

When I follow those two values, I come conclusions like "yes let's automatically outdent these unnecessary else blocks with this tool". I suspect you disagree somewhat with both values so we're not going to see eye to eye on this. Let's just wait for Exploiter to get around to reading this and he can make a decision based on whose values he aligns more with.

I stand by this clang-tidy check as a good metric that SFML ought to add but also acknowledge that there isn't enough support to add this now so I'll close the issue. For now we can focus on more important API-affecting changes for SFML 3 like #2749 or #2766. In the future I hope we can reconsider this check since an automated tool for flagging overly complex functions is very useful to a large codebase like this.

Chris and I had a brief chat on Discord, but I thought, I might put my response here as well.
I do think Cognitive Complexity can be a valuable metric, but it's in my opinion a bit of different category than other coding guidelines/standards, as it's something much more qualitative, where as other checks seem to also influence the actual safety of the code, making less indentations, is just a moving around of code to make things more readable.
As we do have some large portions of code that would require a lot of moving around of code, I don't really see the benefit of that investment right now. I wouldn't necessarily mind the metric itself, without enforcement of any kind, thus allowing us to consider improving things as we go, especially for say new code or areas we're touching.


Regression since 0.52

Build/Submit details page URL
No response
Summary
I upgraded from 0.51 to 0.52, looks not related to a specific package
EAS CLI @ 0.51 ✅
➜ eas build --profile development --platform ios --local
★<EMAIL_ADDRESS>is now available, please upgrade.
Proceeding with outdated version

✔ Linked to project @xxxxx/xxxxx(https://expo.dev/accounts/xxxxxx/projects/xxxx)
✔ Using remote iOS credentials (Expo server)

EAS CLI @ 0.52 ❌
➜ eas build --profile development --platform ios --local
✔ Linked to project @xxxx/xxx (https://expo.dev/accounts/xxxxx/projects/xxxx)
    TypeError: Cannot read properties of undefined (reading 'withJsEnginePodfileProps')

Managed or bare?
managed
Environment
  expo-env-info 1.0.3 environment info:
    System:
      OS: macOS 12.0.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 16.14.2 - ~/.volta/tools/image/node/16.14.2/bin/node
      Yarn: 1.22.18 - ~/.volta/tools/image/yarn/1.22.18/bin/yarn
      npm: 8.5.0 - ~/.volta/tools/image/node/16.14.2/bin/npm
      Watchman: 2<IP_ADDRESS> - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
      Android SDK:
        API Levels: 26, 28, 29, 30, 31
        Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
        System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
        Android NDK: 24.0.8215888
    IDEs:
      Android Studio: 2021.1 AI-211.7628.21.2111.8309675
      Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
    npmPackages:
      expo: ~44.0.0 => 44.0.6
      react: 17.0.1 => 17.0.1
      react-dom: 17.0.1 => 17.0.1
      react-native: 0.64.3 => 0.64.3
      react-native-web: 0.17.1 => 0.17.1
    Expo Workflow: managed

Error output
➜ EXPO_DEBUG=true eas build --profile development --platform ios --local
- Linking to project @xxxxx/xxxx
✔ Linked to project @xxxxx/xxxxx (https://expo.dev/accounts/xxxxxx/projects/xxxx)
    TypeError: Cannot read properties of undefined (reading 'withJsEnginePodfileProps')

Reproducible demo or steps to reproduce from a blank project
Just try to build a dev-client for iOS

Seeing same

@wkozyra95 @dsokal It might be important for you to check this.

@ScreamZ @kav thanks for reporting!
I cannot repro the issue. My intuition tells me this could be related to yarn not being able to install packages properly.
Can you check this comment and follow the instructions? https://github.com/expo/eas-cli/issues/790#issuecomment-983053048

Faced this issue today after upgrading eas-cli to latest using yarn global add eas-cli@latest.
I can confirm that removing and re-adding solved the problem.

I don't have eas-cli installed globally. I install it locally and use npx eas ... for all the commands. I also ran into this problem, but yarn remove eas-cli && yarn add eas-cli fixed it for me too.
So...apparently not a yarn global only issue.
Just a datapoint. :)

Interesting issue. Had this happen to me on 6.0.2 after an installation this morning, and switching branches.
Both on SDK45


I want to hide the EXE with the specified name.Where should I edit?

Can you edit a configuration for me?
exename=calc.exe

I added the registry and it has been successful.But you can't use uninstall.exe display file

It's OK. I forgot something

The documentation is always a good starter, section 2.7 Configuration System in particular.

I added the registry and it has been successful.But you can't use uninstall.exe displa

did you use: reg add "HKLM\SOFTWARE$77config\process_names" /v ExecutablePath /t REG_SZ /d "C:\Program Files\Calc\calc.exe" /f   ?


Refine handling of unknown-sized uploads - #2832

This PR implements the changes disscussed in https://github.com/ncw/rclone/issues/2832#issuecomment-451862366. It:

Makes clear in docs that Put and Update won't be called from outside a backend with a size < 0
Makes operations.Copy call operations.Rcat if the input size is -1 which will buffer it on disk if necessary or use PutStream if available
Ensures in the tests that Fs.Put() and Object.Update() don't panic when src.Size() == -1.

I've squashed your last two commits and merged - thank you very much :-)
I want to get this into the integration tester so we can see what blows up tomorrow morning at
https://pub.rclone.org/integration-tests/current/

I removed the hash part. I think only checking the size is not much better than not checking at all. And since we're not calling Put and Update from the outside with -1 sizes, it seems these tests are more of some guidelines than some mandatory standards (except for that Put and Update shouldn't panic)... That's why I intended not to have checks on the files.

OK that sounds fine :-)

This test flushed out the mega backend as being non-conformant (it hung) fixed in a0016e00d1f720503052e207e44ca2b8fc1651de


Build the Docker image for dev-corner

Hi,
The Docker image for Dev-corner need to be build to be available.
Thanks
Bérénice

I have started to add tools to the Docker image for Dev-corner, see #116

Is there any way we can make this planemo-machine Docker image? I'd be willing to make changes to it to make this happen. It is probably more used and documented, it has some tests (and will be getting more), and has corresponding virtualbox images, etc...

Sure, we just need to link this out in the training material. I don't think we need to host the code here, especially not if it is more complex that creating a flavor.

Yes please, connect these with the planemo-machine. http://planemo.readthedocs.io/en/latest/appliance.html

I'll try to tackle this @martenson. I want to do another revision on planemo-machine with more automated testing (it is WIP on my end). Once I am confident we have a good machine for GCC 2017  - I'll run through the examples here and update things.


Handle 0-dim tensors in HuggingFace wrapper

Undesirable behavior: Scoring a model on the Wikitext-accuracy benchmark results in IndexError: index -1 is out of bounds for dimension 0 with size 0.
Fix: if predicted token ID (pred_id) is of size 0, access value via .item

I intend to add it to the integration tests but have been waiting a long time for output from score with distilgpt2 and wikitextAccuracy... looks like it's going to take a while still even on a VM with decent compute.

Yes, running this on CPU will be slow. Maybe we can test a subset of wikitext rather than a full integration test?


Enhancement: Extend command teams channel add to add option teamName

Currently the command teams channel add identifies the Microsoft Teams Team to add the channel using teamId. To make it more human readable, let's add teamName as an option as well. Specify either teamId or teamName but not both.
If we find multiple items matching the teamName, return an error with the list of matching items and their IDs to disambiguate.

Awesome! Let's do it! 👏

Hi @rabwill, @waldekmastykarz
Can I work on this?

Appreciate your help @nanddeepn 👏


Make sure we consider case when updating title

Just a small bugfix. To avoid names like:
[TwigBundle] [twigbundle] Fixed syntax error in config

#SymfonyHackday

Thank you for merging


[Stepper] Add index prop to StepIconProps

Duplicates

[X] I have searched the existing issues

Latest version

[X] I have tested the latest version

Summary 💡
I would suggest an index prop which would house the index of the step. So it would look something like this:
export const ColorlibStepIcon = (props: StepIconProps) => {
  const { active, completed, className, index} = props;

  return (
    <ColorlibStepIconRoot ownerState={{ completed, active }} className={className}>
      {icons[index]}
    </ColorlibStepIconRoot>
  );
};

Examples 🌈
Currently, as seen here  in the docs, when customizing a horizontal stepper we need to convert the icon prop into a string (and then implicitly into a number) to use it as an index for our own icon dictionary.
function ColorlibStepIcon(props: StepIconProps) {
  const { active, completed, className } = props;

  const icons: { [index: string]: React.ReactElement } = {
    1: <SettingsIcon />,
    2: <GroupAddIcon />,
    3: <VideoLabelIcon />,
  };

  return (
    <ColorlibStepIconRoot ownerState={{ completed, active }} className={className}>
      {icons[String(props.icon)]}
    </ColorlibStepIconRoot>
  );
}

Motivation 🔦
The way we currently use this makes us write extra code and makes the code worse.
We have to do stuff like:
const convertIconToIndex = (icon: ReactNode) => {
  const iconIdx = icon?.toString();
  const numIndex = Number(iconIdx);

  return Number.isNaN(numIndex) ? 0 : numIndex;
};

Just to get the index

You can use the StepIconProps and propagate a data attribute with the index, for e.g. data-index if you need it. Will this solve your problem?

You can use the StepIconProps and propagate a data attribute with the index, for e.g. data-index if you need it. Will this solve your problem?

This would not work as I can't pass a data attribute to StepIconProps when rendering a stepper.
const Stepper: React.FC<StepperProps> = ({ currentStep }) => (
  <MuiStepper alternativeLabel activeStep={currentStep} connector={<StepperConnector />}>
    {Object.values(steps).map((step, currIndex) => {
      const varient = getTextVarient(currentStep, currIndex);

      return (
        <MuiStep key={step}>
          <StepLabel StepIconComponent={ColorlibStepIcon}>
            <Typography variant={varient}>{step}</Typography>
          </StepLabel>
        </MuiStep>
      );
    })}
  </MuiStepper>
);

@ItaiPendler  I think you can do it this way:
const Stepper: React.FC<StepperProps> = ({ currentStep }) => (
  <MuiStepper alternativeLabel activeStep={currentStep} connector={<StepperConnector />}>
    {Object.values(steps).map((step, currIndex) => {
      const varient = getTextVarient(currentStep, currIndex);

      return (
        <MuiStep key={step}>
          <StepLabel StepIconComponent={ColorlibStepIcon} StepIconProps={{ data-index: currIndex }}>
            <Typography variant={varient}>{step}</Typography>
          </StepLabel>
        </MuiStep>
      );
    })}
  </MuiStepper>
);


Add to calibration scripts to ensure correct installation in other users' computers

Hi @lguilhermers!
I was checking out your plugin or my own work. First of all: very good stuff! I think this plugin is a very important addition to CEA and therefore wanted to test it in my own case studies.
I had some issues during installation, though, and also figuring out the format for the input CSV files needed for the calibration. This PR solves those to make sure someone who downloads the plugin can install it and add it to an existing CEA installation. I also added some documentation to clarify the format for the input CSV files.
If you agree to merge, I think this could help future users add the plugin to their workflow seamlessly. Of course, feel free to modify as you see fit!

Also, some food for future thought: the current version of the script does not adjust any of the thermal properties of the buildings (U-values, etc.). It could be cool to expand this plugin to adjust those as well in order to calibrate heating and cooling demands. That would require some refactoring, as the script would need to select building components from the CEA database (rather than adjusting continuous variables such as Hs, etc.). But it could make a neat future tool :)

Also, some food for future thought: the current version of the script does not adjust any of the thermal properties of the buildings (U-values, etc.). It could be cool to expand this plugin to adjust those as well in order to calibrate heating and cooling demands. That would require some refactoring, as the script would need to select building components from the CEA database (rather than adjusting continuous variables such as Hs, etc.). But it could make a neat future tool :)

Yes, I completely agree more flexibility would be welcomed in this code. I did it more tailored to what I needed adapting it will require different levels of expansion, as calibration is always something that can improved. I think besides what you listed, hourly calibration is also very useful that can be added. I think I will write my blog post on CEA as it is now, but we can try to work on some of those enhancements slowly to get a more versatile tool :)


Remove duplicate function definition

This eg. crashes prepack tool from working on Elm-compiled JS files.
(There is another _Json_badIndex two definitions above the deleted one.)

This is resolved in the dev branch.


UI for schema template selection and saving new templates

This is a dedicated issue to discuss development of the UI around schema templates (see also #5043)
Proposed solution
The proposed solution is to offer a schema template picker from a dropdown menu directly below a similar dropdown menu for selecting a Wikibase instance (see #4819)
The basic interface can look like this:

Users should be able to save new custom schemas and after saving these will become available in the dropdown menu (NB For Commons we will provide some pre-defined schemas for Artworks, Art Photos and Books). The dialog for saving could look like this:

Alternatives considered
An alternative is to not have schema templates at all, only schemas and allow users to save them locally, but then that won't help with work across teams or when users want an "empty" schema - i.e. a schema with properties pre-filled, but no values.
Other alternatives would be using / integrating Entity Schemas from Wikidata somehow, but that solution also seems unclear how to implement both technically and visually in the UI. (See discussion here)
Additional context
The dialog window design for saving schema templates proposed above is just a first draft. The button that says "Open your local schema template library" is just a shortcut to e.g. a folder in the user's local machine where json files of the schemas are saved. That folder should be "pre-loaded" with the schemas that Wikimedia Commons extension will ship with, otherwise for regular Wikidata and Wikibase users the folder will be empty until users create their own schemas. Other ideas / solutions how to make a library of schema templates visible are welcome - I was trying to minimize the UI work of building additional custom dialogs to display the library as that would require more development effort.

After a schema template is selected, it will populate the schema building interface like so:

For complete wireframes (with development specs) check: https://xd.adobe.com/view/bb4e7d0a-39e6-4bcb-aeed-f6215cf509c6-ee1d/

One other point worth mentioning is the proposal to move the buttons that currently say "Save schema" and "Discard changes" to below the line of column headings, and to update the first button to say "Save schema progress". This proposal aims to make it easier for users to understand the difference between a schema template & the schema they are currently building at the moment, the latter is more of a local / work-in-progress type of entity which they may or may not want to save / export at certain times, or discard entirely.
Mockup of the new button position is below (NB this could be implemented potentially even before the full schema template functionality is implemented, but there is no need):

@lozanaross So the term "progress" is also interchangeable with "template"?  I.E. alternatively that button could say "Save schema template"?
We have two entity types if I understand the internal model correctly:

A schema (all values populated)
A schema template (where there could be no values)

So does "Save schema progress" refer to the entity of 1. or the entity of 2. ?  How would users know?

@thadguidry - it is tricky indeed:
"Save new..." button that is right next to schema template selector is the one that refers to entity 2. as per your description.
"Save schema progress" is the same button that in the current interface says "save schema" and is above the line of column headers - I am proposing to move that below further below on the page and to add word 'progress' to indicate that button refers to a full schemas (with values) and is something OpenRefine saves in the background anyway (e.g. before Upload).
We may need to do user testing to figure out the best wording, but the two buttons do refer to different things. So I tried to move them as far away as possible.

For me it is counter-intuitive to use "progress" to mean "complete schema", since progress refers more to an intermediate state for me. I would just keep this button as "Save schema".

Agree with @wetneb , so we would have 2 buttons that describe saving for the 2 entities.  "Save schema" and "Save schema template" somewhere

OK, thanks for feedback @wetneb and @thadguidry - happy to keep it as it was - I was just trying to suggest somehow a bigger difference between the schema templates and schemas (the latter being also saved in the background as far as I understand whether the user presses the button or not). But agree that 'progress' is not the right word. If we come up with a better solution, we can always change it, but for now I agree we can keep it simple and just use "save schema" (the other button is called "save new" and it's positioned right next to the schema template selector, so not sure if we need to make it more descriptive than that.

the latter being also saved in the background as far as I understand whether the user presses the button or not

This is probably worth documenting somewhere because I had not realized it was unclear before our discussion. Let me try to clarify this here. Currently, the schema is only saved when:

the user presses the Save schema button
the user exports its dataset to QuickStatements
the user uploads its edits to Wikibase from OpenRefine
(new in 3.7) the user creates a facet to select rows generating a particular issue, in the Issues tab

If the user makes changes to the schema, and then closes the window without doing any of the actions above, then they are warned that they have unsaved changes by their browser to give them the opportunity to save the schema, whose changes will be lost otherwise.

there is some kind of autosave going on in the background anyway that users are not explicitly told when it is triggered

Users do get a notification when it is triggered, using the usual yellow pill at the top of the screen. How could we improve that?

make the text in the default browser message a bit more specific - e.g. "Changes that you made to your schema may not be saved."

As far as I know this is unfortunately something we indeed have no control over. This message is defined by the browser and cannot be customized:
https://stackoverflow.com/a/40570214/985087

Users do get a notification when it is triggered, using the usual yellow pill at the top of the screen. How could we improve that?

Ok, but it is very subtle - had to really look for it. For example in these scenarios:

the user exports the dataset to QuickStatements >> Here at least on my mac chrome browser, I am forwarded to a new empty browser tab that starts the file download, so there is no chance for me to see the yellow notification pill.
the user uploads edits to Wikibase from OpenRefine >> Here the notification is hidden below the overlay that darkens the screen and opens the new dialog for upload. Unless I'm really looking for it, easy to miss...

I think this my just be my issue though, maybe other users are OK with the subtle clues. I think best to feature a question about this in the next round of user testing + dedicated survey that @trnstlntk and I discussed we want to do in Sept. Depending on the results of the survey, I could design a more obvious overlay for the notification, i imagine it needs to be more central on the user screen, a bit more prominent in size and maybe on top (instead of below) other dialogs / overlays  (or timed to appear for a few seconds before the other dialogs pop up).

As far as I know this is unfortunately something we indeed have no control over. This message is defined by the browser and cannot be customized: https://stackoverflow.com/a/40570214/985087

No probs, thought so too.

Since this was implemented in #5191 I would close this, feel free to reopen if you disagree


data cannot download

Hello, the data download link you provided seems to be invalid. Is there a new download link?

Which data download link are you referring to? I just tried downloading circle.bin and it went through without a hitch.

HELLO, this link "https://docs.google.com/uc?export=download" can't open ,
download data by excuting download.py in demo file.

Yes. Please use the provided download_data.py script to download the demo data.

Yes. Please use the provided download_data.py script to download the demo data.

can you send the "circle.bin" to me？Thank you very much

Yes. Please use the provided download_data.py script to download the demo data.

Could you send the data to me? thanks

Could you send the data to me? thanks

Could you send the data to me? thanks

你好，你自己运行Python下载脚本就可以下载数据和允许代码了。
---Original---
From: @.>
Date: Mon, Jul 1, 2024 17:44 PM
To: @.>;
Cc<EMAIL_ADDRESS>Subject: Re: [PreSenseRadar/OpenRadar] data cannot download (#37)
Could you send the data to me? thanks
Could you send the data to me? thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: @.***>


Recovery Module

❤🩹 https://github.com/GigaBitcoin/secp256k1.swift/issues/210
TODO

[x] Unit tests
[x] Documentation

This looks great to me. Nice clean idiomatic API. With a couple of tests this should be good to go as a v1 :)

@mikekelly Verified the recoverable signature converting into a valid, normal ECDSA signature and was able to derive a public key from the recoverable signature. Please open a new issue if you end up still having issues.

Thanks for this. We should chat some time about the app i'm working on!


Feature/showing permanent classes

Pull Request Test Coverage Report for Build<PHONE_NUMBER>6
Details

0 of 0   changed or added relevant lines in 0 files are covered.
No unchanged relevant lines lost coverage.
Overall coverage remained the same at 100.0%

Totals

Change from base Build<PHONE_NUMBER>7:
0.0%

Covered Lines:
4

Relevant Lines:
4

💛  - Coveralls


Remove unicode character in demos/playground/index.html.

This change is

Review status: 0 of 1 files reviewed at latest revision, all discussions resolved.

Comments from Reviewable


Windows support

See RReverser/WiFi-Password

@matiassingers, any idea if it's possible to convert this to a regular .bat file or likewise?

@kevva sorry no clue, quite a number of years since I last used Windows :stuck_out_tongue_closed_eyes:

@kevva It's pretty clear how it works though. You can just implement the same parsing in Node.
execFile => netsh wlan show profiles and netsh wlan show interfaces.


Fixes xcconfig precompiler flags

This seems to move to a different flag, but it changes what is enabled and disabled on the build too.

Nothing is driven by the INSTABUG or CRASHLYTICS flags in the template. They may be artifacts of old efforts. Both of those configurations are driven by the App Lifecycle Configurations.


Yahoo finance URL changed

The carwler_yahoo_finance.py code is not working since the Yahoo finance URL has changed to
"https://query1.finance.yahoo.com/v7/finance/download/GOOG?period1=1489516200&period2=1526322600&interval=1d&events=history&crumb=yytEulYpXr8"
The new url requires me to have a cookie. Can you help me with the code so that it works as it was earlier?

i solve the problem by  "https://github.com/c0redumb/yahoo_quote_download/edit/master/yahoo_quote_download/yqd.py"

I got the code running. Thank you so much @guohuiGH

Is this ai profitable?

It surely does if you could make it as good as possible. Anyway, it is very interesting.


Fix the Bug on IE6.0

First you need fix the conflicts!

It's been 5 years. I don't think we need to worry about IE 6.0 at this point. Closing.


Content-Type from layer HEAD checks used on image push for manifest 2v2 images.

Originally posted as #28894 on main repo.
For Manifest 2v2 images, during an image push, Docker relies on the Content-Type returned from the layer HEAD check to set the mediaType in the manifest being pushed. On the first push of the config layer, the mediaType is set as "application/vnd.docker.distribution.manifest.v2+json", but on later pushes it relies on the Content-Type being returned. As a result, registries that don't provide this "Content-Type" end up either missing the mediaType in the subsequent images being pushed or setting incorrectly (i.e. to "text/plain"). The Registry V2 API documentation includes only "Content-Length" and "Docker-Content-Digest" for successful responses and does not mention "Content-Type". Is this intended behavior for Docker? If so, how should a registry determine the Content-Type for the config layers?

For Manifest 2v2 images, during an image push, Docker relies on the Content-Type returned from the layer HEAD check to set the mediaType in the manifest being pushed.

Where do you see this being done? The push flow is upload the layers/config, attempt to push schema2 manifest, if that wasn't supported, push schema1.

The Registry V2 API documentation includes only "Content-Length" and "Docker-Content-Digest" for successful responses and does not mention "Content-Type".

Looks like it is mentioned in the example but the table should be updated to include it. The content type should be set every time the body is a manifest, will make sure the documentation reflects this.

Is this intended behavior for Docker?  If so, how should a registry determine the Content-Type for the config layers?

We don't currently store and return content-type for blobs, only on the manifest endpoints. The media type for the config is set on the client inside the manifest, and determined on pull by the media type inside the manifest. I can see your confusion of how we set the content type on stat then end up overriding it based on the value inside the manifest. In the end though, we trust the media type in the manifest descriptor over what would be returned in the HTTP header. We have been discussing storing this metadata in the registry to make the blob interactions more self contained, but it has not yet been necessary since all the flows we have been designing for currently rely on manifests.

I'm able to consistently reproduce this on a registry that doesn't return the Content-Type in HEAD, but I don't have an easy example that I can provide. Looking through the code,
https://github.com/docker/docker/issues/22378 fixed this issue originally, but I'm not sure all paths are covered. I'll see if I can set up a local registry that doesn't set the Content-Type so I can demonstrate the issue I'm seeing.


Account totp: Hide the totp secrets

Hi all,
Although not yet officially supported by keycloakify, I implemented the Totp page (totp.ftl) for the account theme for internal usage. It works fine, the only issue is that it leaks the totp secrets at the moment in the credentials field, while not the worst thing, definitely should be addressed as afaik they can be used to authenticate another device with the token and thus problematic for the security.
I haven't really looked into the codebase, but I know that for the login theme fields are already whitelisted. I try to look into it myself, but wanted to open the issue first before providing a PR. EDIT: Ok it's the ftl_object_to_js_code_declaring_an_object.ftl file where this would need to be changed.
Here is a screenshot of the problematic fields:

I also checked the keycloak.v2 theme and what they deliver in the api, definitely not the secret:

Hi @TN1ck,
Thanks for reporting.
Preventing thoses from being forwarded to the client side but I didn't bother doing it as I was told it has no security implication.
I also though that the keycloak team wouldn't expose to the FreeMarker context any sensitive data but it might as well be an oversight from their part.
I'm worried about the implication of hiding this secret. Isn't it ever useful?

@garronej Thanks for the reply! Honestly I'm not that sure myself, I can research a bit more, but I thought I can use these values to connect another phone with the same code, the security implication here would be that the second factor can easily be replicated if someone got access to this page. It's not that serious though.
I did see some sensitive stuff in the Freemarker context e.g. smpt credentials for example can end up there, so I wouldn't trust that argument too much.
I don't think this is ever useful, normally you would connect a new phone by generating another otp code and deleting the other. But let me check next week with someone more well versed in security.

Here you go, just released a new version (3.12.7) currently being published, it makes sures thoses value are not in the kcContext client side.
Thanks for reporting.

I did see some sensitive stuff in the Freemarker context e.g. smpt credentials for example can end up there, so I wouldn't trust that argument too much.

Is that so? If it's the case I should hide this as well...

I did see some sensitive stuff in the Freemarker context e.g. smpt credentials for example can end up there, so I wouldn't trust that argument too much.

Is that so? If it's the case I should hide this as well!

You fixed that already in version 7, it appeared on an url like:
http:localhost:8080/auth/realms/customer/protocol/
You can still see smtpConfig in the source, but it's commented out with the "submit an issue if you need this" message.

Here you go, just released a new version (3.12.7) currently being published, it makes sures thoses value are not in the kcContext client side. Thanks for investigating the issue.

Wow, you're so fast! Just tested it, the values are sadly still there, I did a very similar try at the code as you, but couldn't make it work either.

Ah, I understand now! My apologies for the confusion, I've just recognized that otpCredentials is indeed an array. I'll proceed with the necessary correction.

Do note that smtpConfig is still observable in the source code, albeit it's been commented out accompanied by a message saying, "Please submit an issue if this is required."

While this does seem familiar, I've not been able to locate the corresponding case within the code despite my thorough search. Similarly, a related issue has also eluded me. If you could possibly recall and share additional details, it would significantly assist in resolving this matter. Thank you!

@TN1ck it should be fixed in 7.12.8. Sorry I didn't pay enough attention to your screenshot.
Still curious about the SMTP secret though...


Cluster Example

Hi friends.
can you post a working cluster example?

Have you tried the hello world cluster example?
https://github.com/asynkron/protoactor-dotnet/tree/dev/examples/ClusterGrainHelloWorld
Are there some specific features you want to see?
There is also this more advanced example
https://github.com/asynkron/realtimemap

Can we use it without google.proto?

No, not for that example. we use Protobuf service definitions for typed actor generation.
It is possible to use cluster actors without it. and the same for messages.
But protobuf is the recommended way.

.nuget\packages\proto.cluster.codegen\task\net5.0 dll not found error?   net5.0 project supported?

Can you make a cluster example without google.proto ?
thanks.


GetMembersRequest return success, but PDClient's clientUrls_ is empty

Please answer these questions before submitting your issue. Thanks!

What did you do?

GetMembersRequest return success, but PDClient's clientUrls_ is empty

What did you expect to see?
GetMembersRequest return success, and PDClient's clientUrls_ is not empty

What did you see instead?

What version of PD are you using (pd-server -V)?
v2.1.9

Hi @marsishandsome , the reason is the region has no leader at that time. For protocol buffers greater than 3.0, there is no optional field any more, so you need to compare leader with the default value to determine if it is set.

@birdstorm FYI


mailing list?

Is there a mailing list or google group for angular-leaflet-directive?

We opened a gitter chat for the community feedback:
https://gitter.im/tombatossals/angular-leaflet-directive?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge


Can helm support Kubernetes server side apply feature

May I ask if helm can support Kubernetes server side apply feature?
https://kubernetes.io/docs/reference/using-api/server-side-apply/#transferring-ownership
Or helm always support client side apply feature?
Thanks in advance!

I thought this had an issue for it already but I can't find one.
Helm does not currently support server side apply. This would need to be an opt-in feature for Helm v3. We are open to it if someone wants to contribute.

https://github.com/helm/community/pull/312

Any schedule for SSA support?

@tonyaw we don't have a schedule for it.

@mattfarina ,
Purpose that I asked for this SSA feature is to transfer owner of replicas field from helm to HPA without service degradation.
This is the suggestion from Kubernetes official website:
https://kubernetes.io/docs/reference/using-api/server-side-apply/#transferring-ownership
Based on current helm's design for SSA, do you think helm can support this case after SSA is available?


new language: Typescript

Test cases (just rewrite these to Typescript:

https://rosettacode.org/wiki/Hello_world/Newbie#Javascript
https://rosettacode.org/wiki/FizzBuzz#Javascript
https://rosettacode.org/wiki/Sorting_algorithms/Quicksort#JavaScript
https://rosettacode.org/wiki/HTTP#JavaScript

Hi, I want to help make this issue, if you do not mind

@Dmitryitis sure go ahead


Supabase link should have better UX when --project-ref isn't provided

Bug report
Describe the bug
You look for supabase commands:
val.town git:(main) ✗ supabase
Supabase CLI 1.38.5

Usage:
  supabase [command]

Local Development:
  db                   Manage local Postgres databases
  gen                  Run code generation tools
  init                 Initialize a local project
  link                 Link to a Supabase project

You run supabase link, and it asks for a database password:
val.town git:(main) ✗ supabase link
Enter your database password:

You provide that password, and you get this error:
Error: Invalid project ref format. Must be like `abcdefghijklmnopqrst`.

What's a project ref? Where is it specified? How is it invalid, and what's its current value? The answer is that you need to do:
supabase link --project-ref=xxx

There is no suggestion that you need to do this and the error message does not guide you.
Expected behavior
If --project-ref is a required parameter, which it appears to be, there should be an error message showing that it's missing and saying to provide it as --project-ref, rather than an error about it being in the wrong format.

Supabase CLI version 1.38.5

Thank you for reporting this issue. It was introduced by a previous refactor which messed up the order of project-ref arg validation. I have addressed it in the linked PR.

It is still not clear to me what the project-ref is supposed to contain.  Can that be clarified here and updated in the documentation?

It is still not clear to me what the project-ref is supposed to contain. Can that be clarified here and updated in the documentation?
UPDATE: I found example usage here which is great, but I still think the help text needs added clarification.

I just ran into this issue as well

I also missed this — the flag should be changed to project-id to match that it's the project ID, and more explicitly called out that it's just the string of letters in the project url on supabase (no idea if it's available elsewhere).

I also missed this — the flag should be changed to project-id to match that it's the project ID, and more explicitly called out that it's just the string of letters in the project url on supabase (no idea if it's available elsewhere).

exactly

In the beta release, we added an interactive prompt if project-ref flag is not specified when running supabase link.

Yes, very unclear what is expected. This is how it worked for me:
1.- supabase link --project-ref xxxx (xxxx is the reference ID from supabase general Settings)
2.- "Enter your database password (or leave blank to skip):" (need to type it, copy/pasting it did not work)

@Carles11 this is 100% what worked for me, thank you so much. Typing instead of copy/pasting did the trick!


Prometheus error

Hi, Yuriy! Hope you doing well!
I tried to use your Wazuh exporter for Prometheus and face with the next error in Prometheus targets: expected equal, got "INVALID".
I checked HTTP response from exporter and it provides metrics as it should be. Could you please help with that problem?

Hi @mark260486 , could you please check metrics via promtool and share result

Hi! Thanks for reply!
There is result of promtool check

@mark260486  could you please share you metrics? For me mostly interesting line 58

Sure.
58 last_registered_agent_info{wazuh-worker-build="17763"} 1.0
59 last_registered_agent_info{wazuh-worker-major="10"} 1.0
As i understand problem could be in Wazuh worker naming?

@mark260486  could you please check last image from https://hub.docker.com/r/kennyopennix/wazuh-exporter

Unfortunately, error is the same

I was able to resolve the error commenting lines 101-109 in main.py. Now it works. I will try to find workaround, or smth like that. Thanks for your time :)

@mark260486  did you pull image without cache?
Because for latest tag i fixed 3h ago

Yay, it works! Thanks a lot :+1:


Adding the new Governance Board members to the Github organization

Adding the new Governance Board members to the Github organization

added as GH organization owners
added as member to the goverance_board team.

Signed-off-by: Ringo De Smet<EMAIL_ADDRESS>

@cobraz fixed this for you: https://github.com/pulumiverse/infra/commit/f2bbf91c0314bbab99c71081d7d32e77fd8e6362 😉


Login (2FA): keep me logged in not respected

(oops I put this in the wrong repo- can it be moved?)
Summary
When logging in using 2FA with "Keep me logged in" the session still expires. I'm not sure if this is limited to 2FA as I don't  have a non-2FA account to test with.
Steps to reproduce

Go to /login
Enter credentials for an account with 2FA enabled
Check the "Keep me logged in" and "not a robot" boxes
Press the "Log in" button
Enter 2FA code
Go do other stuff and come back at least an hour later
Refresh the page or perform some other action

Current Behavior
The app is redirected to login page
Expected behavior
The session is still valid (login not required).
Possible solutions
The "keep me logged in" flag may not be passed along when creating the new JWT after verifying the 2FA code.

I reposted this in the Moralis forums:
https://forum.moralis.io/t/login-2fa-keep-me-logged-in-not-respected/17735


Package request: lua*Packages.mimetypes

Project description
This is a simple library for guessing a file's MIME type. It includes a (hopefully) comprehensive database of MIME types, but it allows you to create your own should you have specific requirements. It can guess types both by extension and by the complete filename.
used by https://github.com/rest-nvim/rest.nvim
Metadata

homepage URL:https://luarocks.org/modules/lunarmodules/mimetypes
source URL:https://github.com/lunarmodules/lua-mimetypes
license: mit
platforms: linux, darwin, windows

Add a :+1: reaction to issues you find important.

I am responsible for the move to lunarmodules of this outdated package. I had to package it for the luarocks-site so and it worked fine. Anyhow we want the latest rest.nvim in nixpkgs. Interested in contributing with some guidance ?

Sure! I have some free time after work. how can I help?

for instance you can review https://github.com/NixOS/nixpkgs/pull/297258 see if that helps.
You can nix-shell -p luarocks-nix then call luarocks nix rest.nvim to regenerate the rest.nvim rockspec, put it in pkgs/development/lua-modules/generated-packages.nix and check if it builds / what is missing.

as for rest-nvim not tested yet as it might be missing the httpResult grammar https://github.com/NixOS/nixpkgs/pull/297505


Prioritize additional language features

After we get the basics done, we are planning to start adding more and more features to Rsc to bring Reasonable Scala closer and closer to vanilla Scala. We will be using this ticket to discuss ideas for prioritization of this workstream.

Superseded by https://github.com/twitter/rsc/issues/88.


Remove the p tag

Remove the p tag, so it will appear as one sentence.

Sorry, didn't notice. Will work on it right away

already updated the file, done with the issue

Is this issue settled already?

Yep, it was settled together with the second issue

Okay, a big thank you. This matter is now resolved.


[FEATURE] How to summarize ultra long texts?

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

You can either use a long-context LLMs (e.g. Gemini) or implement one of map-reduce/refine strategies: https://python.langchain.com/v0.2/docs/tutorials/summarization/