Discrepancy between routes and cached routes with double slashes

Laravel Version: 7.4.0
PHP Version: 7.4.3
Database Driver & Version: -

Description:
There is a discrepancy between routes and cached routes when we have double slashes in the url.
Steps To Reproduce:
app('router')->get('/foo', 'Controller@foo');

http://<IP_ADDRESS>//foo works (same for ...///foo or any arbitrary number of slashes)
Run ./artisan route:cache
http://<IP_ADDRESS>//foo does not work and shows a misleading exception
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
The GET method is not supported for this route. Supported methods: HEAD.

But HEAD is also a 405.
Not having consistency between routes and cached routes is dangerous, we had a typo with a domain.com//foo somewhere in the front-end code which was working fine on development but broke on production.

To define a route, app('router') is not recommended, use Route Facade instead and it's  consistency. Also, rfc1738 recognizes one and only one slash as path separator in http urlpath part. That is to say, "foo//bar" means "foo / /bar" where "/bar" is a hsegment. You can't expect arbitrary number of slashes in the url work the same.

@mo3000 using Router::foo or app('router')->foo is the same, in both case you use the container, I simply try to never use facades for many reasons.
Right for rfc1738, I would prefer domain.com//foo not to work but I'm fine as long as it's consistent between the two options.

I have tested laravel 7.4.0, 7.3.0 in "php artisan serve" on mac, works fine.  Now I'm a little confused. Any further info may help others reproduce this. @BafS

I know it's not irrelevant to this issue but when I was looking into route implementation I found this code in RouteFileRegistrar.php:
    /**
     * Require the given routes file.
     *
     * @param  string  $routes
     * @return void
     */
    public function register($routes)
    {
        $router = $this->router;

        require $routes;
    }

where "$router" is assigned but never used because it's local.  It looks suspicious to me.

@mo3000
in routes/web.php
Route::get('/foo', 'Controller@foo');

in app/Http/Controllers/Controller.php
class Controller extends BaseController {
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    public function foo() {
        return 'foo';
    }
}

With http://<IP_ADDRESS>:800//foo

./artisan route:cache && ./artisan serve: Does not match
./artisan route:clear && ./artisan serve: Does match

You can reproduce only if it's the root path, domain.com/foo//bar is consistent

I know it's not irrelevant to this issue but when I was looking into route implementation I found this code in RouteFileRegistrar.php:
    /**
     * Require the given routes file.
     *
     * @param  string  $routes
     * @return void
     */
    public function register($routes)
    {
        $router = $this->router;

        require $routes;
    }

"$router" is assigned but never used because it's local (commit 4cf3d30). It looks suspicious to me.

That is there on purpose, it enables you to write (in your routes file):
$router->get('/foo', 'Controller@bar');
instead of:
Route::get('/foo', 'Controller@bar');
And if you put at the top:
use Illuminate\Contracts\Routing\Registrar;

/** @var Registrar $router */

you get nice autocompletion in your IDE.

http://<IP_ADDRESS>//foo is an incorrect url and shouldn't work in the first place tbh.

@driesvints I agree but please keep the issue open then because it does work in dev mode :)

@BafS there's no need to keep an issue open when it's not a bug.

http://<IP_ADDRESS>//foo is an incorrect url and shouldn't work in the first place tbh.

It does work in dev mode, it does not work with cached routes; it's inconsistent.


update ruby gem version to 0.1.0

for releasing a new version by ruby gem because of this bug

duplicated by #115


Search does not tell you if it did not find anything

If you enter a TX or address in the search and the explorer does not find anything it does just nothing.
I was quite confused at first.
May be there should be a page telling you that nothing was found?

Don't you see this?

Now I understand. I never really noticed the blue thing because of my content complete. LOL

And on top of that if I click a Link I also do not see anything.
https://explorer.ark.io/tx/f01f8db73fce0aee4901f4255f276bb44d806d4e2373b011ccdf7975c6f0a832

@Jarunik What browser and OS are you using, so it can be tested in your situation?
Thanks!

Chrome, Windows 10

Hi @Jarunik
Is that a public key link?  Why are you trying to use that link?  Is it listed somewhere?
Thanks

It is an account from the reddit lottery and I wanted to check if it is valid.


issue with hitTest()  after rotate marker

i modified marker by using marker.setRotation() but now if i click on the marker, the InfoWindow does not show up. If i click on the original marker area , the InfoWindow shows.
so i think the hitTest() function is not working correctly

That's right. This is mentionned as a TODO in the Marker javadoc.

related issues #459 and #460

there is what i get

Just PR'ed #1115, that fixes the issue and optimizes the drawing performances.
@spyhunter99 Where do you expect the info window to appear with a rotated icon?

hmm well, the pointy part of the info window should probably point to the anchor point of the marker, i.e. the lat/lon that the marker represents

@spyhunter99 Actually I believe there's an anchor for the information window too. It's just that it may look strange on a rotated marker, but I'll implement that too.

@spyhunter99 Just PR'ed the final version, where the info window takes into account the Marker bearing

sweet i'll put it down, good great work @monsieurtanuki

it's perfect

@spyhunter99 Thanks!


Fix setGLSLVertexBufferAt for Context3DVertexBufferFormat.BYTES_4

I don't think numBytes is needed here (it's always 4 in all cases), I removed that as well.

Thanks!


move react to dev deps

Reduce bundle size by assuming client has react installed. Move to dev deps 👍🏿

Would this achieve the same thing as what's being done here: https://github.com/esr360/pax5/blob/master/webpack.config.babel.js#L16 ?
Also this got me thinking....is this what 'peerDependencies' is for?

Yep exactly the same thing, pointless PR 😬
Dunno about peerDependencies tbh, sounds very similar but this blog post I just read (https://nodejs.org/en/blog/npm/peer-dependencies/) was really long winded and I'm still unsure

dependencies
devDependencies
optionalDependencies
peerDependencies

This isn't at all confusing.


Two factor auth breaks fork

Fork doesn't recognize the 2nd factor hint and blows up with something obscure like:
$ heroku sudo fork -a myapp
Failed to fork app myapp to myapp-633.

 !    WARNING: Potentially Destructive Action
 !        To proceed, type "myapp-633" or re-run this command with --confirm myapp-633

>

/cc @jacobian @pedro

Just ran into this. Anybody come up with workarounds?

I can look into fixing it with the fork replacement

actually this brings up something possibly important. @jacobian @brandur are people forking under sudo?

@dickeyxxx I would like to fork with sudo (for support tickets).

@friism just wanted to point this out, I'll have to take a look at this issue next week

@dickeyxxx do you need any help here?

working on it, I need to add 2fa into v4

any updates on this?  This is causing problems for a number of scripted deployments I have.

any updates on this?  This is causing problems for a number of scripted deployments I have.

nothing yet, I need to fix the new fork implementation here https://github.com/heroku/heroku-fork and include the fixes around 2fa

this is now fixed


Update Index.md

Made and updated the table properly
Issue
#6

Thank you. I reviewed your PR already. Here's my reply to your commits
Link: https://github.com/surpathcommunity/hacktoberfest-philippines/issues/6#issuecomment-774889897


Chunk Corruption After Power Cut to Server

I had my server, which runs c2me, get shut down last night because of a power outage. When I restarted the server today I noticed the logs were filled with [15:06:27] [C2ME serializer worker #3/ERROR]: Chunk file at [63, 36] is in the wrong location; relocating. (Expected [63, 36], got [62, 38]).
Going to that location in the world I noticed that the chunks around there were scrambled up. I attached some of the region files with the problematic chunks . This is after it is scrambled so im not sure how helpful it would be but they are attached anyways. Regions. I also had some that were going to be scrambled but werent loaded yet, so here is that file: region.
This was 1.17.1 fabric in the 0.2.0 alpha5. I also run carpet and the spawn chunks are off, however this hadnt caused issues for the month or two ive been using c2me. I also have repurposed structures 2.3.3. The config file (converted to txt) and logs are also attached in case that helps.
c2me.txt
2021-10-08-1.log.gz

How is this a c2me issue?

How is this a c2me issue? It sounds like c2me didnt cause it.

The chunks wouldnt be corrupted and jumbled up if the power cut out with just vanilla. Its the only mod I have on the server that I think could've caused it. It also says its relocating chunks with C2ME serializer in the logs, so that seems like confirmation that c2me caused it to me.

The chunks wouldnt be corrupted and jumbled up if the power cut out with just vanilla.

Thats blatantly false.

C2ME serializer in the logs, so that seems like confirmation that c2me caused it to me.

Its a c2me worker thread running the vanillia serializer. The error is coming from vanillia

Can confirm this. You just need to force off the server, then some of you chunks (.mca file) will be broken.


azure label for system node pool appearing in GCP main.tf file

This line should probably be updated/removed
"node_labels" = merge(var.tags, var.default_nodepool_labels,{"kubernetes.azure.com/mode"="system"})
it does not seem to hurt but I checked and my GKE system nodes get this "azure" label.

This is correct. The SAS software requires this label on the default node pool.


Configuration as TypeScript

Is your feature request related to a problem? Please describe.
YAML is ... not great (politely speaking).
Describe the solution you'd like
Because we already have types for the test file, wouldn't it be great to write the test files in TS directly?
Describe alternatives you've considered
Writing my own generator from TS -> YAML.
Additional context
Can use Liftoff to support any config file type: https://www.npmjs.com/package/liftoff
Tools like gulp and plopjs use it
And many other projects: https://www.npmjs.com/browse/depended/liftoff

Hi @moltar, thanks for your suggestion! We actually support TypeScript configurations already. You can check out a basic example here: TypeScript Config Example. If you have any specific improvements or additional features in mind, I’d love to hear your thoughts. Let us know if you have any questions!

Perfect! Works great. Thank you!
Here's a tsx based example too:
NODE_OPTIONS="--import tsx" promptfoo eval -c src/promptfooconfig.ts

Thanks for the link to liftoff, looks pretty cool


Question: How to mock (simulate) data access layer for unit testing for Model<> Active Record ?

In codebase where model classes use

public class SomeDomainClass extends Model {

How to mock (simulate) data access layer for unit testing?
当前使用版本(必填,否则不予处理)
com.baomidou:mybatis-plus-extension:3.4.1
该问题是如何引起的？(确定最新版也有问题再提!!!)
重现步骤(如果有就写完整)
报错信息

Asked on https://stackoverflow.com/questions/66756355/question-how-to-mock-simulate-data-access-layer-for-unit-testing-for-model

Junit 吧 mock 没空去研究了

Please keep this issue open until answered/solved.


Set root_tenant when creating miq_group for user factory

When calling :user_with_group pass in the root tenant

@kbrock @gmcculloug
Please review

:+1:  @kbrock Please merge if you are ok with this change.


Suggestion

Why not just "http://ifconfig.me" Method GET  to discover the public ip

Are you kidding?  ifconfig.me does not even have an IPv6 endpoint.
Moreover, if is just a standard STUN-style discoverer (with a bunch of other scraped data, too, which is superfluous for this tool).  It also does not appear to be machine-readable.
This is why we use jsonip.io for this tool.  It handles both IPv4 and IPv6, and it outputs the data in JSON.
Beyond that, this is a tool for cloud-based resources, too, which is why we integrate with the cloud-suppliers' APIs.


Add mention of library used for Timepicker on demo page

Fix #5247

@Dogfalo says it is already documented in v1.0


get_global_mouse_position() is shifted in the viewport's transform

Godot version
4.0rc1
System information
Linux
Issue description
This is a copy of https://github.com/godotengine/godot/issues/30215, as it seems it was incorrectly closed (or there's a regression).
When I use the get_global_mouse_position() in a normal scene, the coordinates are right, but when I use in a scene that uses a viewport container to render pixelated the scene, the coordinates are incorrect.
Steps to reproduce
Add a viewport node with a non-1:1 scale. Note that get_global_mouse_position returns the wrong coordinates.
Minimal reproduction project
scale-bug-4rc1.zip

# mouse = to_local(mouse)  # no effect?

In your MRP, it is correct, that to_local has no effect in this case, because TileMap has a default transform.
to_local is not affected by the viewport.
The SubViewport-setup in your MRP looks complicated. Doesn't look like a trivial issue to investigate.

Somehow you managed to bring the SubViewport into an inconsistent state in the editor.
SubViewportConteiner.stretch == true implies that SubViewport.size is set automatically by the SubViewportContainer.
However in your MRP you have

SubViewportConteiner.size == (2560x1440)
SubViewportConteiner.stretch == true
SubViewport.size == (640x360)

This will cause problems, as described in #66906, which fixed a different way to create an inconsistent state.
The following topics might also be interesting for you.
related to #61301
related to godotengine/godot-proposals#6221
related to godotengine/godot-proposals#1666
Currently the method that brings you as close as possible to your wanted functionality is to set in your MRP SubViewportContainer.stretch_shrink = 4

This will automatically scale the SubViewport to the size of 1/4 of the SubViewportContainer.
If this doesn't fill your requirements, I would like to suggest, that you describe your needed functionality in the form of a proposal in https://github.com/godotengine/godot-proposals

Thanks, I'll mess around and see if that fixes the mouse coordinates. This particular project was created in version 3.something then migrated to 4 which might explain how it got into such a weird state.


Ratify branching and release strategy

What would you like to be added?
Ratify should publish a document that outlines branching strategy,  as wells as patches and support criteria.
Anything else you would like to add?
No response
Are you willing to submit PRs to contribute to this feature?

[ ] Yes, I am willing to implement it.

JFYI, we are defining the release and branch strategy, and release support plan in Notation and ORAS. Maybe they could be used as references for Ratify.

To add to this, I had a discussion with Gatekeeper maintainers about their release strategy:
Gatekeeper releases a minor version every 3 months. Each release will have a beta and RC release prior to stable. Refer to this doc for detailed info on versioning: https://github.com/open-policy-agent/gatekeeper/blob/master/docs/RELEASE.md
Patch releases are typically cut every month if there are changes. All security fixes (even those raised by dependabot) are manually cherry-picked to a patch branch. Each month, if there are patch changes, there's a patch release. emergency patches can be released but that's at discretion of maintainers.
Here's the release management doc: https://github.com/open-policy-agent/gatekeeper/blob/master/docs/Release_Management.md


No compiler error when type is defined inside a function

Bug Report
🔎 Search Terms
I don't know how to search for it, these are a few things I tried. I apologize if its a duplicate, or if I am misunderstanding how the types work.

No compiler error when type is defined inside a function
No compiler error when function type is defined

🕗 Version & Regression Information
v4.5.4 possibly others too
⏯ Playground Link
Playground Link - Check Line 10
💻 Code
type SomeType = "listen" | "orNot";

const foo = (value: SomeType) => { console.log(value) };

interface AnotherType {
  anotherValue?: SomeType
}

const lorem: (value: AnotherType) => void = ({
  anotherValue = "dam", // this should be a compiler error too?!
  // thisIsACompilerError: string
}) => {
  anotherValue = "anythign";
  console.log(anotherValue)
  // foo(anotherValue || 'listen');
}

🙁 Actual behavior
It is not a compiler error.
🙂 Expected behavior
It should be a compiler error, as the following works fine,
const lorem: (value: AnotherType) => void = ({
  anotherValue = "dam",
  // thisIsACompilerError: string
}: AnotherType) => {
  anotherValue = "anythign";
  console.log(anotherValue);
}

From the point of view of a user of lorem, there’s nothing wrong with the function you’ve assigned to it.  The implementation has to deal with the fact that value.anotherValue might be "dam", but that doesn’t affect the caller of the function and so the assignment is legal.  Function parameters are contravariant: You can give me a function that accepts a wider type than I asked for.
Adding the required string property thisIsACompilerError does produce an error because nothing the caller provides is going to have that property.

Took me a while to understand what @fatcerberus is saying 😄 Your signature of : (value: AnotherType) => void is only visible to the caller, but not to the implementation. TypeScript is fine with your implementation being something wider than AnotherType, so even if you widen it to (value: {anotherValue: string}) => void in the implementation, there won't be an error.
You can see your code as this:
declare function foo(value: {anotherValue: string}): void;
const lorem: (value: AnotherType) => void = foo;

Which apparently is fine.

@Josh-Cena In this particular case it's actually a bit closer to writing this:
const lorem: (value: AnotherType) => void = (value: AnotherType) => {
  let anotherValue = value.anotherValue ?? "dam";
  anotherValue = "anythign";
  console.log(anotherValue)
  // foo(anotherValue || 'listen');
}

which TypeScript has no reason to reject.

@Josh-Cena @fatcerberus Wait, what? I don't understand, what is the difference between the two? In both cases, we are saying that I will take AnotherType as a parameter. Whether you write one way or the other, I thought that both are saying the same thing.
const lorem: (value: AnotherType) => void = ({ anotherValue = "dam" }) => {};

OR
const lorem = ({ anotherValue = "dam" }: AnotherType) => {};

And what would be the case where you want the implementation to be wider than the caller signature? If it is wider, then why not define it in the signature? I mean why would you implement for wider cases, but you will only allow a subset? Then why not just say the subset is allowed, it does not make sense :(

Without getting into technical details: lorem itself is typed as a function which accepts an AnotherType value.  The actual function you’ve assigned to it can be passed an AnotherType without violating the type system; the implementation will see "dam" instead of undefined in case the property doesn’t exist, but the caller has no reason to care about that.
See my comment above:
https://github.com/microsoft/TypeScript/issues/47556#issuecomment-1019297185

@fatcerberus I think you missed the bullet there, I don't want the developers that are using my interface AnotherType to assign dam. I know I can do alue.anotherValue ?? "dam" or alue.anotherValue || "dam", but this is exactly what I am trying to avoid. Do you understand the question now?

I understand what you want, what I'm trying to tell you is that the reason you don't get an error is the same reason you don't get an error here:
// why is this legal?
let fooey: (x: "foo" | "bar") => void = (x: string) => console.log(x);

// because both "foo" and "bar" are valid inputs for (x: string):
fooey("foo");  // no problem
fooey("bar");  // ditto

By omitting the type annotation on your destructured parameter, TS infers (value: { anotherValue: string }) => void for the type of the arrow function expression, which is assignable to (value: AnotherType) => void for the same reason the above example is legal.  To prevent this inference, you have to annotate the destructure like in your example under Expected Behavior.
Function assignability is based on what the caller can do with the function.  Since you seem to also want to restrict the implementation, you need to be explicit.

I don't want the developers that are using my interface AnotherType to assign "dam".

This is already the case even in your "broken" code - you'll find that it's not legal to call lorem({ anotherValue: "dam" }) (or any other string for that matter).  The destructuring and defaulting you've done is an implementation detail from the caller's PoV.  That's why I posted the example using ?? "dam" - because the semantics are exactly the same.

Splitting up the construction of the arrow function and its subsequent assignment to lorem might help clarify what's going on:
type SomeType = "listen" | "orNot";

const foo = (value: SomeType) => { console.log(value) };

interface AnotherType {
  anotherValue?: SomeType
}

const loremFun = ({
//     ^? const loremFun: ({ anotherValue }: { anotherValue?: string | undefined }) => void
  anotherValue = "dam",
  // thisIsACompilerError: string
}) => {
  anotherValue = "anythign";
  console.log(anotherValue)
  // foo(anotherValue || 'listen');
};

const lorem: (value: AnotherType) => void = loremFun;

Notice that the default string "dam" is completely invisible from outside the function and the result is a function type that takes string | undefined, which in turn is compatible with the type of lorem for the aforementioned reasons.

If you truly want your downstream developers to have a strict type, you should make them put the type on their parameters, not on the function. i.e. const lorem = ({ anotherValue = "dam" }: AnotherType) => {};. There's actually a semantic difference in this.


Could not load your Services

Describe the bug
I got the error message "Could not load your services" (under "Your Services Tab") or "Could not load user information" (under "Account" tab)
To Reproduce
Steps to reproduce the behavior:

Have a PAC proxy script configured on windows machine
Login franz Account
See error

Expected behavior
Load srvices/account info correctly
Screenshots

using Developer tools, it's show this:

Desktop (please complete the following information):

OS: windows 10 x64
Version 5.1.0 / Release: 4.1.4 / win32 / x64

Additional context
The IT department has installed the Zscaler Root CA certificate because of the proxy script configuration

I am having same issue at work computer because my company uses Zscaler to configure the network. You need some type of browser page to login and allow the application to access and Franz doesn't have that so everything gets blocked. Hopefully this is resolved soon.

I have had the same issue with Zscaler for everything (Google Drive, Dropbox, Android Messages for Web, Franz, and surely more to crop up).
Dropbox can be fixed by changing from Auto-Proxy to No-Proxy - I wonder if something similar could work for Franz?


Custom Interactive Controls

With Mixer it is possible to create custom interactive controls.  Currently this library will only work with the default Mixer interactive controls and it appears there is no simple way to bring in custom controls without making a custom version of this library.  Any thoughts on how to support custom interactive controls?

So, let's separate out custom controls from custom MixPlay a bit. Custom MixPlay is fully supported, as it's no different than regular MixPlay. If your controls that you're making are based off of the standard MixPlay controls, they'll also continue to work fine. If you're designing your own control type, you'll need pull the repo and add that custom logic into the following class:
https://github.com/SaviorXTanren/mixer-client-csharp/blob/master/Mixer.Base/Model/Interactive/InteractiveControlCollectionModel.cs
Since Mixer returns an unstructured JSON array of controls, we won't know what types each of them are to correct unserialize & reserialize them. So you'll need to add in those times into there.

Sounds good.  That is what I am doing.  Just wanted to make sure I wasn’t heading down a path different than what you were thinking.
Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: Matthew Olivo<EMAIL_ADDRESS>Sent: Sunday, March 10, 2019 2:55:43 PM
To: SaviorXTanren/mixer-client-csharp
Cc: Mike Hacker; Author
Subject: Re: [SaviorXTanren/mixer-client-csharp] Custom Interactive Controls (#55)
So, let's separate out custom controls from custom MixPlay a bit. Custom MixPlay is fully supported, as it's no different than regular MixPlay. If your controls that you're making are based off of the standard MixPlay controls, they'll also continue to work fine. If you're designing your own control type, you'll need pull the repo and add that custom logic into the following class:
https://github.com/SaviorXTanren/mixer-client-csharp/blob/master/Mixer.Base/Model/Interactive/InteractiveControlCollectionModel.cs
Since Mixer returns an unstructured JSON array of controls, we won't know what types each of them are to correct unserialize & reserialize them. So you'll need to add in those times into there.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com/SaviorXTanren/mixer-client-csharp/issues/55#issuecomment-471333283, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQFd_Qhut3BlnFZmB8z5EOoOs2qopiW2ks5vVVUvgaJpZM4bnQ31.


Resource Tab

Add an additional resource tab that is controlled by admin for resources. @robynlloos  did you already create this one?

Yes - see comment from meeting above.


DocsArchive-<IP_ADDRESS>Auto archive content

Please don't merge this PR until target archive repo PR https://github.com/OPS-E2E-PPE/docs-yml-archive-non-versioning-archive/pull/296 is merged into live branch.
Auto archive content to https://github.com/opstest2/docs-yml-archive-non-versioning-archive.git

Docs Build status updates of commit b9f7a32:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

.openpublishing.redirection.json
:white_check_mark:Succeeded

docs/TOC.yml
:white_check_mark:Succeeded
View

docs/to-be-archive/level1/article3-1-1.md
:white_check_mark:Succeeded
View

docs/to-be-archive/level1/article3-1-2.md
:white_check_mark:Succeeded
View

docs/to-be-archive/level1/article3-1-3.yml
:white_check_mark:Succeeded
View

docs/to-be-archive/level2/article3-2-1.md
:white_check_mark:Succeeded
View

docs/to-be-archive/level2/article3-2-2.md
:white_check_mark:Succeeded
View

docs/to-be-archive/level2/article3-2-3.yml
:white_check_mark:Succeeded
View

For more details, please refer to the build report.
Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report.
For any questions, please:Try searching the docs.microsoft.com contributor guidesPost your question in the Docs support channel


Website: consider curating sponsors list

Looking at the site and the CONTRIBUTING.md file, some of the backers and sponsors listed are advertising adult escort services. It looks like the list is being dynamically generated. Consider moderating these lists.
https://github.com/facebook/jest/blob/master/CONTRIBUTING.md#sponsors

Here's the place in the code where a filter rule could be added:
https://github.com/facebook/jest/blob/master/website/pages/en/index.js#L89

I actually don't think this should be an issue. It is just fair that all sponsors get featured. Just because one doesn't necessarily agree with the work of the sponsor shouldn't be a reason that they do not get featured. I guess in that case maybe there should be a way to prevent sponsorship from said parties if you really don't want their money?

I mean, from the outside it looks like a porn site paying $2 a month for a lot of free publicity.

Technically, it's NOT free since they DO pay.


Updated index of vmware-cs extension

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

For new extensions:

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

If this PR is for a new extension or change to an existing extension, use the following to try out the changes in this PR:
docker run -it microsoft/azure-cli:latest
export EXT=<NAME>
pip install --upgrade --target ~/.azure/cliextensions/$EXT "git+https://github.com/shivam-msft/azure-cli-extensions.git@master#subdirectory=src/$EXT&egg=$EXT"


chore: cleanup .eslintrc & fix ESLint warnings

Just as in #2226, this makes the .eslintrc file clearer + removes unnecessary rules (as they were already fixed)

This PR is for dev branch

#2247 Is already changing internal ESLint config


How to use the Raw class?

I'm trying to insert a background image (from an existing svg file).
The element itself is something like this (saved as the variable content)
<g id="surface1"> <use xlink:href="#image5" transform="matrix(0.24,0,0,0.24,0,0)"/> </g>
The definition is something like this (saved as the variable blob)
<image id="image5" width="5334" height="4267" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAFNYAABCrC .... </>
I attempted to create the element like this
rawElement = draw.Raw(content=content, defs=('image5', blob))
But I'm getting a
TypeError: No tag with id="image5" found.
Any tips on how to make it work?

Don't use Raw.  It's a special class for inserting raw XML code directly into the resulting SVG.  You are embedding an image so use draw.Image like this:
...
d.append(draw.Image(-50, -50, 100, 100,  # x, y, width, height
                    'data:image/png;base64,...'))
...

Yes that works now. Thanks very much!


Error while adding user with full name to team

Gitea version (or commit ref): 9e865ce
Git version: 2.7.4
Operating system: Linux Ubuntu 16.04
Database (use [x]):

[x] PostgreSQL
[ ] MySQL
[ ] MSSQL
[ ] SQLite

Can you reproduce the bug at https://try.gitea.io:

[x] Yes ( https://try.gitea.io/org/webjoel_test_user/teams/team_test )
[ ] No
[ ] Not relevant

Log gist:

Description
When adding a user with full name filled to a team occurs the error that the user does not exist, removing the full name of the user in his or her registry works perfectly.
Screenshots

I'm quite sure this is expected behavior.

I do not agree, I can not add users who filled out your full name?

@webjoel good point.

this was eventually corrected with issue #2962. I to close.

That's a duplicated of this one in fact.


refactor: Speed up value creation and update DEV-2473

Pull Request Checklist
Task Description/Number

Remove verifyValue from ValuesResponderV2
Tests should assure the create and update logic correctness. If after the update a problem is detected it is too late anyway, the change in the persistence store was already performed.
Remove CreateValueRequestV2
Expose and use org.knora.webapi.responders.v2.ValuesResponderV2#createValueV2 directly without the MessageRelay indirection.
Basic Requirements
Please check if your PR fulfills the following requirements:

[ ] Tests for the changes have been added (for bug fixes / features)
[ ] Docs have been added / updated (for bug fixes / features)

PR Type
What kind of change does this PR introduce?

[ ] fix: represents bug fixes
[x] refactor: represents production code refactoring
[ ] feat: represents a new feature
[ ] docs: documentation changes (no production code change)
[ ] chore: maintenance tasks (no production code change)
[ ] test: all about tests: adding, refactoring tests (no production code change)
[ ] other... Please describe:

Does this PR introduce a breaking change?

[ ] Yes
[x] No
[ ] Maybe (not 100% sure => check with FE)

Does this PR change client-test-data?

[ ] Yes (don't forget to update the JS-LIB team about the change)
[x] No

I like it!
How big is the performance impact?

I have not yet been able to measure this robustly. I am still figuring out how to profile zio workflows.
The speedup for the removal of the MessageRelay indirection is probably negledible.
The verification of the value safes a getResourcePropertiesAndValues query which could be quite intense depending on the resource.
I was able to reproduce the reported slowdown on test. Once this is merged I can test it there.


No Examples for Azure DevOps

You really should have prioritize providing examples using your own Azure DevOps products over GitHub examples.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 2db5100c-6804-3290-7986-e203119751b0
Version Independent ID: e03089e8-acc5-6926-3883-d38e7bc1ae41
Content: Tutorial: Implement Azure Policy as Code with GitHub - Azure Policy
Content Source: articles/governance/policy/tutorials/policy-as-code-github.md
Service: azure-policy
GitHub Login: @georgewallace
Microsoft Alias: gwallace

Hello @capdragon
Thank you for your feedback! We have assigned this issue to the author to review further and take the next course of action.

Thanks, @capdragon. I'll pass your feedback to the Azure Policy engineering team this morning.

#please-close


nixos: systemd doesn't respect fileSystems..depends

Describe the bug
systemd doesn't respect the depends option for file systems. Usually this is ok because systemd will mount file systems in the correct topological ordering. The depends option is useful because it allows you to express dependencies on e.g. the file systems that an overlay FS's lower/upper/work directories exist on.
Steps To Reproduce
This test should hang forever. Instead, it exits cleanly.
import ./nixos/tests/make-test-python.nix ({ lib, pkgs, ... }: {
  name = "should-hang";

  nodes.machine = {
    systemd.services.block-foo = {
      unitConfig.DefaultDependencies = false;
      serviceConfig = {
        ExecStart = "${pkgs.coreutils}/bin/sleep infinity";
        Type = "oneshot";
      };
    };

    virtualisation.fileSystems = {
      "/foo" = {
        device = "tmpfs";
        fsType = "tmpfs";
        options = ["nofail" "x-systemd.requires=block-foo.service" "x-systemd.after=block-foo.service"];
      };

      "/bar" = {
        device = "tmpfs";
        fsType = "tmpfs";
        depends = ["/foo"];
        # This would fix it:
        # options = ["x-systemd.requires-mounts-for=/foo"];
      };
    };
  };

  testScript = ''
    machine.wait_for_unit("bar.mount")
    machine.fail("mount | grep foo")
  '';
})

Expected behavior
The block-foo service never exits, so /foo is never mounted, and therefore /bar should never be mounted. So the test should hang.
Additional context
This is also a problem for systemd stage 1, but it's worse because we also have to account for the /sysroot prefix. We can fix this by adding x-systemd.requires-mounts-for= options for every dependency, and prefixing /sysroot for the systemd stage 1 file systems.

Do we even need the depends option? I don't think they're particularly useful. The overlay also shouldn't be a concern since https://github.com/NixOS/nixpkgs/pull/286176 anymore.

@nikstur Well, currently depends literally only does anything in scripted stage 1. In stage 2 and in systemd stage 1, you have to use x-systemd.requires-mounts-for=, which is what the overlay stuff does. That's fine, but it's an incompatibility between scripted and systemd stage 1. So we need to either deprecate it or implement it, and it's really easy to implement (I just need to fixup https://github.com/NixOS/nixpkgs/pull/233707). It's a handy convenience for people I guess, though far from a necessary one.


Create Book

As a Book Owner,
I want create a book if it is not yet in the crowd library
So that I can later add it to my personal library.
Acceptance Criteria:

[ ] If I notice I cannot find the book in the crowd library I want to have the option to create it
[ ] The creation should be able to happen by ISBN (API)
[ ] The creation should be able to happen by form (manually)
[ ] I want to submit my created book
[ ] After submitting the created book I should be able to add it to my personal library (#2 )

Definition of Done:

[ ] All acceptance criteria are met.
[ ] Code is reviewed and approved.
[ ] Necessary tests are written and pass.
[ ] Documentation is updated, if applicable.
[ ] Feature is deployed to the [environment name].

Affected - check if implemented:

[x] FE
[x] BE - cl-book-service

Book creation by form -> Should be allow it in frontend for users to add books manually?


Sync upstream 22 may 2023

This brings changes from prometheus/prometheus up to 2023-05-22 commit https://github.com/prometheus/prometheus/commit/905a0bd63a12fa328eac4b7f2674356c283bacac
Minor merge conflicts only.

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.9 out of 16 committers have signed the CLA.:white_check_mark: zenador:white_check_mark: leizor:white_check_mark: krajorama:white_check_mark: beorn7:white_check_mark: codesome:white_check_mark: rfratto:white_check_mark: bboreham:white_check_mark: cstyan:white_check_mark: jesusvazquez:x: roidelapluie:x: alanprot:x: AkshaySiwal:x: brancz:x: damnever:x: mickael-carl:x: codebaskyYou have signed the CLA already but the status is still pending? Let us recheck it.

Thanks for the review! Marking as draft now while waiting for the fix in https://github.com/prometheus/prometheus/pull/12387 to be merged, then will merge from upstream again. Other than that, this should be fine if https://github.com/grafana/mimir/pull/5049 passes all tests (still running).


Allow categories to be collapsed

Seconding this, it would be great to be able to collapse categories like spells and features, for spells even collapsing based on spell levels to make looking for particular spells easier


Fix default export typing for projects without esModuleInterop enabled

Hi! :wave:
I believe the current typing of the default export is a tiny bit off.
When the TypeScript type says export default …, TypeScript expects there to be an export named default. However, the actual export from index.js is just declared as module.exports = ….
I don't think there's any neat way to use the export default syntax without requiring the library's consumers to enable esModuleInterop in tsconfig.json. I'm not an expert, though 🤷♂
With the current typing, the compiler lets me do this:
import knexSessionStore from 'connect-session-knex';
const session = /* some code */;
const KnexSessionStore = knexSessionStore(session);

This builds just fine. When I run the code, however, it breaks with this error message: [ERROR] TypeError: connect_session_knex_1.default is not a function.
I'm pretty sure the correct way of telling TypeScript that this is a module.exports = …-style export is to replace export default … with export = …. By changing it, the import now fails (as expected):

Instead, I can now import the module like so, which both compiles and runs:
import knexSessionStore = require('connect-session-knex');
const session = /* some code */;
const KnexSessionStore = knexSessionStore(session);

The export = … syntax requires declaring the function before exporting it, but that shouldn't make any difference.
I know a lot of projects have esModuleInterop enabled, but I'm trying very hard to avoid it :smile:
Do you think this looks reasonable?

Thanks for merging it! Can I expect a release in the near future? This is the only
thing I can't really work around in my own project :smile:


Web Worker Support

Current Behavior
When importing into a worker environment the following runtime error occurs
Uncaught ReferenceError: window is not defined
    at node_modules/.pnpm/isomorphic-dompurify<EMAIL_ADDRESS>(isomorphic-dompurify.js?v=650fd638:949:22)

Change in behavior
The runtime error does not occur and DOMPurify is accessible both as a export
and on self.DOMPurify/globalThis.DOMPurify in workers
Developer Notes
There are probably a dozen different ways to fix this issue, the one chosen was
picked for being the one with the fewest number of changes while being
backwards compatible all the way back to browser versions from 2012 (Firefox
back to 2004)
See: https://developer.mozilla.org/en-US/docs/Web/API/Window/self#examples
Other approaches considered

Using typeof window !== "unefined"

This method of determining if the window exists and if this code is
executing in a worker was considered however after this check was done the
split in exuection after this was detected would have either needed to use
self or pollyfil window on self. Since self always works it seemed
more straight forward to just always use it instead of window

Example:
const globalObject = typeof window !== "undefined" ? window : self;
module.exports = globalObject.DOMPurify || (globalObject.DOMPurify = require('dompurify').default || require('dompurify'));

Using globalThis

This method would be better if trying to target the same code on server and
browser however it is a much newer feature and not available on all platforms
(ie, React Native, etc.)

Example:
module.exports = globalThis.DOMPurify || (globalThis.DOMPurify = require('dompurify').default || require('dompurify'));

Using typeof window !== "undefined" but not assigning to self.DOMPurify

This would simply remove the accessing of window in worker environments
effectively killing the polyfil nature of this in worker environments but
still allowing the import

Example:
const dompurify = require("dompurify")

if (typeof window !== "undefined") {
  window.DOMPurify = window.DOMPurify || dompurify.default || dompurify;
}

module.exports = typeof window !== "undefined" ? window.DOMPurify : dompurify.default || dompurify;

Using optional chaning

This would have had the same outcome of not having DOMPurify accessible on
self/globalThis as the previous method however it would rely on a feature
only aviable in newer JavaScript environments.

Example:
const dompurify = require("dompurify")

if (typeof window !== "undefined") {
  window.DOMPurify = window.DOMPurify || dompurify.default || dompurify;
}

module.exports = window?.DOMPurify || dompurify.default || dompurify;

Using null coalescing

Again this feature is very new and not supported in every environment

const dompurify = require("dompurify")

if (typeof window !== "undefined") {
  window.DOMPurify ??= dompurify.default || dompurify;
}

module.exports = window?.DOMPurify : dompurify.default || dompurify;

fixes: #240

Thank you very much @wSedlacek for such a thoughtful analysis of solutions and choosing the best one for your PR.
Please give me a couple of days to test the chosen solution.

@wSedlacek I'm having hard times importing isomorphic-dompurify from inside of a Web Worker script. I don't have much experience with web workers. Could you please instruct me how to do it?
I'm using Vite vanilla template and importing this way import DOMPurify from "isomorphic-dompurify";, but unfortunately it gives me DOMPurify.sanitize is not a function.

I’ll create an example today for testing and get back to you.

https://github.com/cure53/DOMPurify/blob/d7498e0546c0f67cf95437ae430ff2035582a689/src/purify.js#L90-L96
So dompurify itself is also checking the window and early exiting. I am going to mark this as a draft for a moment while I evaluate the options.

Thank you @wSedlacek for your work on this issue! Really good job!
However, I think we cannot release this change without dompurify itself adding support for Web Worker, so I suggest us keeping this issue open in case anything changes in the future. For your particular case, you may consider using alternatives for now.


Changed the repo link in /help message

Changed the repo link to https://github.com/osdc/bots in main.go file Line 67,  for /help message

Thanks @PrimalPimmy for the contribution :100: Looking forward to more :partying_face:

Closes #29


Invalid variable handling when query and header fields have the same names

Description
Given an openapi spec where a request has the following parameters (a header and a query field that have the same sort of name):
{
            "name": "entity_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Entity Id"
            }
          },
          {
            "name": "entity-id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Entity-Id"
            },
          }

Despite both of the fields being named slightly differently and being located in different parts of the request, the generated service is:
	public static getMyEndpoint(data: $OpenApiTs['/api/my-endpoint']['get']['req'] = {}): CancelablePromise<$OpenApiTs['/api/my-endpoint']['get']['res'][200]> {
		const { entityId, entityId } = data;
		return __request(OpenAPI, {
			method: 'GET',
			url: '/api/my-endpoint',
			headers: {
				'entity-id': entityId
			},
			query: {
				entity_id: entityId
			},
		});
	}

Where both fields get given the same name, and both the header and query would receive the same value.
I would expect some way to distinguish the two fields so that I could call the service with a distinct value for the header field and another for the query field.
My usecase is along the lines of:

Resources in my system are linked to a "commit" of sorts, which is a sequential list of applied changes
Given a series of commits, like commitA->commitB->commitC->commitD
Any request (post, put, get, etc) can be in the context of a commit. So "GET /resources where commitC is the head", which would be done by passing "commit-id: commitC" in the header
We can also then say "In the context of commitC, get resources related to commitA", in which case we pass "commit-id: commitC" in the header and "commit_id: commitA" as a filter in the query string.

OpenAPI specification (optional)
No response
Configuration
No response
System information (optional)
No response

@reritom Yeah we need to change the client API, this will be done in the new clients otherwise those would be huge breaking changes for people https://github.com/hey-api/openapi-ts/issues/179


Rename #[near_sdk] to #[near_bindgen]

/cc @fckt

Do we need to include the .wasm files? They should not have changed as far as I understand.

Wasm compiler works in mysterious ways.


D44892

Set a maximum of 14 concurrent processes, if travis fails also this it should be disgarded

Travis tends to timeout on LLVMBuilder. I am using https://github.com/tcnksm/ghr to manually upload releases.


discord-canary: 0.0.106 -> 0.0.109

Automatic update generated by nixpkgs-update tools. This update was made based on information from passthru.updateScript.
meta.description for discord-canary is: "All-in-one cross-platform voice and text chat for gamers"
meta.homepage for discord-canary is: "https://discordapp.com/"
meta.changelog for discord-canary is: ""
Updates performed

Ran passthru.UpdateScript

To inspect upstream changes
Impact

Checks done (click to expand)

built on NixOS

The tests defined in passthru.tests, if any, passed

0 of 0 passed binary check by having a zero exit code.

0 of 0 passed binary check by having the new version present in output.

found 0.0.109 with grep in /nix/store/z9x3i5my42fb8jylbyw6wx759qqx7gvy-discord-canary-0.0.109

directory tree listing: https://gist.github.com/f573f641b22affb06d65acb00fac5b9b

du listing: https://gist.github.com/a919f5c6d2e20088607d432250c58c8b

Rebuild report (if merged into master) (click to expand)

1 total rebuild path(s)

1 package rebuild(s)

1 x86_64-linux rebuild(s)
0 i686-linux rebuild(s)
0 x86_64-darwin rebuild(s)
0 aarch64-linux rebuild(s)

First fifty rebuilds by attrpath
discord-canary

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/z9x3i5my42fb8jylbyw6wx759qqx7gvy-discord-canary-0.0.109 \
  --option binary-caches 'https://cache.nixos.org/ https://r-ryantm.cachix.org/' \
  --option trusted-public-keys '
  r-ryantm.cachix.org-1:gkUbLkouDAyvBdpBX0JOdIiD2/DP1ldF3Z3Y6Gqcc4c=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(r-ryantm's Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A discord-canary https://github.com/r-ryantm/nixpkgs/archive/70f134468b60271dc0bb2f9f1dc429bd8f4a4ed8.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/z9x3i5my42fb8jylbyw6wx759qqx7gvy-discord-canary-0.0.109
ls -la /nix/store/z9x3i5my42fb8jylbyw6wx759qqx7gvy-discord-canary-0.0.109/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review 1

1 package built:

discord-canary

Maintainer pings
cc @ldesgoui @MP2E @tadeokondrak for testing.

...and again for 0.0.12


App only works in debug mode

If you run the app in release mode, it looks like the nakamoto thread crashes very quickly

Fixed now that we no longer use nakamoto.


Investigate allowing esbuild to tree shake library

I discovered that esbuild does not tree shake the library at all (https://github.com/evanw/esbuild/issues/1573). The issue might be in the way each of the classes assigns class and prototype for the factory function. Need to investigate changing this.
export default function factory() {
  return new Vector(...arguments);
}
factory.prototype = Vector.prototype;
factory.class = Vector;

Confirmed that it is both the factory assignment and any class that extends the .class property. Once those are both removed, esbuild tree shakes properly.
class Text extends GameObject.class

Also need to add /*@__PURE__*/ to any assignment to WeakMap(). It's apparently not listed as a known global in esbuild.
let pointers = /*@__PURE__*/new WeakMap();

I'm interested in taking a look at this, but think I'm missing some context for the constraints here.
I'm assuming the API needs to stay consistent, so the default export needs to function the same, but is there any constraint on additional exports from these modules? Exporting the class in addition to the default factory can prevent the extends Module.class
Thanks for helping!

Thanks!
Since this is going to be a breaking change (there's no way to remove the .class assignment without it being breaking) the only constraints are that the factory export can't change (I want to make sure you don't have to call new for everything) and the class itself is exported in some way so that the user can extend it.

it looks like switching the .prototype assignments to use Object.setPrototypeOf and marking them as /*#__PURE__*/ allows for them to be eliminated:
// lib.js
export function one() {
    console.log("one");
}
export function two() {
    console.log("two");
}

/*#__PURE__*/ Object.setPrototypeOf(two, "x");

// input.js
import * as lib from './lib.js'
lib.one()

// out.js
(() => {
  // ../treeshaketest/lib.js
  function one() {
    console.log("one");
  }

  // ../treeshaketest/input.js
  one();
})();

so i think the combination of using setPrototypeOf and exporting the classes separately would allow for dead-code elimination

Oh nice. Though I don't remember exactly what the purpose of the setting the prototype was. I think originally it was so you could extend it for functional extends (e.g. function CustomSprite () {} CustomSprite.prorotype = Sprite.prototype). It may not be needed at all anymore now that I switched to classes.

It looks like I was actually wrong as well, after doing some more testing it looks like marking the setPrototypeOf as PURE will completely remove the prototype assignment from the bundle. But if that's not needed that simplifies things

i believe i have esbuild treeshaking working properly and all tests passing:
> npx rollup game.js --format iife --file rollup.out.js
> npx esbuild game.js --bundle --format=iife --outfile=esbuild.out.js
> ls -lah *out.js
35K esbuild.out.js
52K rollup.out.js

i followed through with what was discussed, and exports are:
export default function factory() {
    return new Text(...arguments);
}
export { Text as TextClass };

etc.
before i make a pull request i want to confirm i have code formatted properly, is there a CLI for code formatting for this project?

Unfortunately there is not. I've been meaning to set one up but haven't done so. Code formatting is mostly just 2 spaces instead of tabs at this point.


Versioning of api-logs, instrumentation and sdk-logs with 0.x.x version causes dependency resolution issues in client projects

What happened?
Steps to Reproduce

Install @vercel/otel package.
Execute npm ci to install dependencies exactly as defined in the lockfile.
Run the build.

Expected Result
The build should work.
Actual Result
It sometimes causes an issue during local development, and sometimes during the build, see logs below
Additional Details
The problem are semantic version ranges in combination with versions starting with 0.x.x.
OpenTelemetry Setup Code
No response
package.json
No response
Relevant log output
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving<EMAIL_ADDRESS>npm ERR! Found<EMAIL_ADDRESS>npm ERR! node_modules/@opentelemetry/api
npm ERR!   peer<EMAIL_ADDRESS><1.9.0" from<EMAIL_ADDRESS>npm ERR!   node_modules/@opentelemetry/context-async-hooks
npm ERR<EMAIL_ADDRESS>from<EMAIL_ADDRESS>npm ERR!     node_modules/@sentry/node
npm ERR<EMAIL_ADDRESS>from<EMAIL_ADDRESS>npm ERR!       node_modules/@sentry/nextjs
npm ERR<EMAIL_ADDRESS>from the root project
npm ERR!   peer<EMAIL_ADDRESS><1.9.0" from<EMAIL_ADDRESS>npm ERR!   node_modules/@opentelemetry/core
npm ERR<EMAIL_ADDRESS>from @opentelemetry/instrumentation-connect@0.[36](https://gitlab.willhaben.at/willhaben/tribe/odin/beast/-/jobs/3036231#L36).0
npm ERR!     node_modules/@opentelemetry/instrumentation-connect
npm ERR<EMAIL_ADDRESS>from<EMAIL_ADDRESS>npm ERR!       node_modules/@sentry/node
npm ERR<EMAIL_ADDRESS>from<EMAIL_ADDRESS>npm ERR!         node_modules/@sentry/nextjs
npm ERR<EMAIL_ADDRESS>from @opentelemetry/instrumentation-express@0.[38](https://gitlab.willhaben.at/willhaben/tribe/odin/beast/-/jobs/3036231#L38).0
npm ERR!     node_modules/@opentelemetry/instrumentation-express
npm ERR<EMAIL_ADDRESS>from<EMAIL_ADDRESS>npm ERR!       node_modules/@sentry/node
npm ERR<EMAIL_ADDRESS>from<EMAIL_ADDRESS>npm ERR!         node_modules/@sentry/nextjs
npm ERR!     12 more (@opentelemetry/instrumentation-fastify, ...)
npm ERR!   49 more (@opentelemetry/instrumentation-connect, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @opentelemetry/sdk-logs@"^0.[46](https://gitlab.willhaben.at/willhaben/tribe/odin/beast/-/jobs/3036231#L46).0" from<EMAIL_ADDRESS>npm ERR! node_modules/@vercel/otel
npm ERR<EMAIL_ADDRESS>from the root project
npm ERR!
npm ERR! Conflicting peer dependency<EMAIL_ADDRESS>npm ERR! node_modules/@opentelemetry/api
npm ERR!   peer<EMAIL_ADDRESS><1.8.0" from<EMAIL_ADDRESS>npm ERR!   node_modules/@opentelemetry/sdk-logs
npm ERR!     peer<EMAIL_ADDRESS>from<EMAIL_ADDRESS>npm ERR!     node_modules/@vercel/otel
npm ERR<EMAIL_ADDRESS>from the root project

Hmm, I think we'd need a reproducer for us to determine if this is actually violating SemVer. :thinking:
When I try it locally, simply installing @vercel/otel does not fail.
Note that 0.x packages are to be considered experimental by SemVer and that every minor bump in that stage should be considered like a major bump for stable (1.x) packages.

See https://github.com/open-telemetry/opentelemetry-js/issues/4548 .

It looks like this specific issue is resolved for the vercel/otel package, and we are still working toward documenting and better enabling compatibility between API and SDK versions. See related issue https://github.com/open-telemetry/opentelemetry-js/issues/4832. I'm going to close this out as it's already being tracked elsewhere, but let me know if I'm missing something on this.


Change fundamental types for simde__m128i

Previously typeof(m128) == typeof(m128i) and this is a problem for code that use mmx types to specialize templates. Specifically the following compiles for Intel, but fails for Arm:
template<>
inline void Foo<__m128>::Bar()
{ . . .}
template<>
inline void Foo<__m128i>::Bar()	<— fails because the underlying type float32x4_t has already been specialized.
{ . . .}
The Intel defines are:
typedef float __m128 attribute((vector_size(16), aligned(16)));
typedef long long __m128i attribute((vector_size(16), aligned(16)));
This proposal switches __m128i to using int64_t

The failures are in the " Install APT Dependencies" step and I don't see any useful information in the failure report

Codecov Report

Merging #143 into master will increase coverage by 11.30%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           master     #143       +/-   ##
===========================================
+ Coverage   67.95%   79.25%   +11.30%
===========================================
  Files          34       34
  Lines        8185     7729      -456
===========================================
+ Hits         5562     6126      +564
+ Misses       2623     1603     -1020

Impacted Files
Coverage Δ

simde/x86/sse2.h
80.44% <ø> (-7.70%)
:arrow_down:

simde/x86/avx2.h
67.99% <0.00%> (-13.95%)
:arrow_down:

simde/x86/sse4.1.h
71.67% <0.00%> (-11.78%)
:arrow_down:

simde/arm/neon/int64x1.h
50.00% <0.00%> (-8.07%)
:arrow_down:

simde/arm/neon/uint64x1.h
50.00% <0.00%> (-8.07%)
:arrow_down:

simde/arm/neon/int64x2.h
51.85% <0.00%> (-7.53%)
:arrow_down:

simde/arm/neon/uint64x2.h
51.85% <0.00%> (-7.53%)
:arrow_down:

simde/x86/sse.h
75.55% <0.00%> (-4.64%)
:arrow_down:

simde/arm/neon/int8x8.h
71.42% <0.00%> (-1.30%)
:arrow_down:

... and 21 more

Continue to review full report at Codecov.

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

Good catch.  Merged, thanks!
Sorry about all the issues :(


[Bug]: jest.mock not working with ESM support activated

Version
28.1.3
Steps to reproduce

Clone my repo: https://github.com/iamWing/jest-esm-mock-issue
npm I
npm run start to verify Electron app shows up without issue
npm t to run jest for the error

Expected behavior
Expecting Jest to mock functions app.on, app.whenReady and component BrowserWindow from electron, then execute the test cases with the mocked functions.
Actual behavior
Encountered TypeError: Cannot read properties of undefined (reading 'whenReady') when trying to run the test cases.
One possible reason I can think of is the imported module is being executed before jest.mock('electron', ...) in main.spec.js, hence Node is executing the line app.whenReady() in main.cjs with the non-mocked version.
Additional context
I originally tested with TypeScript & ts-jest with ESM support activated. The error I encountered there is very similar, so that I believe the error is from jest instead of ts-jest. See my comment on #10025 (https://github.com/facebook/jest/issues/10025#issuecomment-1214297747)
Environment
System:
    OS: macOS 12.5
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 16.16.0 - /usr/local/opt/node@16/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.13.2 - /usr/local/bin/npm
  npmPackages:
    jest: ^28.1.3 => 28.1.3

Thanks for repo. Easy to fix. Change your test file like this:
  import { jest } from "@jest/globals";
- import { BrowserWindow } from "electron";
- import { exportedForTests } from "../src/main.cjs";

  jest.mock("electron", () => ({
    app: {
      on: jest.fn(),
      whenReady: jest.fn(() => Promise.resolve()),
    },
    BrowserWindow: jest.fn().mockImplementation(() => ({
      loadFile: jest.fn(() => Promise.resolve()),
      on: jest.fn(),
    })),
  }));

+ const { BrowserWindow } = await import("electron");
+ const exportedForTests = await import("../src/main.cjs");

  // ...

As you suspected – ESM evaluates import statements before looking at the code. So you have to mock before importing. Same applies for for modules which have to load mocked modules (in this case it is the main.cjs which loads BrowserWindow).
This pattern worked with CJS, because babel-jest transformer is moving jest.mock calls at the top of the file (above any require statement). Hoisting magic does not work with ESM, because any static import will be always evaluated first. Solution: use dynamic import().

Thanks for repo. Easy to fix. Change your test file like this:
  import { jest } from "@jest/globals";
- import { BrowserWindow } from "electron";
- import { exportedForTests } from "../src/main.cjs";

  jest.mock("electron", () => ({
    app: {
      on: jest.fn(),
      whenReady: jest.fn(() => Promise.resolve()),
    },
    BrowserWindow: jest.fn().mockImplementation(() => ({
      loadFile: jest.fn(() => Promise.resolve()),
      on: jest.fn(),
    })),
  }));

+ const { BrowserWindow } = await import("electron");
+ const exportedForTests = await import("../src/main.cjs");

  // ...

As you suspected – ESM evaluates import statements before looking at the code. So you have to mock before importing. Same applies for for modules which have to load mocked modules (in this case it is the main.cjs which loads BrowserWindow).
This pattern worked with CJS, because babel-jest transformer is moving jest.mock calls at the top of the file (above any require statement). Hoisting magic does not work with ESM, because any static import will be always evaluated first. Solution: use dynamic import().

Hi @mrazauskas, thanks for your reply. I've tried using dynamic import but it seems that the BrowserWindow is still not mocked.
The following test resulted in error:
import { jest } from '@jest/globals';

jest.mock('electron', () => ({
  app: {
    on: jest.fn(),
    whenReady: jest.fn(() => Promise.resolve()),
  },
  BrowserWindow: jest.fn().mockImplementation(() => ({
    loadFile: jest.fn(() => Promise.resolve()),
    on: jest.fn(),
  })),
}));

const { BrowserWindow } = await import('electron');
const exportedForTests = await import('../src/main.cjs');

test('Private props exported for unit tests', () => {
  expect(exportedForTests).toBeDefined();
});

test('func createWindow()', () => {
  const { createWindow } = exportedForTests;

  createWindow();
  expect(BrowserWindow).toHaveBeenCalledTimes(1);
});

Error:
 ● func createWindow()

    expect(received).toHaveBeenCalledTimes(expected)

    Matcher error: received value must be a mock or spy function

    Received has value: undefined

      23 |
      24 |   createWindow();
    > 25 |   expect(BrowserWindow).toHaveBeenCalledTimes(1);
         |                         ^
      26 | });
      27 |

      at Object.<anonymous> (tests/main.spec.js:25:25)

Also tried using the unstable_mockModule API but it doesn't work on electron, as I think electron is still not an ES module(?).

Ah.. The are different solution, but perhaps it would be the best to require() CJS modules:
+ import { createRequire } from "node:module";
  import { jest } from "@jest/globals";

+ const require = createRequire(import.meta.url);

  jest.mock("electron", () => ({
    app: {
      on: jest.fn(),
      whenReady: jest.fn(() => Promise.resolve()),
    },
    BrowserWindow: jest.fn().mockImplementation(() => ({
      loadFile: jest.fn(() => Promise.resolve()),
      on: jest.fn(),
    })),
  }));

- const { BrowserWindow } = await import("electron");
+ const { BrowserWindow } = require("electron");
  const exportedForTests = await import("../src/main.cjs");

  test("Private props exported for unit tests", () => {
    expect(exportedForTests).toBeDefined();
  });

  test("func createWindow()", () => {
    const { createWindow } = exportedForTests;

    createWindow();
    expect(BrowserWindow).toHaveBeenCalledTimes(1);
  });

Also works:
const { default: electron } = await import("electron");

// inside `test()`
expect(electron.BrowserWindow).toHaveBeenCalledTimes(1);

Or (least elegant for my eye):
const { BrowserWindow } = (await import("electron")).default;

I agree that it’s probably better to import CJS modules by using required(). Perhaps we should update the ECMAScript Modules to include things we discussed here so there’s less confusion for anyone attempting to enable ESM support. Maybe the mock document as well.

This discussion was helpful, but I can't seem to replicate it in my own ESM project with Node v16.16.0 and jest v28.1.3.
# myModule.js

import { execSync } from 'node:child_process';

export default function myFunc() {
  console.log(execSync('ls package.json').toString());
}

# myModule.test.js

import { createRequire } from "node:module";
import { jest } from '@jest/globals';
const require = createRequire(import.meta.url);

jest.mock('node:child_process');

const { execSync } = require('node:child_process');
const myFunc = (await import('../src/myModule.js')).default;

afterEach(() => jest.resetAllMocks());

test('execSync mock should be working', () => {
  execSync('echo');

  expect(execSync).toHaveBeenCalledWith('echo')
});

test('myFunc should call mocked execSync', () => {
  myFunc();

  expect(execSync).toHaveBeenCalledWith('ls');
});

My test fails because the module under test still didn't get the mocked version of execSync. I get the same failure if I selectively mock execSync (like mrazauskas does), with jest.mock('node:child_process, () => ({ execSync: jest.fn() })).
$ NODE_OPTIONS=--experimental-vm-modules jest tests/myModule.test.js
(node:486995) ExperimentalWarning: VM Modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
  console.log
    package.json

      at myFunc (src/myModule.js:4:11)

 FAIL  tests/myModule.test.js
  ✓ execSync mock should be working (4 ms)
  ✕ myFunc should call execSync (45 ms)

  ● myFunc should call execSync

    expect(jest.fn()).toHaveBeenCalledWith(...expected)

    Expected: "ls"

    Number of calls: 0

      19 |   myFunc();
      20 |
    > 21 |   expect(execSync).toHaveBeenCalledWith('ls');
         |                    ^
      22 | });
      23 |

      at Object.<anonymous> (tests/myModule.test.js:21:20)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 passed, 2 total

It does seem to work if I use a spy instead, which must be created before importing the module under test:
const cp = require('child_process');
const execSpy = jest.spyOn(cp, 'execSync').mockImplementation(() => {});
const myFunc = (await import('../src/myModule.js')).default;

@iamWing Good idea. I think it would be great to add an example with jest.unstable_mockModule() (see https://github.com/facebook/jest/issues/10025#issuecomment-1016690087) and your case with electron to ECMAScript Modules guide. Perhaps a link from jest.mock() would be enough for now? I mean, ESM in Jest is still considered experimental, so keeping docs in ECMAScript Modules guide makes sense. Or?

@mildmojo
Did you try like this:
- import { createRequire } from "node:module";
  import { jest } from "@jest/globals";
- const require = createRequire(import.meta.url);

- jest.mock("node:child_process");
+ jest.unstable_mockModule("node:child_process", () => ({
+   execSync: jest.fn(),
+ }));

- const { execSync } = require("node:child_process");
+ const { execSync } = await import("node:child_process");
  const myFunc = (await import("../src/myModule.js")).default;

// ...

@mrazauskas Thank you! That got me moving. I guess unstable_mockModule is undocumented, but needed instead of .mock() for ESM modules? I found the PR where it was added; seems transitional.
I also needed to make sure that if I provided a mock implementation, I manually restored that implementation after jest.resetAllMocks(). My working test code looks like this:
// myModule.test.js

import { createRequire } from "node:module";
import { jest } from '@jest/globals';
const require = createRequire(import.meta.url);

jest.unstable_mockModule('node:child_process', () => ({
  execSync: jest.fn(() => 'foobar'),
}));

const { execSync } = await import('node:child_process');
const myFunc = (await import('../src/myModule.js')).default;

afterEach(() => {
  jest.resetAllMocks();

  execSync.mockImplementation(() => 'foobar');
});

test('execSync mock should be working', () => {
  execSync('echo');

  expect(execSync).toHaveBeenCalledWith('echo')
});

test('myFunc should call mocked execSync', () => {
  myFunc();

  expect(execSync).toHaveBeenCalledWith('ls package.json');
});

@iamWing Good idea. I think it would be great to add an example with jest.unstable_mockModule() (see https://github.com/facebook/jest/issues/10025#issuecomment-1016690087) and your case with electron to ECMAScript Modules guide. Perhaps a link from jest.mock() would be enough for now? I mean, ESM in Jest is still considered experimental, so keeping docs in ECMAScript Modules guide makes sense. Or?

Yeah I think it makes sense to keep the examples in the ECMAScript Modules guide. Docs will need to be changed when the APIs are stabled for ESM support anyway.

Agreed (; Are you up to opening a PR?

Agreed (; Are you up to opening a PR?

@mrazauskas sure. Let's see if I can find some time to make it later this week.

@mrazauskas Thank you! That got me moving. I guess unstable_mockModule is undocumented, but needed instead of .mock() for ESM modules? I found the PR where it was added; seems transitional.
I also needed to make sure that if I provided a mock implementation, I manually restored that implementation after jest.resetAllMocks(). My working test code looks like this:
// myModule.test.js

import { createRequire } from "node:module";
import { jest } from '@jest/globals';
const require = createRequire(import.meta.url);

jest.unstable_mockModule('node:child_process', () => ({
  execSync: jest.fn(() => 'foobar'),
}));

const { execSync } = await import('node:child_process');
const myFunc = (await import('../src/myModule.js')).default;

afterEach(() => {
  jest.resetAllMocks();

  execSync.mockImplementation(() => 'foobar');
});

test('execSync mock should be working', () => {
  execSync('echo');

  expect(execSync).toHaveBeenCalledWith('echo')
});

test('myFunc should call mocked execSync', () => {
  myFunc();

  expect(execSync).toHaveBeenCalledWith('ls package.json');
});

@mildmojo Yes I can confirm unstable_mockModule is needed to mock ESM. jest.mock only works for CJS modules for now.
I don't understand why do you need to resetAllMocks in afterEach tho. What went wrong if you don't?

I don't understand why do you need to resetAllMocks in afterEach tho. I tried it without resetting it and it works fine for me. What went wrong if you don't?

I extracted this example from my real test code that modifies the mocks on a per-test level. In this example here, it's not actually necessary. :stuck_out_tongue:

I don't understand why do you need to resetAllMocks in afterEach tho. I tried it without resetting it and it works fine for me. What went wrong if you don't?

I extracted this example from my real test code that modifies the mocks on a per-test level. In this example here, it's not actually necessary. :stuck_out_tongue:

Ah I see. It makes sense then. Just wanna make sure before it goes into the docs. Cheers 🍻

Thanks guys we are now finally able to mock our ES modules properly again 🎉  - please allow me to share our mockESModule() approach;
https://gist.github.com/booya2nd/dcaa1775fd4c06cd79610e3feea6362c#file-mock-esmodule-js
usage:
const mocked = await mockESModule('someDependency', import.meta);
const myModule = (await import('my-module-using-dep.js')).default;

it('...', () => {
  mocked.someFunction.mockImplementationOnce(() => 1337);
  ...
});

Only "downside" now is to switch from static import to dynamic import() 😅


Add codeowners file

Team will be added to PRs as reviewers

Codecov Report

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

@@           Coverage Diff           @@
##           master       #9   +/-   ##
=======================================
  Coverage   69.37%   69.37%
=======================================
  Files           5        5
  Lines         542      542
=======================================
  Hits          376      376
  Misses        122      122
  Partials       44       44

Continue to review full report at Codecov.

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


nix package installed by nix-darwin ignore the PATH env passed by the parent process

Test Result on macOS with nix-darwin:
# remove bashrc to avoid interfering with test results
$ sudo rm -rf ~/.bashrc

# 1. bash installed by nix-darwin ignored the `PATH` env passed by the parent process
$ PATH=XXX /run/current-system/sw/bin/bash
bash-5.2$ echo $PATH
/Users/ryan/.nix-profile/bin:/etc/profiles/per-user/ryan/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin

bash-5.2$ exit
exit

# 2. macOS's builtin bash read the passed `PATH` successfully
$ PATH=XXX /bin/bash

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
bash-3.2$ echo $PATH
XXX

Tried to make a shell wrapper with the expected PATH, but useless:
https://github.com/ryan4yin/nix-config/commit/087d38487ca5307c3afd14ca699768e68d70d39d#diff-96e580d4ef2e5de2c220100b5b9352d1c3da3ebeecc623736db9cb953798642aR158-R174

Bash
Several config files used by Bash:

/etc/profile: A global configuration file that applies to all users. This file is read for login shells.
~/.bash_profile or ~/.profile: A personal initialization file for login shells. This is read after /etc/profile.
~/.bashrc: A personal initialization file for non-login shells. This is specific to each user and allows them to customize their shell environment.
/etc/bash.bashrc: A system-wide initialization file for non-login shells. This is a feature specific to Debian and Ubuntu-like systems.

nixpkgs's bash use /etc/bashrc as its system-wide initialization file: https://github.com/NixOS/nixpkgs/blob/nixos-23.11/pkgs/shells/bash/5.nix#L44

The problem we have here is related to non-login shell, and we have deleted ~/.bashrc beafore we execute the test.
So /etc/bash.bashrc and /etc/bashrc may be the root cause of this problem.
/etc/bash.bashrc(used by macOS's builtin bash):
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
    . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix

/etc/bashrc(used by nix-darwin's bash):
# /etc/bashrc: DO NOT EDIT -- this file has been generated automatically.
# This file is read for interactive shells.

[ -r "/etc/bashrc_$TERM_PROGRAM" ] && . "/etc/bashrc_$TERM_PROGRAM"

# Only execute this file once per shell.
if [ -n "$__ETC_BASHRC_SOURCED" -o -n "$NOSYSBASHRC" ]; then return; fi
__ETC_BASHRC_SOURCED=1

# Don't execute this file when running in a pure nix-shell.
if [ "$IN_NIX_SHELL" = "pure" ]; then return; fi

if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then
  . /nix/store/icwhz17wr4wgwp89n95mrs1ngj859c6m-set-environment
fi

# Return early if not running interactively, but after basic nix setup.
[[ $- != *i* ]] && return

# Make bash check its window size after a process completes
shopt -s checkwinsize

source /nix/store/sxwsmk522l5zm83s9y73qklfgn3w6val-nix-index-0.1.7/etc/profile.d/command-not-found.sh

# Read system-wide modifications.
if test -f /etc/bash.local; then
  source /etc/bash.local
fi

set-environment seems like a key word related to this issue, take a look at it:
/nix/store/icwhz17wr4wgwp89n95mrs1ngj859c6m-set-environment:
# Prevent this file from being sourced by child shells.
export __NIX_DARWIN_SET_ENVIRONMENT_DONE=1

export PATH=$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin
export EDITOR="nvim"
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"

# ...

Oh set __NIX_DARWIN_SET_ENVIRONMENT_DONE to 1 may prevent bash clear my PATH! let's test it!
# check its value, it's empty
$ echo =${__NIX_DARWIN_SET_ENVIRONMENT_DONE}=
==

# try to prevent bash import environment from `/nix/store/icwhz17wr4wgwp89n95mrs1ngj859c6m-set-environment`
bash-5.2$ __NIX_DARWIN_SET_ENVIRONMENT_DONE=1 PATH=XXX /run/current-system/sw/bin/bash
bash-5.2$ echo $PATH
XXX:/Users/ryan/bin:/Users/ryan/.local/bin:/Users/ryan/go/bin

Succeeded! so the root cause is the environemnt variable __NIX_DARWIN_SET_ENVIRONMENT_DONE is missing, it should be 1！

My default shell used in terminal is nushell, but nix-darwin do not support to set nushell as a login shell.
nix-darwin has option [programs.zsh.loginShellInit](https://daiderd.com/nix-darwin/manual/index.html#opt-programs.zsh.loginShellInit) but do not have a programs.nushell.loginShellInit, which caused this problem!


“There was a problem communicating with Google servers”

Accounts stopped working in YT ReVanced, and MicroG stopped being able to connect to Google

https://github.com/ReVanced/GmsCore/issues/37


When a new promotion mutation is used on an old sale - change old_sale flag to True (the old sale becomes proper promotion)

Part of https://github.com/saleor/saleor/issues/12539

Duplicated task: https://github.com/saleor/saleor/issues/13321


CRDReplicator Enhancement

Description
The "update" functions used to update a resource now can recover from "Conflicting" when trying to perform an update on the status or spec fields.
Fixing a minor bug which caused the operator to run even if the clusterID configmap is not found
Fixing race conditions on the creation and replication of the local resources on the remote peering clusters. With this fix, given a remote peering cluster, for each type of resource there is a local and remote watcher. The local watcher is created after that a connection to the API server of the remote peering cluster exists.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

added a test where the spec and status fields of a resource are modified in order to check that the conflicting errors are handled properly

updated the unit tests on the functions that start and stop the watchers for a given resource.

Thanks, Aldo!
Minor question @palexster about the naming: is it really a "CRD" replicator, or "object" replicator? Service replicator? Resource replicator?

Thanks, Aldo!
Minor question @palexster about the naming: is it really a "CRD" replicator, or "object" replicator? Service replicator? Resource replicator?

The replicator is designed to replicate CR for a configurable set of CRD. So far, we assume that CRD are already installed on remote cluster, in the future we would enable CRD replication.
I think it is out of the scope of this PR but we can discuss to rename it future to a more generic ObjectReplicator or ResourceReplicator. I personally would avoid service which has a different meaning in K8s.

/rebase

The replicator is designed to replicate CR for a configurable set of CRD. So far, we assume that CRD are already installed on remote cluster, in the future we would enable CRD replication.
I think it is out of the scope of this PR but we can discuss to rename it future to a more generic ObjectReplicator or ResourceReplicator. I personally would avoid service which has a different meaning in K8s.

Perfect. Let's keep the current name for the time being.
We can consider to change it when the code will be used for a broader scope in the future. Thanks!


[connectivity_plus] Migrate to null safety (WIP)

Migrate to null safety, #50
-- WIP --

[ ] connectivity_plus (migrated but has dependency_overrides)
[ ] connectivity_plus_linux (migrated but blocked by dbus)
[x] connectivity_plus_macos
[x] connectivity_plus_platform_interface
[x] connectivity_plus_web (1 dev dependency not)
[x] connectivity_plus_windows

Hey, are there any other impediments besides dbus?

Hey, are there any other impediments besides dbus?

Everything else should be ready to review, except this dbus dependency and also integration test in [connectivity_plus_web] package should be moved to test_driver folder(?) + I don't know how you do now mockito with null safety (manual mocks or generated?)

I don't know how you do now mockito with null safety (manual mocks or generated?)

Personally, I'm leaning towards simple fakes aka. manual mocks that I've seen the Flutter team using, but it would be great to hear others' opinions on this.

@mzdm Hey, did you have a chance to try the example app on Linux, by the way? Just wondering if there are any issues with the unreleased null-safe version of dbus.dart.

@mzdm Hey, did you have a chance to try the example app on Linux, by the way? Just wondering if there are any issues with the unreleased null-safe version of dbus.dart.

I didn't unfortunately (I'm on Windows)

The example runs fine on Linux with the fresh 0.2.0 release of dbus.

connectivity_plus (migrated but has dependency_overrides)

Some temporary local overrides are sometimes handy/needed when developing these packages and dealing with unreleased versions, but in the end, melos should be able to handle it correctly without any manual overrides.
Sometimes it may also help to pass --no-pub to avoid that flutter pub get screws up pubspec.lock changes made by melos (if you want to run the example or tests for a specific package).

Is there any package for reference on how to do that manual mocks/fakes ?

I think generated mocks are also fine if it makes things easier. Those rarely change and can be pushed to the repo so that they don't need to be generated every time, right?

Ok I'll add them for now to also see how if CI pass.
Also after updating SDK constraints to comply with dbus now the error on CI is:
ERR : The current Dart SDK version is 2.12.0-259.12.beta.
    |
    | Because connectivity_plus requires SDK version >=2.12.0-259.14.beta <3.0.0, version solving failed.

The Dart SDK available in Flutter beta is at version 2.12.0-259.12.beta so we need to lower the SDK version constraint to that. And then the next problem is presumably args, same as here: https://github.com/fluttercommunity/plus_plugins/pull/114#issuecomment-782005724 :(

The Dart SDK available in Flutter beta is at version 2.12.0-259.12.beta so we need to lower the SDK version constraint to that. The next problem will presumably be args - same as here: #114 (comment) :(

Oh you're right dbus was released on dev version

I saw beta in the SDK pubspec version number so that was what confused me 😃

Flutter dev would work fine, but beta is a problem due to its dependency on old args:
Running "flutter pub get" in example...
Because every version of connectivity_plus from path depends on connectivity_plus_linux from path which depends on dbus ^0.2.0, every version of connectivity_plus from path requires dbus ^0.2.0.
And because dbus >=0.2.0 depends on args ^2.0.0 and every version of flutter_driver from sdk depends on args 1.6.0, connectivity_plus from path is incompatible with flutter_driver from sdk.
So, because connectivity_plus_example depends on both flutter_driver any from sdk and connectivity_plus from path, version solving failed.
pub get failed (1; So, because connectivity_plus_example depends on both flutter_driver any from sdk and connectivity_plus from path, version solving failed.)

I don't know how to get past this without eliminating the whole integration test.

I don't know how to get past this without eliminating the whole integration test.

We can simple override the dependency in connectivity_plus/example/pubspec.yaml :facepalm:
dependency_overrides:
  args: ^2.0.0

https://github.com/fluttercommunity/plus_plugins/issues/50#issuecomment-782284716

I don't know how to get past this without eliminating the whole integration test.

We can simple override the dependency in connectivity_plus/example/pubspec.yaml 🤦
dependency_overrides:
  args: ^2.0.0

#50 (comment)

Seems to be working, nice! The last thing, I think, connectivity_plus_web example dir - I can't generate mocks. Might be because of html dependency

all_plugins / analyze (pull_request) Failing after 5m — analyze

[connectivity_plus_example]:
[connectivity_plus_example]:   info - The library 'package:flutter_driver/flutter_driver.dart' is legacy, and should not be imported into a null safe library at test_driver/connectivity_plus_e2e_test.dart:7:8 - (import_of_legacy_library_into_null_safe)

I think we should leave the example intact, besides the args override. I believe the only change in the example directory should be the dependency_override.
all_plugins / integration_tests (pull_request) Failing after 4m — integration_tests

Because every version of connectivity_plus from path depends on connectivity_plus_windows ^0.2.0-nullsafety.0 which doesn't match any versions, connectivity_plus from path is forbidden.
So, because connectivity_plus_example depends on connectivity_plus from path, version solving failed.

I'm not sure what's going on here... As if melos somehow fails to setup local overrides, because the versions seem to be defined correctly.

The example runs fine with flutter run --no-pub, but flutter drive --no-pub somehow insists on trying to use hosted connectivity_plus_xxx packages even if melos has setup pubspec.lock correctly so that they point to the local paths... :exploding_head:

I have created a minimal test case of the problem with flutter drive --no-pub: jpnurmi/flutter_drive_vs_pubspec_lock

I have reported a bug: https://github.com/flutter/flutter/issues/76446

@mhadaily I'm afraid we have to make the all_plugins / integration_tests optional (not required) until the problem has been fixed in flutter drive.
P.S. I believe the integration test passes after the null-safe packages have been published, because then the version validation will pass.

This looks good to me too! the integration tests issue indeed should work once the individual packages are released, as I am afraid @mzdm does not have rights to do that, one of us will have to.

@miquelbeltran Thanks for checking! I'm going to publish some other packages too later after work so I can publish this at the same time unless someone else beats me to it :smile:

I published the leaf packages and re-run the CI jobs but it seems to have failed:
connectivity_plus_example:
Running "flutter pub get" in example...
Warning: You are using these overridden dependencies:

! args 2.0.0
Running "flutter pub get" in example...                          2,078ms
add_custom_command() missing VERBATIM or FLUTTER_TARGET_PLATFORM, updating.
Building Linux application...
VMServiceFlutterDriver: Connecting to Flutter application at http://<IP_ADDRESS>:42027/bk1HSjSkpDM=/
VMServiceFlutterDriver: Isolate found with number:<PHONE_NUMBER>998851
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
flutter: 00:00 +0: Connectivity test driver (setUpAll)
flutter: 00:00 +1: Connectivity test driver test connectivity result
flutter: Error: org.freedesktop.DBus.Error.ServiceUnknown
flutter: (The following exception is now available via WidgetTester.takeException:)
flutter: ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
flutter: The following NoSuchMethodError was thrown running a test:
flutter: The getter 'isEmpty' was called on null.
flutter: Receiver: null
flutter: Tried calling: isEmpty
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
flutter: #1      _NMConnectivityType.toConnectivityResult (package:connectivity_plus_linux/src/connectivity_real.dart:76:9)
flutter: #2      ConnectivityLinux._getConnectivity.<anonymous closure> (package:connectivity_plus_linux/src/connectivity_real.dart:37:52)
flutter: <asynchronous suspension>
flutter: <asynchronous suspension>
flutter: (elided 6 frames from dart:async and package:stack_trace)
flutter:
flutter: The test description was:
flutter:   test connectivity result
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: (If WidgetTester.takeException is called, the above exception will be ignored. If it is not, then the above exception will be dumped when another exception is caught by the framework or when the test ends, whichever happens first, and then the test will fail due to having not caught or expected the exception.)
flutter: ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
flutter: The following NoSuchMethodError was thrown running a test:
flutter: The getter 'isEmpty' was called on null.
flutter: Receiver: null
flutter: Tried calling: isEmpty
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
flutter: #1      _NMConnectivityType.toConnectivityResult (package:connectivity_plus_linux/src/connectivity_real.dart:76:9)
flutter: #2      ConnectivityLinux._getConnectivity.<anonymous closure> (package:connectivity_plus_linux/src/connectivity_real.dart:37:52)
flutter: <asynchronous suspension>
flutter: <asynchronous suspension>
flutter: (elided 6 frames from dart:async and package:stack_trace)
flutter:
flutter: The test description was:
flutter:   test connectivity result
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: 00:00 +1: Connectivity test driver test connectivity result [E]
flutter:   Test failed. See exception logs above.
  The test description was: test connectivity result
flutter:
flutter: 00:00 +1 -1: Connectivity test driver (tearDownAll)
flutter: 00:00 +2 -1: (tearDownAll)
flutter: Warning: integration_test test plugin was not detected.
flutter: 00:00 +3 -1: Some tests failed.

Works for me
$ flutter drive -d linux --no-pub --target=./test_driver/connectivity_plus_e2e.dart
Warning: You are using these overridden dependencies:
! args 2.0.0
Running "flutter pub get" in example...                          1,861ms
add_custom_command() missing VERBATIM or FLUTTER_TARGET_PLATFORM, updating.
Building Linux application...
VMServiceFlutterDriver: Connecting to Flutter application at http://<IP_ADDRESS>:43779/u0dD06CE-nk=/
VMServiceFlutterDriver: Isolate found with number:<PHONE_NUMBER>039459
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
flutter: 00:00 +0: Connectivity test driver (setUpAll)
flutter: 00:00 +1: Connectivity test driver test connectivity result
[ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!

[ERROR:flutter/third_party/txt/src/minikin/FontFamily.cpp(184)] Could not get cmap table size!

VMServiceFlutterDriver: Connected to Flutter application.
flutter: 00:00 +2: Connectivity test driver (tearDownAll)
flutter: 00:00 +3: (tearDownAll)
flutter: Warning: integration_test test plugin was not detected.
flutter: 00:00 +4: All tests passed!

could you apply the minor fixes to network_manager and bump connectivity_plus_linux version to nullsafety.1?

on it

could you apply the minor fixes to network_manager and bump connectivity_plus_linux version to nullsafety.1?

so only packages/connectivity_plus/pubspec.yaml file should have this format ^x.y.z-nullsafety ?

All green! :tada:


tradfri component stops receiving state changes ~30 minutes after starting Home Assistant

Home Assistant release with the issue:
0.69.0
Last working Home Assistant release (if known):
never worked for me
Operating environment (Hass.io/Docker/Windows/etc.):
Arch Linux on a Raspberry Pi 3 (AUR package)
Component/platform:
tradfri
Description of problem:
Around 30 minutes after starting (just guessing, could also be a lot shorter), Home Assistant no longer receives any state changes from the tradfri bridge, which means every time I turn on a tradfri light, Home Assistant will not consider it as turned on and vice versa. It works flawlessly until then. The state changes do not appear in any log files either. Turning lights on/off from Home Assistant still works, but they will revert to the previous state because Home Assistant does not seem to receive any callback from the bridge reflecting the change.
Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):
discovery:
  ignore:
    - ikea_tradfri

tradfri:
  host: [tradfri bridge's hostname]
  allow_tradfri_groups: false

Traceback (if applicable):
does not apply

@ngdio unfortunately this could be due to a plethora of reasons, but it sounds like the socket is dying for whatever reason.
Can you try factory resetting your gateway? As it's known to have some issues created by firmware upgrades.

I'm still have tradfri working and I'm on the latest hassbian version.

Same for me.
I'm using official docker image 0.69.1.
I can control the lights with HA, but no status updates, when I using the ikea switch.

Can confirm this too. Also had this in 0.65 and still in 0.69.
Some debug output, working after restart:
2018-05-29 19:33:10 DEBUG (MainThread) [pytradfri.api.aiocoap_api] Executing <IP_ADDRESS> put ['15001', 65605]: {'3311': [{'5850': 1}]}
2018-05-29 19:33:10 DEBUG (MainThread) [coap] Sending message , 3 option(s), 23 byte(s) payload>
2018-05-29 19:33:10 DEBUG (MainThread) [coap] Exchange added, message ID: 42256.
2018-05-29 19:33:10 DEBUG (MainThread) [coap.requester] Timeout is 93.0
2018-05-29 19:33:10 DEBUG (MainThread) [coap.requester] Sending request - Token: 00007335, Remote:
2018-05-29 19:33:10 DEBUG (MainThread) [coap] Incoming message >
2018-05-29 19:33:10 DEBUG (MainThread) [coap] New unique message received
2018-05-29 19:33:10 DEBUG (MainThread) [coap] Exchange removed, message ID: 42256.
2018-05-29 19:33:10 DEBUG (MainThread) [coap] Received Response: >
2018-05-29 19:33:10 DEBUG (MainThread) [coap] Incoming message , 3 option(s), 233 byte(s) payload>
2018-05-29 19:33:10 DEBUG (MainThread) [coap] New unique message received
2018-05-29 19:33:10 DEBUG (MainThread) [coap] Received Response: , 3 option(s), 233 byte(s) payload>
2018-05-29 19:33:10 DEBUG (MainThread) [coap] Sending message >
2018-05-29 19:33:10 DEBUG (MainThread) [pytradfri.api.aiocoap_api] Status: 2.04 Changed, Received:
2018-05-29 19:33:10 DEBUG (MainThread) [coap.blockwise-requester] Notification received
2018-05-29 19:33:10 DEBUG (MainThread) [coap.blockwise-requester] Reporting completed notification
2018-05-29 19:33:10 DEBUG (MainThread) [pytradfri.api.aiocoap_api] Status: 2.05 Content, Received: {"9001":"Deckenleuchte #12","9002":1521024463,"9020":1527591071,"9003":65605,"9054":0,"5750":2,"9019":1,"3":{"0":"IKEA of Sweden","1":"TRADFRI bulb E27 opal 1000lm","2":"","3":"1.2.214","6":1},"3311":[{"5850":1,"5851":254,"9003":0}]}
Stopped working after some time:
2018-05-29 20:16:00 DEBUG (MainThread) [pytradfri.api.aiocoap_api] Executing <IP_ADDRESS> put ['15001', 65537]: {'3311': [{'5850': 1}]}
2018-05-29 20:16:00 DEBUG (MainThread) [coap] Sending message , 3 option(s), 23 byte(s) payload>
2018-05-29 20:16:00 DEBUG (MainThread) [coap] Exchange added, message ID: 42258.
2018-05-29 20:16:00 DEBUG (MainThread) [coap.requester] Timeout is 93.0
2018-05-29 20:16:00 DEBUG (MainThread) [coap.requester] Sending request - Token: 00007337, Remote:
2018-05-29 20:16:00 DEBUG (MainThread) [coap] Incoming message >
2018-05-29 20:16:00 DEBUG (MainThread) [coap] New unique message received
2018-05-29 20:16:00 DEBUG (MainThread) [coap] Exchange removed, message ID: 42258.
2018-05-29 20:16:00 DEBUG (MainThread) [coap] Received Response: >
2018-05-29 20:16:00 DEBUG (MainThread) [pytradfri.api.aiocoap_api] Status: 2.04 Changed, Received:

Seems like a duplicate of #14386

Seems like it. I will close this one


Please document how to restructure the repo to be a cookbook so we can fork and test changes

Documented over in the Halite README https://github.com/poise/halite#using-a-pre-release-version-of-a-cookbook

Though it is worth noting that master on most of my cookbooks is broken this week while I rebuild and simplify my test harness. Also if you want to just fork and run the tests, normal kitchen commands and rake spec should be enough.


SDK key issue

I have register for my SDK key and its active.
I have download the basic demo and enter the proper Bundle ID below my team name.
I assume that I dont have to place the key inside the program ins Xcode, is that correct?
The program run and says that my SDK key is invalid.  I have restart Xcode, clean the cache and rebuild the program couple of time with the same result.

Just found the answer in the code: It would be appreciate if it was in the instruction.
struct QuickPoseBasicView: View {
private var quickPose = QuickPose(sdkKey: "YOUR SDK KEY HERE") // register for your free key at https://dev.quickpose.ai
@State private var overlayImage: UIImage?


Fix editor/property_editor.cpp TTR

no more commit，just this.
Independent from #11285.

Please amend the commit with a more descriptive commit log. Change is okay to merge.

You need to push another change to overwrite the commit log. Use git commit --amend to fix this:

What's mean YOLO?

Please don't mind. Just a word people say when they do something risky, in this case: not waiting for error checks to finish and merge instantly.