Define config from env file

Environment
PHP version
$ php -v
PHP 7.4.5 (cli) (built: Apr 23 2020 02:25:56) ( NTS )

Subject
Is it possible to get config from .env file ?
Im trying to set a2lix_translation_form.locales from the .env file
Steps to reproduce
# config/packages/a2lix.yaml
a2lix_translation_form:
  ...
  locales: '%env(json:APP_LOCALES)%'
  ...

#.env
APP_LOCALES='["fr", "en"]'

Expected results
🎉
Actual results
Invalid type for path "a2lix_translation_form.locales.0". Expected one of "bool", "int", "float", "string", but got "array".

Hi CharlyPoppins,
You can use a comma separated string.
# config/packages/a2lix.yaml
a2lix_translation_form:
  ...
  locales: '%env(APP_LOCALES)%'
  ...

#.env
APP_LOCALES='fr,en'

If you want to use the same env variable in other places in your application you could consider creating a custom EnvVarProcessor
# app\Components\EnvVarProcessor\StringToArrayEnvVarProcessor

namespace App\Components\EnvVarProcessor;

use Symfony\Component\DependencyInjection\EnvVarProcessorInterface;

class StringToArrayEnvVarProcessor implements EnvVarProcessorInterface
{
    public function getEnv($prefix, $name, \Closure $getEnv)
    {
        $env = $getEnv($name);

        return preg_split('/\s*,\s*/', $env);
    }

    public static function getProvidedTypes()
    {
        return [
            'stringToArray' => 'array',
        ];
    }
}

#config/services

services:
    # default configuration for services in *this* file
    _defaults:
        ....
        bind:
            ...
            $enabledLocales: '%env(stringToArray:APP_LOCALES)%'
            ...

https://symfony.com/doc/current/configuration/env_var_processors.html

Hello @ray-001
First thank you very much for your effort on this bundle and your prompt answer.
However, even with your solution or the Symfony native csv processor, the result does not change. I still encounter the same issue.
However, changing the bundles configuration loader and setting locales to be a variableNode solves the issue.

@ray-001 thanks for your answer, I'm so sorry I only saw it now. I was giving another try today.
I tried both comma separated string and with the env var processor but i did not manage...
a2lix_translation_form:
  locales: '%env(APP_LOCALES)%'

APP_LOCALES=de,fr,en
Default locale `fr` not found within the configured locales `[de,fr,en]`. Perhaps you need to add it to your `a2lix_translation_form.locales` bundle configuration?

APP_LOCALES='de,fr,en'
Default locale `fr` not found within the configured locales `[de,fr,en]`. Perhaps you need to add it to your `a2lix_translation_form.locales` bundle configuration?

APP_LOCALES="de","fr","en"
Default locale `fr` not found within the configured locales `[de,fr,en]`. Perhaps you need to add it to your `a2lix_translation_form.locales` bundle configuration?

After analyse of debug:config I think it's because conf is converted this way :
# config/packages/a2lix.yaml
a2lix_translation_form:
  locales: '%env(APP_LOCALES)%'

# dump
a2lix_translation_form:
    locales:
        - '%env(APP_LOCALES)%'

I also have the same error with env var processor, seems logic according to my previous statement with debug:config
a2lix_translation_form:
  locales: '%env(stringToArray:APP_LOCALES)%'

Invalid type for path "a2lix_translation_form.locales.0". Expected one of "bool", "int", "float", "string", but got "array".

Hi all,
This is an issue in Symfony itself (see https://github.com/symfony/symfony/issues/40906 mainly, and https://github.com/symfony/symfony/pull/29270 also).
To date, there is no workaround, except using individual env vars for each language (which is clearly not ideal), or using an hardcoded array in the configuration file.
Closing in favor of following the upstream issue.


NEW: Removed old tests

example should cover majority of specific case scenarios that might of been skipped by given and that are present in the old test. It is designed as just in case scenario.
Code:
@given(
    start_date=st.dates(
        min_value=date(1960, 1, 1), max_value=date(2024, 12, 31)
    ),
    end_date=st.dates(min_value=date(1960, 1, 1), max_value=date(2024, 12, 31)),
)
@example(start_date=date(2022, 2, 28), end_date=date(2024, 2, 29))  # Leap year
@example(start_date=date(2024, 1, 1), end_date=date(2024, 1, 31))  # Same month
@example(start_date=date(1973, 1, 1), end_date=date(1973, 1, 1))  # Same date
@example(start_date=date(2019, 12, 31), end_date=date(2020, 1, 1))  # Border
@example(start_date=date(2018, 12, 1), end_date=date(2020, 1, 1))  # End of year
@example(start_date=date(2022, 12, 1), end_date=date(2020, 1, 1))  # Negative

example are the first tests, the total number of tests are 106 (100 given and 6 example)

start_date
end_date
month_delta

28/02/22
29/02/24
24

01/01/24
31/01/24
0

01/01/73
01/01/73
0

31/12/19
01/01/20
0

01/12/18
01/01/20
13

01/12/22
01/01/20
-35

01/01/00
01/01/00
0

01/01/67
01/01/00
396

15/11/67
17/04/86
221

Covered in PR #70


New version: vim.vim.nightly version 9.1.0181

Pull request has been created with WinGet Releaser v2 :rocket:
Microsoft Reviewers: Open in CodeFlow

Hi @chrisbra,
The package didn't pass a Defender or similar security scan. This might be a false positive and we can rescan tomorrow.
(Automated response - build 870.)

Automatic Validation ended with:

Installation failed with exit code -1978335187
2024-03-14 17:51:36.288 [FAIL] Installer failed security check. Url: https://github.com/vim/vim-win32-installer/releases/download/v9.1.0181/gvim_9.1.0181_x86.exe Result: 0x80004005

(Automated response - build 870.)

@wingetbot run


[BUG] Unable to login with email

Rocket.Chat.Android version: latest build from the develop-2.x branch.
Mobile device model and OS version: HTC Desire 626 , Android v5.1
Description
Login only works with username (although the username edit text gives the hint to enter either username or email for logging in). This is happening probably because the SDK builds the model with the json key as username (see here) and the server accepts only username (and not email) with this payload. Have a look at  the docs here. They say that in order to send the request with the email as the payload, we need to provide it as a value to the user key instead of the username key, whereas we are sending email and username as a value to the same key ie username.

I'll be working on this one after fixing https://github.com/RocketChat/Rocket.Chat.Kotlin.SDK/issues/69

This is fixed in #833


FFmpeg

How can i use ffmpeg in the library. For example, I want to join the file

It's open source now

How to use it? I want to execute some ffmpeg commands @wysaid

@Sp4Rx @iigacon
You can compile the jni module with ffmpeg, and add the ffmpeg-command feature: https://github.com/wysaid/android-gpuimage-plus/issues/269
I can do that later, but you can do it yourself if you really need it for now.

What I want is to execute ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4 this.
ffmpeg.so is already there in your library. For the filter you are calling the native c++ method from java in CGEFFmpegNativeLibrary class
private static native boolean nativeGenerateVideoWithFilter(String outputFilename, String inputFilename, String filterConfig, float filterIntensity, Bitmap blendImage, int blendMode, float blendIntensity, boolean mute);
So to execute the command I want I guess I need to call some native method in ffmpeg.so and I don't know which method to call. Correct me If I'm wrong.
I know how to execute that command using a ffmpeg binary. I'm no familiar with .so files. Please help me @wysaid

Any updates on this yet?

I was finally able to achieve this but then realized, there are not many codecs in the ffmpeg version used. as a result you can't transcode many videos.

Please elaborate your method @assassinshadow0


Laravel 6 support on 0.2.2

Hello,
Thank you for the package. I was wondering is there any specific reason why version 0.2.2 doesn't support Laravel 6 ?
I forked it and changed the composer.json file to allow Laravel 6 and haven't encountered any issues so far.
I'm asking because it might be something I missed.
Thank you

Hi @Donkfather,
No specific reason at this point. As a general rule, I only support the latest version of Laravel. Further, I might only support more recent versions of PHP in order to take advantage of new functionality. If you forked it and it works, you should be OK. :)

Hi @Donkfather,
No specific reason at this point. As a general rule, I only support the latest version of Laravel. Further, I might only support more recent versions of PHP in order to take advantage of new functionality. If you forked it and it works, you should be OK. :)


No longer need install.ps1 for NuGet.

We no longer need install.ps1 for NuGet by the following reason:

NuGet package became the end of the dependency chain.
When developing, we can use newer assemblies immediately by cleaning the project and entrusting automatic restoration to NuGet.
VSIX became always checking installed package version.
When installing, user can use newer assemblies naturally by executing some operations as usual.

Currently, this script isn't harmful, but it is unnecessary process.

Fixed at 1f812df0981603c398c42fd70bb1e840bec3c8ab.


Add static (and some dynamic) metadata to all CCs

fixes #233

Coverage decreased (-0.6%) to 46.418% when pulling 59e11d3ba1598c4e139e959419f401d8e940edd5 on static-metadata into 00c27c1c5468f3302ba3327aee61c0d016b16127 on master.


gobgp: 3.4.0 -> 3.5.0

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/osrg/gobgp/releases.
meta.description for gobgp is: "A CLI tool for GoBGP"
meta.homepage for gobgp is: "https://osrg.github.io/gobgp/"
meta.changelog for gobgp is: ""
Updates performed

Golang update

To inspect upstream changes

Release on GitHub

Compare changes on GitHub

Impact

Checks done (click to expand)

built on NixOS
The tests defined in passthru.tests, if any, passed
found 3.5.0 with grep in /nix/store/dyfay9qgi21qnvbl66643kq6iz3h3y0d-gobgp-3.5.0
found 3.5.0 in filename of file in /nix/store/dyfay9qgi21qnvbl66643kq6iz3h3y0d-gobgp-3.5.0

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

1 total rebuild path(s)

1 package rebuild(s)

First fifty rebuilds by attrpath
gobgp

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/dyfay9qgi21qnvbl66643kq6iz3h3y0d-gobgp-3.5.0 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

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

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

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

1 package built:

gobgp

Maintainer pings
cc @higebu for testing.

Result of nixpkgs-review pr 185946 run on x86_64-darwin 1

1 package built:

gobgp


szepsegbroker.hu/elements/bannerz

How can I propose a rule?
||szepsegbroker.hu/elements/bannerz

And: ctag.hu domain is closed.

How can I propose a rule?

You can create your PR in the dev repo: https://github.com/hufilter/hufilter-dev/pulls
This repo is release-only.


[Bug]: missing script start

When i follow the steps exactly as mentioned on the docs i cant execute npm run start

Tracked in https://github.com/ecadlabs/taqueria/issues/1112


Tweak optimized checking if the file is relevant for the cop

Follow up to https://github.com/rubocop/rubocop/pull/11247 (addresses style suggestions from the comments).

Perfect!


Interactive Element Skeleton

Overview
An Interactive Element is a follow up component to MRTK's Interactable.  Support for specific types of input an Interactive object recognizes is represented in the form of Interaction States.
The work in this PR has only added support for the Focus state and the creation of custom states.
Concepts included in the Interactive Element structure:

Base Interactive Element
Interactive Element (a placeholder class)
Tracked States Scriptable Object
State Manager
Event Receiver Manager
Custom inspectors for the Tracked States scriptable and a Base Interactive Element

Interactable and Interactive Element + State Visualizer
The following figure illustrates how concepts in Interactable are represented in the Interactive Element + State Visualizer structure:

How to Use
See the documentation for examples on how to add a Core Interaction State and create a new state both in-editor and via script.
To do

[x] Add how to use section to PR description
[x] Add diagrams of the structure

/azp run

/azp run

/azp run

/azp run

Not sure if this is expected at this stage, as it still the skeleton. But in the editor, when I create a new TrackedStates asset and press the "Add Focus State Events" button, I get a null reference error.

I notice this is a PR directly into mrtk_development. Since this is a pretty large feature similar in size to the scrollable object collection graduation vanessa was doing, consider making PRs into a separate feature branch, and then merging that feature branch into mrtk_development when the new interactive element is ready (might be in a release or two).

In the PR description, I noticed that the events are configured differently from the editor. How do I listen for events from code? Is it the same way as before? Want to make sure it's still easy to configure the interactive element from code as well as in editor.

In the PR description, I noticed that the events are configured differently from the editor. How do I listen for events from code? Is it the same way as before? Want to make sure it's still easy to configure the interactive element from code as well as in editor.

Here is how you add listeners to the events via script:
        InteractionState focusState = interactiveElement.GetState(CoreInteractionState.Focus);

        // Get the event configuration for the Focus state
        var focusEventConfiguration = focusState.EventConfiguration as FocusInteractionEventConfiguration;

        focusEventConfiguration.OnFocusOn.AddListener((focusEventData) =>
        {
            Debug.Log("New Focused Object: " + focusEventData.NewFocusedObject.name);
        });

        focusEventConfiguration.OnFocusOff.AddListener((focusEventData) =>
        {
            Debug.Log("Old Focused Object: " + focusEventData.OldFocusedObject.name);
        });

In the PR description, I noticed that the events are configured differently from the editor. How do I listen for events from code? Is it the same way as before? Want to make sure it's still easy to configure the interactive element from code as well as in editor.

Here is how you add listeners to the events via script:
        InteractionState focusState = interactiveElement.GetState(CoreInteractionState.Focus);

        // Get the event configuration for the Focus state
        var focusEventConfiguration = focusState.EventConfiguration as FocusInteractionEventConfiguration;

        focusEventConfiguration.OnFocusOn.AddListener((focusEventData) =>
        {
            Debug.Log("New Focused Object: " + focusEventData.NewFocusedObject.name);
        });

        focusEventConfiguration.OnFocusOff.AddListener((focusEventData) =>
        {
            Debug.Log("Old Focused Object: " + focusEventData.OldFocusedObject.name);
        });

Hm...that feels a bit lengthy to me, here's how that would look in one line. I woudl suggest making the API a little bit easier to use, so that it's easy for folks to remember how to add event listeners from code as this is a very common dev task.
Here's the current way I would listen for events...
var eventConfig = interactiveElement.GetState(CoreInteractionState.Focus).EventConfiguration as FocusEventConfiguration;
eventConfig.OnFocusOn.AddListener

Could you maybe add a convenience method so that it could at least look like this?
var eventConfig = interactiveElement.GetEventConfig<FocusEvent>();
// I assume there is a one to one mapping from state to event configuration, so that given an event config, you can figure out the state it maps to.
// I also assume that "Configuration" term is not needed here...but fine if we need to add it back
eventConfig.OnFocusOn.AddListener(...);

I notice this is a PR directly into mrtk_development. Since this is a pretty large feature similar in size to the scrollable object collection graduation vanessa was doing, consider making PRs into a separate feature branch, and then merging that feature branch into mrtk_development when the new interactive element is ready (might be in a release or two).

I created a new feature branch: feature/interactive_element

/azp run

In the PR description, I noticed that the events are configured differently from the editor. How do I listen for events from code? Is it the same way as before? Want to make sure it's still easy to configure the interactive element from code as well as in editor.

Here is how you add listeners to the events via script:
        InteractionState focusState = interactiveElement.GetState(CoreInteractionState.Focus);

        // Get the event configuration for the Focus state
        var focusEventConfiguration = focusState.EventConfiguration as FocusInteractionEventConfiguration;

        focusEventConfiguration.OnFocusOn.AddListener((focusEventData) =>
        {
            Debug.Log("New Focused Object: " + focusEventData.NewFocusedObject.name);
        });

        focusEventConfiguration.OnFocusOff.AddListener((focusEventData) =>
        {
            Debug.Log("Old Focused Object: " + focusEventData.OldFocusedObject.name);
        });

Hm...that feels a bit lengthy to me, it would be a lot to remember! I'd probably need to look up the docs every time. I would suggest making the API a little bit easier to use, so that it's easy for folks to remember how to add event listeners from code as this is a very common dev task.
Here's the current way I would listen for events, under the current design (I normally try to squeeze registering events into as few lines as I can, since again this is super common task)...
var eventConfig = interactiveElement.GetState(CoreInteractionState.Focus).EventConfiguration as FocusEventConfiguration;
eventConfig.OnFocusOn.AddListener(...)

Could you maybe add a convenience method so that it could at least look like this?
// I assume there is a one to one mapping from state to event configuration, so that given an event config, you can figure out the state it maps to.
// I also assume that "Configuration" term is not needed here...but fine if we need to add it back
var eventConfig = interactiveElement.GetEventConfig<FocusEvent>();
eventConfig.OnFocusOn.AddListener(...);

Added a convenience method var stateEvents = interactiveElement.GetStateEvents<FocusEvents>("Focus")

/azp run

Closing to avoid increasing the size of the PR due to changes in MRTK since this PR was opened.  A new PR will be opened and the feedback in the comments above will still be integrated.

Reopening to keep the history and the feature/interactive_element branch is set to be updated.

/azp run

/azp run

mrtk_PR is failing because InteractionState.cs uses the SerializeReference attribute which is new to Unity 2019 while mrtk_PR uses Unity 2018.

/azp run mrtk_pr_2019

/azp run mrtk_PR_2019

/azp run mrtk_PR_2019

/azp run mrtk_PR_2019

/azp run mrtk_PR_2019


Get calculated variables from REST API

Zentracloud has an API endpoint for calculated variables like plant-available water and evapotranspiration.  Need to access this and add to our dataset.

Instructions on how to get environmental variables directly from zentra using the API can be found here:
https://zentracloud.com/api/v3/documentation/
This documents using a PUSH API
https://docs.zentracloud.com/l/en/article/39tw3ctj9n-api-endpoint


add C_E to command line argument

bors try

bors r+

hmm why is the build successful but this doesn't seem to be merged? https://buildkite.com/clima/climaatmos-ci/builds/3190


Wait until page is ready before trying to check

What are your thoughts on preventing pre-mature calls to check()? This would prevent false positives as reported in #22.

This is not particularly comparable because the person really had misused the script.
And anyway, there is already a variable that indicates whether a detection is in progress and blocks the use of the method "check ()" if this is the case: https://github.com/sitexw/FuckAdBlock/blob/1a29bed9f29da3811f6f5518b1bd6d9d827160a9/fuckadblock.js#L88

That makes sense. I was thinking that instead of silently failing and letting people hit that false positive issue we could try to make it more fool-proof?

I understand what you mean, but it's a bug that is not caused by this type of problem. This is another type of bug that only affects Firefox and occurs because of a synchronization problem.
This will be fixed in the next release (3.2.0):
https://github.com/sitexw/FuckAdBlock/tree/c903b5a6291c47a38e50bc1c4845125cce2b1551


Unable to use the search function of the PyAEDT home page

Discussed in https://github.com/pyansys/pyaedt/discussions/2963

Originally posted by Dicksky May  4, 2023
Hello, I can't use the search function on PyAEDT's documentation home page, no matter what keywords I enter, I don't get any entries. Can you help me?

Adding @Revathyvenugopal162 and @jorgepiloto for visibility.


Decimal.ConversionSyntax error while connecting OKEX

I'm getting decimal conversion syntax error when connecting okex exchange after entering api, security and pass keys,
Here's the screenshot,

They keys are completely fine, already using em to run another bot using ccxt python. Dunno what I'm doing wrong with hummingbot.

Hey @buckydroid could you please tell what's version you use?
I'd advise to update your bot version to the latest version.
https://hummingbot.org/installation/
Looks like on your screenshot that's old one. Thanks
Actual on latest dev:


why mkl can not get fft(x,1)?

please first create a random matrix x = rand(100,100,100) and then call the FFTW library. If you use FFTW.set_provider!("mkl") and then fft(x,1), it will report an error. What is the reason?
i always get ERROR: FFTW could not create plan

It looks like it cannot do fft along a given axis for arrays with more than two dimensions. Seems like either a major regression or some missing functionality.
import FFTW

# %% Works perfectly
a = ones(Float64, 64, 64);
iffta = FFTW.fft(a, 1)

# %% ERROR: FFTW could not create plan
b = ones(Float64, 64, 64, 64);
iffta = FFTW.fft(b, 1)

This is documented and longstanding limitation of MKL:

That is, it can't handle multiple nested loops of FFTs, only a single loop of FFTs.    A workaround for the first or last dimensions would be to reshape the array to group the other dimensions together, in which case it can handle it, but it still won't be able to transform the middle dimension.
Or you could just use FFTW.


Roll Flutter Engine from 70671baabbba to 0b9f56b6d3cf (7 revisions)

https://github.com/flutter/engine/compare/70671baabbba...0b9f56b6d3cf
2024-10-28<EMAIL_ADDRESS>iOS/macOS: migrate darwin/common to ARC (flutter/engine#56155)
2024-10-28<EMAIL_ADDRESS>Reverts "Pin local_engine mac builds to arm64 (#56172)" (flutter/engine#56179)
2024-10-28<EMAIL_ADDRESS>Migrate PlatformViewIOS to ARC (flutter/engine#55672)
2024-10-28<EMAIL_ADDRESS>Roll Skia from 35ad4e89212f to 21035cd95b68 (1 revision) (flutter/engine#56176)
2024-10-28<EMAIL_ADDRESS>Roll buildroot to pick up revert of debugging gen_snapshot prints (flutter/engine#56175)
2024-10-28<EMAIL_ADDRESS>Pin local_engine mac builds to arm64 (flutter/engine#56172)
2024-10-28<EMAIL_ADDRESS>Switch some mac_unopt tests from intel to arm hosts (flutter/engine#55882)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC codefu<EMAIL_ADDRESS>on the revert to ensure that a human
is aware of the problem.
To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Commit queue failed; closing this roll.


Infinite Loops

Hi,
I am trying to run theater inside an infinite loop where I create the random text to show.
However I had the impresion that Theater is blocking the execution.
Is that possible ?

Hey @siscia,
That's an interesting use case and you shouldn't have too much trouble to make it work with TheaterJS. The only thing to keep in mind as that you need to wait for the animation to be finished before calling for the next one. I'd recommend to go with a recursive function:

jsFiddle
Let me know if it do fulfill your requirements ;)

That is really nice, thank you :)


With dynamic test, getLocalStorage on after hooks return undefined

Describe the bug
I have a situation where I need to set localStorage with cy.setLocalStorage() inside Cypress before hook, and run some dynamic test, and on after hook I want to get the final data from localStorage back, but turns out, runing cy.getLocalStorage() on Cypress's after hook will result in an undefined data
To Reproduce
I have compiled down into minimum reproducible test, here is the code:
// test.cy.js
import "cypress-localstorage-commands";

describe("Minimum repro", () => {
  before(() => {
    cy.setLocalStorage("foo", JSON.stringify({ state: "completed" }));
  });

  after(() => {
    cy.getLocalStorage("foo").then((data) => {
      // data will be undefined
      // since writeFile require the second argument to exist, it will throw
      cy.writeFile("cypress/path/to/foo.json", data);
    });
  });

  // Test section
  [1, 2].forEach((_, index) => {
    it(`Dynamic ${index + 1}`, () => expect(true).equal(true));
  });
});

If you run that you will have an error (you can see the screenshot in the logs) because data is undefined.
However, when I tried to get rid of the forEach and swap the // Test section with normal test like this code below, it works fine
// snip ...
  it("Static", () => expect(true).equal(true));
// snip ...

I was curious, I tried to move the getLocalStorage command inside the // Test section and remove the after hooks, if I set to run the command at the very first index, it works, otherwise it doesn't work, here's the full code
import "cypress-localstorage-commands";

describe("Minimum repro", () => {
  before(() => {
    cy.setLocalStorage("foo", JSON.stringify({ state: "completed" }));
  });

  [1, 2, 3].forEach((_, index) => {
    it(`Dynamic ${index + 1}`, () => {
      if (index === 0) { // if you change this to 1 or 2, it doesn't work, and data below will not exist
        cy.getLocalStorage("foo").then((data) => {
          // data is exist
          cy.writeFile("cypress/path/to/foo.json", data);
        });
      }

      expect(true).equal(true);
    });
  });
});

Expected behavior
with dynamic test script, cy.getLocalStorage should return the exact data instead of undefined
Logs

Thank you!

Hi @alvin883 ,
Without testing it, I think that it is related to the localStorage being cleaned between tests, which is the default behavior of Cypress. You can also use this plugin to persist it between tests or even spec files.
Try adding cy.saveLocalStorage() in the before hook and cy.restoreLocalStorage() in the after hook:
import "cypress-localstorage-commands";

describe("Minimum repro", () => {
  before(() => {
    cy.setLocalStorage("foo", JSON.stringify({ state: "completed" }));
    cy.saveLocalStorage();
  });

  after(() => {
    cy.restoreLocalStorage();
    cy.getLocalStorage("foo").then((data) => {
      // data will be undefined
      // since writeFile require the second argument to exist, it will throw
      cy.writeFile("cypress/path/to/foo.json", data);
    });
  });

  // Test section
  [1, 2].forEach((_, index) => {
    it(`Dynamic ${index + 1}`, () => expect(true).equal(true));
  });
});

Or even better, if you want the localStorage to be available in every test, use beforeEach and afterEach hooks to save and restore the localStorage, as the plugin documentation explains:
import "cypress-localstorage-commands";

describe("Minimum repro", () => {
  before(() => {
    cy.setLocalStorage("foo", JSON.stringify({ state: "completed" }));
    cy.saveLocalStorage();
  });

  beforeEach(() => {
     cy.restoreLocalStorage();
  });

  after(() => {
    cy.getLocalStorage("foo").then((data) => {
      // data will be undefined
      // since writeFile require the second argument to exist, it will throw
      cy.writeFile("cypress/path/to/foo.json", data);
    });
  });

  afterEach(() => {
     cy.saveLocalStorage();
  });

  // Test section
  [1, 2].forEach((_, index) => {
    it(`Dynamic ${index + 1}`, () => expect(true).equal(true));
  });
});

Oh you're right, I added those saveLocalStorage & restoreLocalStorage and now it works, my bad I didn't notice it in the documentation.
Thanks for the quick response, so I'm going to close this since it's not a bug then 😅
Thank you so much!


Let UIDropDown's close_button_width/open_button_width be settable in a theme file

I am work on a tiny LCD and use 5 gpio button for gui navigation, so the default width 20 is too large.
I have to manual change width in each state and invoke update_dimensions.
It is great if this width would available in UIDropDown's construction args.

Yeah, this should probably be a theming parameter. I'll make this issue into a feature request.
For now, I think you should be able to set the .menu_states['closed'].open_button_width and .menu_states['expanded'].close_button_width attributes of each drop down and call .rebuild() on them.

Yes, I am just do it in that way, and consider extend UIDropDown to make life easy.

This will make it into 0.6.0.


potential off by one in parse_arguments

In parse arguments in the length check here
            while ((s[i] != '=') && (s[i] != argument_separator) && (i < inputlength)) {

The bounds checking happens after the deref s[i] -so if i == inputlength the deref on the buffer in s will run off the end before the bounds check (i < inputlength)

Thanks @tinselcity.
Resolved at: 89f5427


[SPARK-46819][CORE] Move error categories and states into JSON

What changes were proposed in this pull request?
Move the error categories and states out of the Markdown table in the error README and into standalone JSON files.
I am using the terms "error category" and "error state" as defined in SPARK-46810.
Why are the changes needed?
The data captured in Markdown is not automation-friendly. In future work, I intend to automate the generation of sql-error-conditions-sqlstates.md using these new JSON files.
Additionally, there are many instances of duplicate keys and inconsistent descriptions for the error categories, which this change resolves by moving the data into JSON. This also enables IDE support for basic validation.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
The updated unit tests ensure the following:

All error categories (e.g. 42) and states (e.g. 42K01) have the correct length and format.
All error states have a two-character prefix that is a valid error category.
All error classes define an error state that is valid.

Was this patch authored or co-authored using generative AI tooling?
No.

@MaxGekk - Before I continue down this path, do you like where this is going?
Asking you per @itholic's comment on SPARK-46810.

also cc @cloud-fan

@MaxGekk - The naming choices I made here are based on my proposal in SPARK-46810. Are you OK with what I wrote there? (If yes, could you chime in on the ticket just for the record, please?)

@nchammas I will review this PR tomorrow. Also cc @srielau

No rush at all. (Didn't mean to nag. Dunno if my comment came off that way.)

Thanks for doing this. Adding a row to this table is royal pain in the behind. This will make it easier.

@nchammas I wonder did you generate error-states.json automatically by a script?

The failure Run / Run Spark on Kubernetes Integration test is not related to the changes, I do believe.

+1, LGTM. Merging to master.
Thank you, @nchammas and @itholic @srielau for review.


Demo page "switch theme" does not work.

@kognise @kylejrp @jonaskuske
I think using CSS variables is a great idea!!(https://github.com/kognise/water.css/issues/70)
However, I found a problem on the demo page, though.
By use "prefers-color-scheme", it does not switch with "switch theme" on the demo page.
This is because the device's theme setting is prioritized.
So, in order to preview both "switch theme" and "prefers-color-scheme" on the demo page, I think it is necessary to take measures such as creating a dedicated demo page.(Page for loading "* .standalone.css".)
I am sorry if it has already been discussed somewhere or the correspondence is in progress.

Hah! Great catch. I don't think there was discussion about this before.
You're right that we'll probably have to use the standalone files to get this working.

In the future, I think personally it is better to use standalone files in demo page and use "prefers-color-scheme" in landing page.
For now, do change it to read standalone files now?
I can also give a PR.

Yeah, if you can make a pull request that switches to the standalone files, that would be great! Thanks a ton, @kimulaco.
Let's leave this open and discuss more after that merge. I personally like having the "most default" file on all pages where possible. Maybe some feature detection in the JavaScript?

@kylejrp I will try to adjust the switch by detect "prefers-color-scheme" with "window.matchMedia".
Please wait for a while before give the PR.

Yes good catch, this needs to be taken care of with the new interactive version picker! (#27)
Then the version used on the demo site should always match the selected one, and there needs to be an explanation for the current display status. ("Light theme is selected, but your system is currently set to dark mode")
I think if we recommend the normal versions as default but always use standalone builds on the demo page, we pretty much "don't practice what we preach" and people will probably be confused why the demo page behaves differently than their own page.

I will adjusting to read the normal version by default.
Then, when the switching button is pressed, the switching theme is changed based on the loaded theme and the device theme.
I think that showing the status is a good idea!
I will try in this PR.

@kylejrp Since you can switch the theme, you can close this issue, but do you wait for the version picker?

I'll wait for #90 to automatically close the issue when it gets merged in.

This has been fixed in 2.0.


Bump jarjar-abrams to 1.13.1

Description
Bump jarjar-abrams to 1.13.1 (changelog).
Testing
Built locally sbt-assembly with the new version and confirmed this solves issue #479 for us.

Thanks for adding a test in #514 and cutting a new release 🙇


E2e free AWS testing pipeline

Description
Changes proposed in this pull request:

add free-aws e2e test
add possibility to specify provider region to KEB client in those tests

Related issue(s)

/hold

/retest

/retest

/unhold


Add requirement for Carry Out Mode of Delivery as pre-requisite

The QR code will only work if the Carry out the mode of delivery is configured in Commerce Parameters. Please add this as a mandatory requirement.
Ref: MS Support ticket #2201040060001383

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

ID: fa377324-5397-4669-2ed2-de02c8891396
Version Independent ID: fa377324-5397-4669-2ed2-de02c8891396
Content: Generate QR codes and print them on receipts for Saudi Arabia - Commerce | Dynamics 365
Content Source: articles/commerce/localizations/emea-sau-qr-code.md
Service: dynamics-365-commerce
Product: ****
Technology: ****
GitHub Login: @EvgenyPopovMBS
Microsoft Alias: epopov

@EvgenyPopovMBS, please review.

Thank you for the feedback. This product issue is fixed in the monthly update 10.0.25, that is, starting from 10.0.25, it is not required to specify Carry-out delivery mode in Commerce parameters to make QR codes for Saudi Arabia working.


clang-format-11

We see an off problem that, running clang-format-11 on a files on the commandline has slightly different behavior, from running the same version of clang-format-11 (full path specified) in visual studio from the clang-power-tools format-on-save option.  I will try to gather a reproduction scenario.

HI Jan,
A simple repro test project would help narrow down the investigation.

Sorry, I was too hasty reporting this, it was a user error, the right version of clang-format was not set in the custom binary setting in clang-format settings. closed.