Relationship fixes

Hello again guys! \o
Here we are around relationships once again :D
Short story short this can be seen as #3272 and #3250  merge.
Let's break this down.
Relationships: BelongsTo
The foreign key is stored in the current model table. BelongsTo display as a select with the option to add new items via InlineCreate
public function icon()
    {
        return $this->belongsTo(\App\Models\Icon::class, 'icon_id');
    }

$this->crud->addField(['name' => 'icon']);

Relationships: HasOne / MorphOne
Both are very similar, the difference beeing the database structure. The key is in the foreign table as oposed to BelongsTo.
There is no specific field for this relation, it displays the user desired field type. Supports BelongsTo relations in the foreign model.
In backpack the usability of both is the same:
// HasOne

public function address()
    {
        return $this->hasOne(\App\Models\Address::class);
    }

$this->crud->addFields([
     [
           'name'    => 'address.street',
           'label'   => 'Street column in address table',
     ],
     [
           'name'    => 'address.icon',
           'label'   => 'Icon is a BelongsTo relation in address model',
     ],
]);

// MorphOne

public function comment()
    {
        return $this->morphOne(\App\Models\Comment::class, 'commentable');
    }

$this->crud->addField([
     [
           'name'    => 'comment.text',
           'type' => 'ckeditor',
           'label'   => 'text column in comments table',
     ],
]);

Relationships: HasMany / MorphMany
They are similar but at the same time kind of different. The key is stored in the foreign model table.
There are two ways of dealing with this relationship, either using a select to select from a prefefined list of items, or creating the items along with the model.
Let's first break down the HasMany.
public function postalboxes()
    {
        return $this->hasMany(\App\Models\PostalBox::class);
    }

Developer can setup this relation to be a select:
[
                'name'    => 'postalboxer',
                'label'   => 'HasMany - selectable',
                // 'force_delete' => true, //optional - explained bellow
            ],

When using this approach backpack does not impose a way of dealing with the data. The default behavior is:

check if developer provided a fallback_id, this key can be used in case database column is NOT nullable but developer don't want to delete the entry (the selectable option) from database.
check if the column is nullable, if it is, set the value of the connected key to null.
if no fallback is provided, and null cannot be used in database we just delete it.

The optional force_delete => true say backpack that even if column is nullable in database, we should delete the entry when removed from selections.
This was the behaviour intended in https://github.com/Laravel-Backpack/CRUD/pull/1453 I think.
This select approach is available also in MorphMany but does not make much sense to use it there as the morph table requires morphable_type and morphable_id.
For MorphMany and the HasMany creatables it's recommended to use the new repeatable field to create the related items.

// MorphMany

public function stars()
    {
        return $this->morphMany(\App\Models\Star::class, 'starable');
    }

$this->crud->addField([
    [
        'name'    => 'stars',
        'label'   => 'MorphMany - Starts',
        'pivotFields' => [
            [
                'name' => 'title',
                'type' => 'text',
            ]
        ],
    ]
]);

Behind the scenes this field would be converted to a repeatable field that would allow to create the amount of desired stars. Same for HasMany :
 public function postalboxes()
    {
        return $this->hasMany(\App\Models\PostalBox::class);
    }

$this->crud->addField([
    [
        'name'    => 'postalboxes',
        'label'   => 'HasMany - creatable',
        'pivotFields' => [
            [
                'name' => 'postal_name',
                'type' => 'text',
            ]
        ],
    ]
]);

Relationships: BelongsToMany / MorphToMany
They are both very simillar so is the usability in backpack.
Both provide both interfaces select and repeatable. The select best for when we just want to connect two entities. The repeatable when we want to deal with pivot data.
REPEATABLE
IMPORTANT: to work with pivot tables you need to explicitly tell what pivot fields you are about to edit using ->withPivot() from Laravel.

public function recommends()
    {
        return $this->morphToMany(\App\Models\Recommend::class, 'recommendable')->withPivot('text');
    }
public function dummyproducts()
    {
        return $this->belongsToMany(\App\Models\Product::class, 'monster_productdummy')->withPivot('notes');
    }

$this->crud->addField([
    [
        'name'    => 'recommends',
        'label'   => 'MorphToMany Recommends - with pivot fields',
        'pivotFields' => [
           [
            'name' => 'text',
            'type' => 'text',
           ]
        ],
    ],
]);

$this->crud->addField([
    [
        'name'    => 'dummyproducts',
        'label'   => 'BelongsToMany - with aditional pivot fields',
        'pivot_wrapper' => [ //optional explained below
            'class' => 'form-group col-md-6',
        ],
        'pivotFields' => [
           [
            'name' => 'notes',
            'type' => 'text',
            'wrapper' => [
                'class' => 'form-group col-md-6',
            ]
           ]
        ],
    ],
]);

The interface for this field is common for both, a Selectable Entity to relate and the optional pivot fields to add along.

pivot_wrapper configures the wrapper for the select of related entry.
You can also pass along more options like ajax and data_url etc, they will be streamlined for your "Select Related". Basically the options you could pass to any relationship field, but pivot_wrapper needed to be overwritten because the "main" repeatable field also has a wrapper.
SELECT
To work with this relations as regular select you don't need to provide the withPivot. You will also be able to create new "relatable entities" using inline create.
public function products()
    {
        return $this->belongsToMany(\App\Models\Product::class, 'monster_product');
    }

public function bills()
    {
        return $this->morphToMany(\App\Models\Bill::class, 'billable');
    }

$this->crud->addField([
    [
        'name'    => 'bills',
        'label'   => 'MorphToMany Bills - selectable',
    ],
]);

I'v created https://github.com/Laravel-Backpack/demo/pull/218 in demo that has all this relationships setup, tables etc.
Don't forget migrate & seed.

A new inspection was created.

The inspection completed: 8 new issues, 22 updated code elements

Pedro you are a BEAST! Can't wait to have all of this behind us! 👏👏👏

@promatik please note my review above is only in terms of code readability. I have NOT tested the functionality. Please do that for this PR, thoroughly.

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

The inspection completed: 13 new issues, 22 updated code elements

The inspection completed: 13 new issues, 22 updated code elements

A new inspection was created.

A new inspection was created.

The inspection completed: 13 new issues, 22 updated code elements

The inspection completed: 13 new issues, 22 updated code elements

The inspection completed: 10 new issues, 22 updated code elements

The inspection completed: 10 new issues, 22 updated code elements

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

The inspection completed: 11 new issues, 24 updated code elements

The inspection completed: 11 new issues, 24 updated code elements

A new inspection was created.

A new inspection was created.

The inspection completed: 11 new issues, 24 updated code elements

The inspection completed: 11 new issues, 24 updated code elements

The inspection completed: 9 new issues, 25 updated code elements

The inspection completed: 9 new issues, 25 updated code elements

The inspection completed: 8 new issues, 25 updated code elements

The inspection completed: 8 new issues, 25 updated code elements

@pxpm, just to make sure, does this PR invalidates https://github.com/Laravel-Backpack/CRUD/pull/3250?

@pxpm, just to make sure, does this PR invalidates https://github.com/Laravel-Backpack/CRUD/pull/3250?

@promatik indeed, this has everything inside.

@promatik indeed, this has everything inside.

A new inspection was created.

A new inspection was created.

A new inspection was created.

A new inspection was created.

The inspection completed: 11 new issues, 24 updated code elements

The inspection completed: 11 new issues, 24 updated code elements

The inspection completed: 11 new issues, 24 updated code elements

The inspection completed: 11 new issues, 24 updated code elements

Just chiming in to say that this looks great & that this would be a great addition !
Especially the whole "pivot columns in repeatable field" – that'd be very helpful 😇
In general, Backpack has made my PHP dev tremendously more productive, thank you !

I hope you guys don't mind me asking, any rough estimation on when will this feature be available to us? Thank you for your work :)

Hi @priyankmaniar!
I've been reviewing this PR, this is now my priority so there will be updates soon 🙌

A new inspection was created.

A new inspection was created.

The inspection completed: 8 new issues, 23 updated code elements

The inspection completed: 11 new issues, 23 updated code elements

@promatik 🙌
Thank you for your response :)
Looking forward to it.

A new inspection was created.

The inspection completed: 11 new issues, 23 updated code elements

A new inspection was created.

A new inspection was created.

The inspection completed: 13 new issues, 23 updated code elements

The inspection completed: 13 new issues, 24 updated code elements

A new inspection was created.

The inspection completed: 10 new issues, 25 updated code elements

I'm sorry but you guys are taking really long to push this one to production :(

@priyankmaniar , indeed we are, I'm sorry for the bad experience and thank you for the light scolding 😀
The reason we're taking our time with this is that... it's a mega branch, with changes in one of the hugely important part of Backpack, so even though theoretically it doesn't have breaking changes, merging it is "scary as f&3k" because it could break tens or thousands of apps. Backpack was meant to be as extensible as possible, so people are using it in A LOT of ways we didn't expect. We're trying to not break those people's apps either.
But yeah... you're right, of course. Time to do something about this. So I'll tell you what. Use this branch (composer require backpack/crud:dev-relationship-fixes. We'll keep it updated and non-breaking towards 4.1.
I'm asking @pxpm to:

merge master into this branch, so that it's up-to-date and has no conflicts;
every time I tag a new release, @pxpm will merge master into this branch too;

That way, we all win:

you (and others) get to use these features right now;
we get to test it out in real projects before we release it "in the wild";

With our promise to keep this updated, there's really no downside to using this, as opposed to master(4.1). Then, one by one,
What do you say @priyankmaniar & @pxpm - do we do this 💪 ?

@tabacitu Thank you so much, Cristian for your response. Your efforts to make things right for all are much appreciated.
I understand your concern. The more you are concerned about the robustness, the finer product, we, the user can receive.
I'm sure many non so active users like me who generally don't voice their thoughts, and simply wait for an update would benefit from the idea you proposed here. In my opinion, that should definitely be done.
The stability of this feature is much important to me (due to the nature of my project) and I will still be looking forward to having it in the main production version. Having said that, I understand it will take some more time but having your attention on this will be much reassuring.
Thanks again for your response, Christian.

Will do @priyankmaniar . Thanks a lot for being so understanding 🙏

@pxpm just merged #3797 , could you please merge master into this branch and fix the conflicts? I imagine there's quite a few of them now... 🙄

Is there any progress on these issues?
I am pulling my hair out to get a (morphTo, morphMany) CRUD work with Backpack.
So far i am able to show all values (added via tinker) in a repeatable form.
However ... the moment i want to store it, i get relationship error in the create.php trait.

A new inspection was created.

A new inspection was created.

Heads up @priyankmaniar and @tabacitu master is merged here! 🙃
Hello @webboty I've just tested a morphMany scenario and it worked great, I will leve here my code for you, and anyone that might have the same issue:
Migrations
Schema::create('stars', function (Blueprint $table) {
            $table->id();
            $table->string('name')->nullable();
            $table->morphs('starable');
        });

Schema::create('universes', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->timestamps();
        });

Models
<?php

namespace App\Models;

use Backpack\CRUD\app\Models\Traits\CrudTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Star extends Model
{
    use HasFactory;
    use CrudTrait;

    /**
     * Indicates if the model should be timestamped.
     *
     * @var bool
     */
    public $timestamps = false;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'id' => 'integer',
    ];

    public function starable()
    {
        return $this->morphTo();
    }
}

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Universe extends Model
{
    use \Backpack\CRUD\app\Models\Traits\CrudTrait;
    use HasFactory;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'id' => 'integer',
    ];

    public function stars()
    {
        return $this->morphMany(\App\Models\Star::class, 'starable');
    }
}

UniverseCrudController
CRUD::field('stars')->pivotFields([
            [
                'name' => 'name',
                'type' => 'text'
            ]
        ]);

You might be hitting some usecase that we didn't cover yet, if so, please let us know so we can improve this branch to the finest before merging into master.
Thanks for your patience and understanding.
Best,
Pedro

The inspection completed: 5 new issues, 1 updated code elements

The inspection completed: No new issues

@pxpm thanks a lot pedro. This rocks!
For the simple and default use cases it is very useful now.
But let me also bring up some issues i have been experiencing:
many to many relationship:
1.) What is the best approach to limit the selectable entries if additional data is in the pivot table and i need to filter the entries by one of the columns in the pivot table?
I tried many options and did not get one to work.
a.) I tried to use a select2_array field ... this works and i get to limit the result. But in this case i can not get rid of the default pivot select2 field. So the approach is not useable.
b.) I tried to use the boot method in an extra model that extended the original model (that also contains the relationship info) ... if i add this model in the "model" attribute, it is ignored. So this approach did not work either.
c.) I tried to enable ajax ... but i get an error message right away:
Undefined variable: routeEntity (View: .../vendor/backpack/crud/src/resources/views/crud/fields/relationship/repeatable_relation.blade.php
So i am stuck in this use case and probably have to ditch the repeatable form altogether.
2.) Tiny bug ... when  'type' => 'repeatable' is added, it ignores the pivotFields ... yet it shows the repeatable div in the right amount of the entries in the database. Not adding the 'type' at all brings back the fields.
Thanks in advance for reading the feedback. :-)

Hello @webboty .
Thanks for sharing your experience, let's try to make it more pleasant!
I think the problem you described is addressed here: https://github.com/Laravel-Backpack/CRUD/pull/3439
I haven't had time to finish that PR, it's missing a little bit you can read the TODO. (I think now it needs conflict resolution too) since it's a bit old.
I will try to give that PR some love during this week.
Let me know if that PR is for the specific case you are trying to solve.
Wish you the best,
Pedro

@pxpm
what we basically need in the m-n repeatable is the normal options functionality ['options' => (function($query){})]. In order to use scopes or queries on the pivot table, before the pivot before results are returned.
Like here: [https://github.com/Laravel-Backpack/CRUD/pull/1694]

@webboty can you check if my last comment https://github.com/Laravel-Backpack/CRUD/pull/3410/files#r695658944 fixes your issue ? It's not merged in the branch yet, just copy-paste the solution to try it out and let me know the results.
Thanks for the feedback! 👍
Let me know,
Pedro

Hello @pxpm ... i hope you are doing well. May i report a bug i have stumbled across using the "relationship fix" branch and it cool features it.
I will attach a screenshot below.
Here is what I have tried.
Using the Backpack Permission Manager Addon, I tried to assign a Role to User.
This threw an exception error.
So I changed my composer.json file and pulled in the original backpack crud master branch and tried to do the same. Assigning a role worked with master. Switching back to this branch i get the error back.
Would be cool if you can take a look at it.
Cheers

Thanks for the report @webboty ! I will definatelly have a look at it!
I will get back with news here!
Cheers,
Pedro

A new inspection was created.

So, this is an interesting case here. Thanks for noticing @webboty !
What happens here is that the "field" is not the relation per-se, but there were some code to include the subfields as relation fields in : https://github.com/Laravel-Backpack/CRUD/blob/756173cf6593c3d530fca0e54831763c796e24d8/src/app/Library/CrudPanel/Traits/Create.php#L66
I think this code is here specifically for this field (checklist_dependency). Problem is the fact the we are pushing the fields directly to the relationship fields array, but they did not go through the same process that other relationship field goes by ->makeSureFieldHasNecessaryAttributes() and raises that error.
I've merged master here (since there were some updates, and also a fix for this).
Let me know if it's working on your side!
Thanks,
Pedro

The inspection completed: 8 new issues, 21 updated code elements

So, this is an interesting case here. Thanks for noticing @webboty !
What happens here is that the "field" is not the relation per-se, but there were some code to include the subfields as relation fields in :
https://github.com/Laravel-Backpack/CRUD/blob/756173cf6593c3d530fca0e54831763c796e24d8/src/app/Library/CrudPanel/Traits/Create.php#L66
I think this code is here specifically for this field (checklist_dependency). Problem is the fact the we are pushing the fields directly to the relationship fields array, but they did not go through the same process that other relationship field goes by ->makeSureFieldHasNecessaryAttributes() and raises that error.
I've merged master here (since there were some updates, and also a fix for this).
Let me know if it's working on your side!
Thanks,
Pedro

Hi Pedro @pxpm ,
awesome. This is a double strike. :-) Thanks for the merge and thanks for the fix.
I pulled it in and the bug is gone! This rocks.
Can I get you a beer?
Best

Best beer to have in my life is happy people around me. I get happy when "my users" are happy. I wish I could make everyone happy. Just the supportive message is more than enough. Thanks, it's really appreciated.
But sure, if you ever come to Portugal feel free to send me a message and we can hangout a bit and drink some beers :)

@pxpm this is the most important PR for 4.2.0, now that repeatable has been merged (🎉).

Update - we're probably going with this new PR - https://github.com/Laravel-Backpack/CRUD/pull/3962

@pxpm is there anything here that we haven't already done in a separate PR?

This is very old @tabacitu !
There were other PR's already replacing this one like #3962 !
I am going to close this! Cheers

Sh****** it was not a good idea to delete the relationship-fix branch. ;-(
I was depending on that.
Switching to master ... breaks the app.
Reverting back to the previous stage does not work as the branch got deleted.
Now I am screwed.

@tabacitu and @pxpm  ... i was able to find a fork that was slightly behind the master to recover the "relationship-fix" branch.
https://github.com/prodixx/CRUD
At least the app is working again (until the next composer update).
Could you please officially recover the relationship-fix branch please, so i can point back the composer file to the official url?
You guys mentioned that you want to keep this branch live and maintained until it is fully merged into the main branch.

You guys mentioned that you want to keep this branch live and maintained until it is fully merged into the main branch.

Yes we did! Sorry for the trouble @webboty , it's now recovered - you can use the relationship-fixes branch again.
Please reserve some time to upgrade to 4.2 (you can even do it now following the 4.2-dev docs). It should have everything this branch has... and more!
Cheers!


Properly determine the size of sets

Closes #19.
Full disclosure: this code is a little bit of a mess, so I will absolutely understand if you would prefer simply removing this check from the list.
The first commit is a real abomination, because I tried to use Set.fromList >> Set.size from a List (Node Expression), but of course Set can only accommodate a comparable value, so I had to transform the expressions into a comparable type. It's bad, but possibly in a "it's so bad it's good" kind of way, which is why I left the commit.
The second commit defines a unique function (ripped from List.Extra) that is less efficient but less demanding. But then I had to do an extra step of reducing a Node Expression to an Expression to get rid of ranges. It's less horrible, but still messy.
Again, if you think it's not worth it, I can just skip the check for sets.

Thank you very much @jiegillet :pray:
I just released your work in 2.0.11.

Awesome, thank you :)


Snackbar.Add() doesn't show if called during lifecycle methods, if ClearAfterNavigation is enabled

Bug type
Component
Component name
Snackbar
What happened?
If I call Snackbar.Add() from within the OnInitialized() Method of a Page, the Snackbar won't be shown unless the page is navigated with NavigationManager.NavigateTo("...", forceLoad: true);
Expected behavior
The Snackbar gets is shown as usual.
Reproduction link
https://github.com/Schuttrim/mudblazor.snackbar-issue
Reproduction steps
In Code Behind of a Page
[Inject]
private ISnackbar Snackbar { get; set; } = default!;

protected override void OnInitialized()
{
    this.Snackbar.Add("Foo", Severity.Success);
}

the `OnInitialized()´ Method could be exchanged with ´OnParametersSet()´ or ´OnAfterRender()´ for the same behavior.
To reproduce the issue, the Page must be navigated using the NavigationManager with forceLoad: false. Also ´AddMudServices()´ must configure be configured like this
builder.Services.AddMudServices(x =>
{
    x.SnackbarConfiguration.ClearAfterNavigation = true;
});

Relevant log output
No response
Version (bug)
6.0.5
Version (working)
No response
What browsers are you seeing the problem on?
Chrome
On what operating system are you experiencing the issue?
Windows
Pull Request

[ ] I would like to do a Pull Request

Code of Conduct

[X] I agree to follow this project's Code of Conduct

Works with OnAfterRender. This is recommended over OnInitialized.


Configure a unique_key for incremental materialization

Preview
What are you changing in this pull request and why?
This convo in Slack that included:

I think it's an oversight that the code snippet here doesn't have a unique_key configured
def model(dbt, session):
    dbt.config(
        materialized = "incremental",
        unique_key = "id"
    )

Implementation
Updated both the "Snowpark" and "PySpark" tabs to include a unique_key configuration.
🎩

Checklist

[x] Review the Content style guide and About versioning so my content adheres to these guidelines.

This is an extra small PR -- I just need a review.


[3.x] [tvOS] tvOS Support

Rework of #45829 and #45830 PRs.
Implements proposal: https://github.com/godotengine/godot-proposals/issues/224
tvOS and iOS platform uses new UIKit platform to share functionality and code.
UIKIT_ENABLED flag is used instead of IPHONE_ENABLED.
Export code is from previous PRs:

Launch screen is storyboard based (no need for launch images)
tvOS project supports empty Apple Team ID
Icons, Signatures and certificates are handled by Xcode project

Mono haven't been ported.
GDNative uses same configuration as iOS platform.
Support plugins that works the same way as iOS, but configuration is using .gdatvp
Related PRs: https://github.com/godotengine/build-containers/pull/71, https://github.com/godotengine/godot-build-scripts/pull/21 will be reworked for tvOS in future.

Great to see tvOS and iOS refactored to a commonish UIKit platform.  UIKIT_ENABLED instead of IPHONE_ENABLED is nice

Could we not share the existing xcode .xcodeproj and define multiple build targets within that project, instead of having a separate one to maintain alongside the iOS one?  Actually, it would kinda be nice to just have misc/dist/xcode and have separate build targets for iOS, tvOS, and macOS...

I don't see a benefit in sharing single project with multiple targets for completely different export profiles that have completely different setting for each platform, plugins system and other stuff.
There will be no benefit for a user to have a single project that require them to fill all fields unrelated to their target platform. Without filling them project wouldn't load. iOS, tvOS and macOS can share bundleID, teamID, maybe some more fields, but after that, they come with different configuration that's better to keep separate.
Also separate .xcprojects are easier to maintain in case we need specific configuration without changing non-target platform template.

Could we not share the existing xcode .xcodeproj and define multiple build targets within that project, instead of having a separate one to maintain alongside the iOS one?  Actually, it would kinda be nice to just have misc/dist/xcode and have separate build targets for iOS, tvOS, and macOS...

I don't see a benefit in sharing single project with multiple targets for completely different export profiles that have completely different setting for each platform, plugins system and other stuff. There will be no benefit for a user to have a single project that require them to fill all fields unrelated to their target platform. Without filling them project wouldn't load. iOS, tvOS and macOS can share bundleID, teamID, maybe some more fields, but after that, they come with different configuration that's better to keep separate. Also separate .xcprojects are easier to maintain in case we need specific configuration without changing non-target platform template.

Fair enough, we just had quite a few frameworks that are universal and our own workflow is usually out of a single .xcodeproj with multiple build targets instead of multiple .xcodeproj for each platform (iOS, MacOS, tvOS).  Seemed like maintaining a single .xcodeproj with multiple build targets might have been easier than 3 separate, (Storyboard, launchscreen, could be shared, or whatever other universal resource or framework).
I think the benefit may come from more in the maintenance of the .xcodeproj template  in the project itself (upgrade formats with new xcode versions, etc), not necessarily from sharing bundle ids, team ids, etc.  For specific configuration changes to a platform build target, we've always managed to achieve that pretty simple per target.
But all-in-all, minor suggestion.

@akien-mga  is this PR supposed to be added to 4.0 milestone?   https://github.com/godotengine/godot/pull/58977 is the [4.0] PR.

@akien-mga is this PR supposed to be added to 4.0 milestone? #58977 is the [4.0] PR.

Is the minor suggestion of keeping only one .xcproject file hold this PR back from being added to the 4.0 milestone? Or will it might be added to the 4.1?
Would love to be able to support Apple Arcade demands of tvOS as well, when developing for their services.


Format code using 'cargo fmt'

I ran cargo fmt on the current version and committed the result, to avoid conflicts.
Thanks for the suggestion!


Update ansible-bootstrap to Python 3

https://github.com/kinvolk/ansible-coreos-bootstrap

We still occasionally use that repo in our own infra, and i had the need to update it to python3 recently. Check the flatcar-historical branch here https://github.com/kinvolk/ansible-coreos-bootstrap/tree/flatcar-historical.


Add an ANET service graphql interface

Add an ANET service interface with the following methods:
anetVersion - returns the version of ANET served by the server, visible to all users
clearCache - clears all caches, mutation allowed for admins only
reload dictionary - reloads the dictionary (may requiure splitting the dictionary from the rest of the anet.yml file), mutation allowed for admins only
recentUsers - returns the users that recently called a service, last time of service use (besides heartbeats) and ip address (either users in the last n minutes, or the most recent n users...)
onlineUsers - returns the currently/recently logged users, last time of service use and ip address (or an approximation - i.e. the most recet 20 users)

anet version : it says version of Anet served by the server . I guess this is the version that "git describe" returns , isn't it ?

clearCache : Does it mean to server side cache of working project on network or is it the cache just only related with the admin's client-side cache (Apollo cache logic)

reload dictionary : What I understand on this subject is ; a network admin changes the dictionary file located in deployed project folder manually (which will be a seperate file other than anet.yml)  and then wants to apply these new dictionary values into to the working project instance without restarting server.
So he/she needs a service url to reload AnetConfiguration dictionary parameter with these new values .Does the scenario like that or did I get it wrong?

Last question is about UI .
is it just enough to create new call urls so that admin calls these urls manually to clearCache and reloadDictionary
or should we provide a new UI page and so admin opens that page and can trigger these functions through clicking buttons (Clear Cache and Reload Dictionary) placed on that page.

anet version : it says version of Anet served by the server . I guess this is the version that "git describe" returns , isn't it ?
I think this is a good one to use. At gradlew build time, we can inject this version in index.hsb or similar, as well as somewhere in the server-side code as well.

clearCache : Does it mean to server side cache of working project on network or is it the cache just only related with the admin's client-side cache (Apollo cache logic)
As it is a graphql service, it is about serverside cache. I had in mind to clear the ehcache cache, but there could be others. Which one did you have in mind?

reload dictionary : What I understand on this subject is ; a network admin changes the dictionary file located in deployed project folder manually (which will be a seperate file other than anet.yml) and then wants to apply these new dictionary values into to the working project instance without restarting server.
So he/she needs a service url to reload AnetConfiguration dictionary parameter with these new values .Does the scenario like that or did I get it wrong?
Correct. We are looking to reload the new values in the service that returns the dictionary. We should not try to solve updating the clients's states with these values, as this is probably too much work at this point

is it just enough to create new call urls so that admin calls these urls manually to clearCache and reloadDictionary
or should we provide a new UI page and so admin opens that page and can trigger these functions through clicking buttons (Clear Cache and Reload Dictionary) placed on that page.
Let's put them directly in the existing page for /admin:
clearCache -> a button there
recentUsers/onineUsers -> a simple react table

anet version -> we can put this in the banner, visible to everyone


Unabale to build container

Hi Devs,
Very excited to test out your code but I am running into issues building the docker container. I want to preface that I am completely new to Docker so I may be overlooking something simple when building.
When building the container I initially was unable to install python.
=> ERROR [ 4/11] RUN conda install python=3.6 && pip install presto=  2.1s
From the Dockerfile I referenced the image source, continuumio/miniconda3:4.10.3, but found that python 3.6 is not available. Changing the python version to 3.9 allowed me to proceed. Then moving forward it was failing to install umi_tools.
#7 32.16 PackagesNotFoundError: The following packages are not available from current channels:
#7 32.16
#7 32.16   - umi_tools

Again I edit the Dockerfile, this time changing the source from anaconda to pypi, and was able to proceed. But now I'm running into an error I can't seem to solve.
#7 41.08     gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
#7 41.08     gcc: error: .2-a+fp16+rcpc+dotprod+crypto: No such file or directory
#7 41.08     gcc: error: unrecognized command line option ‘-n1’; did you mean ‘-n’?
#7 41.08     gcc: error: unrecognized command line option ‘-n1’; did you mean ‘-n’?
#7 41.08     error: command '/usr/bin/gcc' failed with exit code 1
#7 41.08     ----------------------------------------
#7 41.08 ERROR: Command errored out with exit status 1: /opt/conda/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-669d2j4s/pysam_e4e6114a58a348479bb4b46e64d38786/setup.py'"'"'; __file__='"'"'/tmp/pip-install-669d2j4s/pysam_e4e6114a58a348479bb4b46e64d38786/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-a7zsn5n8/install-record.txt --single-version-externally-managed --compile --install-headers /opt/conda/include/python3.9/pysam Check the logs for full command output.
------
executor failed running [/bin/sh -c conda install python=3.9 && pip install presto==0.6.2 changeo==1.1.0 && pip install umi_tools]: exit code: 1

I would greatly appreciate some guidance. I am working in MacOS on Apple M1. Thanks for your time and patience.

Hi, have you got more info on your initial error? Was it Python that couldn't be installed or any of the modules?

Thanks so much for the quick reply. It was initially a failure to install python. Once corrected, its always failing at installation of umi_tools. And if that gets corrected, it gives that large chunk of error code which is where I've been stuck.
Here is the initial error output when the Dockerfile has been unchanged.
 > [ 4/11] RUN conda install python=3.6 && pip install presto==0.6.2 changeo==1.1.0 && conda install -c bioconda -c conda-forge  umi_tools=1.1.2:
#7 0.332 Collecting package metadata (current_repodata.json): ...working... done
#7 1.694 Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
#7 1.694 Collecting package metadata (repodata.json): ...working... done
#7 2.591 Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
#7 2.592
#7 2.592 PackagesNotFoundError: The following packages are not available from current channels:
#7 2.592
#7 2.592   - python=3.6
#7 2.592
#7 2.592 Current channels:
#7 2.592
#7 2.592   - https://repo.anaconda.com/pkgs/main/linux-aarch64
#7 2.592   - https://repo.anaconda.com/pkgs/main/noarch
#7 2.592   - https://repo.anaconda.com/pkgs/r/linux-aarch64
#7 2.592   - https://repo.anaconda.com/pkgs/r/noarch
#7 2.592
#7 2.592 To search for alternate channels that may provide the conda package you're
#7 2.592 looking for, navigate to
#7 2.592
#7 2.592     https://anaconda.org
#7 2.592
#7 2.592 and use the search bar at the top of the page.
#7 2.592
#7 2.592
------
executor failed running [/bin/sh -c conda install python=3.6 && pip install presto==0.6.2 changeo==1.1.0 && conda install -c bioconda -c conda-forge  umi_tools=1.1.2]: exit code: 1

Hi,
I was able to reproduce the error of being unable to install umi_tools when using python=3.9
But with the original Python 3.6 the docker build command does not give errors for me.
I will investigate why Python 3.6 was not available for you.
Peter

Are you using a Apple M1 Max computer by any chance?

Hi there. My computer is using an M1 Pro processor.
From: Peter van Galen @.>
Date: Monday, February 21, 2022 at 9:14 AM
To: mainciburu/WAT3R @.>
Cc: Medina-Serpas, Miguel A. @.>, Author @.>
Subject: Re: [mainciburu/WAT3R] Unabale to build container (Issue #3)
[External Email]
Are you using a Apple M1 Max computer by any chance?
—
Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mainciburu_WAT3R_issues_3-23issuecomment-2D1046924000&d=DwMCaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=MtKkbYWVoRDJfchtr8QS09qONktLZiTa77_bZw64sIA&m=wR2HX-40MuzJXo7mCqTctFHQuQTX8SrOecz56XDSYoI46kpAtOGngqBv_2s8kC2J&s=zjKSwjQZBfQNf2uGnARFUhnXiPwLVMnsJOFpIoJ1EtQ&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AXSBYQZHJ3FT75UX6N3IE73U4JCERANCNFSM5N25OAUA&d=DwMCaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=MtKkbYWVoRDJfchtr8QS09qONktLZiTa77_bZw64sIA&m=wR2HX-40MuzJXo7mCqTctFHQuQTX8SrOecz56XDSYoI46kpAtOGngqBv_2s8kC2J&s=sxzhqmcEAgFHbnrQk62Wnf4yWKy48pSREolaC8rbv8U&e=.
Triage notifications on the go with GitHub Mobile for iOShttps://urldefense.proofpoint.com/v2/url?u=https-3A__apps.apple.com_app_apple-2Dstore_id1477376905-3Fct-3Dnotification-2Demail-26mt-3D8-26pt-3D524675&d=DwMCaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=MtKkbYWVoRDJfchtr8QS09qONktLZiTa77_bZw64sIA&m=wR2HX-40MuzJXo7mCqTctFHQuQTX8SrOecz56XDSYoI46kpAtOGngqBv_2s8kC2J&s=5PWW57jHZGnmXXUFPvVMmavPr267mqbGIcjvkyIMh4w&e= or Androidhttps://urldefense.proofpoint.com/v2/url?u=https-3A__play.google.com_store_apps_details-3Fid-3Dcom.github.android-26referrer-3Dutm-5Fcampaign-253Dnotification-2Demail-2526utm-5Fmedium-253Demail-2526utm-5Fsource-253Dgithub&d=DwMCaQ&c=sJ6xIWYx-zLMB3EPkvcnVg&r=MtKkbYWVoRDJfchtr8QS09qONktLZiTa77_bZw64sIA&m=wR2HX-40MuzJXo7mCqTctFHQuQTX8SrOecz56XDSYoI46kpAtOGngqBv_2s8kC2J&s=tLDqkXGbVRDN3cp9tEf05NiSFijyh7ygpV-J6YtL28k&e=.
You are receiving this because you authored the thread.Message ID: @.***>

Hi,
Thanks for your patience. I don't have a solution but found that the errors occur on Mac with M1 processor (M1 Pro and M1 Max). I was able to successfully build the image using this line:
docker buildx build --platform linux/amd64 -t mainciburu/wat3r .
(you may  need to add the option --no-cache and/or install rosetta using softwareupdate --install-rosetta)
When running wat3r, I am now getting another error when the igblastn is being executed. This is the error:
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x451f76
I have not been able to get around this. The quickest solution would be to run WAT3R on a cluster or Terra.bio, but I will continue to look into this.


Upgrade to JTS v1.14

Fix for #583.  Also backs out of temporary fix for #564.  I used the FilterTest provided by @datasedai to verify.

my one concern is regarding conflicting with geotools' dependencies:
because the artifact name changes, I imagine we'd be bringing in both dependencies? Did 1.14 change package naming conventions to avoid a conflict or are we ending up relying on the order of class loading?  If so, and it so happens that 1.14 classes are used instead of 1.13 could the 1.14 classes potentially cause runtime issues with geotools?

Good catch.  Let this PR sit and I will look into this.

  I used the Maven dependency plugin to ensure that the only JTS dependencies in our entire tree are JTS 1.14.  This will ensure that anyone who relies on JTS loads the 1.14 class (GeoTools/Geoserver).  JTS 1.14 does not introduce any breaking API changes, only bug fixes and functionality/performance enhancements so this approach should be safe.  Let me know what you think.


Integrating Mongoose structure

Hi, I'm using your project structure and find that very helpful. Can you advice me on how would you structure this project adding mongoose integration.
I would need to use models' logic in controllers. Could you help me on that?

I think you can create two folders named 'controllers' and 'models' under /server
Then, in your model folder put your mongoose model.
Is this what you need or more specific?

Hi @khoiln! I have actually responded to someone with the same question here... https://github.com/hapijs/discuss/issues/100
I hope that helps. Please let me know if you have other questions but that should do it! :smile:
Also @dev0x10 just responded while I was typing this. Yeah, having a controllers folder and a models folder is a usually the simplest way and most common way to handle the folder structure. On really large projects it is nicer to have it broken down by section. Such as a users folder with the controllers and models of users. But I wouldn't worry about breaking it out like that until you have a LOT of stuff or many team members working on the project.

Yes I'd agree. So, it depends on the project :+1:

Thanks alot @dev0x10 and @poeticninja :+1:


Errors with Rails 5.2

Just upgraded to Rails 5.2 (notably ActiveModel 5.2) and am getting these errors when trying to call .create or .save on my models. Stack trace at bottom of issue.
I've tracked it down to the fact that it seems that ActiveModel now expects the @attributes property to be a ActiveModel::AttributeSet causing the semantics of checking for changed? to change in attribute_mutation_tracker.rb:45.
attributes[attr_name].changed? throws the nil error because Cequel stores Cequel::Record @attributes as a regular hash.
As a quick fix I tried this the following:
module ActiveModel
  class AttributeMutationTracker # :nodoc:
    OPTION_NOT_GIVEN = Object.new

    def initialize(attributes)
      @attributes = attributes.is_a?(Hash) ? ActiveModel::AttributeSet.new(attributes) : attributes # Check for hash and act accordingly

But that causes the following error:
/Users/erik/.rvm/gems/ruby-2.5.1/gems/activemodel-5.2.0/lib/active_model/attribute_set.rb:37:in `block in keys': undefined method `initialized?' for #<Cassandra::Uuid:0x00007fc5262f35d0> (NoMethodError)

So I'm not sure if Cassandra::Uuid might need changing to support ActiveModel 5.2?
Original stack trace (exactly following MyModel.create)
	17: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:54:in `new'
	16: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:54:in `tap'
	15: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:55:in `block in new'
	14: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/scoped.rb:62:in `initialize_new_record'
	13: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:420:in `initialize_new_record'
	12: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/mass_assignment.rb:39:in `attributes='
	11: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:314:in `attributes='
	10: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:314:in `each_pair'
	 9: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:315:in `block in attributes='
	 8: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:247:in `id='
	 7: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/dirty.rb:66:in `write_attribute'
	 6: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/persistence.rb:327:in `write_attribute'
	 5: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/cequel-3.0.2/lib/cequel/record/properties.rb:384:in `write_attribute'
	 4: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/activemodel-5.2.0/lib/active_model/attribute_methods.rb:382:in `id_will_change!'
	 3: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/activemodel-5.2.0/lib/active_model/dirty.rb:312:in `attribute_will_change!'
	 2: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/activemodel-5.2.0/lib/active_model/dirty.rb:174:in `attribute_changed?'
	 1: from /Users/erik/.rvm/gems/ruby-2.5.1/gems/activemodel-5.2.0/lib/active_model/dirty.rb:290:in `changes_include?'
/Users/erik/.rvm/gems/ruby-2.5.1/gems/activemodel-5.2.0/lib/active_model/attribute_mutation_tracker.rb:45:in `changed?': undefined method `changed?' for nil:NilClass (NoMethodError)

My model:
class Feed
 include Cequel::Record

  key :id, :uuid
  column :legacy_id, :int
end

Code to reproduce:
Feed.create({
  "id" => "b0000000-0000-0000-0000-000000000000",
  "legacy_id"=>388176577
})

I made this  fork that works. What I did was change the name of the internal instance variable of Cequel to cequel_attributes instead of attributes. TBH I don't think it's a great solution, as there is probably a simpler approach to connecting ActiveModel::Dirty with classes that have @attributes instance variables.
https://github.com/feederco/cequel

+1
Having the same issue.

I've never tried cequel with rails 5.2. I'd love to have a PR that makes it work, though.

@pezra did you check out https://github.com/cequel/cequel/pull/392?

@pezra sorry but just wondering what you meant with "I'd love to have a PR that makes it work, though." when there was a PR since before that comment :)

What's the status on getting the ActiveModel 5.2 support https://github.com/cequel/cequel/pull/378?

I  think this request is stale, and handled. Will mark as stale and close in 30 days if no one complains.


Visit site buttons

Hello,
Visit site buttons are not working and they are also an HTML button element but should be as best practice should be a tags.

hey , can you please assign it to me

@hparashar27  FYI there is a PR related to this issue #15

Hi @hparashar27, i'm glad to see you wanting to contribute. you can create issue(s) related to suggestions, feedbacks, bugs or any improments you need in site, and also feel free to rise PR. I'd love to have you

Am available.


Reconsider usage of dockerImageRepository from imagestream status field in image field of assembled Notebooks

Feature description
https://github.com/opendatahub-io/odh-dashboard/search?q=dockerImageRepository
Currently, across the board in both frontend (Jupyter, same namespace for Notebooks as namespace of ODH Instance) and backend (different namespaces posssible), the imageUrl referenced in Notebook image: field is constructed from Imagestream status ' dockerImageRepository (varialbe imageUrl in the code).
That entry is empty and non-existent when there is no openshift-internal docker registry / dockerImageRepository used.
     from:
        kind: DockerImage
        name: 'quay.io/thoth-station/s2i-generic-data-science-notebook:v0.0.5'
      generation: 2
      importPolicy: {}
      referencePolicy:
        type: Source
status:
  dockerImageRepository: ''
  tags:
    - tag: v0.0.5
      items:
        - created: '2022-11-21T13:14:31Z'
          dockerImageReference: >-
            quay.io/thoth-station/s2i-generic-data-science-notebook@sha256:3f619c61501218f03d39d97541336dee024f446e64f3a47e2bc7e62cddeb2e58
          image: >-
            sha256:3f619c61501218f03d39d97541336dee024f446e64f3a47e2bc7e62cddeb2e58
          generation: 2

Consider instead to use imagestream name and tag for referencing images.
For cases where Notebook CRD is in a different namespaces than the rest of the software (odh notebook controller, odh dashboard, you need to allow the service account to access an imagestream in a different namespace (system:image-puller).
That seems to be the case, however, already,
https://github.com/opendatahub-io/odh-dashboard/blob/c683fef35416e65d974711476e6b0396eceae673/frontend/src/utilities/notebookControllerUtils.ts#L159
which makes the case for referencing imagestream name and tag  in a Notebok container even more valid.
publicDockerImageRepository is not a solution, either, because that is dependent on the internal registry, too, plus it being exposed externally:

PublicDockerImageRepository represents the public location from where the image can be pulled outside the cluster. This field may be empty if the administrator has not exposed the integrated registry externally.

Already, in the types, those fields are not mandatory, optional, which is great.
Describe alternatives you've considered
No response
Anything else?
Absolute blocker on all environments that use no openshift-internal docker registry. Especially critical because Jupyterhub is no longer maintained and customers are encouraged to switch to Dashboard plus Notebook controller / Notebook CRDs.

See also related PR https://github.com/opendatahub-io/odh-dashboard/pull/800

I believe @VaishnaviHire is working with you on this -- is that correct @shalberd ? I know we have had a bit of a hiccup during the start of the year, but the last I heard was there was something happening upstream on the Notebook Controller to help with this.

Yes, that is correct, we have discussed this and I have prepared an upstream Kubeflow PR for the notebook controller and reconciliation util therein. https://github.com/kubeflow/kubeflow/pull/6904
It is on the agenda for today's Kubeflow notebooks workgroup meeting https://docs.google.com/document/d/1YtSWRhdhyOgd6ZQcWLM38TGDy2H_EhXjr8U5lUi37_I/edit#
@LaVLaS We will see whether they are willing to merge this in upstream. In any case, we'd need to do a merge of upstream to downstream Kubeflow then. If they do not agree to merge, we can put the same logic in opendatahub-io/kubeflow and build a test docker image from there for the notebook controller.

@harshad16 @andrewballantyne @lucferbux
Vaishnavi Hire is currently testing behavior of the new notebook controller, taking into account image change trigger annotations, and its impact on long-running notebooks when weekly images change behind an imagestream tag. Idea is to first merge in our opendatahub / downstream notebook PR and then later to merge in odh dashboard PR that makes use of the image change trigger annotation to enable notebook spawning both in environments with and without the internal openshift image registry.

@harshad16 @jiridanek @jstourac @atheo89 @lucferbux
closed in favor odh odh notebook controller doing the notebook image field lookup in all cases (no openshift internal registry, openshift internal registry): https://github.com/opendatahub-io/kubeflow/pull/336 and https://github.com/opendatahub-io/kubeflow/pull/329
as well as dashboard changes https://github.com/opendatahub-io/odh-dashboard/pull/2867/
Thank you all very much, neat work
minor remaining: changing notebook container imagePullPolicy: IfNotPresent from old imagePullPolicy: Always
as a nice-to-have feature for external registry and large images with a unique hash. Needs to be validated if that works with internal openshift registry, too. Saves times on workbench startup.


Support for npm lockfileVersion 3

Hi,
we noticed that pgscan isn't showing any dependencies for one of our npm-projects.
After debugging into it and comparing it with other npm-projects we noticed that there is a difference in the lockfileVersion of the package-lock.json files. The "problem-project" has lockfileVersion 3 while the others have lockfileVersion 2.
pgscan tries to read the dependencies from the property "dependencies" which is a legacy-property from lockfileVersion 1. lockfileVerson 2 was downward compatible, but lockfileVersion 3 (used by npm v9) is not. The newest package-lock.json no longer has the property "dependencies" and all dependencies are part of the "packages"-property.
Here is the official documentation about it: https://docs.npmjs.com/cli/v9/configuring-npm/package-lock-json/#lockfileversion
Have you already noticed this breaking change in the package-lock.json files?
Supporting lockfileVersion 3 would be very useful.

conversation moved to https://forums.inedo.com/topic/3877 (where we can track it much easier)


std.typecons: prevent inference of attributes of test cases

Because the inference rules change, and this makes traits resistant to such changes. Yet another blocker for:
dlang/dmd#5881
so please don't delay reviewing/pulling this.

If this change requires this many Phobos PRs, it begs the question of how much user code is going to be broken.
I know the argument is that this is a bug and therefore should be "broken", but it might be best to see how widespread this is before merging the DMD change.

If this change requires this many Phobos PRs, it begs the question of how much user code is going to be broken.

No actual code has been broken yet, just test code. What's interesting is how the same aspect is tested for over and over and over and over.

Auto-merge toggled on

Thanks!


workflow: set context to build peerpod-ctrl image

working-directory is not applied to steps.uses

I'll merge this PR based on the comments from @snir911

Thanks, yes, I think it should work as this what was in the original PR i sent which IIRC i tested and it was removed during the PR reviewing process

I'll merge this PR based on the comments from @snir911


Home Assistant 2023.8 release with EK integration

Sent an email a few days ago with no reply, but the integration I've been working on has been merged and is going out in the next release of Home Assistant.
Thanks for the collab in making it happen and I'll continue to add additional features over time.
https://www.home-assistant.io/blog/2023/08/02/release-20238/#new-integrations

2023.9 will contain the select entity for selecting HOP and has been merged.

@mikey0000 - congratulations and nice work on getting the Electric Kiwi Integration into Home Assistant. It is a great piece of work and we look forward to seeing more functionality coming through in the plugin.
Cheers, Matt


MM-17444 UI Automation: Write an automated test using Cypress for "Markdown correctly parses "://///" and doesn't break the channel

Summary

Added a unit test for sending "://///" and testing if it parses correctly does not crash.
Ticket Link
https://github.com/mattermost/mattermost-server/issues/11744

@allenlai18 LGTM, thanks!

Thank you!  thanks for bearing with me. I am still learning!

@saturninoabril does this PR needs to be synced before merge?

@prapti Yup, but I did that and something on CI is not working properly.  Will look into this again.

Now ready to merge, thanks @allenlai18!


Active record generate incorrect update query for decimal numbers

What steps will reproduce the problem?
Model: http://pastebin.com/S1VmaAsW
Controller Action: http://pastebin.com/mSJPac90
Raw Body:
{"id":"3","type_id":"1","article":"1231238123","producer_id":"1","title":"Крутой счетчик","price_retail":121.22,"price_wholesale":3123.33,"description":"12312","unit_id":"1","warehouse_id":"1","quantity_1":"22","quantity_1_1":"22","quantity_1_2":"0","quantity_1_3":"0","quantity_2":"1","quantity_2_1":"0","quantity_2_2":"1","quantity_2_3":"0","quantity_3":"0","quantity_3_1":"0","quantity_3_2":"0","quantity_3_3":"0","quantityInWarehouses":[{"id":"10","warehouse_id":"1","warehouse_item_id":"3","number":"22","type":"1"},{"id":"11","warehouse_id":"1","warehouse_item_id":"3","number":"0","type":"2"},{"id":"12","warehouse_id":"1","warehouse_item_id":"3","number":"0","type":"3"},{"id":"13","warehouse_id":"2","warehouse_item_id":"3","number":"0","type":"1"},{"id":"14","warehouse_id":"2","warehouse_item_id":"3","number":"1","type":"2"},{"id":"15","warehouse_id":"2","warehouse_item_id":"3","number":"0","type":"3"},{"id":"16","warehouse_id":"3","warehouse_item_id":"3","number":"0","type":"1"},{"id":"17","warehouse_id":"3","warehouse_item_id":"3","number":"0","type":"2"},{"id":"18","warehouse_id":"3","warehouse_item_id":"3","number":"0","type":"3"}],"producer":{"id":"1","title":"Bosch"}}
Table structure:
CREATE TABLE warehouse_items (
id INT(11) NOT NULL AUTO_INCREMENT,
type_id INT(3) NOT NULL,
article VARCHAR(12) NOT NULL COLLATE 'utf8_unicode_ci',
producer_id INT(3) NOT NULL,
title VARCHAR(60) NOT NULL COLLATE 'utf8_unicode_ci',
price_retail DECIMAL(13,2) NULL DEFAULT NULL,
price_wholesale DECIMAL(13,2) NULL DEFAULT NULL,
description TEXT NULL COLLATE 'utf8_unicode_ci',
unit_id INT(3) NULL DEFAULT NULL,
PRIMARY KEY (id),
INDEX FK_warehouse_items_warehouse_items_types_id (type_id),
INDEX FK_warehouse_items_warehouse_items_producers_id (producer_id),
INDEX FK_warehouse_items_warehouse_items_units_id (unit_id),
CONSTRAINT FK_warehouse_items_warehouse_items_producers_id FOREIGN KEY (producer_id) REFERENCES warehouse_items_producers (id) ON UPDATE NO ACTION ON DELETE CASCADE,
CONSTRAINT FK_warehouse_items_warehouse_items_types_id FOREIGN KEY (type_id) REFERENCES warehouse_items_types (id) ON UPDATE NO ACTION ON DELETE CASCADE,
CONSTRAINT FK_warehouse_items_warehouse_items_units_id FOREIGN KEY (unit_id) REFERENCES warehouse_items_units (id) ON UPDATE NO ACTION ON DELETE CASCADE
)
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB
AUTO_INCREMENT=22
;
SQL Query log after save:
2016-10-12 11:27:08 [profile begin][yii\db\Command::execute] UPDATE warehouse_items SET type_id=1, producer_id=1, price_retail=121, price_wholesale=3123, unit_id=1 WHERE id=3
in /var/www/crm/controllers/WarehouseController.php:109
2016-10-12 11:27:08 [profile end][yii\db\Command::execute] UPDATE warehouse_items SET type_id=1, producer_id=1, price_retail=121, price_wholesale=3123, unit_id=1 WHERE id=3
in /var/www/crm/controllers/WarehouseController.php:109
What is the expected result?
I expected to see query with fractional part number
What do you get instead?
I see only int number without fractional part
Additional info

Q
A

Yii version
2.0.9

PHP version
PHP Version => 7.0.11

Operating system
Linux localhost 4.7.6-1-ARCH x86_64

It does not work only on my localhost but on server it works ok.
Server info:
PHP: 7.0.11-1+deb.sury.org~xenial+1
OS: Linux 4.4.0-38-generic #57-Ubuntu x86_64
Yii: 2.0.9
Code on localhost and server same. Vendors - same.


Decouple the message from what the subject function does to it's argumen...

...ts
Before that, a subject that would e.g. shift the argument array would cause the
final message to be modified. With this change, the @func_args are initialised
immediately and not accessible anymore to modificatoin from the subject.

I should probably do add a spec for this case. It's easy to loose

:+1:

:+1:


Remove the x-scroll in the website (UI scope)

can you remove the overflow-x-scroll class here?

thanks for creating the issue, already solved 🫡


Allow the ryu dependency be opt-out

ryu is Apache-2.0 which may be unacceptable for a MIT-only reverse dependency.
We could make ryu optional (and required by the arbitrary_precision feature), and make write_f32/write_f64 use the standard library's formatter when ryu is not used.

Thanks for the suggestion. The original C implementation my ryu crate is based on is dual licensed Apache 2.0 + Boost 1.0. Would it help if I make the ryu Rust code available under Boost 1.0? Boost is strictly less restrictive than MIT i.e. Boost is identical to MIT except that when distributing only "machine-executable object code generated by a source language processor" then there are no obligations whatsoever. I am not a lawyer but that seems like any MIT-only reverse dependency would be able to satisfy the terms of the Boost license.

Alternatively we could reach out to the original authors asking to make their code available to us under the terms of the MIT license.

Law-wise I think following the original license choice (Apache-2.0/BSL-1.0) is a good idea (IANAL).
I raised this issue because it triggered rustc's license checker. So even with the license change, the tools would still need to know that BSL is compatible with MIT.

Done in ryu 0.2.6. Let's leave this issue open until the legal stuff is sorted on rustc's end.

I am not sure whether this is still moving or who is responsible for following up in the license checker tool, so I'll give this a close. Let me know if there is anything more needed on my end.


Upgrade rust dependencies

Goal
The goal of this PR is to upgrade dependencies on the graph-sdk. To add support for more targets like aarch64 on linux, the CI was demanding newer Rust version and that was the reason to upgrade everything.
Closes #182
Changes

Upgraded Rust version to "1.76.0" stable
Upgraded all crates to latest stable versions
Fixed cargo deny toml to work with the latest updates (had to manually allow some licenses)
Bumped all internal packaged from 1.0.0 to 1.0.2. (Skipped 1.0.1 since wanted to keep the internal and published released versions in sync if possible and we already released 1.0.1)

Open issues

[x] FFI tests is broken in CI and had to comment it temporarily

@JoeCap08055 this was kinda described in the PR description but open to suggestions if you think we should do it differently

Bumped all internal packaged from 1.0.0 to 1.0.2. (Skipped 1.0.1 since wanted to keep the internal and published released versions in sync if possible and we already released 1.0.1)

Merging this PR to get the ball rolling. Any existing concerns will be addressed in future PR's before cutting a new release.


Dont' require "[]" in motor-html element attributes.

For example, let's do
<motor-node rotation="10 20 30"></motor-node>

instead of
<motor-node rotation="[10 20 30]"></motor-node>

closed in https://github.com/infamous/infamous/commit/2ad358ceddc038877b128aa1ae164263db27978b


Does child routes work

{
      path: '/parent',
      component: Parent,
      childen: [
        {
          path: 'child',
          component: Child
        }
      ],
      meta: {
        layout: 'grid'
      }
}

this renders with default.vue insted of grid.vue

sorry, closing this as it was a spelling mistake(childen).


UnboundLocalError: local variable packed referenced before assignment

System information

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac OS 10.14
TensorFlow installed from (source or binary): binary
TensorFlow version (use command below): v1.14.0-rc1-22-gaf24dc91b5 1.14.0
Python version: 3.7.3

Describe the current behavior
Some specific set of circumstances skip over assigning packed to a value.
https://github.com/tensorflow/tensorflow/blob/551b67c8dff2d3656cb1858f1cb11beb049dafaf/tensorflow/python/util/nest.py#L472
Describe the expected behavior
The local variable packed should have a value set.
Code to reproduce the issue
Throw an IndexError in this call and make sure the if statement is not entered.
I wish I had a portable example for you but I'm not quite sure why my code triggering this path and I don't have much time to investigate the root cause, but I can confirm that is an error that I have encountered naturally. It isn't just hypothetical.
Other info / logs
TF portion of the stack trace:
  File "/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/nest.py", line 516, in map_structure
    expand_composites=expand_composites)
  File "/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/nest.py", line 450, in pack_sequence_as
    return _sequence_like(structure, packed)
UnboundLocalError: local variable 'packed' referenced before assignment

In order to expedite the trouble-shooting process, please provide a minimal standalone code to reproduce the issue reported here. Thanks!

It has been 14 days with no activity and the awaiting response label was assigned. Is this still an issue?

@gehring
Please, let us know is this still an issue?. If so please provide a minimal standalone code to reproduce the issue reported here.Thanks!

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!


added permission requirements

#502

@nenonix @JohanFreelancer9 - kindly do the copy editor review for this PR. Thanks.

this goes to @chrisda not chrfox


Error messages upon instance creation

I used octodeploy on 3 different RPIs in the last few days working perfectly - but today i suddenly got an error message?

Are you using OctoPi or some other linux distribution?
This should be fixed with sudo apt install uuid-runtime but it is curious why it wasn't installed when you did the system preparation.

I'm using a fresh OctoPi install, and i chose OctoPi when i ran Prepare system.

What happens when you give sudo apt install uuid-runtime command?


"Nonetype has no attributes "users" " while send_packet_multicast

has i saw the problem, it appear that in this server's method, your define the args room_id to None, but there is no rooms with the id None, so i think you should replace it with "default". that worked for me.

that worked for me.
i just put "room_id" to default.

closing since stale. not sure how to reproduce it since aGoatdev's issue is vague.


Make tokio / async-io optional task execution engines 2

This is a copy of abandoned PR: #2624, I hope every original assumption is kept. All credit should go to @hanabi1224 as he/she is the author of 99% of the code present here and I just resolved conflicts so this could be reviewed again and possibly merged. Quick test shows that added features are not exclusive.

Hello, I can see that both older and newer PRs are reviewed/commented, is there any particular reason for this PR not being reviewed? Can I do anything to speed it up?

This PR is harder to review. While the code change is small, reviewing it properly would mean cloning the PR locally, write an example with tokio compatibility enabled and tokio tasks, and looking at how it behaves, comparing to similar tasks without tokio

My whole intent was being able to use tokio in bevy in a way that will not force me to use async_compat which is not as convenient to use and probably not maintained anymore. I didn't analyze impact of adding new threads, if you believe it will negatively impact bevy then feel free to close it this PR.

Related: #12090

Related: #12090
For tokio, this means we can use tokio-rayon
async-io can probably follow the same convention

Backlog cleanup: closing due to inactivity, noting the existence of #11995 and the merge of #9626. At this stage it seems there are sufficient PRs tracking this and related async issues not to open a further issue.


Show related model's field in list/detail page

Checklist

[X] There are no similar issues or pull requests for this yet.

Is your feature related to a problem? Please describe.
Be able to show a related model's field in the list/details page:
class User(...):
    __tablename__ = "users"

    name = Column(VARCHAR(length=128), nullable=False)
    role = relationship(...)
    role_id = ...

class Role(...):
    name = ...
    users = relationship(...)

Now in the Admin in User page I want to show the User.role.title like:
class UserAdmin(...):
    list_display = [User.id, "role.name"]

Describe the solution you would like.
No response
Describe alternatives you considered
No response
Additional context
No response

Already released in v0.16.0


add in all GL fields

can now lookup GL acct.

[ ] GL button doesn't get selected color even though page changes
[ ] Search is only finding exact matches when looking for the code (maybe this is because the PPM stuff has the code in the name)?
[ ] Purpose is only 2 characters, search isn't triggered unless you search the name

@jSylvestre search should only find exact matches for code, or at least that's how I intentionally wrote it.  Your purpose code comment is interesting though, I guess i'll have to parameterize the # chars required to handle that case.

@jSylvestre I fixed the other 2 things -- purpose code now just requires 2 chars for search, so entering a code directly will work


Remove a newly posted item leads to TypeError: undefined is not a function

Came across the following scenario, could also be linked to #1016:
Populate the posts list:
var Posts = Post.getList().$object;
$scope.posts = Posts;

Add a new post:
$scope.submitPost = function () {
    Posts.post($scope.post).then(function(data) {
        var addedPost = data.success.data;
        $scope.posts.unshift(addedPost);
    }, function() {
        console.log("There was an error saving the post");
    });
};

Attempt to delete the newly added post:
$scope.deletePost = function (postId) {
    var postToRemove = _.find(Posts, function(returnedPost) {
        return returnedPost.id === postId;
    });
    postToRemove.remove().then(function(data){
        $scope.posts = _.without($scope.posts, postToRemove);
    })
};

End up with "TypeError: undefined is not a function", I believe because the newly created post is not added to the Posts collection. (Remove works with the above Posts brought through on initial load, and of course on the newly created post after a page refresh.)
How is it best to handle the following scenario in light of the above? Or is there a better way to handle the add / remove?

OK, so I decided to go for a workaround approach to keep my $scope in sync until #1016 is hopefully implemented.
Added a generic function to the controller:
function restangularize(){
    var restedPosts = Restangular.restangularizeCollection(null, $scope.posts, 'posts');
    return restedPosts;
}

I call this on the various methods that will perform REST functions, example:
$scope.submitPost = function () {

    var Posts = restangularize();

    Posts.post($scope.post).then(function(data) {
        var addedPost = data.success.data;
        $scope.posts.unshift(addedPost);
    }, function() {
        console.log("There was an error saving the post");
    });
};

Concept is that whatever changes are made to the $scope will be picked on any further functions performed through Restangular.
Thought also about updating the initial Restangular collection on a case by case basis as and when the $scope changes, however by using the above blanket catches any $scope changes and seems to be less error prone in my mind.
Still testing this approach but seems to work quite well so far.
If anyone foresees any issues (performance?, side effects?) doing it this way please do shout out.

This seems to work for me. Can you verify that this is what you want to do?
http://plnkr.co/edit/sZNZgVGfzRjRUkQfeZ7C?p=preview


Default wallet derivation path?

I'm trying to import my ord wallet into Sparrow Wallet just to be able to inspect some things and look at transactions.
I tried using a Single Sig P2TR wallet using BIP39 and the 12 words that were supplied via the ord cli when my wallet was created.
The default m/86' /0' /0' derivation path did not seem to work, or generate the same addresses as ord has been using, so I'm wondering if ord is using a different derivation path? Thanks!

Off the top of my head, what you said sounds right. Try using bitcoin-cli -rpcwallet=ord listdescriptors, it should print out the descriptors.

hmm yep the descriptor output does show [<fingerprint>/86' /0' /0']
In Sparrow the fingerprint and xpub generated from the BIP39 seed appears different but I'm unsure why

Here's our derivation code, maybe we're doing something weird: https://github.com/casey/ord/blob/9f5d864421d3beae50fa5115cc5db94117fd519b/src/subcommand/wallet.rs#L123

Im able to do this in Sparrow, but the receive address that ord gives is the first change address in the wallet, not the receive address.  Still valid, but seemed odd

@vicariousdrama you were able to see all your transactions from your ord wallet in sparrow?
hmm maybe it's possible I wrote down the wrong BIP39. I'll do some more testing with a new ord wallet on a different machine.

OK turns it this was totally a me problem, I've tried again and was able to successfully import the ord wallet into Sparrow

Awesome, great to hear!


Hellow world

For this PR the following were done

Create a new Rails app called 'hello-rails-react'.
Use the command rails new -j webpack my_new_rails_app as described in the previous lesson's tutorial.
Verify that the jsbundling-rails gem is added to your Gemfile.
Initialize your project with Git.
Install needed node dependencies as described in the previous lesson's tutorial.
Create a babel.config.js in the root folder of your project as described in the previous lesson's tutorial.
Update webpack.config.js to include the babel loader as described in the previous lesson's tutorial.
Make sure that your project has a Postgres database set up.

Thank you for the feedback


Public import is not included in generated CommonJS file

System
Version: v3.6.1
Language: Javascript
macOS 10.14
Steps to reproduce

Create a src directory with 3 files:// id.proto
syntax = "proto3";

message Id {
  string value = 1;
}

// task.proto adding a transitive import for `Id`
syntax = "proto3";
import public "id.proto";

message Task {
  Id id = 1;
}

// project.proto importing both `Id` and `Task` from Project
syntax = "proto3";
import "task.proto";

message Project {
  Id id = 1;
  repeated Task task = 2;
}

Compile to js usingmkdir build
protoc --proto_path=src --js_out=import_style=commonjs,binary:build id.proto task.proto project.proto

npm install google-protobuf under the root directory.
node test.js// test.js
var id_pb = require('./build/id_pb');
var project_pb = require('./build/project_pb');

var id = new id_pb.Id();
id.setValue("Everything is fine");

var project = new project_pb.Project()
project.setId(id);

process.stdout.write(project.getId().getValue());
process.stdout.write("\n");

Expected behaviour
Everything is fine is printed to the console.
Actual behaviour
.../test-proto/build/project_pb.js:173
    jspb.Message.getWrapperField(this, id_pb.Id, 1));
                                       ^

ReferenceError: id_pb is not defined
    at proto.Project.getId (.../test-proto/build/project_pb.js:173:40)
    at Object.<anonymous> (.../test-proto/test.js:10:30)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

id_pb import is missing from project_pb. Alternatively it may be referenced from task_pb, since it’s declared public in task.proto.
The error does not show up if id.proto is explicitly imported in project.proto.

We don't support public imports, but this is a reasonable feature request.


Block SPI bus while using FRAM instead of everything on Pixracer

Since the FRAM and the baro are on the SPI bus on Pixracer, there needs to be some locking to prevent the two from crashing on the bus.
Currently, this is done by blocking "everything" while doing a param save, see:
https://github.com/PX4/Firmware/blob/master/src/modules/systemlib/param/param.c#L840
As the comment suggests, it would be better to only lock the bus.

What I noticed recently is the following:

After a param change via QGC, the scheduling of sensor sampling is messed up for ~1/2sec. I think it's during the param save and probably related to disabling the IRQ's (the plot is with 623b99327d0ac9d47af applied).

@bkueng I agree, it's still far from optimal. I got more "manual control lost" messages yesterday. Presumably because I had changed more params from the default.

We have improved this a bit already (current testing suggests performance is sufficient), but the better architecture is still pending.


Trying to Fix the no audio track problem after filters

After noticing audio tracks are being dropped after applying filters,
and as the documentation states:

Some ffmpeg filters drop audio streams, and care must be taken to preserve the audio in the final output.
This dilemma is intrinsic to ffmpeg, and ffmpeg-python tries to stay out of the way while users may refer to the official ffmpeg documentation as to why certain filters drop audio.
The .audio and .video operators can be used to reference the audio/video portions of a stream so that they can be processed separately and then re-combined later in the pipeline.
Example
Process the audio and video portions of a stream independently:

input = ffmpeg.input('in.mp4')
audio = input.audio.filter("aecho", 0.8, 0.9, 1000, 0.3)
video = input.video.hflip()
out = ffmpeg.output(audio, video, 'out.mp4')

So I digged a bit, could be that newer ffmpeg versions had fixed this problem with a more precise way of syntax,
For now the audio track WILL BE DROPPED by default with the way this package is compiling the command lines,
So for example, if you want to concatenate two parts of the video 1.mp4 (with time stamps of the 2 parts in variable timePairs) :
          streams=[ffmpeg.input('1.mp4',ss=str(t0),to=str(t1),**inputArgs) for (t0,t1) in timePairs]
          ffmpeg.output(ffmpeg.concat(*streams) ).run()

it will generate the arg:
ffmpeg -ss 195.089 -to 212.579 -i 1.mp4 -ss 304.767 -to 420.326 -i 1.mp4 -filter_complex [0][1]concat=n=2[s0] -map [s0] -vcodec libx265 "out.mp4"
Per the ffmpeg document, it simply means you DONT WANT audio tracks in it, otherwise it should be:
ffmpeg -ss 195.089 -to 212.579 -i 1.mp4 -ss 304.767 -to 420.326 -i 1.mp4 -filter_complex [0][0][1][1]concat=n=2:a=1[s0] -map [s0] -vcodec libx265 "out.mp4"
the a=1 means for every segment 1 audio track will be used, which can be omitted, like how by default the omitted v=1 meaning 1 video track every segment is, so [0] video, [0]audio, then [1] video, [1] audio will be the filter result

To fix this temporarily I added an argument 'alsoAudio' into the nodes.py, so it looks like:
class InputNode(Node):
    """InputNode type"""

    def __init__(self, name, args=[], kwargs={},alsoAudio=False):
        super(InputNode, self).__init__(
            stream_spec=None,
            name=name,
            incoming_stream_types={},
            outgoing_stream_type=FilterableStream,
            min_inputs=0,
            max_inputs=0,
            args=args,
            kwargs=kwargs,
        )
        self.alsoAudio=alsoAudio

in filters.py
kwargs['n'] = int(len(streams) / stream_count)
to
kwargs['n'] = int(len(streams) / video_stream_count)
then in the run.py
def _format_input_stream_name(stream_name_map, edge, is_final_arg=False):
    prefix = stream_name_map[edge.upstream_node, edge.upstream_label]
    if not edge.upstream_selector:
        suffix = ''
    else:
        suffix = ':{}'.format(edge.upstream_selector)
    if is_final_arg: # and isinstance(edge.upstream_node, InputNode):
        fmt = '[{}{}]'.format(prefix, suffix)
    else:
        fmt = '[{}{}]'.format(prefix, suffix)
        fmt+=fmt if edge.upstream_node.alsoAudio else fmt
    return fmt

Add arg alsoAudio=True in your ffmpeg.input to generate audio map in the filter syntax,
which is read during the compile in run.py, with the added edge.upstream_node.alsoAudio and it will add itself again for the extra audio track
for example, the above example should be:
 streams=[ffmpeg.input('1.mp4',ss=str(t0),to=str(t1),      alsoAudio=True    ,**inputArgs) for (t0,t1) in timePairs]
 ffmpeg.output(ffmpeg.concat(*streams,a=1) ).run()

and it will generate the correct output for ffmpeg to run with:
ffmpeg -ss 195.089 -to 212.579 -i 1.mp4 -ss 304.767 -to 420.326 -i 1.mp4 -filter_complex [0][0][1][1]concat=n=2:a=1[s0] -map [s0] -vcodec libx265 "out.mp4"
with audio track in the result file

Is the alsoAudio options still available?


Improve performance of sync

Sync is a little slow now that we cover all the cases. Need to look into ways to optimize the performance.

New wallet sync is optimized. For recovered wallet we can't do better


Update README.md

added line with links so people can get to indico sign up, custom collections documentation, and original article. And some formatting!

Yeeeeee @dianayuan

Merged! Thanks D!


Use React People picker in a React project

Category

[x] Question

Question
Hello, is it possible to use a component such as the people picker your team developed, in a regular React App?  I am developing a React App that has a form, everything works fine but I wanted to use the PNP people picker in my app as a component as it would save time.  Is this possible?
Environment details (if applicable)
SharePoint 2016 on premise
React App
Not an SPFx webpart

OS: [Windows 10]
Framework: [NET Framework v3.x, .NET Core v3.x, Node.js]
Browser(s): IE, Chrome
Tooling: [VS Code, React]

Unfortunately, this isn't the right forum for this question. Please post that question to the PnP reusable controls project's repo's issue list.
I believe the answer is NO as that library is written to run in an SPFx context. It's open-source so you can see how it was done and create your own though.


:sparkles:Initial replacement of KCP-bind with kube-bind

Summary
Initial replacement of KCP APIExport/APIBinding for view of exports with kube-bind in KubeStellar controllers
Related issue(s)
Fixes #

This will be further reviewed when we push the PR from this branch to main
/lgtm
/approve


Unions of objects/dictionaries/maps and tuples generate type errors when numeric keys are present

TypeScript Version:  2.1.4
Code
type BoxOfBoolPairs = { [name: string]: BoxOfBoolPairs } | [boolean, boolean]

// Good.
const boxA : BoxOfBoolPairs = {}

// Good.
const boxB : BoxOfBoolPairs = { hey: [true, false], world: [false, true] }

// Good.
const boxC : BoxOfBoolPairs = { hey: [true, false], world: { earth: [true, true], notEarth: [false, false] } }

// Good.
const boxD : BoxOfBoolPairs = { "hey": [true, false], "world": [false, true] }

// Type error.
const boxE : BoxOfBoolPairs = { hey: [true, false], world: [false, true], "0": [false, true] }

Expected behavior:
boxE is seen as an object containing tuples "hey", "world" and "0".
Actual behavior:
[ts]
Type '{ "0": boolean[]; hey: [true, false]; world: [false, true]; }' is not assignable to type 'BoxOfBoolPairs'.
Type '{ "0": boolean[]; hey: [true, false]; world: [false, true]; }' is not assignable to type '[boolean, boolean]'.
Types of property '0' are incompatible.
Type 'boolean[]' is not assignable to type 'boolean'.

The error message is not the best here, which is a problem we have with unions from time to time. The compiler thinks things that have a "0" property are tuples, so it has compared boxE to the [boolean, boolean] branch of BoxOfBoolPairs, not the string indexer branch.
That's because tuples are really just aliases for a family of types that look kind of like this:
type Tuple2<T,U> = { '0': T, '1': U, [n: number]: T | U }
type Tuple3<T,U,V> = { '0': T, '1': U, '2': V, [n: number]: T | U | V }
// etc ...

So what happens is that the compiler sees the '0', tries to infer T from [false, true], tries to infer U from the non-existent '1' property and creates a Tuple<boolean[], {}>. This fails to match Tuple<boolean, boolean> and creates an error.
I'll go see why the compiler doesn't explore the string indexer branch and find a match.

Looks like contextual type applies to hey to give the type [true, false] but 0 has the contextual type boolean[], which is then not assignable to either side of BoxOfBoolPairs.
The type of '0' is taken from the contextual type BoxOfBoolPairs, which finds a property '0': boolean in the [boolean, boolean] side of the union.
The type of 'hey' is taken from the contextual type BoxOfBookPairs, which does not find a matching property hey, so falls back on the string indexer type.
I need to think about a fix; finding a specific property name 0 should definitely outweigh the type of the string indexer. But it does the wrong thing in this case.

After talking to @RyanCavanaugh, I don't think there is a way to create values of type BoxOfBoolPairs in Typescript. Because of the way tuples and arrays are defined in Javascript as objects with number-string keys, it's not possible to distinguish the two sides of the union when given a value.
The correct fix is to use the ADT pattern and add a discriminant field, something like kind, to distinguish between leaf and non-leaf instances of the type.


Fix timestamp comparison in ParseTest

Fixes #16

Unrelated, I was just too lazy to put it in a separate PR. The issue is likely caused by different timezone files in CI vs locally. It was failing consistently in CI.


Logging formating issue in production

Production
Provide at least:
*ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

Rails <IP_ADDRESS>.
Semantic Logger Version 4.3.0.
Rails Semantic Logger Version  4.3.1.
Phusion Passenger 5.3.2.
Rails configuration. Only need the settings related to Rails Semantic Logger and Semantic Logger.

config.semantic_logger.backtrace_level = nil
config.log_level = :info
config.rails_semantic_logger.quiet_assets = true

Expected Behavior
Resque -- Running before_fork hooks with [(Job{check_out_queue} | CheckOutQueue | ["5bbad644f4fc151d5ce85038", "5b328c70ac0966700c622f1c", 2])]
2018-10-08 16:00:15.946398 I [8925:17322260] Resque -- got: (Job{check_out_queue} | CheckOutQueue | ["5bbad644f4fc151d5ce85039", "5b328c71ac0966700c622f1d", 2])

Actual Behavior
2018-10-08 12:20:11.220795 ^[[36mI^[[0m [11090:17322260] ^[[36mResque^[[0m -- got: (Job{gateway_queue} | GatewayStatus | [])
2018-10-08 12:20:11.220837 ^[[36mI^[[0m [11090:17322260] ^[[36mResque^[[0m -- Running before_fork hooks with [(Job{gateway_queue} | GatewayStatus | [])]

This is because of below
config.colorize_logging = true
setting it to false solves the problem.
Colorize logging is used to generate better console logs but it provides messy log file with unwanted characters related to the color.


Redis and prefetching

There are a couple of points unclear to me how redis (cachedb) is working in combination with the prefetch functionality

Are records stored in redis only prefetched?
When an unbound instance prefetches a record of its own cache, does it update the record in redis accordingly?
When an unbounds instaces prefetches a record of its own cache, does it query redis for an updated record before resolving it by itself?

Could someone please clarify that?

The first question is not the case, the records are prefetched based on the internal cache.
The second question, yes they are also stored in the cachedb redis storage after a prefetch of the record.
Yes unbound attempts to query the cachedb storage for the record before resolving it itself. It does that for all queries, and also prefetch queries walk through this code path.

That helps a lot. Thank you 😄


Is it possible to add support for proxies?

In some areas access to github is not smooth enough, can you add proxy settings?

Can you please provide more details?

@TfTHacker I want BRAT to support proxy, to be able to set the IP address, port, username (optional) and password (optional) of the proxy.
When I update other plugins through BRAT , BRAT accesses through the proxy I set.

So after further review, BRAT is using the built in fetch API for Obsidian, which works reliably across devices and platforms. So to get this changed, please submit a suggestion to the Obsidian devs to make it core.


failed to build trusty-ppc64el: /usr/lib/apt/methods/http runs forever

No longer a problem per successful build in https://github.com/vicamo/docker-brew-ubuntu-debootstrap/actions/runs/8978651790/job/24659448341


SST equivalent of a SLS local invocation

A while back I asked the following question:
What is the  SST equivalent of the following command to be able to mock the SST API :
$ serverless invoke local --function get --path mocks/get-event.json

In my PR I just added a section on how to go about.

Thanks @AmoDinho! Local invoke has been frequently requested.
@jayair Can you take a look at the changes?

Thanks @fwang apologies for the delay in making this PR as promised. 🙏

Thanks @AmoDinho!