cmd/vet: false positive for uint128 ([2]uint64)

What version of Go are you using (go version)?

$ go version
go version go1.16.5 linux/amd64

Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/zyh/.cache/go-build"
GOENV="/home/zyh/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/zyh/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/zyh/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.5"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/zyh/GitHub/lscqtest/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2984921841=/tmp/go-build -gno-record-gcc-switches"

What did you do?
go vet these files
asm.go Content
// +build amd64,!gccgo,!appengine
package lscq
import "unsafe"
type uint128 [2]uint64
func compareAndSwapUint128(addr *uint128, old, new uint128) (swapped bool)

asm_amd64.s Content
// +build amd64,!gccgo,!appengine
#include "textflag.h"
TEXT ·compareAndSwapUint128(SB),NOSPLIT,$0
MOVQ addr+0(FP), R8
MOVQ old+8(FP), AX
MOVQ old+16(FP), DX
MOVQ new+24(FP), BX
MOVQ new+32(FP), CX
LOCK
CMPXCHG16B (R8)
SETEQ swapped+40(FP)
RET

What did you expect to see?
Nothing will happen.
What did you see instead?

./asm_amd64.s:7:1: [amd64] compareAndSwapUint128: invalid MOVQ of old+8(FP); github.com/zhangyunhao116/lscqtest.uint128 is 16-byte value
./asm_amd64.s:8:1: [amd64] compareAndSwapUint128: invalid offset old+16(FP); expected old+8(FP)
./asm_amd64.s:9:1: [amd64] compareAndSwapUint128: invalid MOVQ of new+24(FP); github.com/zhangyunhao116/lscqtest.uint128 is 16-byte value
./asm_amd64.s:10:1: [amd64] compareAndSwapUint128: invalid offset new+32(FP); expected new+24(FP)
./asm_amd64.s:24:1: [amd64] loadUint128: invalid MOVQ of val+8(FP); github.com/zhangyunhao116/lscqtest.uint128 is 16-byte value
./asm_amd64.s:25:1: [amd64] loadUint128: invalid offset val+16(FP); expected val+8(FP)

Some hints:
These errors come from
https://github.com/golang/tools/blob/master/go/analysis/passes/asmdecl/asmdecl.go#L782
https://github.com/golang/tools/blob/master/go/analysis/passes/asmdecl/asmdecl.go#L800
Looks like go vet should allow a single instruction to load each part of an array?

cc @matloob

Try e.g.
MOVQ new_0+24(FP), BX
MOVQ new_1+32(FP), CX

That is, use underscores to refer to components of a composite type.

@josharian It works, thanks a lot!

Try e.g.
MOVQ new_0+24(FP), BX
MOVQ new_1+32(FP), CX

That is, use underscores to refer to components of a composite type.


RemoteDriverAttribute doesn't support shared drivers.

The RemoteDriverAttribute doesn't respect the Shared property. It will ignore it by always creating a new driver.
In the code:
public override IEnumerable<IWebDriver> GetDrivers(MethodInfo testMethod)
{
    yield return CreateWebDriver(testMethod, Capability, Hub);
}

Unfortunately sub classing it and implementing the methods as follows doesn't work because of the cache implementation. In my scenario I have created a specific attribute for a Chrome remote driver.
public class CustomChromeRemoteDriverAttribute : RemoteDriverAttribute
{
    public CustomChromeRemoteDriverAttribute() : base(RemoteWebDriverCapability.Chrome)
    {
    }

    public override void ReturnDriver(MethodInfo testMethod, IWebDriver driver)
    {
        this.ReturnDriver(testMethod, driver as RemoteWebDriver);
    }

    public override IEnumerable<IWebDriver> GetDrivers(MethodInfo testMethod)
    {
        yield return GetOrCreateWebDriver(testMethod, () => CreateRemoteWebDriver(testMethod, Capability, Hub));
    }

    public RemoteWebDriver CreateRemoteWebDriver(MethodInfo testMethod, RemoteWebDriverCapability capability, string hub)
    {
        var capabilities = CustomDesiredCapabilities.Chrome();

        if (string.IsNullOrEmpty(hub))
        {
            var attr = ReflectionHelper.GetAttribute<RemoteWebDriverHubAddressAttribute>(testMethod);

            if (attr != null)
            {
                hub = attr.Hub;
            }
        }

        return CreateWebDriverInstance(testMethod, hub, capabilities);
    }

    public static RemoteWebDriver CreateWebDriverInstance(MethodInfo testMethod, string hub, ICapabilities capabilities)
    {
        var driver = string.IsNullOrEmpty(hub) ? new RemoteWebDriver(capabilities) : new RemoteWebDriver(new Uri(hub), capabilities, TimeSpan.FromMinutes(60));

        InitializeDriver(testMethod, driver);

        return driver;
    }
}

The solution to get it to work with the current version of SeleniumFixture is to subclass RemoteWebDriver as well and change the CustomChromeRemoteDriverAttribute to
public class CustomChromeRemoteDriverAttribute : RemoteDriverAttribute
{
    public CustomChromeRemoteDriverAttribute() : base(RemoteWebDriverCapability.Chrome)
    {
    }

    public override void ReturnDriver(MethodInfo testMethod, IWebDriver driver)
    {
        this.ReturnDriver(testMethod, driver as CustomChromeRemoteDriver);
    }

    public override IEnumerable<IWebDriver> GetDrivers(MethodInfo testMethod)
    {
        yield return GetOrCreateWebDriver(testMethod, () => CreateRemoteWebDriver(testMethod, Capability, Hub));
    }

    public CustomChromeRemoteDriver CreateRemoteWebDriver(MethodInfo testMethod, RemoteWebDriverCapability capability, string hub)
    {
        var capabilities = CustomDesiredCapabilities.Chrome();

        if (string.IsNullOrEmpty(hub))
        {
            var attr = ReflectionHelper.GetAttribute<RemoteWebDriverHubAddressAttribute>(testMethod);

            if (attr != null)
            {
                hub = attr.Hub;
            }
        }

        return CreateWebDriverInstance(testMethod, hub, capabilities);
    }

    public static CustomChromeRemoteDriver CreateWebDriverInstance(MethodInfo testMethod, string hub, ICapabilities capabilities)
    {
        var driver = string.IsNullOrEmpty(hub) ? new CustomChromeRemoteDriver(capabilities) : new CustomChromeRemoteDriver(new Uri(hub), capabilities, TimeSpan.FromMinutes(60));

        InitializeDriver(testMethod, driver);

        return driver;
    }
}

The shared instance cache key should not only be the driver type because this will not work in case of multiple remote webdrivers with different capabilities.

Yeah originally my thinking was that sharing wasn't a good idea because the combinations of possible different drivers was large and I didn't know if it was really needed (wasn't sure if it helps with a grid or not).
Since you're the first person to use/ask for features for the remote driver I'll defer to your use cases.
At the moment I'm knee deep in another project, I'm not sure when I will get to this change. If you want to create a PR for it to speed things along that would be cool. If not I'll see what I can do over the next week or two.

No worries.
I am also pretty busy for a new project so I will only be able to file the issues I encounter.  We can work from there whenever you or me got more time.  I can work around those issues fairly easy so there is no hurry. When I have more time I am happy to help out.

In case you're interested these are the other two projects that I'm currently working.
Grace - Dependency injection container for .net, currently re-writing from the ground up for .netstandard and performance reasons.
SimpleFixture - Data generation library used by SeleniumFixture for creating random data as well as constructing models instances for the PageObject pattern.

I will look into them.


A couple of inquiries regarding CompanyConfig

Hello, firstly allow me to say that ChatDev is an amazing application with so much potential since it is only the end of 2023. I was going through the CompanyConfig settings and want to incorporate as many features into the development process as possible, but I have a few things to ask about beforehand so I best understand:

For "incremental_develop", I'm a bit confused on whether or not it can be ran within the Human configuration? Because I see it listed as an option in the Human ChatChainConfig file, yet Increment is a separate folder with it's own ChatChainConfig. I would love to combine both to experiment with results.

For "brainstorming", is there any additional setup required to set this up? I changed it to "True" and was having some issues running it, but I did have other errors that I created when editing the structure that were fixed after redownloading. I am going to attempt to run it now with a fresh functional ChatDev but thought I would still ask just incase.

I would really like to know if Docker is necessary for advanced gui programs or something? The Docker section seems a bit vague in whether I should or shouldn't utilize it. I didn't want to install it if it won't be useful but if it helps with running more visually complex software then that definitely helps.

EDIT: Can I combine the functions of Human/Increment/Art configurations?
I really appreciate the help, have a great rest of your weeks.

Thank you for your advice!

incremental_develop: incremental_develop is coded based on the Human mode, we will consider unifying these two configurations.
brainstorming: please ignore it. It was an early design, now deprecated. We will remove this option.
docker: you can try advanced GUI programs in command style. Docker is only used for safer execution.


Can i use this package in rust project ?

Not really. This is a pyo3 based project and it's only used t generate the daily-python package.
Right now the only option would be to use Rust FFI with https://github.com/daily-co/daily-core-sdk/ which I believe you have already found.

Closing.


reconnect when app is in background

Hi,
Sometimes the socket connection disconnects when the application is in the background. How do I get it to reconnect when the application is opened?
Thank you.

I thought that too. But how can I reconnect? I mean, i need something like ActionCable.reconnect() isn't it?


Documentation inaccurate for TestLocation

I know this component is under construction but it mentions to check the tests in the main repo.
There are none, so maybe the wording could be changed to reflect that. http://rackt.github.io/react-router/#TestLocation

we now have a MemoryLocation on master.

Well the bug is wrong documentation... as it points to something that doesn't exist it's worse then having no documentation at all.
"Useful for testing your app. Check out the tests in the git repo to see how its used (more docs soon? PRs welcome after you figure it out!)"


Files with absolute paths that do not specify a PackFolder are not included in the final nupkg

Describe the Bug
Specifying a PackageFile to an absolute path without specifying a PackFolder causes that file not to be included in the resulting nupkg
Steps to Reproduce
Specify a PackageFile with an absolute path as follows:
<PackageFile Include="$(BinaryLocation)\web\service\bin\Microsoft.Oasys.ServiceLogging.dll"/>
BinaryLocation is an MSBuild property that resolves to an absolute path ("D:\OM\Import\x64\debug\pkgnuget_oasys\x-none\x64\oasys\x-none" in this case).
The diag logging for "AssignPackagePath" shows the following Task Parameter:

  Files=
      D:\OM\Import\x64\debug\pkgnuget_oasys\x-none\x64\oasys\x-none\web\service\bin\Microsoft.Oasys.ServiceLogging.dll
              OriginalItemSpec=
              PackageId=EngTelemetryLogging
              PackageReference=
              PackageReferencePath=
              PackageReferencePathProperty=
              PackFolder=None
              Platform=AnyCPU
              Source=Explicit

Which results in the following Output Item:

  _PackageContent=
      D:\OM\Import\x64\debug\pkgnuget_oasys\x-none\x64\oasys\x-none\web\service\bin\Microsoft.Oasys.ServiceLogging.dll
              OriginalItemSpec=D:\OM\Import\x64\debug\pkgnuget_oasys\x-none\x64\oasys\x-none\web\service\bin\Microsoft.Oasys.ServiceLogging.dll
              PackageFolder=
              PackageId=EngTelemetryLogging
              PackagePath=D:/OM/Import/x64/debug/pkgnuget_oasys/x-none/x64/oasys/x-none/web/service/bin/Microsoft.Oasys.ServiceLogging.dll
              PackageReference=
              PackageReferencePath=
              PackageReferencePathProperty=
              PackFolder=None
              Platform=AnyCPU
              Source=Explicit
              TargetPath=D:/OM/Import/x64/debug/pkgnuget_oasys/x-none/x64/oasys/x-none/web/service/bin/Microsoft.Oasys.ServiceLogging.dll

The resulting nupkg then does not include that file in the package.
Expected Behavior
The expectation is that the file would be packed to the root of the package, which would likely mean stripping the absolute path to define the following:

  _PackageContent=
      D:\OM\Import\x64\debug\pkgnuget_oasys\x-none\x64\oasys\x-none\web\service\bin\Microsoft.Oasys.ServiceLogging.dll
              OriginalItemSpec=D:\OM\Import\x64\debug\pkgnuget_oasys\x-none\x64\oasys\x-none\web\service\bin\Microsoft.Oasys.ServiceLogging.dll
              PackageFolder=
              PackageId=EngTelemetryLogging
              PackagePath=Microsoft.Oasys.ServiceLogging.dll
              PackageReference=
              PackageReferencePath=
              PackageReferencePathProperty=
              PackFolder=None
              Platform=AnyCPU
              Source=Explicit
              TargetPath=Microsoft.Oasys.ServiceLogging.dll

Version Info
NuGetizer 0.7.5

It wouldn't be intuitive to resort to packing on the root of the package. In most cases, you'll want to place the file somewhere else, and it's not clear which relative path should be used for that. For that reason, we don't do any special processing in that case, and in my testing, it actually results in an error (albeit a bit of an unintuitive one).
You can specify either a PackFolder or a PackagePath metadata for the PackageFile and decide precisely where you want it to land. For example:
<PackageFile Include="$(BinaryLocation)\web\service\bin\Microsoft.Oasys.ServiceLogging.dll" PackFolder="lib" />

Or, to place on the package root:
<PackageFile Include="$(BinaryLocation)\web\service\bin\Microsoft.Oasys.ServiceLogging.dll" PackagePath="Microsoft.Oasys.ServiceLogging.dll" />

Or generically, to include all files under that binary location (say):
<PackageFile Include="$(BinaryLocation)\**\*.dll" PackagePath="lib\$(TargetFramework)\%(Filename)%(Extension)" />


TS2300 when typescript is installed & run locally

I'm trying to use local installation of ts compiler and having lots of "TS2300" errors.
Step by step:

install typescript as a local npm module (npm install typescript without -g)
create some .ts source files
create tsconfig.json file
use "rootDir" entry in tsconfig.json to make typescript compile everything inside some project dir
use "outDir" entry in tsconfig.json to point output somewhere inside project dir
run tsc from local installation (./node_modules/typescript/bin/tsc -p ./)

As result I have lots of "TS2300", looks like tsc for some reason is trying to use some internal .d.ts files twice ore more.
As a workaround I've tried to add "exclude" section to tsconfig with the only "node_modules" inside it. And it worked! No "TS2300" errors anymore.
So the bug is (as it seems to me) that tsc is trying to use node_modules even when it's not inside rootDir.
PS
Please be aware that I'm new to typescript compiler and thanks in advance =)

If you have a tsconfig.json, with no "files" property defined in it, the whole folder is considered part of your "project". the compiler will load all .ts files in the folder and subfolders, this includes node_module (as you pointed in the original post). the correct thing to do is, again as you mentioned, to add node_modules to the "exclude" property.
one handy trick is to use tsc --init, that will build you a tsconfig.json file that has the correct shape to get you started

forgot to mention that once all files are included in the compilation, such as files in packages like the TypeScript package (e.g. lib.*.d.ts) will produce the TS2300 or duplicate identifier errors.

hope that helps. and welcome to TypeScript :)

Ok, I've got it, thanks for your reply. But then what is the purpose to have "rootDir" defined in tsconfig (as I do have defined), if it doesn't tell the compiler where to grab the sources? Or am I missing something obvious?

The rootDir is used only when outDir is passed to detect the directory structure the compiler needs to recreate in the output.
Here is some more information about options: https://github.com/Microsoft/TypeScript/wiki/Compiler-Options

Well, as being said in documentation (thanks for the link) the "rootDir" points to the directory with sources. In my case I have both "rootDir" and "outDir" defined. And I have a file tree like that:
project folder
|--out
|    |--main.js
|
|--src
|    |--main.ts
|
|--node_modules
|    |--typescript
|
|--tsconfig.json

I have "rootDir" pointing to "src" and "outDir" pointing to "out" in file tree.
So the problem is that even in theese conditions TS compiler somehow is looking through node_modules folder (unless it is explicitly excluded in tsconfig).
Looks like "rootDir" is ignored and always refers to the folder, where tsconfig.json itself is located. Is that true? If so, that behaviour should be either fixed or well-documented.

Looks like "rootDir" is ignored and always refers to the folder, where tsconfig.json itself is located. Is that true?

that is correct.

If so, that behavior should be either fixed or well-documented.

I updated the docs, it now says:

--rootDir :  Specifies the root directory of input files. Only use to control the output directory structure with --outDir.

dose this make sense to you?

Being honest I'd loved to see the change in behaviour rather than in documentation =)
Current behaviour looks sophisticated and unclear to me. Let me suggest my opinionated sane behaviour:

Having files defined means that these (and only these) files should be considered as sources.
Having rootDir defined means that there is no any other place to get sources from, except this directory and all hierarchy inside it. It also means that we do not have files defined in tsconfig.json.
Having --outFile defined means that the compiler should store one .js file for all .ts files (compile each + combine).
Having --outDir defined means that the compiler should store one .js file for each .ts file (compile each). And of course it should use the same directory structure as we have for sources (otherwise we'll produce an undefined chaos).

Anyway, my particular problem was solved even before I've created this issue, so I think it might be closed =) Thanks again for your time

i think all of your suggestions work the way you describe, except for rootDir. and while i would agree that it can be better, i would not want to break existing user code by changing its semantics, let a side introducing yet another flag that has a better behavior.


In Add Conditions by default cart properties should be selected.

Framework Version: 0.1.6

Framework Version: 0.1.6

Fixed


[ISSUE #5923] Revert "Fix tiered store README.md error about Configuration (#7436)"

[ISSUE #5923] Revert "Fix tiered store README.md error about Configuration (#7436)"
This reverts commit 70dc93abbcb9bf161378d66fcaca55bedc78b905.

Which Issue(s) This PR Fixes

for issue #5923
Brief Description

How Did You Test This Change?

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (1be5ebc) 43.11% compared to head (0124da5) 43.17%.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #7557      +/-   ##
=============================================
+ Coverage      43.11%   43.17%   +0.05%
- Complexity      9708     9719      +11
=============================================
  Files           1159     1159
  Lines          84035    84035
  Branches       10922    10922
=============================================
+ Hits           36234    36283      +49
+ Misses         43294    43244      -50
- Partials        4507     4508       +1

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Support on "OAuth2JWTBearer" Authentication

Hi,
I am having a similar issue as the post describe below:
https://answers.sap.com/questions/13195320/unable-to-call-external-service-sap-workflow-servi.html?childToView=13192516#answer-13192516
My main question:
Is the cloud sdk currently able to handle authentication automatically or do we still need to rely on axios or other third-party nodejs module to connect to workflow serivce?
My Errors:
When I deployed my project to the cloud foundry, I am getting this error message below

Below are my files:
cat-services.js
""

Hi @shumagundam,
cds.connect.to('workflow_trial') doesn't look like Cloud SDK to me but instead more like CAP.
The good news is we're releasing a type-safe client for OpenAPI services this or coming week. It's going to be integrated with our Connectivity feature which means you'll have auth working out of the box.
We'll also release a certified client library for the SAP Workflow which would be available on NPM. I'll ask colleagues if we can give you a canary version to try it out.
@FrankEssenberger @jjtang1985, from your experience, can auth be simplified in the example below? Or should we wait for a released client?

Hi @shumagundam ,
Unfortunately, the OAuth2JWTBearer auth type is not supported by the SAP Cloud SDK for the time being. (@artemkovalyov )
Would it be ok to switch to some other auth types?
Here is a list of supported authentication type when using the SDK.
Let's assume you can switch to some other supported auth type, then you can use our type-safe client, which will handle the authentication flow under the hood.
Having a certified client library is nice, which is pre-generated and released by SAP to reduce your effort of the the generation.
As this might take a while (we plan to release the client in May, which is not guaranteed), I recommend you can generate your own client for now.
Here is the document about the generation. Please use the canary version of the generator and be aware, currently the generator is still under beta version and the GA will be released soon.
When you successfully generate your own type-safe client, here is the document about how should you execute a request.
Best regards,
Junjie

@shumagundam
if you have to use the auth type OAuth2JWTBearer, could you please create a separate ticket as a feature request?

Just for the colleague who will work on this. Here is thw point where a additional block is needed:
https://github.com/SAP/cloud-sdk-js/blob/9636132d149b16b866042c9b136e336820bd2ba0/packages/core/src/connectivity/scp-cf/destination/destination-from-service.ts#L101
I have not looked into the OAuth2JWTBearer flow but I would assume that the destination service should do all the work and potentially it would already work if you call the addOAuthSamlAuth method also for the JWTBearer case. The important this is anyhow not the implementation which is small but to properly include the flow in our E2E tests.

Hi all,
Thanks for the sending me the documentation and recommendation. I think we can switch to different types of authentication.
Regarding the type-safe client, it looks like there is a JAVA version.  https://sap.github.io/cloud-sdk/docs/java/features/rest/clients/scp-workflow-rest-api/ Can you confirm?
Regards,
Jonas
From: Junjie Tang @.>
Reply-To: SAP/cloud-sdk-js @.>
Date: Wednesday, April 28, 2021 at 3:07 AM
To: SAP/cloud-sdk-js @.>
Cc: "Wang, Jonas" @.>, Mention @.***>
Subject: Re: [SAP/cloud-sdk-js] Support on "OAuth2JWTBearer" Authentication (#1245)
Hi @shumagundamhttps://github.com/shumagundam ,
Unfortunately, the OAuth2JWTBearer auth type is not supported by the SAP Cloud SDK for the time being. @.***https://github.com/artemkovalyov )
Would it be ok to switch to some other auth types?
Here is a list of supported authentication typehttps://sap.github.io/cloud-sdk/docs/js/features/connectivity/destination#authentication-and-json-web-token-retrieval when using the SDK.
Let's assume you can switch to some other supported auth type, then you can use our type-safe client, which will handle the authentication flow under the hood.
Having a certified client library is nice, which is pre-generated and released by SAP to reduce your effort of the the generation.
As this might take a while (we plan to release the client in May, which is not guaranteed), I recommend you can generate your own client for now.
Here is the documenthttps://sap.github.io/cloud-sdk/docs/js/features/openapi/generate-openapi-client about the generation. Please use the canary version of the generator and be aware, currently the generator is still under beta version and the GA will be released soon.
When you successfully generate your own type-safe client, here is the documenthttps://sap.github.io/cloud-sdk/docs/js/features/openapi/execute-openapi-request about how should you execute a request.
Best regards,
Junjie
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/SAP/cloud-sdk-js/issues/1245#issuecomment-828203710, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADJCMI2BPQEQPFBZGK6PDYLTK6XZPANCNFSM43UZQKCA.

@shumagundam , yes, we have a Java client released already. YOu can try it out if you want. Soon there will be a JS client as well. I believe in 2-3 weeks or so.

Hi @shumagundam ,
we have released 1.47.0, that contains the new feature about this auth type.
I'll close this ticket and please reopen if you have questions.
BR,
Junjie


add shorter imports

this PR solves issue #57
clunky imports such as
from eckity.evaluators.simple_individual_evaluator import SimpleIndividualEvaluator

can now be replaced with
from eckity.evaluators import SimpleIndividualEvaluator

When merging this to main - we need to update the wiki and then publish


Update BaseController.SetupConfiguration parameters to no longer take in a source type

Overview
This method was taking in an InputSourceType, though one is already saved for this controller as part of its InputSource.
Instead of having this second parameter, it's been marked as Obsolete and the type is now read from the InputSource

/azp run

/azp run

/azp run

/azp run


"module command not found" using Snakemake with Slurm

I think I've initially posted in the wrong repo. Please see https://github.com/snakemake/snakemake/issues/2802#issuecomment-2049297585
Especially as --executor none works fine, but my profile using --executor slurm fails to load an environment module.
Given my discussion with IT so far, we suspect that whatever shell is launched on the compute node isn't a login shell, which is a requirement to access the module function (at least on our cluster).

Not being a complete expert on many of the topics involved, and following a link to another, i've
arrived from
subprocess.check_output
to
https://docs.python.org/3/library/subprocess.html#subprocess.Popen
which states:

On POSIX with shell=True, the shell defaults to /bin/sh.

while most of what we do on our cluster relies on /bin/bash in particular that issue of login shells needed to access modules.
Could that /bin/sh thing be the issue?
Happy to be the guinea pig testing things if someone is willing to guide me through the process, as I've been trying to solve that problem for a whole day now and I've been going in circle and losing track of what to focus on.

Well,

Could that /bin/sh thing be the issue?

Try,
$ md5sum /bin/sh /bin/bash

chances are they are the same. Even if not, I can think of two different causes here:

either the environment is different in job context
or we indeed face a bug in the executor.

Could you use your minimal example, start with snakemake --verbose ... and post the log from both the login node and the job output (or attach it) here, please?
Snakemake will attempt to run the module command in the job context, if the module command is not present there, it is most likely an environment issue.  Hence, a second thing to check would be running env on the login node and within the snakemake rule and include the output, here.
Also: Which module system are you using (output of which module)?

Thanks for the quick reply!
Interesting, they're different 👀
$ md5sum /bin/sh /bin/bash
7409ae3f7b10e059ee70d9079c94b097  /bin/sh
d7bc3ce3b6b7ac53ba2918a97d806418  /bin/bash

With --verbose
$ snakemake --verbose --use-envmodules
Using profile default for setting default command line arguments.
Building DAG of jobs...
shared_storage_local_copies: True
remote_exec: False
SLURM run ID: 6ec84bc7-c457-42a8-9655-1561f880896c
Using shell: /usr/bin/bash
Provided remote nodes: 100
Job stats:
job                   count
------------------  -------
cellranger_version        1
total                     1

Resources before job selection: {'_cores':<PHONE_NUMBER>854775807, '_nodes': 100}
Ready jobs (1)
Select jobs to execute...
Using greedy selector because only single job has to be scheduled.
Selected jobs (1)
Resources after job selection: {'_cores':<PHONE_NUMBER>854775806, '_nodes': 99}
Execute 1 jobs...

[Thu Apr 11 13:46:36 2024]
rule cellranger_version:
    jobid: 0
    reason: Rules with neither input nor output files are always executed.
    resources: mem_mb=1000, mem_mib=954, disk_mb=1000, disk_mib=954, tmpdir=<TBD>, slurm_partition=short, runtime=10

cellranger --version
No SLURM account given, trying to guess.
Unable to guess SLURM account. Trying to proceed without.
General args: ['--force', '--target-files-omit-workdir-adjustment', '--keep-storage-local-copies', '--max-inventory-time 0', '--nocolor', '--notemp', '--no-hooks', '--nolock', '--ignore-incomplete', '', '--verbose ', '--rerun-triggers software-env code params input mtime', '', '', '--deployment-method conda env-modules', '--conda-frontend mamba', '', '--conda-base-path /ceph/project/sims-lab/albrecht/miniforge3', '', '', '', '--shared-fs-usage sources input-output storage-local-copies persistence source-cache software-deployment', '', '--wrapper-prefix https://github.com/snakemake/snakemake-wrappers/raw/', '', '', '', '', '--printshellcmds ', '--latency-wait 15', '--scheduler ilp', '--local-storage-prefix .snakemake/storage', '--scheduler-solver-path /ceph/project/sims-lab/albrecht/miniforge3/envs/snakemake/bin', '', '', '', '', '', '--default-resources base64//bWVtX21iPW1pbihtYXgoMippbnB1dC5zaXplX21iLCAxMDAwKSwgODAwMCk= base64//ZGlza19tYj1tYXgoMippbnB1dC5zaXplX21iLCAxMDAwKQ== base64//dG1wZGlyPXN5c3RlbV90bXBkaXI= base64//c2x1cm1fcGFydGl0aW9uPXNob3J0 base64//cnVudGltZT0xMA==', '']
sbatch call: sbatch --job-name 6ec84bc7-c457-42a8-9655-1561f880896c --output /ceph/project/tendonhca/albrecht/test-snakemake/.snakemake/slurm_logs/rule_cellranger_version/%j.log --export=ALL --comment cellranger_version -p short -t 10 --mem 1000 --ntasks=1 --cpus-per-task=1 -D /ceph/project/tendonhca/albrecht/test-snakemake --wrap="/ceph/project/sims-lab/albrecht/miniforge3/envs/snakemake/bin/python3.12 -m snakemake --snakefile /ceph/project/tendonhca/albrecht/test-snakemake/Snakefile --target-jobs 'cellranger_version:' --allowed-rules 'cellranger_version' --cores all --attempt 1 --force-use-threads  --resources 'mem_mb=1000' 'mem_mib=954' 'disk_mb=1000' 'disk_mib=954' --wait-for-files '/ceph/project/tendonhca/albrecht/test-snakemake/.snakemake/tmp.4cxxt4o_' --force --target-files-omit-workdir-adjustment --keep-storage-local-copies --max-inventory-time 0 --nocolor --notemp --no-hooks --nolock --ignore-incomplete --verbose  --rerun-triggers software-env code params input mtime --deployment-method conda env-modules --conda-frontend mamba --conda-base-path /ceph/project/sims-lab/albrecht/miniforge3 --shared-fs-usage sources input-output storage-local-copies persistence source-cache software-deployment --wrapper-prefix https://github.com/snakemake/snakemake-wrappers/raw/ --printshellcmds  --latency-wait 15 --scheduler ilp --local-storage-prefix .snakemake/storage --scheduler-solver-path /ceph/project/sims-lab/albrecht/miniforge3/envs/snakemake/bin --default-resources base64//bWVtX21iPW1pbihtYXgoMippbnB1dC5zaXplX21iLCAxMDAwKSwgODAwMCk= base64//ZGlza19tYj1tYXgoMippbnB1dC5zaXplX21iLCAxMDAwKQ== base64//dG1wZGlyPXN5c3RlbV90bXBkaXI= base64//c2x1cm1fcGFydGl0aW9uPXNob3J0 base64//cnVudGltZT0xMA== --executor slurm-jobstep --jobs 1 --mode remote"
Job 0 has been submitted with SLURM jobid 1194995 (log: /ceph/project/tendonhca/albrecht/test-snakemake/.snakemake/slurm_logs/rule_cellranger_version/1194995.log).
The job status was queried with command: sacct -X --parsable2 --noheader --format=JobIdRaw,State --starttime 2024-04-09T13:00 --endtime now --name 6ec84bc7-c457-42a8-9655-1561f880896c
It took: 0.09709572792053223 seconds
The output is:
'1194995|PENDING
'

status_of_jobs after sacct is: {'1194995': 'PENDING'}
active_jobs_ids_with_current_sacct_status are: {'1194995'}
active_jobs_seen_by_sacct are: {'1194995'}
missing_sacct_status are: set()
The job status was queried with command: sacct -X --parsable2 --noheader --format=JobIdRaw,State --starttime 2024-04-09T13:00 --endtime now --name 6ec84bc7-c457-42a8-9655-1561f880896c
It took: 0.09258508682250977 seconds
The output is:
'1194995|PENDING
'

status_of_jobs after sacct is: {'1194995': 'FAILED'}
active_jobs_ids_with_current_sacct_status are: {'1194995'}
active_jobs_seen_by_sacct are: {'1194995'}
missing_sacct_status are: set()
[Thu Apr 11 13:50:34 2024]
Error in rule cellranger_version:
    message: SLURM-job '1194995' failed, SLURM status is: 'FAILED'For further error details see the cluster/cloud log and the log files of the involved rule(s).
    jobid: 0
    log: /ceph/project/tendonhca/albrecht/test-snakemake/.snakemake/slurm_logs/rule_cellranger_version/1194995.log (check log file(s) for error details)
    shell:
        cellranger --version
        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
    external_jobid: 1194995

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2024-04-11T134633.623105.snakemake.log
unlocking
removing lock
removing lock
removed all locks
Full Traceback (most recent call last):
  File "/ceph/project/sims-lab/albrecht/miniforge3/envs/snakemake/lib/python3.12/site-packages/snakemake/cli.py", line 2068, in args_to_api
    dag_api.execute_workflow(
  File "/ceph/project/sims-lab/albrecht/miniforge3/envs/snakemake/lib/python3.12/site-packages/snakemake/api.py", line 589, in execute_workflow
    workflow.execute(
  File "/ceph/project/sims-lab/albrecht/miniforge3/envs/snakemake/lib/python3.12/site-packages/snakemake/workflow.py", line 1285, in execute
    raise WorkflowError("At least one job did not complete successfully.")
snakemake_interface_common.exceptions.WorkflowError: At least one job did not complete successfully.

WorkflowError:
At least one job did not complete successfully.

Not sure why I see --executor slurm-jobstep in the log above when my profile says:
#cluster: qsub
executor: slurm
jobscript: "slurm-jobscript.sh"
jobs: 100
latency-wait: 15
default-resources:
  - slurm_partition=short
  - runtime=10
  #- mem_mb=6000
  #- disk_mb=1000000
rerun-incomplete: True
printshellcmds: True
use-conda: True

(and I haven't installed the slurm-jobstep plugin.

and I haven't installed the slurm-jobstep plugin.

That should be installed automatically, if you install this plugin via conda/mamba/etc. However, if it is really missing, please be sure to work with it: Snakemake submits itself and to work properly in the job context, you need the plugin. You can check this with
$ mamba list | grep snakemake

or conda in place of mamba.
After installation, please try again and report the output, resp. log of
rule my_cellranger:
    envmodules:
        "cellranger/7.2.0"
   log: "logs/cellranger.log"
    shell:
        "env && cellranger --version &> {log}"

Sorry for the confusion. I didn't mean that it was not installed. I meant that I hadn't installed it explicitly myself.
$ mamba list | grep snakemake
# packages in environment at /ceph/project/sims-lab/albrecht/miniforge3/envs/snakemake:
snakemake                 8.10.6               hdfd78af_0    bioconda
snakemake-executor-plugin-slurm 0.4.2                    pypi_0    pypi
snakemake-executor-plugin-slurm-jobstep 0.1.11                   pypi_0    pypi
snakemake-interface-common 1.17.1             pyhdfd78af_0    bioconda
snakemake-interface-executor-plugins 9.1.0              pyhdfd78af_0    bioconda
snakemake-interface-report-plugins 1.0.0              pyhdfd78af_0    bioconda
snakemake-interface-storage-plugins 3.1.1              pyhdfd78af_0    bioconda
snakemake-minimal         8.10.6             pyhdfd78af_0    bioconda

To clarify, I've installed Snakemake and the snakemake-executor-plugin-slurm plugin in a brand new environment using the following YAML file:
name: snakemake
channels:
  - conda-forge
  - bioconda
  - defaults
dependencies:
  - python=3.12
  - snakemake
  - pip:
    - snakemake-executor-plugin-slurm

Let me know if I need to reinstall anything (including the whole Conda environment), but in the meantime, the log of the adjusted rule you asked is (after adjusting the missing indentation space in front of log:):
cellranger.log
/usr/bin/bash: line 1: cellranger: command not found

Do you need the console log or the .log too?

ah, you are working with system c-modules. I am not sure how up-to-date your version is, so:
What is - on the login node the output of:
module avail |& grep -i cellranger
And the same in job context.

 I don't see any module matching 'spider'.
Also, I'm not sure what your |& grep -i is doing. It seems to me you're looking for available cellranger modules, which I usually do with simply module avail cellranger, which gives
$ module avail cellranger
---------------------------------------------------------------------------------- /package/modulefiles -----------------------------------------------------------------------------------
cellranger-arc/1.0.1  cellranger-arc/2.0.2   cellranger-atac/2.1.0  cellranger/3.0.1  cellranger/4.0.0  cellranger/6.0.1  cellranger/6.1.2  cellranger/7.0.1  cellranger/7.2.0
cellranger-arc/2.0.0  cellranger-atac/1.2.0  cellranger/2.1.1       cellranger/3.1.0  cellranger/5.0.0  cellranger/6.1.1  cellranger/7.0.0  cellranger/7.1.0

Key:
modulepath
```#

Thanks again for your time so far!

module spider ... is the search command for lmod - I was under the impression, that the c-version implements it as well, yet your version might be too old.
Anyway, the module command works in job context and the module path is the same.
I need some time - I will be teaching next week.

No worries. Thanks for the help. I've got my workaround for now, which is that I've got few enough samples to write and submit the job scripts myself using sbatch.
If only I could figure out what changed since I last used snakemake back in January. Really weird.

FWIW
$ module --help
Modules Release 5.0.1 (2021-10-16)
Usage: module [options] [command] [args ...]

Loading / Unloading commands:
  add | load      modulefile [...]  Load modulefile(s)
  try-add | try-load modfile [...]  Load modfile(s), no complain if not found
  rm | unload     modulefile [...]  Remove modulefile(s)
  purge                             Unload all loaded modulefiles
  reload                            Unload then load all loaded modulefiles
  switch | swap   [mod1] mod2       Unload mod1 and load mod2
  refresh                           Refresh loaded module volatile components

Listing / Searching commands:
  list            [-t|-l|-j]        List loaded modules
  avail   [-d|-L] [-t|-l|-j] [-a] [-S|-C] [--indepth|--no-indepth] [mod ...]
                                    List all or matching available modules
  aliases         [-a]              List all module aliases
  whatis [-a] [-j] [modulefile ...] Print whatis information of modulefile(s)
  apropos | keyword | search [-a] [-j] str
                                    Search all name and whatis containing str
  is-loaded       [modulefile ...]  Test if any of the modulefile(s) are loaded
  is-avail        modulefile [...]  Is any of the modulefile(s) available
  info-loaded     modulefile        Get full name of matching loaded module(s)

Collection of modules handling commands:
  save            [collection|file] Save current module list to collection
  restore         [collection|file] Restore module list from collection or file
  saverm          [collection]      Remove saved collection
  saveshow        [collection|file] Display information about collection
  savelist        [-t|-l|-j]        List all saved collections
  is-saved        [collection ...]  Test if any of the collection(s) exists

Environment direct handling commands:
  prepend-path [-d c] var val [...] Prepend value to environment variable
  append-path [-d c] var val [...]  Append value to environment variable
  remove-path [-d c] var val [...]  Remove value from environment variable

Other commands:
  help            [modulefile ...]  Print this or modulefile(s) help info
  display | show  modulefile [...]  Display information about modulefile(s)
  test            [modulefile ...]  Test modulefile(s)
  use     [-a|-p] dir [...]         Add dir(s) to MODULEPATH variable
  unuse           dir [...]         Remove dir(s) from MODULEPATH variable
  is-used         [dir ...]         Is any of the dir(s) enabled in MODULEPATH
  path            modulefile        Print modulefile path
  paths           modulefile        Print path of matching available modules
  clear           [-f]              Reset Modules-specific runtime information
  source          scriptfile [...]  Execute scriptfile(s)
  config [--dump-state|name [val]]  Display or set Modules configuration
  sh-to-mod       shell shellscript [arg ...]
                                    Make modulefile from script env changes
  edit            modulefile        Open modulefile in editor

and
$ module spider
ERROR: Invalid command 'spider'
  Try 'module --help' for more information.

 Did you run Snakemake with --sdm=env-modules?

Thanks for coming back to me.
I just did and I see no difference:
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided remote nodes: 1
Provided resources: mem_mb=1000, mem_mib=954, disk_mb=1000, disk_mib=954
Select jobs to execute...
Execute 1 jobs...

[Fri Apr 26 09:53:25 2024]
rule my_cellranger:
    log: logs/cellranger.log
    jobid: 0
    reason: Rules with neither input nor output files are always executed.
    resources: mem_mb=1000, mem_mib=954, disk_mb=1000, disk_mib=954, tmpdir=<TBD>, slurm_partition=short, runtime=10

. /etc/profile.d/modules.sh && env && cellranger --version &> logs/cellranger.log
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Provided resources: mem_mb=1000, mem_mib=954, disk_mb=1000, disk_mib=954
Select jobs to execute...
Execute 1 jobs...

[Fri Apr 26 09:53:33 2024]
localrule my_cellranger:
    log: logs/cellranger.log
    jobid: 0
    reason: Rules with neither input nor output files are always executed.
    resources: mem_mb=1000, mem_mib=954, disk_mb=1000, disk_mib=954, tmpdir=/var/scratch/albrecht/1280293, slurm_partition=short, runtime=10

env && cellranger --version &> logs/cellranger.log
Activating environment modules: cellranger/7.2.0
/usr/bin/bash: line 1: module: command not found

A couple of thoughts:

Maybe irrelevant, but I'm curious why stdout first reports rule my_cellranger: and a split second later localrule my_cellranger:.
Having talked with IT in the meantime, one thing that came up is that on our system, module is Bash function (not an executable), which has two implications:

IT told me only login shells define the module function. I cannot figure out whether the snakemake slurm plugin launches login shells (bash --login) or not. Also, I've recently run into a login shell issue with VScode, and I wonder if this could be related here: https://github.com/microsoft/vscode-remote-release/issues/1671#issuecomment-2049250849
IT also told me that Slurm jobs receive environment variables from the submission Shell, but not Bash functions, which again may explain why the module Bash function doesn't make it to whatever shell the plugin uses to load the environment module.

Perhaps I should get you in touch directly with our IT team rather than acting as middle-man and potentially fudging the information I'm passing back and forth?

Oh, this never ending not-invented-here syndrome, resulting in how-do-we-deviate-best-from-commuity-standards ...
Yes, the module command is a shell function. And it should be available on compute nodes. Why? Because otherwise it forces people to write their batch scripts without documenting the software therein. Where else? In a different statement, issued before submission. (My 2 cents: Most likely in .bashrc, where it will lead inevitable to conflicts over time, due to accumulating modules - at least for serious long-term analysis.)
Oh, wait: The plugin already does sbatch ... --export=ALL ... .
We strive to provide portable workflows, where the workflow should not be tinkered with when shipped (because every additional information is in profile and/or config files). Here, you could write a rule to load the module (a local rule) and then submit your job, but that result in a slightly odd software pattern, right? So, yes, talk to your admins. (Snakemake launches no shell at all upon submission. It assumes a working shell with an environment satisfying its needs, when in job context. You can see the launch, when running Snakemake with --verbose.)
As to your other question about the job log: Snakemake submits itself. Hence, it needs to figure out what kind of rule it is dealing with. It will receive a part of the workflow (e.g. one rule), and subsequently interprets it to be local.

Either I misundertood your suggestion, or it's also not working
#shell.executable("/bin/bash")
#shell.prefix("source ~/.bashrc; ")

localrules:
    module_init

rule all:
    input:
        "logs/cellranger.log"

rule module_init:
    output:
        "logs/module_init.log"
    shell:
        ". /etc/profile.d/modules.sh &> {output}"

rule my_cellranger:
    input:
        module="logs/module_init.log"
    output:
        "logs/cellranger.log"
    envmodules:
        "cellranger/7.2.0"
    # log: "logs/cellranger.log"
    shell:
        "env && cellranger --version &> {output}"
        #"echo $SHELL && which conda && conda info && module avail cellranger && env && cellranger --version &> {log}"

# shopt login_shell -> off and returns error code 1

Still getting /usr/bin/bash: line 1: module: command not found
Anyway, at this point don't worry, I'll check with IT again if they want to offer a solution, but a simple workaround is to manually load the modules in my Bash terminal before running snakemake, and not using the --use-envmodules option.

What I meant is to write a rule which explicitly performs module load. Which is silly as every work-around is because workarounds should be temporary and tend to be become established.
If the module command does not work on the compute nodes, there is no way to trigger it there - all you can do is to export the entire environment, which Snakemake does by default.


Splitter (Iterator) Node

After writing a lot of my game logic, I want to be able to split logic from a single entry point.
For example, a little old lady arrives home, and I would like to be able to trigger multiple events from this entry point.
At the moment these events can also be triggered if she is already home when something else happens.
This can cause the logic to become quite twisted.
It would be better to have a splitter node (like an inverted hub).

Note I was able to implement this pretty easily by duplicating the randomizer node and changing the name of everything to splitter (Find & Replace)

The thing is, each type in the Arrow's node system, needs to know what is the next node to play.
There can be different strategies to select that next node. The basic one is to have one path forward (similar to content and variable modifier nodes.) Another approach is to let player choose which node they want to go to (e.g. dialog and interaction) or define a condition to choose for them.
In other words, to run multiple events, we have to chain them somehow or have a way to choose between them.
Now when we intend to split to different nodes and have no preference, the best strategy to select the next node can be randomizing.
So I think randomizer is exactly the inverted hub.
Suggestions for any other strategy that is not implemented is very welcome.
If you're suggesting to rename the node to splitter; I don't think it really reflects the underlying process.

I mean a node that has two or more exits, which are played sequentially.
I was using this to link logic trees together so that the same dialog could have different options.
When I drop something in the house, it can check a few separate condition trees and play the correct dialog. Currently randomiser does not work like this since it only plays one output.

Here's an example of my tree:

OK!  have questions though.
What if more than two of the conditions return true or dispatch to multiple different path with either true or false ?
Then won't we have multiple next nodes, while we can only print/show one of them to the player ?

For me I will play each of those dialog trees until the end, step by step.
A use for this would be when the player enters an area. Imagine they have several party members, those party members might say something if they have not talked to the player recently.
We can use a splitter node to link to each of those dialog sets, and perhaps include a delay node which can be setup with a random timer.
In that way, the players companions will talk to them randomly as they progress through the level.

In other words, the strategy is:

let's forget the rule that: there is always only one next node
provide developers with an option to iterate over multiple nodes which allows cases such as:

"a little old lady arrives home, and I would like to be able to trigger multiple events from this entry point."

and let developers face/mange the (unsafe) consequences; Where multiple possible events (iterated/parallel nodes) naturally result in multiple possible future events (next nodes) or multiple end-of-line signals or a mix of both.

?
This is normal when we develop game(-play or runtime) logic and catch exceptions;
Yet it is considered unsafe strategy in terms of narrative design, because a particular (sub-) plot may not [rationally] end and then (or at the same time,) evolve forward too. It either finishes or continues/branches.
The safe strategy is to use conditional chains (probably a lot of them in a macro) where all cases are meticulously handled and result in individual/singular future per condition/(sub-)branch (instead of multiple outcomes of non-chained sequentially outputted nodes.)
I say unsafe (not wrong) because it can be a handy feature if used correctly, where [all] outcomes are carefully handled.
It's can be a convenience at-least for avoiding lots of conditional chains. I agree.

Yep that feature breakdown sounds correct. In my screenshot above I didn't take much care about the possible race conditions of subplots, but I was building for a game jam in only 9 days.
I would say that with a few UI issues aside Arrow was very helpful for my project, more powerful than simply iterating on a codebase which could quickly become tangled and messy.
If I might point out I feel like the game engine part of this app could be nicely separated.
For me I would have submitted a PR with this feature, but having to implement the whole feature-set of a story-mode splitter which i'll never use kept me from doing so.

I'm thinking more in the terms of Firewatch story.
They had a great GDC interview recently where they built their own version of something like Arrow, I think you might find it interesting to watch:
https://www.youtube.com/watch?v=RVFyRV43Ei8

I intend to implement this node (with the safety warning) with priority.
Also watched the GDC talk. Good watch for sure.
I found the approach they took to tell the story, very interesting.
Thanks for both suggestions.

We now have Sequencer node in v2.0.0.
I think you may find our new Character Tag System interesting as well.
It may be used to manage events (somehow like what they did in Firewatch) together with Tag-Edit and Tag-pass nodes.


DefinePlugin throws "unexpected token" on special characters

using webpack ^4.12.0 i've run into a bug with DefinePlugin creating unexpected token errors. in my webpack config i am injecting global values like this:
new webpack.DefinePlugin({
  API_ENDPOINT: 'https://api.test.company.io',
}),

but when running a webpack build i get this error (everything still transpiles, but if i do a find-all in the generated code the value of the global was never injected):
{ SyntaxError: Unexpected token (1:6)
at Parser.pp$4.raise (/<node_modules>/acorn/dist/acorn.js:2757:13)
at Parser.pp.unexpected (/<node_modules>/acorn/dist/acorn.js:647:8)
at Parser.pp.expect (/<node_modules>/acorn/dist/acorn.js:641:26)
at Parser.pp$3.parseParenAndDistinguishExpression (/<node_modules>/acorn/dist/acorn.js:2228:38)
at Parser.pp$3.parseExprAtom (/<node_modules>/acorn/dist/acorn.js:2163:41)
at Parser.parseExprAtom (/<node_modules>/acorn-dynamic-import/lib/inject.js:60:31)
at Parser.pp$3.parseExprSubscripts (/<node_modules>/acorn/dist/acorn.js:2047:19)
at Parser.pp$3.parseMaybeUnary (/<node_modules>/acorn/dist/acorn.js:2024:17)
at Parser.pp$3.parseExprOps (/<node_modules>/acorn/dist/acorn.js:1966:19)
at Parser.pp$3.parseMaybeConditional (/<node_modules>/acorn/dist/acorn.js:1949:19)
at Parser.pp$3.parseMaybeAssign (/<node_modules>/acorn/dist/acorn.js:1925:19)
at Parser.pp$3.parseExpression (/<node_modules>/acorn/dist/acorn.js:1896:19)
at Parser.pp$1.parseStatement (/<node_modules>/acorn/dist/acorn.js:815:45)
at Parser.parseStatement (/<node_modules>/acorn-dynamic-import/lib/inject.js:47:31)
at Parser.pp$1.parseTopLevel (/<node_modules>/acorn/dist/acorn.js:706:23)
at Parser.parse (/<node_modules>/acorn/dist/acorn.js:551:15)
at Object.parse (/<node_modules>/acorn/dist/acorn.js:5288:37)
at Function.parse (/<node_modules>/webpack/lib/Parser.js:2229:16)
at Parser.evaluate (/<node_modules>/webpack/lib/Parser.js:2132:22)
at parser.hooks.evaluateIdentifier.for.tap.expr (/<node_modules>/webpack/lib/DefinePlugin.js:180:29)
...

the stack trace keeps going, but that last line was what finally unlocked this issue for me and led me to this thread on visionmedia's debug repo. where the suggested solution to wrap values in JSON.stringify actually fixed my issue.
so, my next guess was that special characters were killing the DefinePlugin constructor. i tried running builds without special characters in the DefinePlugin constructor, and then slowly reintroduced characters into its diet until it died:
// works with no special characters
new webpack.DefinePlugin({
  API_ENDPOINT: 'httpsapitestcompanyio',
}),

// works when introducing the period character
new webpack.DefinePlugin({
    API_ENDPOINT: 'httpsapi.test.company.io',
}),

// dies when introducing colon
new webpack.DefinePlugin({
    API_ENDPOINT: 'https:api.test.company.io',
}),

// works when introducing one slash
new webpack.DefinePlugin({
    API_ENDPOINT: 'https/api.test.company.io',
}),

// dies when introducing two slashes
new webpack.DefinePlugin({
    API_ENDPOINT: 'https//api.test.company.io',
}),

// dies with both colon and slashes
new webpack.DefinePlugin({
    API_ENDPOINT: 'https://api.test.company.io',
}),

wrapping the URL container special characters in a JSON.stringify call is a valid workaround for the bug:
new webpack.DefinePlugin({
    API_ENDPOINT: JSON.stringify('https://api.test.company.io'),
}),

the other (maddening, table-flip inducing, completely nonsensical) workaround is to lowercase the name of the global var:
new webpack.DefinePlugin({
  api_endpoint: 'https://api.test.company.io'), // this works...
}),

🤷♂

@sokra @evilebottnawi
I'm having this same issue, although my usage scenario is different.

define-plugin/#usage states:

If the value is a string it will be used as a code fragment.

I'm using the code fragment functionality to execute code for development purposes, rather than to render a static value.
For example, the following configuration
new Webpack.DefinePlugin({
  foo: ";(()=>{console.log('@ injected.foo')})",
})

allows me to execute the defined code snippet with foo() in my source code.

I've found that webpack-dev-server's execution is entirely functional and the exemplified usage of DefinePlugin is successful for my intended purposes. However, I am getting a stack trace in the console:
SyntaxError: Unexpected token (2:2)
  at Parser.pp$4.raise                              (./node_modules/acorn/src/location.js:15:13)
  at Parser.pp.unexpected                           (./node_modules/acorn/src/parseutil.js:110:8)
  at Parser.pp$3.parseExprAtom                      (./node_modules/acorn/src/expression.js:463:10)
  at Parser.pp$3.parseExprSubscripts                (./node_modules/acorn/src/expression.js:266:19)
  at Parser.pp$3.parseMaybeUnary                    (./node_modules/acorn/src/expression.js:243:17)
  at Parser.pp$3.parseExprOps                       (./node_modules/acorn/src/expression.js:178:19)
  at Parser.pp$3.parseMaybeConditional              (./node_modules/acorn/src/expression.js:161:19)
  at Parser.pp$3.parseMaybeAssign                   (./node_modules/acorn/src/expression.js:129:19)
  at Parser.pp$3.parseParenAndDistinguishExpression (./node_modules/acorn/src/expression.js:559:28)
  at Parser.pp$3.parseExprAtom                      (./node_modules/acorn/src/expression.js:423:41) {
    pos:      4,
    loc:      Position { line: 2, column: 2 },
    raisedAt: 5
  }

Is there anything I can do to avoid that error? I think it would be helpful to have an option for DefinePlugin like allowSpecialCharacters or disableParsing to allow this type of usage without causing errors.
Also; I wouldn't mind opening a new issue using the issue template (or posting it here), if it would help to move the issue towards resolution.

You should not use DefinePlugin for injecting code

For those who don't know, DefinePlugin can't handle empty strings either...

You should not use DefinePlugin for injecting code

If we should not use DefinePlugin, what should we use ?

@Ratstail91 that's correct I just found out about it now and was pulling my hair off for the past 24 hours.


Handling of new Cairo v2.0.0 types

Describe the bug
Starknet.js  is not handling properly some new Cairo types :
ContractAddress, EthAddress, ClassHash, and Span
To Reproduce
If you try to interact with such Cairo v2.0.0 functions, it will fail :
fn array_new_types(
            self: @ContractState,
            tup: (ContractAddress, EthAddress, ClassHash),
            tupa: (Array<ContractAddress>, Array<EthAddress>, Array<ClassHash>)
        ) -> (Array<ContractAddress>, Array<EthAddress>, Array<ClassHash>)

fn new_span(self: @ContractState, my_span: Span<u16>) -> Span<u16>

Expected behavior
1. ContractAddress & ClassHash :
In Cairo code, they are considered as felt.
In ABI, they are considered as core litterals :
{
  "name": "creator",
  "type": "core::starknet::contract_address::ContractAddress"
},
{
  "name": "ch",
  "type": "core::starknet::class_hash::ClassHash"
},

So, in DAPP code, they have to be considered as BigNumberish limited to 252 bits.
2. EthAddress :
In Cairo code, it's considered as felt.
In ABI, it's considered as struct (!!!) :
{
  "type": "struct",
  "name": "core::starknet::eth_address::EthAddress",
  "members": [
    {
      "name": "address",
      "type": "core::felt252"
    }
  ]
},

So, in DAPP code, they have to be considered with same type as in Cairo code :  BigNumberish limited to 160 bits.
3. Span :
In Cairo code, it's considered as very close to Array (just immutable).
In ABI, it's considered as struct (!!!):
{
  "type": "struct",
  "name": "core::array::Span::<core::integer::u16>",
  "members": [
    {
      "name": "snapshot",
      "type": "@core::array::Array::<core::integer::u16>"
    }
  ]
}

So, in DAPP code, they have to be considered with same type as in Cairo code :  Array.
Screenshots
N/A
Desktop (please complete the following information):

Browser & version [e.g. chrome, safari, webworker]
Node version [e.g. 16.0.1]
Starknet.js version 5.17.0
Network [devnet, testnet]

Additional context
N/A

Resolved in https://github.com/0xs34n/starknet.js/pull/712
v5.19.0


add prepareAction option to createAction

This is a rough WIP for the feature requested in #148. Essentially, it allows to pass a prepare function with the signature (originalPayload: OriginalPayload) => {payload: Payload; meta? : Meta} to modify the Payload and potentially add a Meta to the created action. You can see examples of use in the type tests I added.
This is working, but needs tuning around the types - but before that I would like some feedback if I'm going in the right direction with this.
@markerikson  @tanhauhau what do you think?

Skimming the code, I have two immediate thoughts.
First, I don't think this is quite what I had in mind.  What I'm really looking for is the ability to define a function that takes whatever parameters I declare, and turns those into the payload.  A couple hypothetical examples:
const payloadFromArgs = (a : string, b : number) => ({a, b});

const payloadIdGenerator = (name : string) => {
     const id = uuid();
     return {id, name};
}

Second: ow, the types are starting to hurt my eyes :(

I personally think that redux-action's createAction api is flexible and great, but man , when I look at their types from DefinitelyTyped, it's kind of pain to read.

Skimming the code, I have two immediate thoughts.
First, I don't think this is quite what I had in mind. What I'm really looking for is the ability to define a function that takes whatever parameters I declare, and turns those into the payload. Typically, folks who write action creators turn multiple arguments into a single object payload, or do some calculations in the action creator like generating an ID.

Ah, that's very valid, I didn't think of that. So if the prepareAction method would take multiple arguments, the general direction for the API would be okay?

Second: ow, the types are starting to hurt my eyes :(

Yup :( Mine too :(
Problem is: We can't really touch any exported pre-existing type other than adding more generics at the end because people might be using them. And I might have broken that rule a few times anyways. That's why I meant this still needs a lot of clean-up.
That leads (in addition to this already being very exhaustive types anyways) to weird generic ones, or new types that do almost the same. :/
Also, the distinction between PayloadAction and SliceAction doesn't really help. Do you know why that isn't one type?

I personally think that redux-action's createAction api is flexible and great, but man , when I look at their types from DefinitelyTyped, it's kind of pain to read.

Hm, yeah, that might also be an option. I think the types might only hurt that much because of backwards compatiblity to older TS versions. A problem would be getting a good API for createSlice that doesn't end up in a combinatoric explosion of types (only reducer, reducer with payloadCreator, reducer with metaCreator, reducer with payloadCreator and metaCreator - that might lead to a LOT of types :( )

I have no idea why any particular types exist in this lib atm - I didn't do the TS conversion.
As a general observation: breakages are never good, but this lib is pre-1.0 for a reason.  If it's necessary to break existing types to get things to work better, go ahead.

@markerikson  @tanhauhau
So here's a second definition with the API initially described in #148.
https://github.com/reduxjs/redux-starter-kit/compare/master...phryneas:prepareAction2?expand=1
The TypeScript doesn't look much more readable :/
So, assuming adding the ...args in this branch wouldn't require much effort - what do you think? Which branch is worth continuing?
@tanhauhau - do you want to give it a try so we have a third alternative to choose from?

🤔 let me try..

Anyone had a chance to think through this further?

API-design wise: would it be better to have separate creator functions for payload and meta, or somehow have one function that must return payload and could return meta?

Anyone had a chance to think through this further?

I was still waiting if @tanhauhau comes up with something. But if you decide to go either route I'd be happy to try and simplify one of mine solutions as well.

API-design wise: would it be better to have separate creator functions for payload and meta, or somehow have one function that must return payload and could return meta?

Typing-wise, I still think it would be easier to have one function there instead of two, as there's already enough different conditions flying around.
There could also be a third alternative - what do you think of something like this? Not really sure if I like it myself but may be worth a thought.
https://codesandbox.io/s/createaction-api-experiment-fz0p1

@markerikson @phryneas sorry for keep you waiting, i've come up nothing. 😢
man its hard to type a flexible api

@markerikson @phryneas sorry for keep you waiting, i've come up nothing. cry
man its hard to type a flexible api

@tanhauhau no worries, this one is really hard to type.
@markerikson - have you come up with a decision on which API to settle? I'll happily try to simplify (or at least streamline a bit) the typings for any approach.

Mmm... yeah, let's go with something like (...args) => ({payload, meta?}) for the prepare callback.

Okay, as so much changed with #157 , I completely redid the PR.
I also added a lot more tests, but there are still some cases where I'll need more tests.
I'm afraid I couldn't find a way to type it so that https://github.com/reduxjs/redux-starter-kit/pull/149/files#diff-87542dc1981a518809a25a787c658ee4R75 throws a type error (prepare result & reducer input not compatible). Might try a few other things in the next days though.

Hmm.  FWIW, the "prepare" thing shouldn't be part of createReducer() itself, as it's really a question of what the action creator accepts and returns.  So, just changes to createAction and createSlice should be necessary.

Good point. What would you think about adding something like https://github.com/joonhocho/tsdef as a dependency? That might make the types a lot more readable. (although that's no guarantee, might have to try)

I have no problems with using some of those typedefs if they make sense.  But, I'd hesitate on adding it as a specific dependency.  Seems like that kind of thing would be easily copy-pastable into our own code instead.

@phryneas : think you have time to push this ahead?  I'd love to get it in relatively soon.

@markerikson had a chaotic week but I have some spare hours this evening so I'll put some time in.

No worries, just checking!

@markerikson okay, by now this should be fairly complete.
Now there's just the question of that one failing test. I'd love to have that behaviour of an error being thrown there, but I don't know how to type it - if the reducer and prepare methods have differing Payload types, TS just seems to widen the type to any instead of showing an error.
The only idea to solve that would be to export another enhancedCaseReducer method that essentially looks like

function enhanceCaseReducer<S, P>(
  reducer: CaseReducer<S, PayloadAction<P>>,
  prepare: PrepareAction<P>
): EnhancedCaseReducer<S, PayloadAction<P>> {
  return { reducer, prepare };
}

and people would use it like this:

createSlice({
  slice: 'test',
  initialState: 0;
  reducers: {
    incrementMultiple: enhanceCaseReducer(
      (state, action: PayloadAction<number>) => state + action.payload,
      (a: number, b: number)  => ({payload: a+b})
    )
  }
})

that would be typesafe.
What do you think?

I'd really rather not have any special exports just for TS usage.
Stupid TS question: is it somehow possible to throw an error if a type has turned into any or something?

Stupid TS question: is it somehow possible to throw an error if a type has turned into any or something?

It couldn't distinguish between loosening an inferred type vs. manually typing as any. So if we did something like that, it wouldn't be possible to manually any-type enhanced reducers any more.
So I'd suggest against that.
Maybe I'm just missing something with the typings there - but I've tried about 10 different versions and I'm pretty much out of ideas. Are there other people you can ping on that? Maybe a second opinion could really help.

Tweeted for help, and also paging the usual suspects:  @Dudeonyx , @denisw , @jessidhia

I read the thread and I’ll try to help, but I don’t think I’m understanding the goal here. Why not just do the ...arts form as @markerikson originally suggested and let users figure out how that maps to their action creator type? And what’s an example of code that would have a false positive in the typechecker with the current type implementation (where two different payloads match and infer to any when they shouldn’t match)?

@nickmccurdy : see this non-working types test:
https://github.com/reduxjs/redux-starter-kit/pull/149/files#diff-d3f6ba32c4f3b495b630095111a617e9R162-R186
The prepare callback is returning a number, while the corresponding reducer is expecting a string.  Instead of erroring, this is falling back to any.

That link seems to be broken (just goes to top of PR diff), is this what you're referring to? https://github.com/reduxjs/redux-starter-kit/pull/149/files#diff-d3f6ba32c4f3b495b630095111a617e9R71-R76

bah, that link doesn't work either :)
Direct file link:
https://github.com/reduxjs/redux-starter-kit/blob/8ec73956be2e685a2b7ce0a92544188c88a3b3c0/type-tests/files/createSlice.typetest.ts#L162-L186

It's not widening the type. The types don't pass generic type parameters properly, which disables the inference.
The type of the reducer property is not given in this test code, so it is inferred and matched against the type CaseReducer<S, A>.  With no generic parameter type given for A, it defaults to PayloadAction because of  A extends PayloadAction. With no generic parameter type given to PayloadAction, it defaults to any because of P = any.
I believe you should be able to do something like this: type EnhancedCaseReducer<S, A extends PayloadAction<P>, P> = {

On an unrelated note regarding maintenance, the types.test.ts implementation makes it difficult to troubleshoot what type error is happening in the tests. Instead of running TypeScript declaration tests dynamically in a test framework, I'd recommend simply running tsc on them. It will give the appropriate status code to fail the build if there are type errors or assertion failures in comments.

It's not widening the type, it's using the default type parameter value of any because no type parameter is given to be inferred.
The type of the reducer property is not given in this test code, so it is inferred and matched against the type CaseReducer<S, A>. With no generic parameter type given for A, it defaults to PayloadAction because of A extends PayloadAction. With no generic parameter type given to PayloadAction, it defaults to any because of P = any.
type EnhancedCaseReducer<S, A extends PayloadAction<P>, P> = {

Hm, while that makes sense, it doesn't seem to be working for me - could you share a working example?

Sorry, this isn't nearly as simple as I thought. I've been trying to pass all these types in createSlice.ts so they wouldn't default to any, and I seem to have the same issue.

@dragomirtitian solved this - https://twitter.com/TitianCernicova/status/1155549716777709570
Thank you so much Titian!

Yay!  Busy with some other stuff atm, but I'll have to try it out in the next day or two to see how it behaves.

No hurry :)

Welp, I seriously have no "real" feedback to offer on this PR.  The type shenanigans y'all are capable of are well and truly beyond me.
But, the examples and the tests look pretty comprehensive, so I'm going to assume this actually works at this point.
Thank you so much for putting this one together!  Lots of folks have been asking for this.

Smacking the button!


RPManagementClient's XML documentation for ctor should have

There should be  documentation for the ctor. Particularly with the very generic name host being used.
`
///  Initializes a new instance of ComputeManagementClient.
public ComputeManagementClient(string host, string subscriptionId, TokenCredential tokenCredential, ComputeManagementClientOptions options = null)
{
_options = options ?? new ComputeManagementClientOptions();
_tokenCredential = tokenCredential;
_host = host;
_subscriptionId = subscriptionId;
}
`

Let me add something more on this. The XML method doc should also list exceptions thrown by the lib.


Fix configuration of second data source for embedded Tomcat

Rationale
The replacement strings in application.properties should match what's in labkey.xml so that we can switch to embedded more easily.
Related Pull Requests

https://github.com/LabKey/server/pull/30

Changes

Fix some replacement strings in application.properties

Verifying on TeamCity: https://teamcity.labkey.org/buildConfiguration/LabKey_EmbeddedTomcat_Internal_InternalSuites_RedshiftPostgres/2878878


DHCP wire module

Implement a wire/dhcp module as proposed in https://github.com/m-labs/smoltcp/issues/63.

I implemented basic parsing and emitting of packets and DHCP options. I'll add a few more essential options, but I don't think that we need the rest right now.

@whitequark I think the most important options are implemented now (message type, requested ip, server identifier). Are there any other options that we need? Other things that I should add/change?

Thanks for the review! I think I addressed all your comments.

@whitequark Is there anything I should improve to get this PR merged?

Added tests and rebased on top of master. I try to add the method documentation soon.

Thanks! FYI the tests are failing.

Due to the addition of proto-ipv6 since DHCP is IPv4 only the module and pub use should probably be #[cfg(feature = "proto-ipv4")]. Speaking of that, should the module be dhcpv4?

Yes to both.

@whitequark I added the cfg gate, renamed the module, and documented the methods. I also rebased on master and squashed the commits.

This looks pretty good to me!
@phil-opp I think you didn't squash the commits after all.
@dlrobertson r? anything I've missed?

Oh, I just thought that I leave the latest commits unsquashed to make the review easier.
I rebased and squashed again, but left @little-dude 's work (to keep author information) and the change to the enum_with_unknown macro (a change that has not much to do with dhcp) separate. I can squash them into a single commit if you like.

@m-labs-homu r+

:pushpin: Commit fe3f2d2 has been approved by whitequark

:hourglass: Testing commit fe3f2d20f4d51e9070ea1b08361942a0ab750875 with merge<PHONE_NUMBER>c2cc814e9c22da69acf9e52571dd56...

:sunny: Test successful - status-travis
Approved by: whitequark
Pushing<PHONE_NUMBER>c2cc814e9c22da69acf9e52571dd56 to master...


Allow displayPriority and collisionMode to pass-through to MKAnnotationView.

I needed to be able to set displayPriority and collisionMode of the MKAnnotationView that gets built from the ViewMapAnnotation.
This PR exposes these values as properties of ViewMapAnnotation, and MKMapAnnotationView sets them on the view during the setup process.

@pauljohanneskraft Is there anything I can do to help get this, and a few other PRs, merged?

Hi @pauljohanneskraft  ! I have this need too, what's blocking this MR ?
Thanks in advance


[Embedding] DartPad embedding using code blocks is broken

What happened?
Initially, I was using gists for embedding the code samples I am creating. Unfortunately, unauthenticated requests has a rate limit of 60 / hour.
Adding authentication layer adds extra complexity for the participants who want to try out the code and resources.
So I opted to use code blocks, as described in this wiki, to overcome the rate limit issue.
Problem is there were tags generated on the embedded Dart code via code blocks:
</widget></widget></widget></pageitemview></statefulwidget></widget></widget></widget></widget></product></myhomepage>

I've read that embedding using code blocks is fairly new, but it's best if we could track down the current issues encountered.

Steps to reproduce problem

Embed widget code inside Dart using code blocks using the class language-run-dartpad:theme-dark:mode-flutter:split-75:run-true
Run the html website

Additional info
Input via HTML and output Dart code:
https://gist.github.com/joshuadeguzman/aaeb682ae4f84f44c301804621ea8879
Intro talk resource:
https://joshuadeguzman.net/talks/flutter-everywhere
Attachments

Browser
Browser: Google Chrome
Version: 81.0.4044.138 (Official Build) (64-bit)
Are you using any extensions/plugins that affect website behavior
(particularly those that affect iframes, such as ad blockers)?
No.
Are there any warnings or errors in your browser's JavaScript console?
If so, paste them below:
Using gists
Loading the iframes:
Access to XMLHttpRequest at 'https://api.github.com/gists/db904ce7cf1fa7602bb5c519ab05d8f2' from origin 'https://dartpad.dev' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

After using code blocks
Loading the iframes:
DevTools failed to load SourceMap: Could not load content for https://dartpad.dev/primer.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

Tapping Run:
UPDATED
Generated dart code lead from code blocks is not runnable due to the malformed/generated widget tree:
Error compiling to JavaScript:
Instance of 'minified:h_'

Old, related to #1554:
Access to XMLHttpRequest at 'https://dart-services.appspot.com/api/dartservices/v2/compileDDC' from origin 'https://dartpad.dev' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
embed_flutter.dart.js:1166 Error
    at Object.xg (embed_flutter.dart.js:2238)
    at k9.$1 (embed_flutter.dart.js:13010)
    at rG.fk (embed_flutter.dart.js:7082)
    at rg.$0 (embed_flutter.dart.js:6643)
    at Object.eD (embed_flutter.dart.js:1472)
    at Z.c_ (embed_flutter.dart.js:6545)
    at Object.xO (embed_flutter.dart.js:1538)
    at pE.$1 (embed_flutter.dart.js:6723)
    at qU.$1 (embed_flutter.dart.js:9759)
    at Dw (embed_flutter.dart.js:516)
embed_flutter.dart.js:9060 POST https://dart-services.appspot.com/api/dartservices/v2/compileDDC net::ERR_FAILED

Machine
Operating system: MacOS Mojave
Version: 10.14.6
Your code
https://gist.github.com/joshuadeguzman/aaeb682ae4f84f44c301804621ea8879#file-input_via_html-txt
DartPad's output
https://gist.github.com/joshuadeguzman/aaeb682ae4f84f44c301804621ea8879#file-output-dart

I believe this is related to https://github.com/dart-lang/dart-pad/issues/1554

Hey @domesticmouse, thanks for dropping by.
The previous logs were actually related to the outage last night. I have added the new logs for the malformed generated code which could be solved easily by fixing the code, as a workaround, in the embedded DartPad itself. Although the workaround would add more complexity for some just to run the pad.
Let me know your thoughts. Thank you!

So I downloaded the dart-services repo on my machine and ran the service locally. I made a POST request via Postman to the analyze endpoint and can confirm that the CORS headers are available in the response.

The issue seems to be a problem with the server which seems to be working now.

I seem to be having an issue with the servers going sideways after 15 odd hours of uptime. I've just added a forced-reboot after four hours to mitigate this situation. Hopefully.

@joshuadeguzman, do you mind having another look at your page to see if the problem persists?
I'm currently able to use each of the examples found here:
https://joshuadeguzman.net/talks/flutter-everywhere
Hopefully this was just a side effect of the server problems we had earlier this week. If not, though, we'll keep investigating.

Hi @RedBrogdon, thanks for looping in. Yes, since I will be using it for the talk tonight I had use some gists temporarily. Had to use code blocks for the Dart exercises (1-3), and use gists for the Flutter (4-7) ones. Hope this helps. Thank you!

I added a reproducible output:
https://joshuadeguzman.net/talks/flutter-everywhere/test-1555
Source code:
https://gist.github.com/joshuadeguzman/93ccbd7bf6f65b269b7a6da66f01a6d3
Thank you @RedBrogdon!

I'll try looking into it as well over the weekend.

If I strip the HTML wrappering the Flutter code in that gist, it works.

Hey @joshuadeguzman, just to circle back on this, here's your gist, lightly edited. And here's it in DartPad.
Let me know if there is anything else I can do to help. Thanks!

Thanks @domesticmouse! Yeah, it works fine really on gists + dartpad. Unfortunately, I guess it still broken using code blocks.

But yeah, I just encountered this one because I want to skip the authorisation and rate limit issues.
Should we still keep this issue open though as for the code blocks issue reference in the future?

Ahh, my bad. I missed that you were trying to get inject_embed.dart.js to work properly. I'll assign this to @johnpryan who knows way more about this tech than I do. Thanks!

No worries @domesticmouse, sorry if I wasn't clear about embedding (injecting) code blocks. But hey, thanks for helping out!

Thanks for all of the discussion on this issue.
The newest DartPad frontend supports embed injection in a different way, and while it's not officially supported, https://github.com/dart-lang/site-shared/tree/main/packages/inject_dartpad has some details on how to use it.
If you have any issues or questions with embeds using the new frontend, please open a new issue and I'd be happy to help. Thanks!


[Bug]: [Project API] document API is throwing an exception for generated IDL client

Description
I generated an IDL client and reloaded the VSCode window. When I was trying to make a change in the generated client the following exception was thrown.

https://github.com/ballerina-platform/ballerina-lang/blob/656430fde21a51e5c01193a72127baf670bc4efe/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/workspace/BallerinaWorkspaceManager.java#L1108
Here we are trying to invoke the document method and get the document for the path of the generated idl client. It throws an exception. Due to this the project can't be compiled.
Steps to Reproduce
Mentioned above
Affected Version(s)
2201.3.0-stage
OS, DB, other environment details and versions
No response
Related area
-> Editor
Related issue(s) (optional)
No response
Suggested label(s) (optional)
No response
Suggested assignee(s) (optional)
No response

@malinthar tested the scenario with changes in and got the following output:

Ideally a generated file should be in read-only mode and the user should not be able to edit it.

@malinthar tested the scenario with changes in #38118 and got the following output:
[Info  - 1:49:49 pm] Operation 'text/didChange' {fileUri: 'file:///home/user/test/idlPlugins/client_decl_test/generated/myapi/idl_client.bal'} updated
[Info  - 1:49:51 pm] Operation 'text/didChange' {fileUri: 'file:///home/user/test/idlPlugins/client_decl_test/generated/myapi/idl_client.bal'} updated
[Error - 1:49:55 pm] Operation 'text/completion' failed! {uri: '/home/user/test/idlPlugins/client_decl_test/generated/myapi/idl_client.bal', [17:9], error: 'Semantic Model Cannot be Empty'}
java.lang.RuntimeException: Semantic Model Cannot be Empty
	at org.ballerinalang.langserver.contexts.AbstractDocumentServiceContext.currentDocImportsMap(AbstractDocumentServiceContext.java:186)
	at org.ballerinalang.langserver.completions.providers.AbstractCompletionProvider.getModuleCompletionItems(AbstractCompletionProvider.java:360)
	at org.ballerinalang.langserver.completions.providers.AbstractCompletionProvider.getTypeDescContextItems(AbstractCompletionProvider.java:325)
	at org.ballerinalang.langserver.completions.providers.context.BlockNodeContextProvider.getCompletions(BlockNodeContextProvider.java:95)
	at org.ballerinalang.langserver.completions.providers.context.FunctionBodyBlockNodeContext.getCompletions(FunctionBodyBlockNodeContext.java:48)
	at org.ballerinalang.langserver.completions.providers.context.FunctionBodyBlockNodeContext.getCompletions(FunctionBodyBlockNodeContext.java:39)
	at org.ballerinalang.langserver.completions.util.CompletionUtil.route(CompletionUtil.java:125)
	at org.ballerinalang.langserver.completions.util.CompletionUtil.getCompletionItems(CompletionUtil.java:81)
	at org.ballerinalang.langserver.completions.BallerinaCompletionExtension.execute(BallerinaCompletionExtension.java:65)
	at org.ballerinalang.langserver.completions.BallerinaCompletionExtension.execute(BallerinaCompletionExtension.java:40)
	at org.ballerinalang.langserver.LangExtensionDelegator.completion(LangExtensionDelegator.java:124)
	at org.ballerinalang.langserver.BallerinaTextDocumentService.lambda$completion$0(BallerinaTextDocumentService.java:149)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

@azinneera  Looping in @dulajdilshan. Semantic model seems to be empty in this scenario. Hence, can't provide completions.

Ideally, a generated file should be in read-only mode and the user should not be able to edit it. Can we add this improvement?

Yes we can restrict edits

@azinneera Tried with the fix. I still get the issue when opening the document. After it's opened, when I do a change the issue is not there.

Is this document opened before issuing a compilation? Generated IDL client files are not loaded when loading the project. It is only resolved during package resolution.

Ideally, a generated file should be in read-only mode and the user should not be able to edit it. Can we add this improvement?

Then we can close https://github.com/ballerina-platform/ballerina-lang/issues/38017

@azinneera Tried with the fix. I still get the issue when opening the document. After it's opened, when I do a change the issue is not there.

Is this document opened before issuing a compilation? Generated IDL client files are not loaded when loading the project. It is only resolved during package resolution. The reason is because if the user has removed the IDL import, then this client module is not necessary to be loaded into the package though its there in the FS.
Won't this be fixed if the file is in read-only mode?

Let's refactor this from the LS side to prevent accessing the document before it's created

Closign as fixed with https://github.com/ballerina-platform/ballerina-lang/pull/38272


⚠ Secret Website 4 has degraded performance

In 5a8be97, Secret Website 4 ($SECRET_WEBSITE_4) experienced degraded performance:

HTTP code: 200
Response time: 15713 ms

Resolved: Secret Website 4 performance has improved in d09d2e3 after 9 minutes.


Enhanced debugging and troubleshooting abilities for the OSM control plane

Please describe the Improvement and/or Feature Request
Higher fidelity of logging on control plan components to enhance debugging scenarios
Scope (please mark with X where applicable)

New Functionality          [X]
Install                    [ ]
SMI Traffic Access Policy  [ ]
SMI Traffic Specs Policy   [ ]
SMI Traffic Split Policy   [ ]
Permissive Traffic Policy  [ ]
Ingress                    [ ]
Egress                     [ ]
Envoy Control Plane        [ ]
CLI Tool                   [ ]
Metrics                    [ ]
Certificate Management     [ ]
Sidecar Injection          [ ]
Logging                    [ ]
Debugging                  [X]
Tests                      [ ]
CI System                  [ ]
Project Release            [ ]

Possible use cases
Troubleshooting scenarios where OSM policies are not being applied or applied correctly.

Pretty much the same as https://github.com/openservicemesh/osm/issues/2879. Closing this one in favor of https://github.com/openservicemesh/osm/issues/2879.


Update node.js

Hi,
I'm running homebridge with homebridge ui from oznu docker container in my qnap nas.
I updated the config ui to latest version (4.23.0) and tried the "sudo hb-service update-node" command.
The result was: "Your version of Linux is not supported by this command"
Is docker container not supported?
Thank you

Hi @PhoenixPT,
It is not. Check out: https://github.com/oznu/homebridge-config-ui-x/issues/745#issuecomment-646606339


"New Home Specialists" section is blank

Can we add logic to remove this section/header if no Home Specialists are associated with the plan?
https://main--hubblehomes-com--aemsites.hlx.page/new-homes/idaho/boise-metro/kuna/sera-sole

@varunmitra I have this already fixed in my latest PR.

Resolved


Angular Library produced NPM package that offers imports from public-api and lib

🐞 bug report
Affected Package

Is this a regression?

Description
After creating a new Angular library using the cli, and adding one exported class within the lib folder, which public-api.ts file exports, consuming applications are able to reference public-apit.ts as well as the lib folder as import locations.

🌍  Your Environment
Angular Version:
Angular CLI: 7.3.9
Node: 8.11.3
OS: win32 x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.13.9
@angular-devkit/build-angular      0.13.9
@angular-devkit/build-ng-packagr   0.13.9
@angular-devkit/build-optimizer    0.13.9
@angular-devkit/build-webpack      0.13.9
@angular-devkit/core               7.3.9
@angular-devkit/schematics         7.3.9
@angular/cli                       7.3.9
@ngtools/json-schema               1.1.0
@ngtools/webpack                   7.3.9
@schematics/angular                7.3.9
@schematics/update                 0.13.9
ng-packagr                         4.7.1
rxjs                               6.3.3
typescript                         3.2.4
webpack                            4.29.0

Anything else relevant?

Hi, this should be be fixed by https://github.com/angular/angular-cli/pull/1634
For existing projects, you can remove the wildcard path mapping from your workspace tsconfig.
Example from:
"foo": [
  "dist/foo"
],
"foo/*": [
  "dist/foo/*"
]

to
"foo": [
  "dist/foo"
],


Unable to set group to the custom created users

I created groups and then i tried to assign them to my custom created users.After assigning the user with respected group and then saving all the changes,When i try i open that edit user page again I don't see the group getting ticked mark in the edit page.
Is this a backend bug ?

{
"data": {
"id": "d104ce00-94ec-4a68-ab14-a8daf5c328ff",
"attributes": {
"username": "rohan",
"email"<EMAIL_ADDRESS>"first_name": "rohan",
"last_name": "poudel",
"is_active": true,
"is_staff": true,
"is_superuser": false,
"date_joined": "2023-03-11T06:21:47.241940+01:00",
"perm_codenames": []
},
"relationships": {
"home_folder": {
"data": {
"type": "folders",
"id": "0721d7a5-7560-41d9-bbee-6d66f1d68076"
}
},
"inbox_folder": {
"data": {
"type": "folders",
"id": "f557e317-4ce2-4419-824c-499d5829f526"
}
},
"groups": {
"data": []
}
},
"type": "users"
}
}
This seems to be the patch request send from frontend after making necessary changes

After submitting these forms ,When i go to edit that user again

@ciur any comment?

yes, sounds like a bug. I am not sure on which side it is (backend/frontend) though.


Breadcrumbs not accessible from the Flurry Website

Describe the bug
When using +[Flurry leaveBreadcrumb:] to log breadcrumbs the breadcrumbs don't appear anywhere in the Crashes tab on the Flurry website.
We switched to Flurry Crashreporting because we thought breadcrumbs can help us track down hard to find crashes. We verified that the breadcrumbs are logged (the method on Flurry is called), but there is no way to see them on the Website and hence the breadcrumbs are useless for us.
This is a very serious drawback for us and it'd be nice if you could shed some light on this. Maybe they are just hidden somewhere and we can't find them?
This Bug is About

[ ] Integration
[x] Analytics
[ ] Ads
[ ] Messaging/Push
[ ] IAP
[ ] Remote Configuration
[x] Flurry Website/Dashboard
[ ] Other

Platform

[x] iOS
[ ] tvOS
[ ] WatchOS

Environment

Flurry SDK: 10.0.2
XCode: 11.2 (11B52)
iOS: 13.2

To Reproduce
Steps to reproduce the behavior:

Integrate Flurry in an app
Call +[Flurry leaveBreadcrumb:] to log breadcrumbs
Try to find them in the Crashes tab on the Flurry Website

Screenshots
Flurry Website:

This has been fixed over the weekend.


Search method

Hello @sergkr ,
Thank you for this library!
I was wondering why there is no search method implemented?
something liketree.search(Rect(0, 0, 300, 300)) would return all entires
Thank you,
Kiru

This library is interesting, but I agree that a search method would be most helpful! It's a bit difficult to use without one.

I use the following methods right now to get the matching nodes:
def visit_child(node, rect):
    if(node.is_leaf):
        yield node

    for entry in node.entries:
        intersection = entry.rect.get_intersection_area(rect)
        if(intersection > 0):
            yield from visit_child(entry.child, rect)

def search(tree, rect):
    yield from visit_child(tree.root, rect)

Sorry for the delay - finally got some time to work on this today.
I just pushed a new version (0.2.0) which adds querying methods. If you're able to give these a try, let me know how they work for you. I added a new "Querying" section to the README with some examples.
I'll go ahead and close this out, but let me know if you see any issues with the implementation.

Hello @sergkr
Thank you very much for the quick implementation. I didn't expect it to get an updated this fast.
The new Point class is interesting. I was expecting to be able to add a new Point as well, such as:
my_tree.insert("A", Point(10, 10))
Doing so breaks the get_bounding_box() method
my_tree = RTree()
my_tree.insert("A", Point(1, 1))
my_tree.insert("B", Rect(3, 3, 4, 4))
print(my_tree.root.get_bounding_rect()) # error 'Point' object has no attribute 'union'

I tested the query method and found this unexpected behaviour:
my_tree = RTree()
my_tree.insert("A", Rect(1, 1, 1, 1))
my_tree.insert("B", Rect(3, 3, 4, 4))
print(my_tree.root.get_bounding_rect())
print(list(my_tree.query(my_tree.root.get_bounding_rect())))

The above snippet prints:
Rect(1, 1, 4, 4)
[RTreeEntry(0x136c817f0, data=B)]

This is intended as you describe: "When querying by point, note that points that lie on the border (rather than the interior) of a bounding rectangle are considered to intersect the rectangle."
Is there a way to overwrite this? In the above example, intuitively I would expect to get all objects in the rtree.
Thank you,
Kiru

Thanks @kiru - I created 3 issues based on your comment, and will tackle them separately:
#5: Allow inserting Point entries
#6: Handle "degenerate" rectangles
#7: More flexible query options (equals, contains, within, intersects, overlaps, touches)
Of these, the last one will almost certainly be the most challenging (and also the most interesting). I think I'm done for today, but I'll try to pick this back up next weekend.
If you have any input, just leave a comment where appropriate.

Thank you very much!


Added info on ostap

Have a look and let me know if you have any other suggestions, @VanyaBelyaev.

thank you very much! everything is fine.