cups: mount private /tmp

Motivation for this change
printer driver and wrapper are often not written with security in mind.
While reviewing https://github.com/NixOS/nixpkgs/pull/25654 I found
a symlink-race vulnerability within the wrapper code, when writing
unique files in /tmp.
I expect this script to be reused in other models as well
as similar vulnerabilities in the code of other vendors. Therefore
I propose to make /tmp of cups.service private so that only processes
with the same privileges are able to access these files.
Things done

[x] Tested using sandboxing
(nix.useSandbox on NixOS,
or option build-use-sandbox in nix.conf
on non-NixOS)
Built on platform(s)

[x] NixOS
[ ] macOS
[ ] Linux

[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Fits CONTRIBUTING.md.

Note that I have not tested actual printing with cups, because I currently have no hardware access.
The service itself works. I suspect if anything would require access to /tmp of cups outside of cups, this would be a security vulnerability on its own.

Note that I have not tested actual printing with cups

I've just tested printing with systemd.services.cups.serviceConfig.PrivateTmp = true; using the mfcl2700dncupswrapper, and it works as expected.

BTW, with PrivateTmp in place it's probably worth ditching cfg.tempDir. (The later doesn't seem to work anyway when set to something else than /tmp.)


Build pipeline enforces a runner

osbuild fails when the build pipeline doesn't have a runner set. It should probably use the host runner in that case, similarly to when there's no build pipeline at all.
{
  "build": {
    "pipeline": {
      "stages": [
        {
          "name": "org.osbuild.noop"
        }
      ]
    }
  },
  "assembler": {
    "name": "org.osbuild.noop"
  }
}

Traceback (most recent call last):
  File "/usr/lib64/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/lars/src/osbuild/osbuild/__main__.py", line 121, in <module>
    sys.exit(main())
  File "/home/lars/src/osbuild/osbuild/__main__.py", line 74, in main
    pipeline = osbuild.load(pipeline, sources_options)
  File "/home/lars/src/osbuild/osbuild/pipeline.py", line 414, in load
    build_pipeline, runner = load_build(build, sources_options)
  File "/home/lars/src/osbuild/osbuild/pipeline.py", line 408, in load_build
    return build_pipeline, description["runner"]
KeyError: 'runner'

I like that they are mandatory, that is why I documented it in osbuild-manifest(5). I was unsure whether that was intentional, though. Hence, if we change it, we definitely have to update the schema as well (or maybe I am misremembering something).
What is the reason to use the host system here? I mean, nothing from host is meant to leak into a pipeline, hence the build-pipeline shouldn't have any semantic connection to the host, should it? Am I missing something?

Am I missing something?

I think so :wink:
Runners describe in which environment a pipeline itself is run in. Removing the build pipeline in the above example makes osbuild choose the runner based on my host. I think the same should apply to build pipelines.
Put another way: if you give me a manifest that has a build pipeline with an org.osbuild.linux runner, it won't work on my fedora system. The idea is that the build pipeline bootstraps from a system with minimal requirements (systemd-nspawn, python3, dnf/rpm) to an environment that the actual build can rely on.

Sorry, I was thoroughly confused. In combination with #289, I thought I was looking at output from a different level pipeline.
I don't know why I thought this is how it worked. Sorry for the noise.


add node_modules to the load paths.

This allows using mixins etc. from mdc-web. For example
@import "@material/button/mdc-button";

.foo-button {
  @include mdc-button-ink-color(teal);
  @include mdc-states(teal);
}

Dart packages normally have node_modules at web/node_modules. It would probably best to have some build.yaml option for this but a quick fix turned out to be really simple.

We should avoid using loadPaths because it creates a FilesystemImporter that will interact with the file system behind the back of the build system. The sass_builder package aims to funnel all interactions with the file system through the build package.
https://github.com/sass/dart-sass/blob/0f7f9e69a72e612412b51bfa2fe1384f778e2821/lib/src/async_import_cache.dart#L67
We are going to open up a similar functionality by merging #47 instead.


small mapResult() documentation fix

replace my with by

Hey @truecrunchyfrog, thanks for the contribution. Can you please sign the Scala CLA (https://www.lightbend.com/contribute/cla/scala). Once done, I will restart the workflow to have a ✅ PR.

Probably best fixing upstream https://github.com/scala/scala/blob/2.13.x/src/library/scala/collection/mutable/Builder.scala, which presumably we'll merge with at some point, rather than fix it here.

Probably best fixing upstream https://github.com/scala/scala/blob/2.13.x/src/library/scala/collection/mutable/Builder.scala, which presumably we'll merge with at some point, rather than fix it here.

Yes, I was going to do it

Raised in https://github.com/scala/scala/pull/10861


feat(@embarkjs/ens): Introduce dappConnection configuration for nam…

…esystem
This commit removes the need for EmbarkJS.onReady() and EmbarkJS.Blockchain.blockchainConnector APIs
in the ENS provider implementation and instead relies purely on vanilla Web3. This comes
with the effect that EmbarkJS.Names needs to figure out itself what to connect
to, as well as when a connection has been established.
To make that possible, EmbarkJS.Names now implements a similar algorithm to
EmbarkJS.Blockchain that tries to connect different endpoint, given a dappConnection
configuration.
If no dappConnection configuration is given via namesystem.json, Embark will fallback
to the same connection list that's provided in contracts.js|json.

This PR needs documentation, as dappConnection is now also possible for namesystem.js

@PascalPrecht could you check the CI/tests plz?

Updated the PR, waiting for CI. CI ran green locally.

Okay CI is reproducibly failing due to invalid node connection $WEB3. This is most likely because the communication config iterates over contracts.js dappConnection, which includes $WEB3.
What isn't clear to me is why this same test is not failing locally.

It seems, the problem is that either the proxy or the geth node can't be connected to, which results in Embark using $WEB3 as connect, which during the test run is an invalid connection, as there's no metamask.

One thing that surprised me was why it didn't even connect to $EMBARK. I have now noticed that, $EMBARK is not being replaced with the actual endpoint at the time the setProvider() call is being eval'd.
Looking into this..

This has now a failing test. investigating..

Can't reproduce this locally, but restarting the build on CI results in the same failing test. Digging deeper.

Turns out the failing test is reproducible with yarn qa inside the dapp, but not with yarn ci from root. After I was able to reproduce this I found out that the tests only fails with the async/await of getEnsConfig.
I did some poking but couldn't figure out quickly why that is. Also debugging this inside the test runner is hard because breakpoints cause the runner to time out and therefore fail any test.
I'm rolling back to the callback version for now, so we can move on.


Some problems in the Japanese environment

The display language is German. The settings are displayed in English. Please make English the default or make it changeable.
Japanese has two byte characters in the alphabet, "a" and "a". Please treat them the same in searches.

It would be great if you could add www.amazon.co.jp/* by default.
Thanks for a great app.

Hey there, thanks for the Feedback.

We are working on a new language Feature, for more info see https://github.com/Amazon-Vine-Explorer/AmazonVineExplorer/pull/27#issuecomment-2042541194
Perhaps you would be interested in providing us with a Japanese translation

It searches 1 to 1 for the term that is entered in the search field. the two "a" are the same for me (could be due to the translator)
With a little more information we can take a look at this

I'm sorry, I don't really know how to use Github.

"ja":{
"ave-btn-allseen":"このページを既読にする",
"ave-btn-db-allseen":"すべて既読にする",
"ave-btn-backtotop":"トップに戻る",
"ave-more-details":"詳細はこちら",
"ave-tax-prize":"税込:",
"ave-show-results":{
1:"表示件数",
2:"：",
3:"（総数）"
},
"ave-settings":"AVE設定",
"ave-version":"バージョン",
"ave-btn-all-products":"すべての商品",
"ave-btn-favorites":"お気に入り",
"ave-btn-list-new":"新しい商品",
"ave-input-search-placeholder":"商品の検索",
"ave-btn-next-page":"さらに表示"
}

Re-challenge
2byte "ａ" 1byte "a"


load json file error with v2.20.0

Describe the bug
load_dataset(path="json", data_files="./test.json")

Generating train split: 0 examples [00:00, ? examples/s]
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/datasets/packaged_modules/json/json.py", line 132, in _generate_tables
    pa_table = paj.read_json(
  File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json
  File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
  File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: JSON parse error: Column() changed from object to array in row 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1997, in _prepare_split_single
    for _, table in generator:
  File "/usr/local/lib/python3.10/dist-packages/datasets/packaged_modules/json/json.py", line 155, in _generate_tables
    df = pd.read_json(f, dtype_backend="pyarrow")
  File "/usr/local/lib/python3.10/dist-packages/pandas/util/_decorators.py", line 211, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pandas/util/_decorators.py", line 331, in wrapper
    return func(*args, **kwargs)
TypeError: read_json() got an unexpected keyword argument 'dtype_backend'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/t1.py", line 11, in <module>
    load_dataset(path=data_path, data_files="./t2.json")
  File "/usr/local/lib/python3.10/dist-packages/datasets/load.py", line 2616, in load_dataset
    builder_instance.download_and_prepare(
  File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1029, in download_and_prepare
    self._download_and_prepare(
  File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1124, in _download_and_prepare
    self._prepare_split(split_generator, **prepare_split_kwargs)
  File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 1884, in _prepare_split
    for job_id, done, content in self._prepare_split_single(
  File "/usr/local/lib/python3.10/dist-packages/datasets/builder.py", line 2040, in _prepare_split_single
    raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

import pandas as pd
with open("./test.json", "r") as f:
    df = pd.read_json(f, dtype_backend="pyarrow")

Traceback (most recent call last):
  File "/app/t3.py", line 3, in <module>
    df = pd.read_json(f, dtype_backend="pyarrow")
  File "/usr/local/lib/python3.10/dist-packages/pandas/util/_decorators.py", line 211, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/pandas/util/_decorators.py", line 331, in wrapper
    return func(*args, **kwargs)
TypeError: read_json() got an unexpected keyword argument 'dtype_backend'

Steps to reproduce the bug
.
Expected behavior
.
Environment info
datasets                  2.20.0
pandas                    1.5.3

Thanks for reporting, @xiaoyaolangzhi.
Indeed, we are currently requiring pandas >= 2.0.0. I am fixing the requirement.
You will need to update pandas in your local environment:
pip install -U pandas

Thank you very much.


Send payment integration test

Add a send-payment test to the integration test framework. It relies on new subscriptions to look for the GraphQL server startup and breadcrumbs with user commands added to the transition frontier.
Because the GraphQL server isn't available over the public internet, there's an Async job that runs port-forwarding via kubectl to expose the port on localhost where the test is run.
There are GraphQL queries to unlock the sender account, and to send payment. Those are done in retry loops, the first one because there's a lag in the server availability even after the server is logged as started, and the second because GraphQL requests are rebuffed if the node is bootstrapping.
The GraphQL encoders/decoders are moved into Graphql_lib so the test can use it.
There's code for running Coda via kubectl. It turns out that code was not needed here, but it may be useful for other tests.
Tested by running locally:
  CODA_IMAGE=codaprotocol/coda-daemon:0.0.15-beta-feature-send-payment-integration-test
  test_executive.exe --coda-image=$CODA_IMAGE send-payment

which succeeded after several minutes.
Closes #5381.

I also think it makes sense to combine the wait_for_init and wait_for_graphql

The init log happens later, and running the test using just wait_for_init works fine. That change may also obviate the first retry loop.


Could not load file or assembly 'Microsoft.Rtc.Internal.Media.DLL' or one of its dependencies. The specified module could not be found

The issue
Hi Guys, this may well be related to [122] (https://github.com/microsoftgraph/microsoft-graph-comms-samples/issues/122). I'm getting the same error (see title). I've been through that issue and I don't have a solution that is working for me. I'm not at this moment trying to deploy anything in to service fabric - i'm just trying to test locally on my machine. I'm not entirely sure if it's valid setup - but.. I can get as far as joining a call/ending a call and reading webhook notifications via ngrok. My issue starts as soon as I try to pull in the Microsoft.Skype.Bots.Media dll.

First issue is the version of the dll - if you pull in Microsoft.Graph.Communications.Calls.Media (latest stable version) using Nuget, it's isn't happy as it states that there is no corresponding version of the Skype bots media dll. I had to go back as far as V1.1.0 of that dll before it pulls in the skype dll dependency.

The above error occurs when attempting to debug. In my case, I'm just trying to fire up a webapi layer in to the bot and I'm running that on IISExpress. (so that's a .net framework 4.7.2. API with a .net framework 4.7.2 class library as the bot). I see that a load of project references get added under a folder called "Skype_media_lib". Do I need to do anything with these? they just appear with the nuget pull.

other things I've tried - I'm running on x64 config and I've installed visual c++.
I gather there is more work needed to get these working beyond simply pulling from nuget, but I haven't really got any idea what. Would love to get some more advice.
many thanks.

I believe this has already been answered in various forms - but keeps coming up. For me, re-writing as a console application with a self hosted owin webapi seems to resolve (well at least this particular issue).

@AlexSapple
I am getting same type of error running the Policy Recording bot with ReceiveUnmixedMeetingAudio = true.

And without this ReceiveUnmixedMeetingAudio flag, everything is working fine. I am testing this locally.
Can you please help me with this?

@AlexSapple
I am getting same type of error running the Policy Recording bot with ReceiveUnmixedMeetingAudio = true.

And without this ReceiveUnmixedMeetingAudio flag, everything is working fine. I am testing this locally.
Can you please help me with this?

Hi @bijaykush
This is a different error arising from a different usecase - my original issue was associated with Skype media dll dependencies running in windows rather than an iis environment. You error above looks like a null argument somewhere in amongst it all.
Without knowing anything much about this - the docs state that

In UnmixedMeetingAudio mode, the bot will receive only unmixed audio and not both unmixed and mixed.

and

In order to receive both mixed and unmixed audio simultaneously, the bot must establish two separate calls into the meeting.

so as a complete guess, I'd firstly say, make sure you are not trying to do anything that requires both mixed and unmixed.

Hi @bijaykush
This is a different error arising from a different usecase - my original issue was associated with Skype media dll dependencies running in windows rather than an iis environment. You error above looks like a null argument somewhere in amongst it all.
Without knowing anything much about this - the docs state that

In UnmixedMeetingAudio mode, the bot will receive only unmixed audio and not both unmixed and mixed.

and

In order to receive both mixed and unmixed audio simultaneously, the bot must establish two separate calls into the meeting.

so as a complete guess, I'd firstly say, make sure you are not trying to do anything that requires both mixed and unmixed.


Support slashes in Quick open dialog even on Windows

I just updated to 0.10.5, thanks for adding path support for quick open dialog (Ctrl+P)!
Even though I'm on Windows, I often use slashes to separate paths, because they are easier to type on my French AZERTY keyboard (backslashes require hitting Alt Gr+8 which breaks the flow of my typing). This is supported basically everywhere (command line, explorer, etc.) so it'd be nice to be able to use them for filtering in the quick open dialog too.

:+1:

Thank you so much! :heart:


Access: implement collection endpoint

@awfm9 Did you mean endpoint singular? The only such endpoint I can find is GetCollectionByID.

Yes, I didn't look in detail when creating these issues, so feel free to correct them with what you find in the Flow docs.

Done in #278


Update text to match name of blade

The name of the blade is "Restore configuration", not "Recovery configuration"

@markgalioto @iainfoulds  - Could you review this Backup PR in the public repo?

#sign-off
@andresnava Thank you for catching the typo. We will make the update.


[RFC] Set --track when creating a worktree

This PR is not to be merged because it is based off these other two: https://github.com/polarmutex/git-worktree.nvim/pull/18 https://github.com/polarmutex/git-worktree.nvim/pull/19
Basically, instead of using git-branch with --set-upstream-to after creating a worktree, the plugin should simply use git-worktree --track instead. That would simplify things a lot for the case where upstream ~= nil in worktree.lua.  I wanted to ask you what do you think the best approach should be here.
Thanks,

I have improved it a bit in my main branch, please let me know if you have interest so I can prepare a proper PR.

I am interested.
I am entering a busy period of the year. I will try to find time to look into it soon

Understood! I will send a proper PR later on then :)

Understood! I will send a proper PR later on then :)


Fix linting issues in github actions

What is being addressed
Following the addition of GitHub Actions linter we should make some fixes.
How is this addressed

run container command action - most inputs need to be optional since they are not always passed in
disable yamllint rule for the "on" key as it's not valid
double quotes for all vars in run steps (this need to happen for regular bash script in *.sh files but it was too much for me - need proper testing)

/test


Refactor to Blade Icons

I'm very happy to say that Adam was so kind to let me take over the library. I recently created my own Blade Icons package without realizing that Adam already created this wonderful package! After thinking it over I thought it would be perfect if we merged the two packages into one. So that's great news for everyone using this library as I'll be actively maintaining it and helping out with issues etc.
There's some pointers on this so let's go through them. First of all, this PR is a complete rewrite of the package. If I'm going to maintain it and use it as a base for future packages/ideas I'd like to be familiar and comfortable with the library so a rewrite makes sense. You can check out the changes in this pr, the new README on its own branch as well as the upgrade guide.
New Requirements
There's some new minimum version requirements like PHP 7.2 and Laravel 7.6 (I need this version specifically for the Blade components). It doesn't makes sense to me to maintain anything for a PHP version that isn't getting active support anymore.
New Features
There's new stuff as well! The package now supports multiple icon sets which makes it very easy for third party packages to be created for it. When the refactor has been merged and released I'll release another "Heroicons" package alongside it which you can optionally pull in.
Besides that you can now reference icons as Blade components. This is a very clean syntax and I personally much prefer this over a directive.
Breaking Changes
There's quite a few breaking changes unfortunately but making these changes now before a full 1.0 release is done will allow me to work with a syntax that I'm comfortable with. Please refer to  the upgrade guide for the most notable ones.
Package Renaming
One last note I want to make is that this rewrite is part of a bigger plan that I have. Before this PR is merged I'll transfer the repo to a new organisation and rename its package name. I'll give more info as soon as we get to that.
I need your help
What I need most now is feedback and people testing the library, especially existing users. I'd much appreciate it! Try out this PR by installing it through Composer:
composer require nothingworks/blade-svg:dev-next-version

There's two things I'm currently considering before shipping the next 0.4.0 release:

~Should we remove the sprite sheets functionality? It doesn't seems to be like something many people use and would clean up the internals a lot.~ (Sprite Sheets functionality was removed)
At the moment blade components icons are loaded with loading the file list on every request. It's probably best that we cache this somehow between requests.

I'd much appreciate feedback so let me know what you think!

Hi @driesvints that's a wonderful new life for this library. Thanks for accepting comments on the topic.
New features like multiple iconset will make a valuable addition especially for defining also illustrations and not only icons. I had a requirement like that when creating an application and I almost created blade components (using the old syntax) to solve it for each illustrations as I was already pulling in an iconset with blade-svg.

There's some new minimum version requirements like PHP 7.2 and Laravel 7.6

The new Blade components are definitely a good point to break compatibility, but old Blade directives are still valuable for who uses Laravel 6.x (which if I'm correct is a LTS). I personally think that supporting an LTS version is an option to consider, or at least create an intermediate version that supports it.

At the moment blade components icons are loaded with loading the file list on every request. It's probably best that we cache this somehow between requests.

I think this was also the approach @adamwathan took. Indeed you have to read the file somewhere unless you cache the entire view in html. Maybe a mad idea could be inlining the SVG in the view cache already generated by Blade instead of the method to read the file. I honestly have no idea how this could be done, but using file cache or redis or the database would not resolve the problem, as it will just read a different "file".

You can check out the changes in this pr, the new README on its own branch as well as the upgrade guide.

I like the approach for getting icons from different sets by prefixing with the set name.
What if I would like to deliver my iconset package via composer?
Let me explain, I created a package avvertix/materialicons-laravel-bridge which was using @adamwathan blade-svg under the hood to deliver the MaterialIcons iconset. Maybe not the most elegant way, but it worked out. Considering your will to rewrite and expand with more iconsets I would love to hear your opinion on additional packages that delivers iconset extensions. Something like :
composer require blade-icons-awesome-set

'sets' => [
    'awesome-set' => [
        'path' => \AwesomeSet\Providers\Icons::class,
    ],
],

and \AwesomeSet\Providers\Icons::class is an invokable class returning the path on disk.
Thanks again @driesvints to be open to accept comments.

Hey @avvertix, thanks a bunch for the very thorough feedback!

I personally think that supporting an LTS version is an option to consider, or at least create an intermediate version that supports it.

Unfortunately we can't do that. I'm making use of a feature in Laravel 7.6 for the Blade components so that's going to have to be the very minimum I'm afraid.

Indeed you have to read the file somewhere unless you cache the entire view in html.

I already took over the same in-memory caching approach that adam dit for individual svg contents but I'm more talking about the new file-listing that's done when the Blade components are registeren. Maybe we need to create like a manifest. But I'm not sure if it's a big enough problem to worry about.

Maybe a mad idea could be inlining the SVG in the view cache already generated by Blade instead of the method to read the file.

Hmm, yeah I'm also not sure how that'd be tackled.

What if I would like to deliver my iconset package via composer?

I'll write a dedicated section on this in the readme soon! After I got some initial feedback here I'm gonna build the heroicons packages. It's actually really easy as all you need to do is to boot the icon set in your service provider.

Should we remove the sprite sheets functionality? It doesn't seems to be like something many people use and would clean up the internals a lot.
Totally, never used it myself nor in my teams.

@minthemiddle thanks. As it stands and from all the feedback I've gotten so far I'm probably going to remove the sprite sheets support this weekend.

I have used this package in the past. Never used the sprite sheets as well.
Good to hear this package gets some fresh air 👍

Heya, some updates:

I've decided to remove sprite sheets functionality as I get the feeling that they're not much used at all.
Added a section about how to build a third party package for your icons.

I feel like we're pretty close to wrapping things up now. The most thing that's needed atm is people testing it.

I have been using this package for quite sometimes. I have the dev-next-version a spin and here are my quick thoughts.

Though renaming svg_image() helper to svg() is a breaking change, I support it, as a small price to pay 😀.
I totally support removal of sprite sheets, I personally never used theme before.
The new blade components comes in handy. However I am having problem loading icons with it.

{{-- This is working --}}
@svg('search','h-4 w-4'')

{{-- This is working too --}}
{{ svg('search','h-4 w-4') }}

{{-- This is NOT working --}}
<x-icon-search class="h-5 w-5"/>

Am getting an error Unable to locate a class or view for component [icon-search]. I will I investigate my codebase and open an issue if necessary and share details.

Finally, am quite interested on how caching icons can be achieved. Am however happy to use the package to render svg and focus on optimising performance on other key areas such as database queries.

@driesvints keep pumping life to this package.

@driesvints I tried to use the package inside another laravel package and it worked out of the box with a custom set.
Can't wait fo the new release. Good work!

I've made some updates today that generalises the usages of prefixes across the directives and components.
I also discovered a bug with Laravel which makes it impossible to actually use the components right now. I'll try to dig into that to see if I can solve it in the framework this week.

(Finally taking time to send feedback.)
A few years ago I dropped blade-svg. Here’s how I dealt with SVG since then.
Intro
I put SVGs in Blade files so that I can @include('svg.my-icon'), sometimes passing more data to the SVG Blade view, allowing high customization.
Eventually I planned to make a directive alias (@svg('my-icon')), or a slotted @component (now <x-something>) for when I need custom DOM.
Not using spritesheets
Example 1 (most current use): similarly to blade-svg, it can receive custom CSS classes, width and height.
{{-- svg/basecamp-logo.blade.php --}}
<svg
    xmlns="http://www.w3.org/2000/svg"
    viewBox="0 0 36.83 32.08"
    width="{{ $width ?? 27 }}" height="{{ $height ?? 24 }}"
    fill="none"
    stroke="currentColor"
    stroke-linecap="round" stroke-linejoin="round" stroke-width="3.41"
    class="{{ $class ?? '' }} basecamp-svg"
>
    <path d="m1.71 17.73c2.61-7.4 7.61-16 17.7-16s15.08 13.27 15.71 22.27c-2.65 4.6-9 6.33-15.71 6.33a18.87 18.87 0 0 1 -14.41-6.33s3.16-8.53 6.11-8.55c2.17 0 4 4 5.73 4s5.33-7.68 5.33-7.68"/>
</svg>

    Login with Basecamp
    @include('svg.basecamp', ['class' => 'login__basecamp-svg'])

Example 2: optional DOM element (here: date on a calendar icon)
{{-- svg/calendar.blade.php --}}
<svg>
    <path d="M6 5V1v4zm8 0V1v4zM5 9h10H5zM3 19h14a2 2 0 002-2V5a2 2 0 00-2-2H3a2 2 0 00-2 2v12c0 1.1.9 2 2 2z"/>
    @isset ($day)
        <text>{{ today()->day }}</text>
    @endisset
</svg>

    @include('svg.calendar', ['day' => today()->day])

(Yes, it’s the Heroicons one, modified.)
Using spritesheets
(I don’t use spritesheets on most projects, but sometimes they make the DOM way lighter.)
I @include('spritesheet.blade.php') before closing the  of the layout template:
{{-- spritesheet.blade.php --}}

    @include('svg.calendar')
    @include('svg.chevron')
    @include('svg.envelope')
    @include('svg.lock-esporg')
    @include('svg.map-marker')
    @include('svg.phone')

Each of the @include('svg.…') brings a full SVG:
{{-- svg/calendar.blade.php --}}
<svg id="calendar-path" other-attributes…>
    <path…>
</svg>

For each of the complete SVGs, there’s another file with <use>, ready to be included by other templates:
{{-- icon/calendar.blade.php --}}
<svg attributes…>
    <use xlink:href="#calendar-path"/>
</svg>

{{-- then in page.blade.php --}}
@include('icon.calendar', ['class' => 'booking__icon'])

In short
This way of working allows high customisation. As mentioned earlier in this message, improvements I see are:

aliasing the @include('path/to/svg.…)
using Blade components, maybe slotted.
(if not a perf killer) a @spritesheet('path/to/a/lot/of/svg') directive to generate a spritesheet from a directory of SVGs.

Regarding next-version
I think it’s a solid refresh with good flexibility for a lot of uses cases. Automatic declaration of the Blade components for each set is really the feature that could be missing from my workflow.
What is missing for me to use it is the customization on the DOM part (and now, the spritesheet :D), that I need for most projects.

@meduzen I'm actually not entirely opposed to bringing back sprite sheet support. After all it was already done. But before I do that could you please walk me through why you need it in this day and age?
I think the idea about slotted components is a good one and one I'm willing to explore in a future version.
PS.: I've finally fixed the component name issue in Laravel so Blade components should work again soon. I'll try to tackle this in the weekend.

Loving the changes to the package, Dries!
I pulled the branch down and played around with it today and noticed one bug. If you specify a default class in the config file, it will only be applied if you set a class when you use the icon. If you use a blank string (which is the default), it never gets applied. I like using a default class to set some basic styles for icons (height, width, etc.) so that jumped out at me right away.
Not a bug, but would be nice to have, is a way to specify additional classes that are specific to a certain set. For example, one of my sets is a stroke set and the other is a filled set. I'd love to be able to specify stroke-current for the stroke set and fill-current for the filled set right from the config file. Not a dealbreaker, but definitely would be nice to have.

@agentphoenix thanks!

I pulled the branch down and played around with it today and noticed one bug. If you specify a default class in the config file, it will only be applied if you set a class when you use the icon. If you use a blank string (which is the default), it never gets applied. I like using a default class to set some basic styles for icons (height, width, etc.) so that jumped out at me right away.

Hmm, not sure I understand. Can you provide a code sample?

Not a bug, but would be nice to have, is a way to specify additional classes that are specific to a certain set. For example, one of my sets is a stroke set and the other is a filled set. I'd love to be able to specify stroke-current for the stroke set and fill-current for the filled set right from the config file. Not a dealbreaker, but definitely would be nice to have.

Definitely something we can consider. Can you share a code sample of this as well how'd you exactly use this?

I've just pushed a commit that fixes the component rendering. Components should now properly be handled. Unfortunately I had to bump the minimum requirements to the just-released Laravel v7.10.0 release.
Can anyone try out the components and let me know how it goes?

@meduzen I'd still be keen to bringing back sprite sheets but can you let me know about my question here? https://github.com/adamwathan/blade-svg/pull/50#issuecomment-621402470

@driesvints This is the line that causes the issue as far as I could tell. Here's an example of what I was seeing:
// Will not apply the default class from the config file
@svg('house')

// Will apply the default class from the config file
@svg('house', 'h-5 w-5')

For the set classes, I figured it'd be simplest to do something like this:
'sets' => [
    'heroicons-solid' => [
      'path' => '...',
      'prefix' => 'heroicons',
      'class' => 'fill-current',
    ],
    'heroicons-solid' => [
      'path' => '...',
      'prefix' => 'heroicons-outline',
      'class' => 'stroke-current',
    ],
]

From there, the package could merge the default class and the set class. (It also wouldn't be a huge deal if the set class took priority and I needed to set the default class multiple times.) Does that make sense?

I've just pushed a commit that fixes the component rendering. Components should now properly be handled. Unfortunately I had to bump the minimum requirements to the just-released Laravel v7.10.0 release.
Can anyone try out the components and let me know how it goes?

Managed to pull the latest commit. Unfortunately, the blade component is not working.
{{-- This is working --}}
@svg('filter','h-5 fill-current')

{{-- This is working --}}
{{ svg('filter','h-5 fill-current') }}

{{-- This is failing --}}
 <x-icon-filter class="h-5 fill-current"/>

Unable to locate a class or view for component [icon-filter].

Am Using

Laravel version 7.10.1
Default icon set

I have checked into @agentphoenix issue and look like we have un-expected behaviour.
...blade-icons.php
return [
//....
'class' => 'h-4 text-gray-500',
]

This syntax
@svg('filter','h-10 text-success-700')
{{ svg('filter','h-10 text-success-700') }}

Is rendering
<svg class="h-4 text-gray-500 h-10 text-success-700" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">....</svg>

While this
 @svg('filter')
{{ svg('filter') }}

Is rendering without the default class
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">....</svg>

I also think @agentphoenix idea of having default class per icon set is more flexible than having a global default class.

@agentphoenix @njoguamos okay, I've managed to fix the default classes and I've also added the ability to add default classes per-set. Make sure to re-publish your config files when testing.

Managed to pull the latest commit. Unfortunately, the blade component is not working.

Hmm, that's strange. Your code samples are working for me. Did you clear your views? You're sure your icons are place in the correct directory and named correctly? Can you republish your config file? Did you uncomment the options inside?

@driesvints I will give it another try and let you know.

@driesvints Works like a charm! Thanks for the quick turnaround on this.

Unless there's any more feedback I'm probably going to be moving the package to its new location and doing the 0.4.0 release somewhere next week.

@driesvints I re-published the config file, cleared view and pulled the latest commit

Hmm, that's strange. Your code samples are working for me. Did you clear your views? You're sure your icons are place in the correct directory and named correctly? Can you republish your config file?

Did you uncomment the options inside?

My config
'sets' => [

return [
    'sets' => [
        'default' => [
            'path' => 'resources/icons',
            'prefix' => 'icon',
            'class' => 'h-5 text-gray-130 fill-current',
        ],
    ],

    'class' => '',
];

Everything is working as expected except the blade component. The default set class h-5 text-gray-130 fill-current is not being applied on blade component.
// This applies
@svg('icon-globe')

// This applies
{{ svg('icon-globe') }}

// This renders svg but doesn't apply
<x-icon-globe></x-icon-globe>

// This applies
<x-icon-globe class="h-5 fill-current text-gray-130"></x-icon-globe>

And thank for making the blade components work. Effort appreciated.

I ran into a problem tonight running my test suite in Github Actions with this package. From the exceptions thrown, it seems that the package can't properly parse out the set from the icon name. Since I don't use a set named default, my tests blow up saying it can't find the icon fluent-eye-off in the set default. Instead, it should be looking for the icon eye-off in the set fluent.
Everything works fine locally and on the test server I'm running, but Github Actions throws an exception the first time I do $this->get from my feature test. Any ideas why that might be happening? Any ideas for how to best debug this?

I'll take a look at these issues tomorrow and will try to solve them. Thanks a lot for testing btw!
If everything goes well I might also finally move the repo and release the new version tomorrow.

Hey @njoguamos. Thank you so much for helping with testing. I pushed a commit that will fix this. You might have to re-run composer install and clear your views to test again.
@agentphoenix hmm I can't reproduce that. I've added two tests to properly test the scenario without a default set present: https://github.com/adamwathan/blade-svg/pull/50/commits/8d531f4870970e9cddc6a9be5384b4e4fdc9c487
Can you maybe share the code to reproduce this?

@driesvints Unfortunately I can't reproduce the issue in my local tests, on my local server, or on my staging server. When I run the test suite through Github Actions though, it blows up. Here's a link to the Github Action result where you see the exception.
https://github.com/anodyne/nova3/runs/780876889?check_suite_focus=true
I'm just more curious about ways I can debug what's actually happening with GA so that I can figure out how to reproduce this locally and see if it's something with my app or with the package.

@agentphoenix I see what's wrong. You're not using your set prefixes when referencing the icons: https://github.com/anodyne/nova3/blob/dev/nova/resources/views/components/input/password.blade.php#L20
I think you missed this part in the readme:

When referencing icons with the Blade directive or helper you can omit the prefix to reference icons from the default set.

I'll try to make that even more clear by adding a sentence that says the prefix is mandatory for other sets.

@driesvints So I have a custom directive @icon that I use since users can swap the icon set they use in the app. Behind the scenes, it takes the name passed into the directive, does a lookup on an icon set map, and then prepends the set prefix and calls the Svg class. The same error gets thrown if I do @svg('fluent-eye-off') as well.

@agentphoenix we can't offer support for custom directives sorry.

The same error gets thrown if I do @svg('fluent-eye-off') as well.

Hmm that's odd because this test verifies that it should work: https://github.com/adamwathan/blade-svg/pull/50/commits/8d531f4870970e9cddc6a9be5384b4e4fdc9c487#diff-b0e3204a285e6556082196cf2a8dc305R125

Hey everyone. We've finally merged this and moved the package to its new home. I'll be leaving this branch on this repo for a few weeks but it's best that you move to the stable 0.4.0 tag as soon as possible.
Thanks a lot for helping with testing!

@driesvints Yeah no, I wouldn't expect support for the custom directive. It's just weird because everything is being built up properly and even with the @svg directive the tests are failing, so I'm just at a loss for how to debug it. No worries though, I'll keep hammering on it. Thanks for all your work on this!

@driesvints  thank you for taking your time to refine the package.
@agentphoenix I understand what you are facing. I have something similar. Everything works on local server but failing on github action. Keep working. If I have sometimes, I will have a look at your issue.

@driesvints @njoguamos I ended up fixing my issue with Github Actions, though I'm not sure why it fixed it, so maybe one of you knows.
I ended up dumping out the registered sets from the BladeUI icons factory class in my tests. Locally, everything looked as expected. In Github Actions though, it was an empty array. So clearly something was going on where Github Actions was running my tests before that service provider could be called. On a whim, I decided to turn off Laravel's auto-discovery and manually registered the BladeUI icons service provider myself. Everything worked after that.
So the question now is... why? Not sure if there's something about Laravel's auto-discovery and when service providers get called, but this is the second time that removing something from auto-discovery fixed my tests in Github Actions. Welcome to hear thoughts on that if you have any, but either way, thought I'd let you both know that I fixed it and what the fix was.

@agentphoenix hmm no idea really. I never experienced that myself. Good that you got it fixed though.


Signal contract broken ?

I found a very strange behavior in my system. For now I have not created a small repro but issue seems very serious so I give you a recap of my trying to narrow down the problem.
    val openSessionRequest = new EventBus[ImportSourceEntry]

    val importFileProcessApiClient1 =
      appCanvas.$clients.value.map(_.map(_.importFileProcessApiClient))

    val importFileProcessApiClient2 =
      appCanvas.$clients.value.map(_.map(_.importFileProcessApiClient))

    val testResult = Val("test1")
      .combineWith(importFileProcessApiClient2)
      .flatMap { t =>
        EventStream.fromValue("test")
      }

... later in code I put some monitoring of what's going on
              div(
                importFileProcessApiClient --> { client =>
                  error(s"client monitoring mapped val 1 ${client}")
                },
                importFileProcessApiClient2 --> { client =>
                  error(s"client monitoring mapped val 2 ${client}")
                },

appCanvas.$clients is an SignalOptionT from laminext so a thin wrapper around Signal[Option[T]] and it's value starts with None and then later changes to Some(..)
so importFileProcessApiClient1 and importFileProcessApiClient2 are identical, the only difference is that importFileProcessApiClient2 is used in constructing testResult
what I got is
'client monitoring mapped val 1 Some(feecompass.app.panel.web.app.AppCanvas$$anon$18@37)'
'client monitoring mapped val 2 None'
if I remove the usage of importFileProcessApiClient2 i got what's expected
'client monitoring direct mapped 1 Some(feecompass.app.panel.web.app.AppCanvas$$anon$18@37) '
'client monitoring direct mapped 2 Some(feecompass.app.panel.web.app.AppCanvas$$anon$18@37) '
if I switch the usage of 1 and 2 the problem appears on 1
'client monitoring mapped val 1 None '
'client monitoring mapped val 2 Some(feecompass.app.panel.web.app.AppCanvas$$anon$18@35)'
Now the strange part testResult is not used anywhere. The trigger for the problem is
      .flatMap({ case (_, _) =>
        EventStream.fromValue("test")
      })

if I comment it out then it works as expected.
If testResult is used for instance in div(child <-- testResult.map(t => div(t.toString)), ... the wrong behavior stays the same.
On the other hand switching to FlattenStrategy.ConcurrentStreamStrategy resolves the problem.
It looks as if adding that flatMap with FlattenStrategy.SwitchStreamStrategy messes things up somehow and it's not related to actual usage of the resulting Observable but just the fact of constructing it. I will let you know if I find something more.

@pbuszka is this close enough to what you have?
    trait Client {
      def importFileProcessApiClient: EventStream[Resp]
    }
    trait Resp

    val $clients: Signal[Option[Client]] = ???

    val importFileProcessApiClient1 =
      $clients.map(_.map(_.importFileProcessApiClient))

    val importFileProcessApiClient2 =
      $clients.map(_.map(_.importFileProcessApiClient))

    val testResult = Val("test1")
      .combineWith(importFileProcessApiClient2)
      .flatMap { t =>
        EventStream.fromValue("test")
      }

    div(
      importFileProcessApiClient1 --> { client =>
        println(s"client monitoring mapped val 1 ${client}")
      },
      importFileProcessApiClient2 --> { client =>
        println(s"client monitoring mapped val 2 ${client}")
      }
    )

trait ImportFileProcessApiClient
case class Client(importFileProcessApiClient: ImportFileProcessApiClient))

// the rest is the same

any actual calls do not matter, just constructing that flatMap is enough to trigger the problem

I tried this, and I'm getting
client monitoring mapped val 1 None
client monitoring mapped val 2 None
client monitoring mapped val 1 Some(...)
client monitoring mapped val 2 Some(...)

    class Client {
      def importFileProcessApiClient: ImportClient = new ImportClient
    }
    class ImportClient

    val clientsVar                       = Var(Option.empty[Client])
    val $clients: Signal[Option[Client]] = clientsVar.signal

    val importFileProcessApiClient1 =
      $clients.map(_.map(_.importFileProcessApiClient))

    val importFileProcessApiClient2 =
      $clients.map(_.map(_.importFileProcessApiClient))

    @unused val testResult = Val("test1")
      .combineWith(importFileProcessApiClient2)
      .flatMap { t =>
        EventStream.fromValue("test")
      }

    import scala.concurrent.duration._

      div(
        importFileProcessApiClient1 --> { client =>
          println(s"client monitoring mapped val 1 ${client}")
        },
        importFileProcessApiClient2 --> { client =>
          println(s"client monitoring mapped val 2 ${client}")
        }
      ),
      after(1.second) {
        clientsVar.set(Some(new Client))
      },

Maybe the fact that client is an effect of a previous chain of dependencies which is something like that:
val user = Var[Option[User]](None)
val entitlement = Var[Option[Entitlement]](None)
external user  --> user.set(Some(???))
external trigger  --> entitlement.set(Some(???))

val entitlementSignal = user.combineWith(entitlement)
...
val client = entitlementSignal.flatMap( ???: EventStream)

It shouldn't matter, at that point you have a Signal and that's it.
Btw, is that a typo in you example here?
                importFileProcessApiClient --> { client =>
                  error(s"client monitoring mapped val 1 ${client}")
                },

(importFileProcessApiClient without 1)

It is quite complex leading to the point where I found the problem (user credentials, then getting entitlement based on crednetials, then geting dataToken obtained by an apiCall) and the final result is a Signal[Option[Client]] which contains all tokens and permission necessary

copy paste before I changed to 1 & 2 but to see the diference clearly.

val client = entitlementSignal.flatMap( ???: EventStream)

Feels like it should be a Signal as well here.
To be honest, I've never tried doing signal.flatMap(???: EventStream) :)

I will try to narrow down which part upstream geenrates the problem.

 Do you get this in your app with literally this?
      .flatMap { t =>
        EventStream.fromValue("test")
      }

Or is it some different stream? Maybe one that also (indirectly) used to construct the $client in the first place?

yes I do, and the result is an unused variable. But before there are a lot of things going on including other flatMaps so it is probably something upstream that is the root cause

I do some testing to narrow down which part upstream generates the problem. In all simple setups of the upstream Signal there were no problems, so the thing appears when upstream is some corner case. Without a reproducible code it's like looking for a needle in a haystack so I think it's on me to find it as I have the only non-working case :)

@pbuszka I've just reviewed the implementation of SwitchStreamStrategy, and I do see a bit of an oddity there:
  private[this] var maybeCurrentEventStream: js.UndefOr[Try[EventStream[O]]] = parent match {
    case signal: Signal[I @unchecked] => signal.tryNow().map(makeStream)
    case _ => js.undefined
  }

This would cause the parent signal's tryNow() to be called (triggering an evaluation of the parent signal's initial value) before the parent signal was actually started (assuming other code didn't start parent signal already), even if the resulting flattened stream was never "used" (started). I would call it a contract violation, yes. For that to become a problem, the parent signal's initial value would need to depend on the exact point of time when that initial value is evaluated (e.g. if you get that initial value from the DOM somehow).
I'm not sure if this is what's causing your issue, but that's definitely one thing I should fix.

So I digged deeper and made it a bit simpler and found out the necessary conditions to trigger the problem in my system:
case class AdminToken(...)

val $dt: SignalOptionT[AdminToken] = ??? // here still a couple things going on upstream

val i1 = $dt.value
val i2 = $dt.value
// required to BREAK
// val i2 = $dt.value.map(_.map(_ => "a"))

val testResult =
  Val("test1")
    .combineWith(i2)
// required to BREAK
//    .flatMap { t =>
//      EventStream.fromValue("test")
//    }(FlattenStrategy.SwitchStreamStrategy)
// if flatMap strategy changed to ConcurrentStreamStrategy then the problem disappears

//breaks
div(
      child.maybe <-- EventStream
        .fromValue("t")
        .delay(100)
        // .delay(4000) // required TO BREAK
        .toWeakSignal
        .signal
        .split(_ => ())((_, _, s) => {
          div(
            i1 --> { client =>
              error(s"INSIDE test monitoring mapped val 1 ${client}")
            },
            i2 --> { client =>
              error(s"INSIDE test monitoring mapped val 2 ${client}")
            }
          )
        })
)

Suming up:

upstream a Signal which changes from None to Some after some delay
the signal must be mapped
it's observer must be in a div which is delayed as well compared to "touching" of the i2 signal by testResult

I think it roughly fits the potential cause you mentioned above.

Do any of the signals involved have an initial value that can't be reduced to a constant? For example, stuff likestream.startWith(thisNode.ref.clientWidth)? As opposed to stream.startWith(1)? Note that the startWith argument is lazily evaluated.

Nothing which depends on the DOM for sure but effectively there is a chain
Var.signal.flatMap(???: EventStream).toWeakSignal.flatMap(???: EventStream).toWeakSignal
leading to val $dt: SignalOptionT[AdminToken] and definitly timing is significant in producing good or bad result.
I am not sure what is just a random correlation and what is an actual cause. The ConcurrentStreamStrategy "fix" kind of confirms your diagnosis as it does not evaluate tryNow() of the parent as SwitchStreamStrategy does and this seems to be the key trigger.
Anyway if this stuff will be changed later then I will stick with the workaround of ConcurrentStreamStrategy for now. I'll try to prepare a test case for laminar which reproduces this problem.

The part which really left me completly confused is the .map requirement to trigger the problem

In the graph of observables events normally propagate depth-first (disregarding special cases like combineWith), so depending on stream vs stream.map(...) can produce different schedules. Again, not something that I would expect to break things in the manner you descrive. I'm still baffled by the whole thing, not sure what could be causing it...

We've confirmed that this branch solves the problem: https://github.com/raquo/Airstream/tree/rough-flatten-fix
I'll release this as Airstream 0.13.1 soon.

Release ETA in a couple days, got sidetracked with other stuff.

Any update on ETA ,if you think it's longer then a week please let me know then I'll make my own module from the fork.

Hey @pbuszka, sorry for the delay, I got hit by some urgent personal issues.
I should be able to make a release this weekend – it turned out that some other flatten observables also need this fix, so I need a bit more code and more tests for this fix to be comprehensive.

Cool, if I can do something to help let me know.

@pbuszka I've just released Airstream branch rough-flatten-fix as 0.13.2-RC1. It will be up on Maven Central shortly.


New user trying to follow the registration flow ends up with "Unknown App is requesting authorization"

Problem
Following Wallet redirects I ended up with the following URL:
https://wallet.nearprotocol.com/sign?app_url=https%3A%2F%2Fkhorolets.github.io&contract_id=nearoverflow.testnet&failure_url=https%3A%2F%2Fkhorolets.github.io%2Fnearoverflow-demo%2F1&public_key=ed25519%3ADdioPWCgFh2c1MTtYKpXhLVDpRusAg4j5HUcPMWCwLwD&redirect_url=%2Fsign&referrer=https%3A%2F%2Fkhorolets.github.io%2Fnearoverflow-demo%2F&success_url=https%3A%2F%2Fkhorolets.github.io%2Fnearoverflow-demo%2F1&title=NEAROverflow

The "More information" button leads to a completely blank page
Expected Behavior
I expected the page to display "NEARoverflow" instead of "Unknown App".
Steps to reproduce
(I did not try to minimize the flow, so some of the steps might not be useful)

I landed on the page suggesting me to transfer some tokens, but my frol.near account did not have enough tokens, so I decided to create a new account
Creation of frol.testnet failed due to timeout, so I had to pick a new account id frol2.testnet, followed the pass-phrase recovery process
Once the account creation was completed, I was redirected to the page I described above

There are several problems here, it was quite problematic to find. The best way to solve it all would be to rebuild it and apply the same approach as in /login where all data from URL is stored in Session Storage. I will implement it.
@kcole16 @vgrichina Also one question. Now, as app title, we are showing referrer domain, we want to change it to app title, or show app title only if it's available, if not available show referrer domain?


Unable to Login with demoUser

Issue description
see https://github.com/streamaserver/streama/issues/877

On readme file :
credentials: username: demoUser | password: demoUser
Feel free to play around there as much as you like (everything is reset at night)
So , what you have to do is to test it tomorrow  .

... okay, but #877 said that it was fixed on sept 25
sorry to misunderstand

also, 'night' may differ from place to place :-)

Login works for me now
I guess some users play around with the user and change the password or some bullshit. I can maybe have the reset be triggered more than once every 24 hours.

It works now. Maybe just prevent de demoUser from being edited. Looks very nice!


support for custom datasets

Hi, thanks for your great job. I wonder if your work support for  custom datasets?
I would like to train on open-datasets and then test on my own datasets.
Thank you!

Hi, thanks for your interest. We do not plan to include additional dataset support here since we want to this project to be light (meaning only the core methods and examples of use). Feel free to adapt the examples to your needs. If you have any issue with that you can also contact me privately.

Hi, thanks for your interest. We do not plan to include additional dataset support here since we want to this project to be light (meaning only the core methods and examples of use). Feel free to adapt the examples to your needs. If you have any issue with that you can also contact me privately.


New .v1 import namespace yields different SettingsError on Python v3.12

Initial Checks

[X] I have searched GitHub for a duplicate issue and I'm sure this is something new
[X] I have searched Google & StackOverflow for a solution and couldn't find anything
[X] I have read and followed the docs and still think this is a bug
[X] I am confident that the issue is with pydantic (not my code, or another library in the ecosystem like FastAPI or mypy)

Description
We have some tests that provoke SettingsError from Pydantic, and we use code like this to test it:
try:  # import from Pydantic v2
    from pydantic.v1 import ValidationError
    from pydantic.v1.env_settings import SettingsError
except ModuleNotFoundError:  # import from Pydantic v1
    from pydantic import ValidationError
    from pydantic.env_settings import SettingsError

...

def test_settings(...):
    with pytest.raises(SettingsError):
        <code that provokes EnvSettingsSource to raise SettingsError>

Our code runs (otherwise successfully) on Python version between 3.7 and 3.12, and our Pydantic version constraint is ">=1.10.4,<3.0.0".
However, on the specific combination of Python v3.12 and Pydantic v1.10.16, the above code fails, because the SettingError that we expect is apparently not the same SettingsError that is raised by Pydantic. More specifically, as of v1.10.16 the imports in the try-clause above have begun to succeed, and the full name of the SettingsError class we end up importing is pydantic.v1.env_settings.SettingsError. However, the full name of the SettingsError that is raised by EnvSettingsSource is different: pydantic.env_settings.SettingsError, and these two classes are not the same, as shown by this experiment:
$ .nox/tests-3-12/bin/python
Python 3.12.2 (main, Feb  6 2024, 20:19:44) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydantic
>>> pydantic.__version__
'1.10.16'
>>> from pydantic.env_settings import SettingsError
>>> from pydantic.v1.env_settings import SettingsError as SettingsErrorV1
>>> SettingsError
<class 'pydantic.env_settings.SettingsError'>
>>> SettingsErrorV1
<class 'pydantic.v1.env_settings.SettingsError'>
>>> SettingsError is SettingsErrorV1
False

On v1.10.15 this is not a problem, since the .v1 namespace it not yet available (and we thus fail the try-clause and fall back to the old-style imports):
$ .nox/tests-3-12/bin/python
Python 3.12.2 (main, Feb  6 2024, 20:19:44) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydantic
>>> pydantic.__version__
'1.10.15'
>>> from pydantic.env_settings import SettingsError
>>> from pydantic.v1.env_settings import SettingsError as SettingsErrorV1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pydantic.v1.env_settings'; 'pydantic.v1' is not a package

An extra curveball is that this is only an issue on Python 3.12. 3.11 (and earlier) behaves differently:
$ ./.nox/tests-3-11/bin/python
Python 3.11.8 (main, Feb  6 2024, 21:21:21) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pydantic
>>> pydantic.__version__
'1.10.16'
>>> from pydantic.env_settings import SettingsError
>>> from pydantic.v1.env_settings import SettingsError as SettingsErrorV1
>>> SettingsError
<class 'pydantic.env_settings.SettingsError'>
>>> SettingsErrorV1
<class 'pydantic.env_settings.SettingsError'>
>>> SettingsError is SettingsErrorV1
True

So:

on <=v1.10.15 we end up using the old fallback imports (no .v1 namespace) as we always intended,
on >=2 we import from the .v1 namespace, and the SettingsError is always pydantic.v1.env_settings.SettingsError,
but on v1.10.16 we end up importing from the .v1 namespace, but the SettingsError that is actually raised is a slightly different one (without .v1).
I'm not yet sure what is the exact difference between Python 3.11 and 3.12 to cause it to behave differently.

More context in this downstream issue: https://github.com/tweag/FawltyDeps/issues/438
Example Code
from pydantic.env_settings import SettingsError
from pydantic.v1.env_settings import SettingsError as SettingsErrorV1

SettingsError is SettingsErrorV1  # should be True

Python, Pydantic & OS Version
pydantic version: 1.10.16
            pydantic compiled: False
                 install path: /home/jherland/code/fawltydeps/.nox/tests-3-12/lib/python3.12/site-packages/pydantic
               python version: 3.12.2 (main, Feb  6 2024, 20:19:44) [GCC 13.2.0]
                     platform: Linux-6.6.25-x86_64-with-glibc2.38
     optional deps. installed: ['typing-extensions']

Affected Components

[X] Compatibility between releases
[X] Data validation/parsing
[ ] Data serialization - .model_dump() and .model_dump_json()
[ ] JSON Schema
[ ] Dataclasses
[ ] Model Config
[ ] Field Types - adding or changing a particular data type
[ ] Function validation decorator
[ ] Generic Models
[ ] Other Model behaviour - model_construct(), pickling, private attributes, ORM mode
[ ] Plugins and integration with other tools - mypy, FastAPI, python-devtools, Hypothesis, VS Code, PyCharm, etc.

@jherland,
So we recently introduced the v1 namespace to v1 as well to make migrations easier for folks.
@exs-dwoodward, any idea why this is happening here?

not too - but likely due to the hacky v1.py __getattr__ not fooling python>=3.12.
I'm starting to think it might just be worth having a pydantic/v1/ sub directory that basically has mirrored modules that just import all the symbols from the mirrored module. Of course though that comes with the caveat that:
pydantic.v1.fields is pydantic.fields # False which is the only annoying part. WDWT - I have a branch with the /v1 sub directory where every symbol is imported and testing on python 3.12 seems to resolve this type of error - even with the module caveat. It should help with the typing issue too.

Marking as resolved by #9660, we'll get a release out tomorrow with this fix!


Base64 conversion of jpeg data

Hi,
I try to make a IoT web camera, it posts jpeg data to Node-RED server.
The camera module is M5Camera, it works fine using by this demo code.
I try to convert image data to Base64 but no success.
I use mbedtls_base64_encode() .
mbedtls_base64_encode(b64data, sizeof(b64data)+1, &olen, camera_get_fb(), camera_get_data_size());
Please tell me how to get jpeg data from frame buffer.....

Finally I could run base64 encode.
unsigned char  image[2048];

 size_t olen;

 mbedtls_base64_encode(image, sizeof(image), &olen, camera_get_fb(), 1024);

Thank you.


fix Automation.HelpText on windows

What does the pull request do?
This exposes AutomationProperties.HelpText to windows automation clients. It also will return the control's tool tip text if the HelpText property is not set, this is a microsoft recommendation.
This does not change the behaviour on mac.
What is the current behavior?

HelpText cannot be read on windows
What is the updated/expected behavior with this PR?

If AutomationProperties.HelpText or Tooltip.Tip are set on a control Narrator will read the text after the control's AutomationProperties.Name or content.
How was the solution implemented (if it's not obvious)?

Checklist

[ ] Added unit tests (if possible)?
[ ] Added XML documentation to any related classes?
[ ] Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation

Breaking changes

Obsoletions / Deprecations

Fixed issues
Fixes #16999

@ahopper,
Please read the following Contributor License Agreement (CLA). If you agree with the CLA, please reply with the following:
@cla-avalonia agree

Contributor License Agreement
Contribution License Agreement
This Contribution License Agreement ( “Agreement” ) is agreed to by the party signing below ( “You” ),
and conveys certain license rights to the AvaloniaUI OÜ ( “AvaloniaUI OÜ” ) for Your contributions to
AvaloniaUI OÜ open source projects. This Agreement is effective as of the latest signature date below.
1. Definitions.
“Code” means the computer software code, whether in human-readable or machine-executable form,
that is delivered by You to AvaloniaUI OÜ under this Agreement.
“Project” means any of the projects owned or managed by AvaloniaUI OÜ and offered under a license
approved by the Open Source Initiative (www.opensource.org).
“Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any
Project, including but not limited to communication on electronic mailing lists, source code control
systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of
discussing and improving that Project, but excluding communication that is conspicuously marked or
otherwise designated in writing by You as “Not a Submission.”
“Submission” means the Code and any other copyrightable material Submitted by You, including any
associated comments and documentation.
2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any
Project. This Agreement covers any and all Submissions that You, now or in the future (except as
described in Section 4 below), Submit to any Project.
3. Originality of Work.  You represent that each of Your Submissions is entirely Your
original work. Should You wish to Submit materials that are not Your original work,
You may Submit them separately to the Project if You (a) retain all copyright and
license information that was in the materials as you received them, (b) in the
description accompanying your Submission, include the phrase "Submission
containing materials of a third party:" followed by the names of the third party and any
licenses or other restrictions of which You are aware, and (c) follow any other
instructions in the Project's written guidelines concerning Submissions.
4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else
for whom You are acting in making Your Submission, e.g. as a contractor, vendor, or agent. If Your
Submission is made in the course of Your work for an employer or Your employer has intellectual
property rights in Your Submission by contract or applicable law, You must secure permission from Your
employer to make the Submission before signing this Agreement. In that case, the term “You” in this
Agreement will refer to You and the employer collectively. If You change employers in the future and
desire to Submit additional Submissions for the new employer, then You agree to sign a new Agreement
and secure permission from the new employer before Submitting those Submissions.
5. Licenses.
a. Copyright License. You grant AvaloniaUI OÜ, and those who receive the Submission directly
or indirectly from AvaloniaUI OÜ, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable
license in the Submission to reproduce, prepare derivative works of, publicly display, publicly perform,
and distribute the Submission and such derivative works, and to sublicense any or all of the foregoing
rights to third parties.
b. Patent License. You grant AvaloniaUI OÜ, and those who receive the Submission directly or
indirectly from AvaloniaUI OÜ, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license
under Your patent claims that are necessarily infringed by the Submission or the combination of the
Submission with the Project to which it was Submitted to make, have made, use, offer to sell, sell and
import or otherwise dispose of the Submission alone or with the Project.
c. Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement.
No additional licenses or rights whatsoever (including, without limitation, any implied licenses) are
granted by implication, exhaustion, estoppel or otherwise.
6. Representations and Warranties. You represent that You are legally entitled to grant the above
licenses. You represent that each of Your Submissions is entirely Your original work (except as You may
have disclosed under Section 3 ). You represent that You have secured permission from Your employer to
make the Submission in cases where Your Submission is made in the course of Your work for Your
employer or Your employer has intellectual property rights in Your Submission by contract or applicable
law. If You are signing this Agreement on behalf of Your employer, You represent and warrant that You
have the necessary authority to bind the listed employer to the obligations contained in this Agreement.
You are not expected to provide support for Your Submission, unless You choose to do so. UNLESS
REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND EXCEPT FOR THE WARRANTIES
EXPRESSLY STATED IN SECTIONS 3, 4, AND 6 , THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS
PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF
NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
7. Notice to AvaloniaUI OÜ. You agree to notify AvaloniaUI OÜ in writing of any facts or
circumstances of which You later become aware that would make Your representations in this
Agreement inaccurate in any respect.
8. Information about Submissions. You agree that contributions to Projects and information about
contributions may be maintained indefinitely and disclosed publicly, including Your name and other
information that You submit with Your Submission.
9. Governing Law/Jurisdiction. This Agreement is governed by the laws of the Republic of Estonia, and
the parties consent to exclusive jurisdiction and venue in the courts sitting in Talinn,
Estonia. The parties waive all defenses of lack of personal jurisdiction and forum non-conveniens.
10. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and
supersedes any and all prior agreements, understandings or communications, written or oral, between
the parties relating to the subject matter hereof. This Agreement may be assigned by AvaloniaUI OÜ.
AvaloniaUI OÜ dedicates this Contribution License Agreement to the public domain according to the Creative Commons CC0 1.

@ahopper,
Please read the following Contributor License Agreement (CLA). If you agree with the CLA, please reply with the following:
@cla-avalonia agree

Contributor License Agreement

@cla-avalonia agree

LGTM with the changes, thanks!
I'll wait for @Gillibald last input before merging.


Could you create a tutorial on using it without any dataset?

What do you mean "without any dataset" ?
(For example, generate random number in begin of tutorial, and this library is applied to it.)

I mean as a blackbox optimizer.
In fact I have a dataset, but prefer not to use sklearn for crossvalidation because it is damn slow. Instead I call the xgboost function doing cv in native code using a precreated object with data.

This library is based on sklearn crossvalidation class and changing not to use it sounds difficult.
Can you have sample code for native code cv?
I will think about this change.

Can you have sample code for native code cv?

Just assumme it as a function call. For example you can try Rosenbrock function, as this one. Your code passes hyperparams to a func. The func returns loss  mean value and variance. The framework I have built around xgbooost assummes that I can pass a grid spec and a func into optimizer and get then the hyperparams corresponding to minimal loss. Most of black box optimizers and hyperparams optimizers work this way, and I guess that all the hyperparams optimizers use a black box optimizer internally somewhere. For me it would be easier if hyperparams were passed into function as a dict rather than an array.

Similarly, don't your framework pass hyper parameter space and a function（internally train xgboost and return predict score）into optimizer ?

It does. For example https://github.com/KOLANICH/AutoXGBoost.py/blob/master/AutoXGBoost/hyperparamsOptimizers/hyperopt.py  I agree that it is more correctly to call that variable spaceSpec rather  than gridSpec.

Thank you for example. Your code use "xgb.cv", so fast than sklearn-cv.
On the other hand, my function (pass into optimizer) is depend on sklearn-cv and I can not support "xgb.cv" right away.
https://github.com/genfifth/cvopt/blob/master/cvopt/model_selection/_base.py#L346
I will think about support "xgb.cv" when I have a time.

I will think about support "xgb.cv" when I have a time.

I meant not this, I meant an example of optimizing any function. I can look into the source myself to try to figure out how to do it, but for now I just have no time for that.

I pass the following function to optimizer and optimizing it.
def f(hyper parameter):
   -----
   # run sklean cross validation.
   # (dataset and an estimator are given before using ".fit" method.)
   -----
   return average_score

As I said before, this based on the sklearn crossvalidation class.
I thought, but it seems to be difficult to optimize any function such as Rosenbrock function.

why i have this problem ?

@jujubbgg, because you are doing everything completely wrong.

you are posting into a completely irrelevant issue
you have ignored the error message describing your problem.
you havenposted a screenshot instead of text
you have provided insufficient information needed for diagnostics. The error message implies that model_selection dir is a package root. So tye obvious question is "what's your cwd?" But as the path looks like you haven't installed the package I can deduce that you have just cded to model_selection and tried to run from it.


Cancel / Refund option should be present for admin if the Automatically invoice generate is enabled.

Bagisto Version: Master
Steps To reproduce--
1. Log in as an admin.
2. Click on payment method inside the configuration/sales.
3.   Enable Automatically generate the invoice after placing an order
4. Visit the shop and place an order.
5. Try to cancel the order
Expected result:  Cancel / Refund option should be present for admin if the Automatically invoice generate is enabled.
Actual result: The admin is not able to cancel the order if the Automatically invoice generate is enabled by admin. Please find the screenshot Here

@Sanjaybhattwebkul
As per the issue and current flow, in case of auto invoice generation there will not be an option to cancel the invoice.
But in this case you need to create transactions for the same and after creating transaction you will be able to see Refund option.


Add dnsmasq and dnsdata CRD to manage external DNS entries

Depends-On: https://github.com/openstack-k8s-operators/lib-common/pull/241

need to run a full e2e test and install_yamls integration

/retest

/test infra-operator-build-deploy

I haven't looked at the test code yet. I will do that next. But it will take time so I publish my comments on the code now.

Thanks a lot @gibizer , I think I have addressed your comments.


devicelab mac-45 quarantined due to 6 consecutive failures of Mac_arm64_ios ios_app_with_extensions_test, simulator runtime profile is not found

cc: @keyonghan
See: https://chromium-swarm.appspot.com/bot?id=flutter-devicelab-mac-45
6 consecutive failures of Mac_arm64_staging ios_app_with_extensions_test on mac-45 caused it to be quarantined.

@jmagman can you please take a look at these failures.

fyi:
[ios_app_with_extensions_test] [STDOUT] stdout:                2022-08-11 11:04:16.965 ibtoold[6998:40084] [MT] IBPlatformTool: *** Failed to launch tool with description <IBCocoaTouchPlatformToolDescription: 0x6000030bac20> System content for IBCocoaTouchFramework-ElevenAndLater <IBScaleFactorDeviceTypeDescription: 0x6000030ba6c0> scaleFactor=2x, renderMode.identifier=(null): Encountered an error communicating with IBAgent-iOS. (Failure reason: IBAgent-iOS (-1) failed to launch): Failed to launch IBAgent-iOS via CoreSimulator spawn (Failure reason: Failed to spawn IBAgent-iOS on IBSimDeviceTypeiPad2x (7D8E9A72-951D-4034-93F2-D1310618E9A1, (null), Shutdown)): Invalid device: The specified device is not available for spawning processes.
[ios_app_with_extensions_test] [STDOUT] stdout:                /* com.apple.ibtool.errors */
[ios_app_with_extensions_test] [STDOUT] stdout:                /opt/s/w/ir/x/t/flutter_ios_app_with_extensions_test.60ZNP4/app_with_extensions/ios/Runner/Base.lproj/Main.storyboard: error: Encountered an error communicating with IBAgent-iOS.
[ios_app_with_extensions_test] [STDOUT] stdout:                    Failure Reason: IBAgent-iOS (-1) failed to launch
[ios_app_with_extensions_test] [STDOUT] stdout:                    Recovery Suggestion: Please check Console.app for crash reports for "IBAgent-iOS" for further information.
[ios_app_with_extensions_test] [STDOUT] stdout:                    Underlying Errors:
[ios_app_with_extensions_test] [STDOUT] stdout:                        Description: Failed to launch IBAgent-iOS via CoreSimulator spawn
[ios_app_with_extensions_test] [STDOUT] stdout:                        Failure Reason: Failed to spawn IBAgent-iOS on IBSimDeviceTypeiPad2x (7D8E9A72-951D-4034-93F2-D1310618E9A1, (null), Shutdown)
[ios_app_with_extensions_test] [STDOUT] stdout:                        Underlying Errors:
[ios_app_with_extensions_test] [STDOUT] stdout:                            Description: Invalid device: The specified device is not available for spawning processes.
[ios_app_with_extensions_test] [STDOUT] stdout: ```

This looks the same as https://github.com/flutter/flutter/issues/100245 and https://github.com/flutter/flutter/issues/99039 and https://github.com/flutter/flutter/issues/99429, the simulator runtime profile is not found.  This was cleared up before by cleaning caches, but I thought all the cache leaking issues had been tracked down.
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8806105004236314353/+/u/list_simulators/stdout
-- Unavailable: com.apple.CoreSimulator.SimRuntime.iOS-15-5 --
    iPhone 8 (817FD431-7A69-4567-8B3E-D8E62726F566) (Shutdown) (unavailable, runtime profile not found)
...

@jmagman will move this back into the queue to get the caches cleared.

Would be good to know why this keeps happening...

Machine was recovered


[Enhancement] : Add README file

Hi team
I've been exploring the project's README file and believe there's room for improvement to enhance its clarity and usefulness for both new users and contributors. Improving the README in multiple aspects will not only make it easier for users to understand and utilize the project but also encourage more contributions and engagement from the community. I have already contributed in open source making it easier to contribute.
Looking forward to collaborating on this enhancement!

please assign this issue to me under gssoc 24

Hey @Dev-tanay ,
I can write better README.md file for your project, with proper description and instruction on how to play the game and how to use this repo with git commands and all.
Please assign this issue to me under GSSoC '24.


Update CI workflows

Add matrix strategy to cvmfs job including compilation with CMSSW_14_1_0_pre4 (ROOT v6.30/07), CMSSW_11_3_4 (ROOT v6.22) and CMSSW_14_0_0_pre1 (ROOT v6.26/11)
Update the main ci workflow, remove the 6.24 build (there is no corresponding combine release), build with root v6.32 will be added once the release is available for installation

merging this for now, will add more tests with datacards later

FYI https://anaconda.org/conda-forge/root/files?version=6.32.0 is out now

Thanks @nsmith- I tried adding 6.32.2 from conda https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit/pull/992   but MDF fails as you can see here  and I didn't have time to figure out why exactly


Unable to Split Localization .arb Files into Multiple Categories

Use case
In the current app development process, we are unable to split our localization .arb files into multiple files for better categorization, such as separating error messages, general messages, and other text strings. This limitation hinders our ability to maintain a well-organized and scalable localization structure.
Proposal

Enable the inclusion of multiple .arb files with the same suffix (e.g., *_en.arb).
Introduce wildcard patterns in the template-arb-file parameter (e.g., template-arb-file: "*_en.arb") to include all matching .arb files.

The relevant changes could be made here

Looks like similar to https://github.com/flutter/flutter/issues/107157, so please follow-up in it for further updates.
Closing as duplicate.


Split a10_device_instance networks into two options. list validation

requires https://github.com/a10networks/a10-neutronclient/pull/11/


Fixing crash

Description
Fixes #1323
Made changes according to the comment:
https://github.com/commons-app/apps-android-commons/issues/1323#issuecomment-373899479
Tests performed
Tested on Motorola Moto G(5) (Android 7.0, API Level 24)

Codecov Report

Merging #1343 into master will decrease coverage by <.01%.
The diff coverage is 0%.

@@            Coverage Diff            @@
##           master   #1343      +/-   ##
=========================================
- Coverage    3.73%   3.72%   -0.01%
=========================================
  Files         127     127
  Lines        6054    6065      +11
  Branches      588     588
=========================================
  Hits          226     226
- Misses       5813    5824      +11
  Partials       15      15

Impacted Files
Coverage Δ

...c/main/java/fr/free/nrw/commons/AboutActivity.java
0% <0%> (ø)
:arrow_up:

...ain/java/fr/free/nrw/commons/upload/FileUtils.java
5.74% <0%> (ø)
:arrow_up:

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 fe1f0b5...79f9cf1. Read the comment docs.


JQL must be run from source code directory

Because
https://github.com/yamafaktory/jql/blob/master/src/utils.rs#L8-L16 is run each time the binary is started if you trying and jql outside of the source code direction you get a file not found panic.

@zmanian Thanks for the report 👍! I've fixed it in the latest version https://crates.io/crates/jql/0.1.8.


enhance scaler agression

Codecov Report

Merging #212 (26a5863) into master (ca7b82e) will increase coverage by 1.77%.
The diff coverage is 42.85%.

@@            Coverage Diff             @@
##           master     #212      +/-   ##
==========================================
+ Coverage   43.80%   45.58%   +1.77%
==========================================
  Files          32       32
  Lines        4570     4934     +364
==========================================
+ Hits         2002     2249     +247
- Misses       2568     2685     +117

Impacted Files
Coverage Δ

assemblyline_core/scaler/scaler_server.py
28.90% <42.85%> (-1.74%)
:arrow_down:

assemblyline_core/dispatching/dispatcher.py
80.81% <0.00%> (+3.26%)
:arrow_up:

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 ca7b82e...26a5863. Read the comment docs.


[Sample] Different forms of hosts in ingresses

Problem Statement
We have a customer who's using different domains in one ingress because they use it as an api tunnel.
We have tried to setup using regex match and request.object.spec.rules[?contains(host, '<domain>')].host
Solution Description
A way to easily setup using different domains in one ingress and they need to support a specific format as this is how the guidelines at my workplace.
Example "Good" Resource
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: <ingress name>
  namespace: <project>
spec:
  rules:
  - host: subdomain.cluster_01.example.com
    http:
      paths:
      - backend:
          service:
            name: <api tunnel name>
            port:
              number: 2222
        path: /
        pathType: Prefix
  - host: subdomain.test.com
    http:
      paths:
      - backend:
          service:
            name: <api tunnel name>
            port:
              number: 2222
        path: /
        pathType: Prefix

Example "Bad" Resource
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: <ingress name>
  namespace: <project>
spec:
  rules:
  - host: subdomain.cluster_01_blalbla.example.com
    http:
      paths:
      - backend:
          service:
            name: <api tunnel name>
            port:
              number: 2222
        path: /
        pathType: Prefix
  - host: subdomain.testdeny.com
    http:
      paths:
      - backend:
          service:
            name: <api tunnel name>
            port:
              number: 2222
        path: /
        pathType: Prefix

Other Comments
No response
Slack discussion
No response
Troubleshooting

[X] I have read and followed the documentation AND the troubleshooting guide.
[X] I have verified the policy does not exist in the samples library.

I'm not understanding from your examples what it is you want to achieve here. Can you explain? Multiple examples also help.

I'm not understanding from your examples what it is you want to achieve here. Can you explain? Multiple examples also help.

Sorry, I am not good at explaining things.
We have a customer who has two different domains in one ingress resource.
One of the domains has to have a subdomain with the cluster name and can specify their host under that cluster name subdomain. We need to restrict by having them to use the cluster name as the first subdomain.
The bold text is required with that host.
Example: project-app-nginx.k8s-prod01.test.internal
The other domain is free to use with whatever subdomain. Bold text is required
project-app-nginx.example.com

Why not use a glob so that all host fields must follow the pattern *.cluster_01.example.com?

Sadly that's not possible. It's two different domains with each of them having different requirements. They have to follow these.
k8s-prod01.test.internal
example.com

Ok, I'm still confused. You're now using different domain examples from what you showed in the initial message. I'm still trying to determine what hosts are "good" and what are "bad". If that's the only deciding factor, perhaps you can give me several examples of good and bad hosts with a short explanation of why.

It's just comments about two different domains which has to follow the guideline.
Good:
project-app01.k8s-prod01.test.internal
nginx01.k8s-prod01.test.internal
project-app01.example.com
nginx01.example.com
Bad:
project-app02.test.internal
nginx02.test.internal

Yes exactly!
I apologize profusely for having a hard time explaining myself and thank you for taking your time understanding.

This'll probably do it:
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: verify-ingress
spec:
  validationFailureAction: Enforce
  background: false
  rules:
  - name: validate-host
    match:
      any:
      - resources:
          kinds:
          - Ingress
    validate:
      message: "Hosts must be either *.k8s-prod01.test.internal OR *.example.com"
      pattern:
        spec:
          rules:
          - host: "*.k8s-prod01.test.internal | *.example.com"


error compiling into react app

Cannot find module '/Users/digit/Sites/react-code-input/node_modules/react-hot-api/modules/index.js' from '/Users/rdewsbury/iogc3/server/node_modules/react-code-input/lib'
Should /Users/digit/Sites be hardcoded in here?

Well, example.js is compiled file. Execute npm run build - this gonna resolve the issue


Feat: Improve the footer

Describe the feature
Improve the footer to add social links and update the copyright automatically according to the current year
Add ScreenShots

Record

[X] I agree to follow this project's Code of Conduct
[X] I'm a GSSOC'24 contributor
[X] I want to work on this issue

Please assign me this task, I will fix it

I would like to work on this project. Please assign it to me.


[RFC] luci-app-storage: created

This luci app allows the user to setup storage automatically: it clears, re-partitions and formats drives to be either used as storage drives (single ext4 GPT partition) or as RAID1 depending on what the user has chosen.
It shows an interface with 2 buttons to choose if the user wants independent drives or RAID, and after it's done it shows the output of the commands issued in a new page.
In case it is not obvious, this allows the average user of a mid-end router (or NAS) to setup a drive connected over usb or Sata without having to use SSH to copy-paste a commandline from the wiki tutorials.
I would like to expand it to be able to deal with filesystem mainteneance, automatic extroot, mdadm operations (remove/add/rebuild and so on), but that's just more of the same thing. User pushes a few buttons and the app does the leg work.
In this state it is good enough for a RFC.
I'm sending this PR to ask information/comments/help about the following issues:
-this app currently works by using luci.sys.call and luci.util.exec to execute embedded large single-line (rather ugly) blobs of shell script, as I didn't find luci functions to do what I needed, likely because I have no experience with lua so I can't read the code very well. Can someone point me to functions I should use or post the lua equivalent of what my shell code is doing (so I can use that to make lua functions)?
For example, even relatively simple things like splitting each line and adding <p> and </p> so they are rendered properly in the "command output page" was done by sed in the shell command line blob.
-I would have liked to update the "command output" page after every command, but I don't know how to do that. Calling "luci.template.render()" again will append the contents to the already rendered page, and again I can't understand the code enough to see if there are functions to do that already.
It's been developed/tested in a Virtualbox VM LEDE x86_64 image.
(yes I know there is no translation support in this app, I figured out how it works and I'll do that later when the app itself is less ugly)
Signed-off-by: Alberto Bursi<EMAIL_ADDRESS>

superseeded by https://github.com/openwrt/luci/pull/1749


Soundcloud embedded playlist not downloading

Please follow the guide below

You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
Put an x into all the boxes [ ] relevant to your issue (like this: [x])
Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.03.14. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

[x] I've verified and I assure that I'm running youtube-dl 2018.03.14

Before submitting an issue make sure you have:

[x] At least skimmed through the README, most notably the FAQ and BUGS sections
[x] Searched the bugtracker for similar issues including closed ones
[x] Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

[x] Bug report (encountered problems with youtube-dl)
[ ] Site support request (request for adding support for a new site)
[ ] Feature request (request for a new functionality)
[ ] Question
[ ] Other

If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:
Add the -v flag to your command line you run youtube-dl with (youtube-dl -v <your command line>), copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'https://w.soundcloud.com/player/?url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F460766655']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.14
[debug] Python version 2.7.12 (CPython) - Darwin-15.6.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2
[debug] Proxy map: {}
[soundcloud:playlist] 460766655: Downloading playlist
ERROR: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 519, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2199, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

[1]+  Exit 1

Description of your issue, suggested solution and other information
The playlist https://w.soundcloud.com/player/?url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F460766655 works in the browser, but running     youtube-dl --verbose https://w.soundcloud.com/player/?url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F460766655 produced the above output.

Does not work in browser: same 404 is returned.

Sorry; that URL does seem to have stopped working.
However, the URL https://w.soundcloud.com/player/?visual=true&url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F460766655&show_artwork=true&dnt=1&secret_token=s-tHR28
is still working in the browser, and reports the same error in youtube-dl.

Most likely you did not quote URL properly.

How embarrassing - I had not realised that quoting the URL was needed. Thank you very much!


Various testbench fixes (missing power nets, iverilog params, prefixes)

Some power nets were undeclared in io_ports_tb.v which caused issues with defaultnettype none
Some of the GCC prefixes were doubled up in certain Makefiles
The -o param in the iverilog invocation was reversed, causing an error like this:

-o: No such file or directory

The sims build and pass locally with these changes.

@RTimothyEdwards Base branch is now develop


Implement deserialize_any

It looks like RON is self-describing. It should be able to tell what type is in the data without relying on a Deserializer hint.
#[macro_use]
extern crate serde_derive;

extern crate ron;

#[derive(Deserialize, Debug)]
#[serde(untagged)]
enum Untagged {
    U8(u8),
    Bool(bool),
}

fn main() {
    println!("{}", ron::de::from_str::<u8>("99").unwrap());
    println!("{}", ron::de::from_str::<bool>("true").unwrap());

    // unhelpful panic :(
    ron::de::from_str::<Untagged>("true");
}

I started implementing that, but it turned out RON is not completely self-describing: There is no way to tell if it is an enum or a struct.

That shouldn't matter. JSON certainly doesn't distinguish between those right, and it is self-describing?

Okay, if that's the case I'll take a look at it later.


Consider passing route props to render prop

Have a feature request?
I'd be nice, if props passed to a route could be passed to render, too. This would be useful to write generic custom routes.
E.g. I have a custom route like this:
export class FooRoute extends Route {
  static defaultProps = {
    render: (props) => { /* complex render logic */}
  };
}

I do it that way so I can use my <Foo/> inside <Switch/>.
I'd like to configure my render logic, but use a default render function:
<FooRoute
  path="/home"
  doCoolStuff
/>

As far as I can see it is not possible to see doCoolStuff in render. (The props passed to render is a router.)
Maybe this.props and this.router could be passed as a merged props to the render or this.props could be passed as routeProps or something like that? Something like that:
    const props = { ...this.router, routeProps: { ...this.props } }

This was temporarily a thing before, but it was removed because it is unnecessary. With the render prop you can include any props that are in scope.
const View = () => {
  const doCoolStuff = () => { alert('!') }
  return (
    <Route
      path='/yay'
      render={(props) => <Alerter {...props} doCoolStuff={doCoolStuff} /> }
   />
  )
}

But this doesn't not work inside <Switch/>.

As I said there, custom <Route>s can work, but they aren't supported. You can modify your custom route to work, but generally speaking you should just use a <Route>.
const View = () => {
  const extraProp = 'extra'
  return (
    <Switch>
      <Route path='/yay' render={(props) => <ComplexThing {...props} extraProp={extraProp} />
    </Switch>
  )
}

but they aren't supported

I think that's why I looked for a supported way.