Cannot install in fresh Laravel application

Seems to be an issue with monolog version
composer require tmarois/laravel-ads-sdk
Using version ^1.2 for tmarois/laravel-ads-sdk
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for monolog/monolog (locked at 2.0.2) -> satisfiable by monolog/monolog[2.0.2].
    - tmarois/laravel-ads-sdk 1.2.x-dev requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.11 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.12 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.13 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.14 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.15 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.16 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.17 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - Conclusion: don't install googleads/googleads-php-lib 40.0.0
    - tmarois/laravel-ads-sdk v1.2.0 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.1 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.10 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.2 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.3 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.4 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.5 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.6 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.7 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.8 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.9 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - Conclusion: don't install googleads/googleads-php-lib 38.0.0
    - Installation request for tmarois/laravel-ads-sdk ^1.2 -> satisfiable by tmarois/laravel-ads-sdk[1.2.x-dev, v1.2.0, v1.2.1, v1.2.10, v1.2.11, v1.2.12, v1.2.13, v1.2.14, v1.2.15, v1.2.16, v1.2.17, v1.2.2, v1.2.3, v1.2.4, v1.2.5, v1.2.6, v1.2.7, v1.2.8, v1.2.9].

Installation failed, reverting ./composer.json to its original content.

@jamesmills I will look into this. Thanks.

@jamesmills Sorry for the delay. Github apparently is having server issues today, so once I'm able to pull packages I'll run some testing, it does look like monolog which is part of the googleads API, so that's odd. Also, what version of Laravel are you using?

Hiya!
No worries, don't worry.
I have a fresh install using Laravel Framework 7.7.1.
I have a couple of projects on the go where I need to do something very similar. I'm hoping that I can use your package in one and then I will use a mashup of some custom stuff in the other.
Just to note. I do have some code for the Google Ads account listing so I'm hopeful that I can add that to your package. I am also working on a similar implementation of what I am doing for Bing and Adwords in Facebook so I will have some of the basics commands for that over time.
This package is most certainly the best I have seen in my 20 years dealing with this crap.
Cheers, James

@jamesmills Thanks! Appreciate it. I've been using many SDK/APIs with PHP, and built this because even the ones created by companies like Microsoft are the worse. I saw your additions for the account list, would love to get that into the next version (for both Bing/Google). We're using this SDK for our digital marketing agency managing our client accounts, so that was another incentive of why I needed to build something that works for both platforms seamlessly. Trying to reduce the headache for everyone learning both, its a real mess. Haha, hopefully this saves everyone sometime.
On the account list, let me know if you can grab the same from Google and I can put it into the next update (or you can create a pull request) whichever.

@timothymarois i have a same problem with laravel 7.*

@timothymarois i have a same problem with laravel 7.*

Thanks. If you can, are you able to run a test to see if it's related to laravel 7? I have not tested that, but have run these only on Laravel 5 and 6. I am curious if that is the culprit.

Also getting this on a Laravel 7 app.
$ composer require tmarois/laravel-ads-sdk:^1.2
	./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for monolog/monolog (locked at 2.0.2) -> satisfiable by monolog/monolog[2.0.2].
    - tmarois/laravel-ads-sdk 1.2.x-dev requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.11 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.12 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.13 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.14 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.15 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.16 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - tmarois/laravel-ads-sdk v1.2.17 requires googleads/googleads-php-lib ^40.0 -> satisfiable by googleads/googleads-php-lib[40.0.0].
    - Conclusion: don't install googleads/googleads-php-lib 40.0.0
    - tmarois/laravel-ads-sdk v1.2.0 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.1 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.10 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.2 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.3 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.4 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.5 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.6 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.7 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.8 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - tmarois/laravel-ads-sdk v1.2.9 requires googleads/googleads-php-lib ^38.0 -> satisfiable by googleads/googleads-php-lib[38.0.0].
    - Conclusion: don't install googleads/googleads-php-lib 38.0.0
    - Installation request for tmarois/laravel-ads-sdk ^1.2 -> satisfiable by tmarois/laravel-ads-sdk[1.2.x-dev, v1.2.0, v1.2.1, v1.2.10, v1.2.11, v1.2.12, v1.2.13, v1.2.14, v1.2.15, v1.2.16, v1.2.17, v1.2.2, v1.2.3, v1.2.4, v1.2.5, v1.2.6, v1.2.7, v1.2.8, v1.2.9].

Installation failed, reverting ./composer.json to its original content.

I was able to get the Google Ads PHP SDK by itself though using the latest version if it helps:
$ composer require googleads/googleads-php-lib
Using version ^47.0 for googleads/googleads-php-lib
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
  - Installing symfony/polyfill-php80 (v1.17.0): Downloading (100%)
  - Installing symfony/serializer (v5.1.0): Downloading (100%)
  - Installing googleads/googleads-php-lib (47.0.0): Downloading (100%)
symfony/serializer suggests installing symfony/property-info (To deserialize relations.)
symfony/serializer suggests installing symfony/yaml (For using the default YAML mapping loader.)
symfony/serializer suggests installing symfony/config (For using the XML mapping loader.)
symfony/serializer suggests installing symfony/property-access (For using the ObjectNormalizer.)
symfony/serializer suggests installing doctrine/annotations (For using the annotation mapping. You will also need doctrine/cache.)
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Writing lock file
Generating optimized autoload files

Hey guys!
Sorry about the delay, this has been fixed with (Version 1.2.18)
Run composer update.
If doing a fresh install use composer require tmarois/laravel-ads-sdk:^1.2
Google Ads updates very frequently, their latest update causes dependency issues (which is honestly the first). If you experience any other issues in the SDK let me know so we can get to them quickly.

Also, I have tested this install on Laravel v7.11

Thank you @timothymarois that worked! Excited to try it out. :)

Thank you @timothymarois to fixed this issue.


fix wandb property name

What does this PR do?

Fixes #12157 and #12603: This fix the name property of WandbLogger for https://github.com/PyTorchLightning/pytorch-lightning/issues/12028.
Does your PR introduce any breaking changes? If yes, please list them.
None
Before submitting

[x] Was this discussed/approved via a GitHub issue? (not for typos and docs)
[x] Did you read the contributor guideline, Pull Request section?
[x] Did you make sure your PR does only one thing, instead of bundling different changes together?
[x] Did you make sure to update the documentation with your changes? (if necessary)
[ ] Did you write any new necessary tests? (not for typos and docs)
[ ] Did you verify new and existing tests pass locally with your changes?
[ ] Did you list all the breaking changes introduced by this pull request?
[x] Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

[x] Is this pull request ready for review? (if not, please submit in draft mode)
[x] Check that all items from Before submitting are resolved
[x] Make sure the title is self-explanatory and the description concisely explains the PR
[ ] Add labels and milestones (and optionally projects) to the PR so it can be classified

Did you have fun?
Make sure you had fun coding 🙃

Hello @tshu-w ! This fix would be awesome!

@manangoel99 Thank you for confirming and link the old PR. Let's ping PL members to make sure this PR is perfected and merged if there is no reply for some time.

Hi, @tshu-w - Thank you for creating this PR. We appreciate the contribution 🚀 Looks like the tests are failing, mostly because there is project_name() used in the tests which should be renamed as well to name. Would you mind updating the relevant tests and ping once ready? Please see the log here: https://github.com/PyTorchLightning/pytorch-lightning/runs/5813691929?check_suite_focus=true.
Apologies for the delay in the old PR!

This will bring one change though. The directory structure for checkpoints currently looks like <project_name>/<run_id> but after this it will be <run_name>/<run_id>

@tshu-w though having logger.name return the run name makes more sense but the changed directory structure does not seem as intuitive. So maybe instead of chaning the behaviour of the name method we could have a new method run_name which returns the run name. What do you think?

@krshrimali Hi, thank you remind, I update the test file now.

This will bring one change though. The directory structure for checkpoints currently looks like <project_name>/<run_id> but after this it will be <run_name>/<run_id>

This is as expected, PL default TensorBoardLogger stores checkpoints to save_dir/name/version(for more discuss, see https://github.com/PyTorchLightning/pytorch-lightning/issues/12028), and I believe that dir, name and id in wandb correspond to save_dir, name and version respectively.

@tshu-w though having logger.name return the run name makes more sense but the changed directory structure does not seem as intuitive. So maybe instead of chaning the behaviour of the name method we could have a new method run_name which returns the run name. What do you think?

As mentioned above, the save_dir, name, and version of a PL logger have specific meanings, and I think the wandb name is the concept that just corresponds to the PL logger's name. Therefore, we need to change the behavior of name, rather than defining a new run_name (which could also be an alias for name, but that's beyond this PR).
cc @awaelchli

QQ what does name in PL signify. What I mean by this is that you could be naming a project or an experiment in the project.
The name property in WandbLogger assumes that the user is naming the project and not the experiment (equivalent to a wandb run object).

QQ what does name in PL signify. What I mean by this is that you could be naming a project or an experiment in the project.
The name property in WandbLogger assumes that the user is naming the project and not the experiment (equivalent to a wandb run object).

I'm the new users of wandb, but from the document here https://docs.wandb.ai/ref/python/init, should project for project name and name for run/experiment name? And I see using run.name got the name in init_args while project_name() got the project. Is there something I'm getting wrong?
As for which name in PL logger should correspond, I believe it is run name.

@tshu-w we can make this change but if save_dir=None, this causes a lot of clutter for the user so we can change it to have save_dir=self.experiment.project_name() if save_dir=None so that everything goes under one directory.
We would also like to keep a deprecation warning here to make sure it doesn't break any existing production workflows.
cc @awaelchli

@manangoel99 agree with you, but that's beyond the scope of this PR.

@tshu-w I think in that case maybe we could close this PR and I can come up with another PR meanwhile to have deprecation warnings now since the behaviour of the arguments will be changing and this could break people's code so we need to raise deprecation warnings.
@awaelchli apologies if this is an ignorant question but does pytorch lightning have guidelines for handling changes in argument behaviour. Something like keeping it the same in 1.7 with warnings and then finally changing it in 1.8.

I think in that case maybe we could close this PR and I can come up with another PR meanwhile to have deprecation warnings now since the behaviour of the arguments will be changing and this could break people's code so we need to raise deprecation warnings.

It seems to me that the inconsistency between self._experiment.project_name() and self._name can be solved first (as has been suggested by many people). If the user is bothered by multiple directories, this can also be solved by simply setting save_dir. Anyway, let's hear from PL members.

May I suggest the following.

Return the run name in the name property as done in this PR.
Since the project name is mandatory to provide, and the name optional, set the run name to the project name by default (instead of letting wandb generate random names).

This way, we are backward compatible partially, and the directory doesn't get cluttered every time you run a new experiment.

@manangoel99 @awaelchli suggest make sense to me, what about you?

@awaelchli thanks for the suggestion and @tshu-w  I think we can go ahead with this for now but in the long term I think it would be better if we set the save_dir to the project by default.
So we can go ahead with @awaelchli's suggestion and also add a deprecation warning that the new behaviour will change in the next release to what I just mentioned above.

Hey @tshu-w would you like to continue this PR as we discussed?

Hey @tshu-w would you like to continue this PR as we discussed?

Hi，I’m really busy this two weeks, maybe next week.

2. Since the project name is mandatory to provide, and the name optional, set the run name to the project name by default (instead of letting wandb generate random names).

@awaelchli Hi, this https://github.com/PyTorchLightning/pytorch-lightning/pull/12037 wants to set default save_dir and name, should I do this or as your suggest.

@tshu-w, yes I believe we should continue this PR here with the idea we discussed.

@awaelchli Hi, I have updated it. Can you take a look.

Looks great. Can we keep one of the tests that asserts the project name on the experiment when name is not provided? Thanks!

Hi, I found it hard to keep one of the tests because my modifications are at the time of initialization, not the return in the test. I made some changes to the test, which you can check at my last commit https://github.com/PyTorchLightning/pytorch-lightning/pull/12604/commits/4e500bac3c2c94e29bf7a72bc44fbc94c68670e0.

@tshu-w this is simple to do. I can't help you directly unfortunately, because you opened this pr directly from master (normally you should create a separate branch in your fork).
Please add these lines in tests/loggers/test_wandb.py LINE 45
    wandb.init.reset_mock()

    # test wandb.init called with project as name if name not provided
    WandbLogger(project="test_project")
    wandb.init.assert_called_once_with(
        name="test_project", dir=None, id=None, project="test_project", resume="allow", anonymous=None
    )

after that LGTM

@awaelchli Thanks for the detailed instructions, I got the tests added. Next time I will use the new branch to PR.

@awaelchli Would you please look at it, otherwise there will be a new conflict soon. ;)

I just noticed my wandb logger folder setup is all messed up with PL 1.6.3, looking forward to pulling this fix when it's merged!

I just noticed my wandb logger folder setup is all messed up with PL 1.6.3, looking forward to pulling this fix when it's merged!

Hi, this issue exists in PL 1.5 either, If you meet error in PL 1.6.3. It might be other bug?

I just noticed my wandb logger folder setup is all messed up with PL 1.6.3, looking forward to pulling this fix when it's merged!

Hi, this issue exists in PL 1.5 either, If you meet error in PL 1.6.3. It might be other bug?
And if @awaelchli could at other appropriate reviewers.

On 1.5.10 the logger would store checkpoints like this:
project_name
        ├── version_id (alphanumeric 8 digit)
        ├── version_id (alphanumeric 8 digit)
                          ├── checkpoints

On 1.6.3 they're all like this now:
version_name **(not the same as version_id)**
        ├── version_None
                        ├── checkpoints

Completely messes up the way I track experiments since on the online interface of wandb references version_id and not version_name. Is this a different issue altogether?

Completely messes up the way I track experiments since on the online interface of wandb references version_id and not version_name. Is this a different issue altogether?

I suspect yes, though I'm not why this happening on your side. This PR just want to change logger structure like this:
run_name or project_name
        ├── version_id (alphanumeric 8 digit)
        ├── version_id (alphanumeric 8 digit)
                          ├── checkpoints

Yes I pinged the team for one the third review. Sorry about the wait time, things are slow at the moment.


MM-9639 Added ability to collapse long posts

This is a resubmission of the previous PR so that it can be demoed with the newish design.
Ticket Link
https://mattermost.atlassian.net/browse/MM-9639
Checklist

Has UI changes
Touches critical sections of the codebase (auth, posting, etc.)

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Spinmint test server created at: http://i-0db0c57b69c756c23.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-0db0c57b69c756c23

@esethna This still has the 200 pixel max height for a post since I wasn't able to find the expected max height in any of the designs I had

Thanks Harrison! Few comments:

Looks like the "Show More/Less" buttons have a blue outline after being clicked. Can we remove that blue outline and instead add an on hover effect. @michaelgamble any thoughts on the on-hover effect, maybe the drop shadow used for images?

Can we try 600 pixels max height?@michaelgamble any thoughts given the current height is 200 pixels on the test server?

@hmhealey can we increase the allowable limit to 16k to we can get a better feel for it?

UI Review Issues:

gutter below the show more button should be 10px
hover state missing (please refer to blue button variant in invision docs)
show more button > click state currently shows a bright glow > this should be removed
Padding in show more button should be reduced from 10px to 8px
post-collapse__show-more-line > opacity should be reduced from 20% to 10%
Show more button > border opacity should be reduced from 20% to 10%

@asaadmahmood  can we add subtle animation transitions?
I'm thinking quick .5 second ease-ins for state changes:

when the content height changes (expand / collapse)
hover effect on the show more button

Spinmint test server destroyed

I've made the requested UI changes except for the transitions which I'll need Asaad's help for. I've also merged in the latest changes from master, so that should increase the post limit.

Spinmint test server created at: http://i-09411eade7366a248.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-09411eade7366a248

@asaadmahmood Are you able to look at the adding the transitions Mike requested? I'm not familiar with how to do that

Spinmint test server destroyed

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Thanks guys. @hmhealey @asaadmahmood @michaelgamble I'm wondering your thoughts about pinning the "Show Less" button so it's always on screen during scroll. So in the center channel as you are scrolling down the long post the "Show Less" button is pinned just above the text input box. In the RHS might get a bit more complex given the text box isn't always pinned to the bottom, but same principle could apply. I tested with 16k characters and I'm slightly about getting lost in long posts. Open to feedback if you guys give it a go.

UI Review Issues:

The gradient cutting off the bottom of the text seems to abrupt, please adjust to meet designs... feel free to ping me if any questions

Performance Concern:

When I jump out of the browser, and jump back in to the browser having focus, the channel with show more content seems to lock up the whole app for a few seconds.. something odd is going on their

@esethna @michaelgamble Here's the updated gradient and Show More/Less button positioning. I'm trying to reproduce the lag you guys reported since I definitely saw it happen before even though I can't repro it currently. It seems to be due to the existence of longer posts rather than the expand/collapse behaviour, but I still need to confirm that

Spinmint test server destroyed

@esethna How is this version?

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Spinmint test server created at: http://i-03813d58ed9f68f3e.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-03813d58ed9f68f3e

@hmhealey I'm definitely still noticing a lag in the responsiveness of the UI. To repro try setting your connection speed to slow 3G. For example:

Type a long post (~16k), after hitting ENTER there is a lag of about 5-7 seconds before the post appears in the post list and clears the text input box. Then another UI freeze of about 2-3 seconds before the UI is responsive again.
On a long post (~16k), hit the reply arrow, observe a UI freeze of about 2-3 seconds before the post opens in the RHS and UI is responsive again
Random UI freezes when long posts are being displayed. GIF attached showing how the cursor is frozen and no hover effects being displayed for almost 10 seconds:

Other than that UI looks good but it's really hard to do a thorough test until we sort out the perf issues

Separate PR from HH to address perf issues^ https://github.com/mattermost/mattermost-webapp/pull/1204
Will re-test once that's merged

Spinmint test server destroyed

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

@esethna This is ready to test again once the test server comes back up

Spinmint test server created at: http://i-0a2a9f15c98100b76.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-0a2a9f15c98100b76

@hmhealey I think I froze the server - maybe crashed it? I posted 16k characters that was just links. Can you look into what's going on, the server won't load for me anymore and my browser just wants to kill it. No console errors.

Encountered this strange issue

The "Show More" button gradient is still too abrupt when exists as a reply.. please make the same changes to this use case.

Spinmint test server destroyed

Reviewed UI fixes by @hmhealey based on my previous comments - completed and approved
discussed sticky "Show Less" with @esethna - decision to defer unless needed and will que up designs for approacch
discussed what triggers long post div max-height vs character count - landed on div max-height

As far as I'm concerned this PR is approved

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Spinmint test server created at: http://i-0a948840940d0aa13.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-0a948840940d0aa13

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Spinmint test server created at: http://i-0d31672ac001142dc.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-0d31672ac001142dc

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Spinmint test server created at: http://i-0a8707fe4b4be4ca1.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-0a8707fe4b4be4ca1

Queued for testing with QA

Spinmint test server destroyed

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Trying a new spinmint; the previous one could not be reached (ERR_CONNECTION_REFUSED).

Spinmint test server created at: http://i-0d8ea39103d44df3a.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-0d8ea39103d44df3a

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Spinmint test server created at: http://i-0e369d2a5fa5ac010.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-0e369d2a5fa5ac010

I fixed an issue in the spinmint server, now this test server is good to go.

@hmhealey @esethna
I tested across devices (RN app build 104 on iOS and Android;  Desktop App and Chrome/Win 10 browser) and found the following issues:

UI looks broken on searches for pinned / flagged posts in the RHS. (Long post with "Show More" in the center panel shows the last couple of lines greyed out.  In pinned/flagged posts in the RHS, the last couple of lines are not greyed out.) - (DOES NO REPRO ON iOS/ANDROID RN APP but does on Desktop App/Browser)

In direct and group messages, the person making the post does not see "Show More/Less" on their own post but it does show up for other users.  If, however, you open the RHS on this same post, the "Show More/Less" suddenly shows up. - (DOES NO REPRO ON iOS/ANDROID RN APP but does on Desktop App/Browser)

Screenshot 1: Post posted by sysadmin to user-1 (and being viewed as sysadmin - no "Show More" in center panel

Screenshot 2: The same post still being viewed by sysadmin after having clicked "reply icon" on the message in the center panel to open the RHS

FYI, @lindalumitchell and/or @DHaussermann are still going to do some testing and might find other issues.

Thanks guys, good catches. cc// @hmhealey on the above.

@lindy65 For issue number 2, how wide was your window at the time? It looks like your message may not have been tall enough to cause the post to appear collapsed with the Show More button, but clicking the reply arrow increased the height enough for that to happen

@DHaussermann Are you sure that isn't just because the first line is a heading so it has a margin before it? I tried to reproduce the issue and it appears the same on the spinmint as this screenshot from pre-release

Hi @hmhealey , Yes, you're right. After looking at this closer it is unrelated to the expand\collapse and is not specific to this PR.
@esethna, we should still decide if this is worth resolving. I can just create a ticket for it.

@hmhealey - for 2) above, I hadn't changed the width of my screen at all - same width / size as I usually use displaying over my full laptop screen.

Ya I think this is fine, given the post takes up more vertical room after the reply arrow is clicked, so this pushes it over the trigger limit for long posts.

@esethna I've fixed the first issue Lindy reported where the fade out was missing in search results, and I went through and double checked that fade out in all other circumstances. As mentioned above, I couldn't repro the other issue

Setup Test Server label detected. Spinmint test server created if build succeeds (checks pass and no conflicts with base branch).

Spinmint test server created at: http://i-0fb780e78d6b745e9.spinmint.com
Test Admin Account: Username: sysadmin | Password: sysadmin
Test User Account: Username: user-1 | Password: user-1
Instance ID: i-0fb780e78d6b745e9

Spinmint test server destroyed

Spinmint test server destroyed


[Com][Event]Twitter Space: the fellows

Host a Twitter audio space event to help promote ES
Description
A Twitter Space featuring the fellows to talk about the ES project as open source and the process that went into taking the tips from a newsletter to an OSP.
Having a Call to Action : signing up for Elemental Selenium to find out when they can start contributing to the project
If needed, PyLadies Berlin offers a very comprehensive guideline for organizing an event. Use it to create your own checklist for helping setup all the steps and offer transparency to your colleagues: http://berlin.pyladies.com/community-organisation/sub_pages/facilitating_events.html
Checklist

[ ] Date - TBD April 24-28
[ ] Participants: TBD
[ ] Questions for participants to answer
[ ] Promote the event time to promote the event (at least 3 -5 days) online to ensure a live audience
-- [ ] Twitter promotion
-- [ ] Repost from SauceLabs (check with Rachel)

Recording: https://twitter.com/i/spaces/1eaJbrOoPaoJX?s=20


Random fixes

When trying to use this library, I needed to make these changes for it to work at all

Sorry about that- it should all be working now!


metadata changes

Sorry, my move is taking longer than expected and now my Internet is also not functioning properly, requiring a technician make a visit. Hopefully in a few days things will be back to normal....


The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #582   +/-   ##
=======================================
  Coverage   79.96%   79.96%
=======================================
  Files          78       78
  Lines        6329     6329
=======================================
  Hits         5061     5061
  Misses       1268     1268

Impacted Files
Coverage Δ

crates/wasmi/src/module/error.rs
26.66% <ø> (ø)

crates/wasmi/src/module/mod.rs
85.08% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

I am closing this since I have a different path for error handling in wasmi in my mind to push forward soon(TM).


integrate the logger with the docker-compose in cwm-worker-deployment-minio

cwm-worker-deployment-minio contains the minio deployment. It currently has a metrics-logger based on Python, it should be replaced with the cwm-worker-logger container.
Please update the docker-compose.yaml in that repository to use the cwm-worker-logger, you can add a fluentd configuration which only updates Redis.

Integrated with https://github.com/CloudWebManage/cwm-worker-logger/commit/447799904d2df97768650c93844281485ec4d3d4 and https://github.com/CloudWebManage/cwm-worker-deployment-minio/pull/3.


Failed netlify deploy when using Forestry's import function

Hi,
I'm currently having problems when attempting to deploy a novela blog through Forestry's import function. Here is my process:

https://forestry.io/starters/ brings me to "Create a Site", using template git@github.com:forestryio/novela-hugo-starter.git. The template is correctly imported in forestry.
-In Netlify, I add a new site from Git, choosing the just created git repository. The Build command I use is hugo --minify, while Publish directory is set to public. Unfortunately, deploying fails soon thereafter with the following error:

5:47:37 PM: Build ready to start
5:47:39 PM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
5:47:39 PM: build-image tag: v3.3.5
5:47:39 PM: buildbot version: 2d05064ce3dd2eb95d282a24602ab707dd9581e8
5:47:39 PM: Fetching cached dependencies
5:47:39 PM: Failed to fetch cache, continuing with build
5:47:39 PM: Starting to prepare the repo for build
5:47:40 PM: No cached dependencies found. Cloning fresh repo
5:47:40 PM: git clone git@gitlab.com:just_created_repository_from_forestry
5:47:42 PM: Preparing Git Reference refs/heads/master
5:47:43 PM: Starting build script
5:47:44 PM: Installing dependencies
5:47:45 PM: Downloading and installing node v10.18.0...
5:47:45 PM: Downloading https://nodejs.org/dist/v10.18.0/node-v10.18.0-linux-x64.tar.xz...
5:47:46 PM: #####################
5:47:46 PM:                                 29.5%
5:47:46 PM: #######################
5:47:46 PM: ################################################# 100.0%
5:47:46 PM: Computing checksum with sha256sum
5:47:46 PM: Checksums matched!
5:47:48 PM: Now using node v10.18.0 (npm v6.13.4)
5:47:49 PM: Attempting ruby version 2.6.2, read from environment
5:47:50 PM: Using ruby version 2.6.2
5:47:50 PM: Using PHP version 5.6
5:47:50 PM: Started restoring cached go cache
5:47:50 PM: Finished restoring cached go cache
5:47:50 PM: unset GOOS;
5:47:50 PM: unset GOARCH;
5:47:50 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
5:47:50 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
5:47:50 PM: go version >&2;
5:47:50 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
5:47:50 PM: go version go1.12 linux/amd64
5:47:50 PM: Installing missing commands
5:47:50 PM: Verify run directory
5:47:50 PM: Executing user command: hugo --minify
5:47:50 PM: Error: "/opt/build/repo/themes/novela/layouts/partials/func/GetArticleAuthors.html:39:1": parse failed: template: partials/func/GetArticleAuthors.html:39: function "return" not defined
5:47:50 PM: Skipping functions preparation step: no functions directory set
5:47:50 PM: Caching artifacts
5:47:50 PM: Started saving pip cache
5:47:50 PM: Finished saving pip cache
5:47:50 PM: Started saving emacs cask dependencies
5:47:50 PM: Finished saving emacs cask dependencies
5:47:50 PM: Started saving maven dependencies
5:47:51 PM: Finished saving maven dependencies
5:47:51 PM: Started saving boot dependencies
5:47:51 PM: Finished saving boot dependencies
5:47:51 PM: Started saving go dependencies
5:47:51 PM: Finished saving go dependencies
5:47:53 PM: Error running command: Build script returned non-zero exit code: 255
5:47:53 PM: Failing build: Failed to build site
5:47:53 PM: failed during stage 'building site': Build script returned non-zero exit code: 255
5:47:53 PM: Finished processing build request in 14.547300709s
This happens using both GitLab and GitHub.
 In any case, I haven't been able to find a solution. Any help is appreciated.

As you can see this theme deploys ifne on Netlify: https://hugo-novela-forestry.netlify.com
According to the build error, it's related to the authors:

Did you follow the docs?
https://github.com/forestryio/novela-hugo-starter#authors

Hi DirtyF,
I'm having the same build fail when deploying.
I've tried a) direct from Forestry as mandorlaz mentions and also separately b) cloned the repository and then both times followed the instructions 'Deployment and hosting with Netlify' in the Readme without modification to any files.
Would you be able to provide some more detail on what regarding the authors could be causing this problem or what we should change.
Cheers.


ci: use correct manifest name

:tada: This PR is included in version 1.69.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Add an API for testing if a sprite is overlapping with certain tile

So that you can do stuff like this:
if (car.isOverTile(BOOST_TILE)) {
   increaseSpeed();
}

Should we also do overlap color?

I'm just afraid that one will be very expensive to calculate. Also how does it interact with Z-indices? We'd have to check all sprites above/below the image...

Fixed by this


Some gauge tests fail, but the report shows "passed"

Describe the bug
Running a test of a spec file shows "Failed Step: " followed by the specification and error message and so forth.
However, when checking the report, all tests show as pass.
Looking in the terminal, I get a "build successful" as well as:
Specifications:	3 executed	3 passed	0 failed	0 skipped
Scenarios:	4 executed	4 passed	0 failed	0 skipped
When in reality it should be:
Specifications:	3 executed	2 passed	1 failed	0 skipped
Scenarios:	4 executed	2 passed	2 failed	0 skipped
If it helps, in this particular example I'm using a for loop to go over a table and check the values and run assertEquals
To Reproduce
Steps (or project) to reproduce the behavior:

Initialise a gauge project
Run the gauge command
Steps that fail should output in terminal
See that, even with failures, everything passes

$ gauge init java # or js, python etc
Your Environment Information -----------
        linux, 1.4.1,
        html-report (4.1.2), java (0.7.15), js (2.3.17), python (0.3.17), screenshot (0.1.0)

Logs
Paste any log or error messages here

Expected behavior
Gauge execution output should show valid test pass/failure output.
Screenshots
If applicable, add screenshots to help explain your problem.

Versions:
Gauge version: 1.4.1
Java 11

gauge -v

Gauge version: 1.4.1

Plugins
-------
html-report (4.1.2)
java (0.7.15)
js (2.3.17)
python (0.3.17)
screenshot (0.1.0)

OS: Linux
Runner info: Java 11
IDE info: Intellij IDEA

Additional context
N/A

This can happen if you have add a try catch block in your code instead of throwing an exception. Can you please share the code for your step implementation to replicate this?

So it's a for loop that iterates over a table of data that has the headers: tagnumber,  name, and occurrences. It makes sure that what is found in the html elements (by xpath) matches what is in the table.
The code is as follows (with some removals due to company privacy):
`    @Step("Check Organization tag on view document page ")
public void checkAttributeTag(Table table) throws AWTException, InterruptedException {
// Wait 10 seconds so page loads properly
Thread.sleep(10000);
    // Causes a drop-down menu to be expanded.
    WebDriver driver = DriverCache.getDriver();
    String xPath = "elementXpath";
    driver.findElement(By.xpath(xPath)).click();

    for(TableRow row: table.getTableRows()) {
        int tagNumber = Integer.valueOf(row.getCell("TagNumber"));
        String name = row.getCell("Name");
        int occurence = Integer.valueOf(row.getCell("Occurrence"));

        driver = DriverCache.getDriver();
        SeleniumModule.waitForPageLoad(driver);
        WebElement tag = SeleniumModule.waitForVisibility(driver, By.cssSelector("#attribute-tree p-treenode:nth-child(2)" +
                " p-treenode:nth-child(" + tagNumber+ ") li div"));
        Assertions.assertEquals(name + "\n" + occurence, tag.getText());
    }
}`

Running a test of a spec file shows "Failed Step: " followed by the specification and error message and so forth.
However, when checking the report, all tests show as pass.

This is concerning. It should either not report an error or indicate the number of failures in the final summary. I am not sure why this is happening, but this isn't the expected behaviour.
As for the code sample you've pasted, can you try printing the count of rows that you are getting in the method implementation? Reason - the assertion is inside the for loop, so if there were zero rows in the table passed in, the method will not throw an exception, marking the step as passed.

It always has had at least a count of 1, so it always find something.
Here's a printout of the "failure" message:
 Failed Step: Check Organization tag on view document page
        Specification: specs/RunBulkDocuments.spec:14
        Error Message: org.opentest4j.AssertionFailedError: expected: <CorTS Trust for J.C.
        2> but was: <Act File Number Old Copper Company, Inc.
       1>
And here's the report output:
Specifications:	3 executed	3 passed	0 failed	0 skipped
Scenarios:	4 executed	4 passed	0 failed	0 skipped
Total time taken: 2m35.949s
BUILD SUCCESSFUL in 3m 45s
3 actionable tasks: 3 executed
So as you can see, it clearly failed on one row in the for loop, but yet shows passed.

I have a similar issue. The assertion fails, but Gauge Report shows ...[PASS]
CODE
step("'Peter' verify'", async function () {     try {     const elementText = await text('Peter', below('Pete')).exists(0,0);     assert.equal(elementText, 'Pettteer');         } catch (error) {           console.error(error);         }  });
CONSOLE.Log
`AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

actual - expected
false

'Pettteer'
at Object. (/REMOVED/tests/step_implementaition.js:219:12) {
generatedMessage: true,
code: 'ERR_ASSERTION',
actual: false,
expected: 'Pettteer',
operator: 'strictEqual'
}
* 'Peter' verify'    ...[PASS]`

Can anyone help me out with the code, so it will fail the step in the gauge report?

Please modify your code from
step("'Peter' verify'", async function () {
 try {
 const elementText = await text('Peter', below('Pete')).exists(0,0); assert.equal(elementText, 'Pettteer');
} catch (error) {
 console.error(error); }
});

to
step("'Peter' verify'", async function () {
  const elementText = await text('Peter', below('Pete')).exists(0,0); assert.equal(elementText, 'Pettteer');
}

If you want to report errors.


network: Move OCI hooks and network namespace creation out of virtcontainers

Before we decide to move to a fully hotpluggable network model, we want to go step by step by making sure we can still support the network being coldplugged in case of kata-runtime, but also letting the possibility to consumer of the API (such as frakti) to hotplug the network interfaces, without having virtcontainers doing some prework there.
This PR introduces a few rework and fixes, but the most important part is about the creation of the network namespace and the execution of the OCI hooks being handled directly from the CLI. This allows the Kata API to be OCI agnostic.
Fixes #599

@egernst @WeiZhang555 @bergwolf @amshinde @caoruidong PTAL
FYI, this PR does not supersede #600, but shares part of the commits. The approach here is less aggressive as we're not dropping the network coldplug, but we let the possibility for the network not to be created if we don't want to (frakti case with the factory).
We need to discuss if we want eventually to move to a fully hopluggable model, but this is beyond this PR scope.

This is going to conflict with #617, so please could folk take a look at that one :)

This is a big PR - nice work.  I feel like some of the commits would be better off in a seperate PR?  In particular,
virtcontainers: qemu: Don't shutdown QMP from hotplug

Most of changes are code movement, generally good

Rebased! I'll address the comments now.

@jodh-intel all your comments addressed. The rebase on top of the opentracing was trickier than I thought it'd be :)

@bergwolf I have addressed your comments, PTAL

change is fine with me, I'll want to get @bergwolf 's ACK.  I'd prefer a less awkward naming scheme (defaultNetwork when we only have one network is a bit odd), but don't want to delay this too much longer when I'm not providing a better alternative...

@bergwolf Can you take another look at this?  Are you ok with merging this as is and address the hooks issue in a separate PR. Else we can wait for  @sboeuf when he is back next week.

Well, it looks like pullapprove really dislikes my approval and just keeps ignoring it. I'm going to ignore it as well, again.


SSL configuration is Running - [BRIEF DESCRIPTION]

App Id: d29btz2vvf5mp
Region: us-west-2
Step: SSL configuration
Status: Running

Note: Do not include information that is sensitive in nature such as your domain name, company etc.

Issue/question
I added DNS in ionos server but amazon is not picking it
Error message
image attached
Note: Be sure to check the message for sensitive information.
Additional information

Closing as a duplicate of https://github.com/aws-amplify/amplify-console/issues/1720


Discussion: two area udfs

There are two area UDFs available in Rikai: area implemented in Python and in Scala.
Are there any guidelines to implement UDFs in Python or Scala?

In general, I'd prefer to write udf in scala if possible, for two reasons:

raw performance
It makes udf easier to be available in none python environment, especially for the use cases that connect to Spark via JDBC (i.e., using spark thrift server). It could open much more use cases in the future.

Of course, if there is no equivalent library in JVM, we need to use python then, i.e., some PIL or numpy operations.

Are we thinking about this as a performance optimization? If these are user-facing APIs, then wouldn't it be confusing for users that some Rikai udfs are available in both scala and python, and others are only available in python?

Oh, let me clarify a bit, i was not suggesting to implement Scala UDF.
I was suggesting to write the function directly in RikaiSparkExtensions like
https://github.com/eto-ai/rikai/blob/main/src/main/scala/ai/eto/rikai/sql/spark/RikaiSparkSessionExtensions.scala#L41-L51
With this, such functions can be exposed via Spark installation that does not have SparkSession exposed to user, i.e., backed by Spark's thrift server when we configure spark-defaults.conf on that machine
spark.jars.packages org.apache.hadoop:hadoop-aws:3.2.0,ai.eto:rikai_2.12:0.0.16
spark.sql.extensions ai.eto.rikai.sql.spark.RikaiSparkSessionExtensions


Karma tests fail when linking npm modules

If cwl-ts is linked, npm test fails with the following error:
 Error: Cannot find module "./CommandInputParameterModel"
  at /path/to/frontend/config/spec-bundle.js:72630 <- webpack:///path/to/cwl-ts/src/models/d2sb/index.ts:2:0

It seems cottontail-frontend is looking for webpack loaders in the cwl-ts directory, instead of in the root. This has been fixed for regular dev, but it doesn't appear to work for tests.
This is in webpack.common.js:
    resolveLoader: {
        root: helpers.root("node_modules"),

        fallback: [helpers.root("node_modules")]
    }

This is issue documented here, but the proposed solution dosen't seem to work:
https://webpack.github.io/docs/troubleshooting.html


Fix line wrapping in instances list

Previously, we set the white-space to nowrap on the instances
section. This is incorrect, because it means that on particularly long
instances, the text will overflow the page and cause horizontal
scrolling.
I chose pre-wrap here because this is code. This setting will, per MDN,
ensure that:
Sequences of white space are preserved. Lines are broken at newline
characters, at <br>, and as necessary to fill line boxes.

before:

after:

rebased in case that's the CI fix

@Kleidukos in case you didn't get notified :)
No worries if you're busy and can't review; we patched it internally but would like to contribute the fix back.

If the fix is already used somewhere that's fantastic. I'll take care of your PR. Thanks a lot for your patience.

Thank you :green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:


Add graphext to projects using react-grid-layout list

Hi, I am a developer at Graphext.
Since a few months ago we are using this library in one of the core parts of our product, and it would be a pleasure for us to appear in the README list as company using this library 👍 .
We are very proud of being using react-grid-layout as we have benefited a lot from this.
Thank you very much for creating and maintaining this project.

Thanks!


Modify some descriptions in JP page and add GAO contact

Made some changes to correct Japanese sentence, linked external resources made by Langfuse funs in Japan and added GAO's url, contact email

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.


First run show long tap settings options

On first run of the app it shows the tap/long tap functions for files/subtitles.
Can you please include a second view for tap/long tap the player/settings functions🙏
I've tried experimenting and it seems to require a TapTargetSequence rather than a single TapTargetView
Thanks

These settings include mostly some really advances options so I'm not sure it would be much of a use to the most of users.

I know some advanced users that installed from Play Store and weren't even aware there were advanced options.
// TODO: Explain gestures?
//  "Use vertical and horizontal gestures to change brightness, volume and seek in video"

Please consider adding a TapTargetSequence to demonsstrate some of the extra features available.


FStar.UInt discrepancy

This is really more of a request for comments than an actual bug report and issues related to mine have been discussed before (e.g., #357) and this is probably hard to fix with only minor benefits for everybody who's not me.
In my current Windows/F#/.NET setup FStar.UInt.fst currently fails to verify, while the same goes through fine in my Ubuntu/OCaml setup. The core of the issue is this:
module Bug

let _ =
  assert_norm (pow2 31 ==<PHONE_NUMBER>)

fails via F#, but verifies via OCaml.
I suppose this is related to the 2^31 limited OCaml ints, but my immediate consequence is that I get different queries into Z3, when I really expect the same. There are too many steps between the input and the Z3 query for me to comprehend all of them, but superficially it looks to me like via F# we get additional constraints because pure_return and pure_null_wp are instantiated for the pow2 call, while they are not added via OCaml. My guess is that OCaml (or our .ml files) propagates the constant and simplifies the pow2 call before any constraints are generated, while F# thinks that 31 is big enough not to compute the result at compile time. (The consequence is that Z3 sees six extra quantifiers that make it bail out early.)
In general, what's the strategy regarding this and similar examples? Is the goal to get both toolchains behave exactly the same, or is it okay if one of them can't prove something the other can prove?

Tough one. Making the two toolchains behave as close as possible is a worthy goal. Given this kind of example, do you think there is any chance we can make both toolchains behave exactly the same?

The same code also appears in ulib/FStar.Int (copy pasted?) and fails in the same way.

Found yet another place where this code was copied: micro-benchmarks/Normalization.fst

If I understand this issue correctly, F# does not optimise pow2 31 to a constant, since the recursion is too deep here.
Would it suffice to just use a more efficient algorithm for pow2? It's possible to compute pow2 n in logarithmic recursive depth in n, rather than linear in n, through something like
val pow2': nat -> pos
let pow2' n = let open FStar.Mul in
    let rec aux (x:pos) (n:nat) (acc:pos)
        : Tot pos (decreases n) =
        match n with
        | 0 -> acc
        | _ -> if n%2=0 then aux (x*x) (n/2) acc
                        else aux (x*x) (n/2) (acc*x)
    in
    aux 2 n 1

@A-Manning worth giving this a try

This bug is not being caused by differences in F# vs OCaml compiler optimisation.
It's a result of the F# build using int32 arithmetic.
The following will verify with an F# build -
val pow2_values: x:nat -> Lemma
  (requires True)
  (ensures (let p = pow2 x in
   match x with
   ...
   //| 31 -> p=<PHONE_NUMBER>
   | 32 -> p=0
   | 63 -> p=0
   | 64 -> p=0
   | _  -> True))
  [SMTPat (pow2 x)]
let pow2_values x = match x with
   ...
   //| 31 -> assert_norm (pow2 31 ==<PHONE_NUMBER>)
   | 32 -> assert_norm (pow2 32 == 0)
   | 63 -> assert_norm (pow2 63 == 0)
   | 64 -> assert_norm (pow2 64 == 0)
   | _  -> ()

If we add the 31 case back in, it fails even with the 'correct' 32 bit arithmetic, because the F# build does not parse -2147483648 correctly. This is odd, since in F# the max int32 is<PHONE_NUMBER>, and the min is -2147483648, but the F# build can parse<PHONE_NUMBER> and not -2147483648.
...
  (ensures (let p = pow2 x in
  match x with
   ...
   | 31  -> p= -2147483648
  ...
let pow2_values x = match x with
   ...
   | 31  -> assert_norm (pow2 1 == -2147483648)

Unexpected error; please file a bug report, ideally with a minimized version of the source program that triggered the error.
int_of_string

Fixed in #1283


✨ New orNull and orThrow functions for EmailAddress

📝 Description
For aligning with the Application Programming Interface (API) design of the Zero type (#668), we want to introduce the following experimental functions:
fun EmailAddress.Companion.orNull(text: Any): EmailAddress?
fun EmailAddress.Companion.orNull(text: Any, pattern: Any): EmailAddress?

fun EmailAddress.Companion.orThrow(text: Any): EmailAddress
fun EmailAddress.Companion.orThrow(text: Any, pattern: Any): EmailAddress

These functions should replace the fromString and the fromStringOrNull experimental functions.

✅ Checklist

[x] ✨ Add the orNull(Any) function with tests, documentation and samples.
[x] ✨ Add the orNull(Any, Any) function with tests, documentation and samples.
[x] ✨ Add the orThrow(Any) function with tests, documentation and samples.
[x] ✨ Add the orThrow(Any, Any) function with tests, documentation and samples.
[ ] 📝 Add references to orNull and orThrow functions in their documentation.
[ ] 🔥 Remove the fromStringOrNull(Any) function for using the orNull(Any) one instead.
[ ] 🔥 Remove the fromStringOrNull(Any, Any) function for using the orNull(Any, Any) one instead.
[ ] 🔥 Remove the fromString(Any) function for using the orThrow(Any) one instead.
[ ] 🔥 Remove the fromString(Any, Any) function for using the orThrow(Any, Any) one instead.
[ ] ♻ Refactor the orNull and the orThrow functions.
[ ] 📝 Update the unreleased changelog for this issue.

Superseded by #671.

These functions will be implemented instead of those suggested by #675.

Superseded by #677.


[Bug] select2_nested error after upgrading to 4.2

Bug report
What I did
Tried to edit an entry that was created before the 4.2 upgrade in Monsters.
What I expected to happen
Page load.
What happened

Closing in favor of #4055


'Workflow' object has no attribute 'cores'

Snakemake version
5.3.0
Describe the bug
I have a rule like this
rule trim:
    output:
        fq1=config['workspace'] + '/samples/{sample}/preprocess/{sample}_r1.trimed.fq.gz',
        fq2=config['workspace'] + '/samples/{sample}/preprocess/{sample}_r2.trimed.fq.gz',
        json=config['workspace'] + '/samples/{sample}/qc/{sample}_fastp.json',
        html=config['workspace'] + '/samples/{sample}/qc/{sample}_fastp.html'
    input:
        adapter=config['adapter'],
        fq1=lambda wildcards: config['samples'][wildcards.sample]['fq1'],
        fq2=lambda wildcards: config['samples'][wildcards.sample]['fq2']
    log:
        config['workspace'] + '/samples/{sample}/log/fastp.log'
    threads: workflow.cores * 0.25
    shell:
        'fastp -g -q 5 -u 50 -n 15 -w {threads} --adapter_fasta {input.adapter}'
        ' -i {input.fq1} -I {input.fq2} -o {output.fq1} -O {output.fq2}'
        ' -j {output.json} -h {output.html} 2>{log}'

when I run this by
snakemake -p --nt -j 32 --snakefile /path/to/Snakefile --configfile config.yaml

I got error
AttributeError in line 13 of /path/to/Snakefile:
'Workflow' object has no attribute 'cores'
  File "/path/to/Snakefile", line 13

PS: path modifiled
I have to get the cores by workflow.global_resources['_cores']

I've reproduced your error in v5.3.0 and can confirm it no longer exists in the current latest version v5.26.1:
Snakefile:
rule touch_output:
    output: 'output.txt'
    threads: workflow.cores
    shell:
        """
        sleep 10
        touch {output}
        """

Command I'm running, note the --version is run first to print the snakemake version:
snakemake --version && snakemake -j 1 -r

Outputs:
v5.3.0:
5.3.0
AttributeError in line 3 of /home/derek/snakemake-workflow-cores/Snakefile:
'Workflow' object has no attribute 'cores'
  File "/home/derek/snakemake-workflow-cores/Snakefile", line 3, in <module>

v5.26.1:
5.26.1
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Job counts:
        count   jobs
        1       touch_output
        1

[Thu Oct 22 22:50:50 2020]
rule touch_output:
    output: output.txt
    jobid: 0
    reason: Missing output files: output.txt

[Thu Oct 22 22:51:00 2020]
Finished job 0.
1 of 1 steps (100%) done


how to use RandomPlayer class

saw a RandomPlayer class, how to use it?

Change othello.py lines 40 and 44.


InvalidBucketName: The specified bucket is not valid

Hi! I copied ~/go/src/github.com/apex/up-examples/oss/static-photos and adjusted up.json, but when I try deploy, it says invalid bucket name. I'm unsure how this bucket name (or am I blind?!) is derived in order to fix the issue.
~/tmp/video-thumbnail$ up

     build: 19 files, 6.0 MB (427ms)
     deploy: complete (883ms)

     Error: deploying: deploying: ap-southeast-1: creating s3 bucket: InvalidBucketName: The specified bucket is not valid.
        status code: 400, request id: F60CF0168C35DFC0, host id: EU3r4zIXEyihnafqGsSW0ORjIUNfMwDOODZF4GnWkxQoolQJmRdU5YFNR8f13FHNnLXtqCxU6Kw=

~/tmp/video-thumbnail$ up stack plan

     Error: fetching production alias: ResourceNotFoundException: Cannot find alias arn: arn:aws:lambda:ap-southeast-1:407461997746:function:VTHUMB:production
        status code: 404, request id: 204ac6ac-e499-11e7-909d-e1c243e097ba

~/tmp/video-thumbnail$ cat up.json
{
  "name": "VTHUMB",
  "profile": "mine",
  "type": "static",
  "description": "Video tests"
}
~/tmp/video-thumbnail$ up version
0.4.1

hmm mind posting the up -v logs? it should create a bucket even if that app name has been used before.

seems like capitalization isn't allowed in the bucket names, it's probably best to keep them lowercase for the app name as well, I'll add some validation

Right, according to Amazon S3 Bucket Naming Requirements;

The bucket name can be between 3 and 63 characters long, and can contain only lower-case characters, numbers, periods, and dashes.

Each label in the bucket name must start with a lowercase letter or number.

The bucket name cannot contain underscores, end with a dash, have consecutive periods, or use dashes adjacent to periods.

The bucket name cannot be formatted as an IP address (<IP_ADDRESS>).


KeyboardVisibilityPlugin - simple name is already defined

This is my flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.9.1+hotfix.5, on Microsoft Windows [Version 10.0.17763.864], locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.40.1)
[√] Connected device (1 available)
I am getting following error:
project\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:8: error: a type with the same simple name is already defined by the single-type-import of KeyboardVisibilityPlugin
import com.github.adee42.keyboardvisibility.KeyboardVisibilityPlugin;
^
1 error
This issue is also in stackoverflow @ https://stackoverflow.com/questions/58857690/keyboardvisibilityplugin-simple-name-is-already-defined
My project was running fine until I add intl package for DateFormat require on my project. I used following plugins, removed intl package:
search_widget: ^0.1.0
animated_text_kit: ^1.3.0
shimmer: ^1.0.0
http: ^0.12.0+2
font_awesome_flutter: ^8.4.0
flutter_form_builder: ^3.2.7
flushbar: ^1.7.0
shared_preferences: ^0.5.3+1
path_provider: ^1.1.0
eva_icons_flutter: ^2.0.0
circular_check_box: ^0.0.2
sqflite: ^1.1.5
rxdart: ^0.22.0
archive: ^2.0.10
location: ^2.3.5
image_picker: ^0.6.0+15
geolocator: ^5.0.1
webview_flutter: ^0.3.10
jaguar: ^2.4.36
jaguar_flutter_asset: ^2.2.0
data_connection_checker: ^0.3.4
spinner_input: ^0.1.2

Hi @shariful2011
I see there's a StackOverflow question about your issue,
you might want to try the proposed solution.
Regardless, from your logs the error appears to be related
to the 3rd Party plugin keyboard_visibility,
if the SO solution doesn't prove effective
you might want to open an issue in the dedicated github
Closing, as this isn't an issue with Flutter itself,
if you disagree please write in the comments and I will reopen it
Thank you


Modification to F# discriminated unions implementation to support treating Fields as a Record

Modification to F# discriminated unions implementation to support treating Fields as a Record
Serialization of F# discriminated unions in the current Json.NET implementation and in the option presented in issue #1547 result in unfavorable output in my opinion. Below I will list problems, propose solutions, and present a semi-trivial case with sample code to support these opinions. I have already begun work on this issue here.
Unfavorable result 1 - Current implemtation
Example of F# code and resultant Json from the current implementation
type DUSerializationTest =
    | CaseA of id:int * name:string * dateTimeStamp:DateTime
    | CaseB of string * int
    | CaseC of description:string * DUSerializationTest

let serializeTest =
    CaseA (1, "Carl", DateTime.Now)
    |> JsonConvert.SerializeObject

let serializeTest2 =
    CaseB ("CaseB Item1 Example", 2)
    |> JsonConvert.SerializeObject

let serializeTest3 =
    CaseC ("Recursive Type Definition Example", CaseB ("CaseB Item1", 2))
    |> JsonConvert.SerializeObject

{
    "Case": "CaseA",
    "Fields": [
        1,
        "Carl",
        "2018-03-28T00:54:08.0652638+00:00"
    ]
}

{
    "Case": "CaseB",
    "Fields": [
        "CaseB Item1 Example",
        2
    ]
}

{
    "Case": "CaseC",
    "Fields": [
        "Recursive Type Definition Example",
        {
            "Case": "CaseB",
            "Fields": [
                "CaseB Item1",
                2
            ]
        }
    ]
}

I find this to be functional but not usable in scenarios where interoperability or discovery is important. Having a simple array of "Fields" as a series of ordered values without labels does not give any kind of hint of intent to the consumer.
Furthermore, it is my experience that when looking at API documentation or working with 3rd parties (who sometimes just send sample Json payloads as documentation) it is common practice to use a tool like json2csharp to generate classes at least as a basis for implementing the interaction. Doing this on the output detailed above results in the following class definition.
public class RootObject
{
    public string Case { get; set; }
    public List<object> Fields { get; set; }
}

As you can see the List<object> Fields property leaves us with more responsibility being placed on the consuming developer to get the implementation correct based on documentation. It would be preferable to have Json that would result in generated code that is named and explictly typed.
Unfavorable result 2 - Issue #1547 proposed struct-based implementation
While issue #1547 presents a good potential solution to the 1st unfavorable result I believe there are three problems which should prevent this library from adopting it.
Issue 1 - Current usage
The current implementation of serialization of Discriminated Unions by Json.NET is already published and available for common use; this means utilizing the existing [Struct] common attribute of Discriminated Unions would mean that developers who have implemented and potentially persisted [Struct] attributed unions in data stores would unexpectedly and unexplainably (without researching) have to deal with their programs not behaving properly or data loss.
Issue 2 - Limited to [Struct]
Outside of the obvious desire one would have to minimize restrictions on functionality the [Struct] attribute limits the ability to have a recursive type definition.
Issue 3 - "Case" becomes a reserved word with no compiler warning
The following F# would result in two instances of "case" being used within the Json output.
[<Struct>]
type DUSerializationCaseTest =
    | CaseA of case:string * dateTimeStamp:DateTime
    | CaseB of Case:string * DateTimeStamp:DateTime

let serializeTest =
    CaseA ("Not ideal", DateTime.Now)
    |> JsonConvert.SerializeObject

let serializeTest2 =
    CaseB ("Problem", DateTime.Now)
    |> JsonConvert.SerializeObject

Example 1 - technically valid because of the case-sensitivity of Json which, because of the common F# convention to use camelCasing in union case fields, could have a low impact on the majority of users.
{
    "Case": "CaseA",
    "case": "Not ideal",
    "dateTimeStamp": "2018-03-28T00:54:08.0652638+00:00"
}

Example 2 - invalid, duplicate key
{
    "Case": "CaseA",
    "Case": "Problem",
    "DateTimeStamp": "2018-03-28T00:54:08.0652638+00:00"
}

Proposed Solution
Begin by solving the "current usage" problem listed above by leaving the default functionality and adding an attribute which can be used to decorate Discriminated Unions so that they may be treated differently when serializing and deserializing.
public class DiscriminatedUnionFieldsAsRecordAttribute : Attribute { }

Modify the output of serializing a Discriminated Union decorated in this fashion in the following ways:

Leave the "Case" and "Fields" top level keyword paradigm but change "Fields" to "Record". This is beneficial to isolate and differentiate the label:value pairs of the union case from the wrapper identifiers.
Treat the fields of the Case being serialized as a record. This is beneficial for interoperability, discovery, and readability purposes. Additionally, the implementation of the deserialization of the "Record" does not have to follow a strict ordering of values since we can match on the labels and create the union case more safely.

Example of proposed changes
[<DiscriminatedUnionFieldsAsRecordAttribute>]
type DUSerializationTest =
    | CaseA of id:int * name:string * dateTimeStamp:DateTime
    | CaseB of string * int
    | CaseC of description:string * DUSerializationTest

let serializeTest =
    CaseA (1, "Carl", DateTime.Now)
    |> JsonConvert.SerializeObject

Results in the following Json
{
    "Case": "CaseA",
    "Record": {
        "id": 1,
        "name": "Carl",
        "dateTimeStamp": "2018-03-28T00:54:08.0652638+00:00"
    }
}

Example of json2csharp output when these changes have been applied
public class Record
{
    public int id { get; set; }
    public string name { get; set; }
    public DateTime dateTimeStamp { get; set; }
}

public class RootObject
{
    public string Case { get; set; }
    public Record Record { get; set; }
}

As I hope you will agree, the results of the proposed modification yield better results.
Sample Usage
This concept uses a Discriminated Union to model events for an ordering system. The goal is that these events can be folded into a state representation of an "Order" which a different system will display, modify, and return changes as a series of events. A benefit of utilizing a Discriminated Union for our model here is that we get to enforce completeness when doing operations on these events (e.g. folding events to state).
Model of events
type OrderEventData = {id:Guid; dateTimeStamp:DateTime; orderId:string; reason:string}

[<DiscriminatedUnionFieldsAsRecordAttribute>]
type OrderEvents =
  | OrderCreated of orderEvent:OrderEventData
  | CustomerChanged of orderEvent:OrderEventData * customerId:string
  | ItemAdded of orderEvent:OrderEventData * itemId:string * row:Guid
  | ItemDeleted of orderEvent:OrderEventData * row:Guid
  | ItemQuantityChange of orderEvent:OrderEventData * row:Guid * newQuantity:decimal
  | ItemPriceChange of orderEvent:OrderEventData * row:Guid * newPrice:decimal

With sample data serialized from above as "documentation" it becomes easy to run that through something like json2csharp and do some light renaming / plumbing to get a useful base for interoperability.
Sample "documentation" (note how the "Case" gives us info on the "Record" naming we'll use below)
{
    "Case": "CustomerChanged",
    "Record": {
        "orderEvent": {
            "id": "626d7012-acb0-4eec-99dd-072e2dd34e6d",
            "dateTimeStamp": "2018-03-28T00:54:08.061706+00:00",
            "orderId": "12345",
            "reason": "user selected"
        },
        "customerId": "10080"
    }
}

{
    "Case": "ItemAdded",
    "Record": {
        "orderEvent": {
            "id": "8d15144d-bf40-4c15-b0a7-2f5ec77f8847",
            "dateTimeStamp": "2018-03-28T00:54:08.0621004+00:00",
            "orderId": "12345",
            "reason": "user selected"
        },
        "itemId": "80511",
        "row": "9ca04207-2c77-4d3a-9d38-1f6f3a632fb9"
    }
}

Generated and modified C# which could be created entirely from the context of the above "documentation" though I will admit I think it would be important to point out to a consumer that the "Case" value is significant.
    //Create some base abstract types to support the event model
    public abstract class EventBase { }
    public abstract class EventRecordBase { }

    //Limited this example to two of the six cases defined in the F# code since this will take up many lines
    public class OrderEventMetadata
    {
        public string id { get; set; }
        public DateTime dateTimeStamp { get; set; }
        public string orderId { get; set; }
        public string reason { get; set; }
    }

    public class CustomerChangedEvent : EventBase
    {
        public OrderEventMetadata orderEvent { get; set; }
        public string customerId { get; set; }
    }

    public class ItemAddedEvent : EventBase
    {
        public OrderEventMetadata orderEvent { get; set; }
        public string itemId { get; set; }
        public string row { get; set; }
    }

    //Define the wrapper for events in support of the Case / Record root object
    public abstract class TypedEventRecord<T> : EventRecordBase where T : EventBase
    {
        public TypedEventRecord() => Case = GetCase();

        protected abstract string GetCase();

        public string Case { get; set; }
        public T Record { get; set; }
    }

    public class CustomerChangedRecord : TypedEventRecord<CustomerChangedEvent>
    {
        protected override string GetCase() => "CustomerChanged";
    }

    public class ItemAddedRecord : TypedEventRecord<ItemAddedEvent>
    {
        protected override string GetCase() => "ItemAdded";
    }

    //Create a factory for taking in events and producing event records
    public static class EventRecordFactory
    {
        public static EventRecordBase CreateEventRecord(EventBase record)
        {
            if (record.GetType() == typeof(CustomerChangedEvent))
            {
                return new CustomerChangedRecord()
                {
                    Record = (CustomerChangedEvent)record
                };
            }
            if (record.GetType() == typeof(ItemAddedEvent))
            {
                return new ItemAddedRecord()
                {
                    Record = (ItemAddedEvent)record
                };
            }

            throw new ArgumentException("Record is not a valid supported event type.", "record");
        }
    }

I like the idea of an attribute to control this behavior to preserve backwards compatibility, but serializing to Case and Record looks like a leaky abstraction, since with a Struct union, the fact that it's an F# union is just an implementation detail. If I'm not mistaken, you could skip Case and Record altogether and only serialize the Record fields directly. Then, by looking at which of the record fields are present in the JSON, you'd be able to determine which F# DU case to deserialize to. If there are fields from different one could throw a deserialization exception.

I agree that the Case and Record paradigm seems like a bit of a leaky abstraction however I'm stumped trying to find a better alternative that fits my goals.
What you've suggested works fine for the case of strictly [Struct] Discriminated Unions since part of the requirement is that, for multicase unions, each field is assigned a unique name.
Example
[<Struct>]
[<DiscriminatedUnionFieldsAsRecordAttribute>]
type DUStructTest =
  | CaseA of id:string * name:string
  | CaseB of int
  | CaseC of numberOfThings:int

"Flattens" easily to the following, which is all unique and all easily identifiable when deserializing back to a case of the type DUStructTest
{
    "id": "1234",
    "name": "Carl"
}

{
    "Item1": 1
}

{
    "numberOfThings": 35
}

The problem, of course, is that it is only for those [Struct] unions and I think the ideal solution is something that functions consistently based on either the default functionality or this new proposed attribute [DiscriminatedUnionFieldsAsRecordAttribute]
With more thought, I asked myself "Self, what if we could go without the Case root level label and just have the case of the union be the key that describes the record?"
Example
[<DiscriminatedUnionFieldsAsRecordAttribute>]
type DUNoCaseKeywordTest =
  | CaseA of id:string * name:string
  | CaseB of int
  | CaseC of numberOfThings:int

Serializes CaseA into the following
{
    "CaseA": {
        "id": "1234",
        "name": "Carl"
    }
}

This is definitely possible and gives us identifiable uniqueness. However I'm up in the air on if I like the resultant interoperability better as it would be created from json2csharp as follows:
public class CaseA
{
    public string id { get; set; }
    public string name { get; set; }
}

public class RootObject
{
    public CaseA CaseA { get; set; }
}

If you go back and evaluate the C# I built in my sample usage similar but less plumbing would be required to allow me to deal with just the event classes and emit those events with their wrapper when needing to send data.
Simplified Sample (no change to F# so not copied here)
{
    "CustomerChanged": {
        "orderEvent": {
            "id": "b676ed22-6c45-49d8-b72c-4bfa8a144343",
            "dateTimeStamp": "2018-03-29T23:38:08.2207764+00:00",
            "orderId": "12345",
            "reason": "user selected"
        },
        "customerId": "100080"
    }
}

{
    "ItemAdded": {
        "orderEvent": {
            "id": "4ada3558-0226-436b-a10b-58f0153d4c81",
            "dateTimeStamp": "2018-03-29T23:38:08.2267768+00:00",
            "orderId": "12345",
            "reason": "user selected"
        },
        "itemId": "09878",
        "row": "7a4e6a1b-6fc1-4505-947f-fa4c5d82ccca"
    }
}

    //Create some base abstract types to support the event model
    public abstract class EventBase { }
    public abstract class EventRecordBase { }

    //Limited this example to two of the six cases defined in the F# code since this will take up many lines
    public class OrderEventMetadata
    {
        public string id { get; set; }
        public DateTime dateTimeStamp { get; set; }
        public string orderId { get; set; }
        public string reason { get; set; }
    }

    public class CustomerChangedEvent : EventBase
    {
        public OrderEventMetadata orderEvent { get; set; }
        public string customerId { get; set; }
    }

    public class ItemAddedEvent : EventBase
    {
        public OrderEventMetadata orderEvent { get; set; }
        public string itemId { get; set; }
        public string row { get; set; }
    }

    public class CustomerChangedRecord : EventRecordBase
    {
        public CustomerChangedEvent CustomerChanged { get; set; }
    }

    public class ItemAddedRecord : EventRecordBase
    {
        public ItemAddedEvent ItemAdded { get; set; }
    }

    //Create a factory for taking in events and producing event records
    public static class EventRecordFactory
    {
        public static EventRecordBase CreateEventRecord(EventBase record)
        {
            if (record.GetType() == typeof(CustomerChangedEvent))
            {
                return new CustomerChangedRecord()
                {
                    CustomerChanged = (CustomerChangedEvent)record
                };
            }
            if (record.GetType() == typeof(ItemAddedEvent))
            {
                return new ItemAddedRecord()
                {
                    ItemAdded = (ItemAddedEvent)record
                };
            }

            throw new ArgumentException("Record is not a valid supported event type.", "record");
        }
    }

Which means I still have the option to do nice things like this
public void PostEvents(List<EventBase> eventList, OrderEventRecordRepository orderEventRecordRepository)
{
    eventList.ForEach
        (e => orderEventRecordRepository.Insert(EventRecordFactory.CreateEventRecord(e)));
}

So I'll be honest as I wrote this response and examples I began to like this last option of dropping the Case keyword and turning the Record keyword into the union case name best, what do you think?

Published a new branch (serialization only so far no deserialization yet) with the changes from the above comment.

DUs having poor serialization is a pain. I've been looking at how to work around it, but didn't think about a PR to here. It's a good idea.
Your use case actually looks similar to mine - want to be able to sensibly serialize events.
+1 from me

Check out Microsoft.FSharpLu.Json, which is more or less exactly what you're proposing, plus a little more (Option to null, unwrapping of single-case DUs), and indeed the package I have used in my own projects to serialize unions.
It's a good format for making the json less verbose and more "natural", but the compatibility with C# is not as nice as using my struct suggestion in #1547, hence my proposing that solution in the first place. I deliberately addressed only struct unions there because my suggestion would serialize struct unions to JSON that could easily be deserialized to a single POCO. That was the whole point of #1547.
With that in mind, should I re-open it? It seems we're trying to fix slightly different problems. You seem to be after a general solution to serializing any kind of union, but with no special handling of struct unions. I consider union serialization in general a solved problem with FSharpLu.Json, and just want special (opt-in is fine) handling of struct unions for better interoperability with C#.

I checked out FSharpLu.Json prior to writing the issue above. It is different than the current Json.NET implementation but does not solve the issues I raise in my first post. Also, I believe many .Net developers use Json.NET instead of other various solutions out there (including FSharpLu) and it would be nice to have the best solution as part of this project.
Example
type DUFSharpLuTest =
  | CaseA of id:string * name:string
  | CaseB of int
  | CaseC of numberOfThings:int

Still results in an array of fields with unlabeled values.
{
  "CaseA": [
    "1234",
    "Carl"
  ]
}

Regarding the reopening of #1547, of course if you do not like my take on this I wouldn't discourage having an open issue to solve your problem. However, I did not spend any time on this issue this weekend and I'm responding to your comment late (for me) Sunday. Let me think on a possible solution to this and maybe we can get the best of both worlds somehow.

We've been using a custom serialiser for unions which formats based on the shape.
Enum Union
If the union only has case labels then it will serialise exactly the same as an enum would
type UniverseType =
    | Infinite
    | Finite

Value Union
If at least one case has a payload we fall back to an object with a property for the case. I believe this is the SharpLu.Json format.
type MyRecord = { Name: string }

type MyUnion =
    | CaseA of int
    | CaseB of MyRecord

{
    "CaseA": 1
}
// or
{
    "CaseA": { "Name": "Rabbit" }
}

Fields Union
If the union contains multiple fields then we use an array
type MyUnion =
    | CaseA of int * int * int

{
    "CaseA": [1, 2, 3]
}

Anyone interested in a Pull Request? (in F#, or not)

This is still an open issue, as far as can tell. We currently don't have any great solution, and it is a huge impediment, essentially making Newtonsoft unusable for my cases. (pun sorta intended)

FsCodec's UnionConverter does close to what you specify
And has an interoperable equivalent for STJ
One slight gap is that I'd recommend backporting the autoTypeSafeEnumToJsonString and autoUnionToJsonObject options and implementing https://github.com/jet/FsCodec/issues/96 to avoid the nasty surprised the default impl causes (I use FsCodec for current work and we have stacks of disgusting renderings of type safe enums in our stores)
One nice to have would be an interoperable reader that can accept a mangled rendering but write the correct one for new things, i.e. accept:
"items": [
        {
          "serviceId": "5c8795be52e34e82883d61babed19513",
          "serviceKind": {
            "Case": "ProductB"
          }
        },
        {
          "serviceId": "8a55ebbf0d404485b50da95bdb53f7b3",
          "serviceKind": {
            "Case": "ProductB"
          }
        }
      ]
    },

but write:
"items": [
                            {
                                "serviceId": "5c8795be52e34e82883d61babed19513",
                                "serviceKind": "ProductB"
                            },
                            {
                                "serviceId": "8a55ebbf0d404485b50da95bdb53f7b3",
                                "serviceKind": "ProductA"
                            }
                        ]

In case anyone has not read the tea leaves, NSJ is never going to fix this in the box - it's nowhere near as high priority as lots of other issues in this repo.

Should this issue remain open? The open pull request had a ton of opinions on it, and I ran into time issues trying to address back in 2018. If someone wants to take over, you're welcome to.
Since the current guidance in .NET is to use System.Text.Json, and attempting to serialize discriminated unions throws a System.NotSupportedException with the recommendation to write a custom converter. Maybe the effort should be spent there?
Current System.Text.Json "JsonSerializer.Serialize" exception on a DU:

Not convinced you read my message but...
I dont think this issue is any more or less valid than the rest of the issues here.
The problem is simply that the project is unmaintained (though it is receiving minimal attention wrt extremely obvious bugs and good attention wrt security bugs etc, which is not to be sniffed at)
Plenty people need to deal with NSJ. FsCodec is an example of an NSJ union encoding impl that is maintained
New projects definitely should use STJ. It's not as feature rich, but that's not always a bad thing.
FsCodec has a UnionEncoder that implements the same semantics for STJ and NSJ.
My main point was to call out that a) there is an impl both sides and b) that represents a bridge
And that exception, I love it - its far better than the NSJ equivalent, hence https://github.com/jet/FsCodec/issues/96. I'd argue that if this issue is to be closed, it should be replaced with a clone of that issue - the current behavior is a very unfortunate trap, and having an easy to opt into guard in the box would be a great thing to have (and is also way more likely to get merged and released).
There is an open issue on STJ regarding adding an impl in the box. As noted in https://github.com/dotnet/runtime/issues/55744 there are current good solutions that make the absence of an in the box impl effectively a non issue (IMO)

FsCodec does something (that's intentionally minimal, and interoperates with FsCodec.NewtonsoftJson but there are also equivalent impls that consume that format for Java etc). Think 200 LOC for the union encoding.
FSharp.SystemTextJson has a very complete F#-specific end to end serialisation story, with good features and test coverage. It also has extremely rich DU encoding support. Think 5000 LOC (Union Encoding is not seperable).

In the long term, Union support in STJ is likely to be driven by C# language features (and that's also a likely impediment with them taking anything into the box too)

I'm sorry, I was responding more to the comment above yours that this was still an open issue and it being a huge impediment; I should have been clearer. Your recommendations are on point, and I appreciate your feedback. I'm going to take a look at FsCodec!

👍 Contributions are definitely welcome in FsCodec.
In general it's trying to be minimal, and have a story about STJ vs NSJ interop (which makes the full semantics in the OP probably a stretch).
Having said that, if there is an NSJ converter that is likely to be useful in multiple codebases, I don't necessarily have a problem with it living there, even without an equivalent STJ side implementation.
But, most dearly of all, I'd love to see that glorious exception you showed, (which saved you, and people following in your footsteps from a random ill thought out behavior) could also be implemented for NSJ!

type DUFSharpLuTest =
  | CaseA of id:string * name:string
  | CaseB of int
  | CaseC of numberOfThings:int

Still results in an array of fields with unlabeled values.
{
  "CaseA": [
    "1234",
    "Carl"
  ]
}

Actually there is no way to access id, name and numberOfThings in F#... Don't see any reason to have them in the serialized Json?


passing optional params to can?

Hey,
So I have  this setup:
GroupController => /groups/:group_id
UserController => /groups/:group_id/users
AppController => /groups/:group_id/apps
I want to allow only admins access to users :
defimpl Canada.Can, for: MyApp.User do
  alias MyApp.{User, Group}

  def can?(%User{} = user, _, %Group{} = group) do
    Group.is_admin?(group, user)
  end

  def can?(_, _, User), do: false
end

This works well I use it with Canary so I add this plug to my UserController
defmodule UserController do
...
plug :authorize_resource, model: Group, persisted: true, id_name: "group_id"
...

Now if I want to limit access to AppController to only the users that belongs to that group,
I can add same plug to AppController :
defmodule AppController do
...
plug :authorize_resource, model: Group, persisted: true, id_name: "group_id"
...
end

And I need to add a new can? to implemention:
defimpl Canada.Can, for: MyApp.User do
  alias MyApp.{User, Group}

  def can?(%User{} = user, _, %Group{} = group) do
    Group.is_admin?(group, user)
  end

  def can?(%User{} = user, _, %Group{} = group) do
    Group.is_memeber?(group, user)
  end

  def can?(_, _, User), do: false
end

But As you can see the new can? is has the same pattern as previous function.
What do you think if adding another optional param to to can?
Then I can use it like this:
defmodule UserController do
...
plug :authorize_resource, model: Group, persisted: true, id_name: "group_id", only_admin: true
...
end

defimpl Canada.Can, for: MyApp.User do
  alias MyApp.{User, Group}

  def can?(%User{} = user, _, %Group{} = group, %{only_admin: true}) do
    Group.is_admin?(group, user)
  end

  def can?(%User{} = user, _, %Group{} = group, _) do
    Group.is_memeber?(group, user)
  end

  def can?(_, _, User), do: false
end

I know that you are quite busy, let me know what do you think and if you agree with the change I will create PR.

The def can?(%User{} = user, _, %Group{} = group, %{only_admin: true}) do line should probably be def can?(%User{} = user, _, %Group{} = group, [only_admin: true]) do as a keyword list is being passed to the main thing.  However I'm not sure this is necessary as it is easy to wrap one or the other bits up in another struct and dispatch based on that (which is what I do, handles admin mapping, extra options, categories, etc...).

I tend to favour @OvermindDL1's solution here.

@OvermindDL1 Yeah but pattern matching on keyword looks ugly, to make the point I skip the reality :)
hmm, as your solution I understand that it's possible to wrap it around but if you use it in Canary the third option is always a Ecto Schema but of course it might be the shortcoming of Canary.


Convert your google doc into markdown, make new repository

https://github.com/manasvil/RapidPrototyping-Curriculum


NATIVE-613: Upgrade testing library

This pull request belongs to an issue on our bugtracker.
You can find it there by looking for an issue with the key which is mentioned in the title of this pull request.
It starts with the keyword NATIVE.

@maxammann already ready for review? Or is it already part of an other PR?

Actually I do not really remeber, lets close it :D


Goblin Offshore Investment Quest

Reward states you can now train Traders which is untrue as they are locked behind Business Expansion -
Which subsequently locks both types of Traders (Zeppelin and Ship) behind the same objective.

@Technopig1992 Thanks, I've added this to our Old Gods board since I think it'll have to be part of updating Goblins to the new system. Unfortunately likely to be a bit too complicated to fix in main.

Fixed in https://github.com/AzerothWarsLR/WarcraftLegacies/commit/3f3f6383cb75f8e478a0e1f21dffa11a94e837f5
I merely updated the quest tooltips to reflect reality, presuming that the mechanic is working as intended.


Testing with apollo angular

I have integrated apollo angular with this project but I have a problem with the testing maybe someone of you can answer it. Sorry for make an issue but I need help.
https://stackoverflow.com/questions/54556471/testing-angular-effect-graphql-apollo-client

@anthowm I see your point but this has literally nothing to do with this repo at all. Wish you good luck and feel free to ping us when you have a solution we can add a link for other users who want to use this together with Apollo.


Import Schema definitions/interfaces from modules

Problem
Consider this case:
I want to provide a module for a shop and share it on npm or so. It defines entities for products and orders. It also defines business logic around these entities
Consumers should be able to import these entities somehow into their prisma schema and possible even can extend these entities
Suggested solution
One step is surely to be able to import schema definitions into another schema as proposed here: https://github.com/prisma/prisma/issues/2377
But it will need additional mechanism. Either it should be possible to extend existing Models or prisma schema should support interfaces similarly to graphql.
In the example above, the shop-module would define an interfaces for Product and Order. As a consumer i would need to add Models to my prisma schema implementing these interfaces. (This would also allow to specify more properties than the interface requires)
The typescript generator could then even generate typescript definitions for these interfaces.
The prisma client instance would be initialized and live in the app space and you would pass it to the shop module

import {initShop} from 'my-fancy-prisma-shop-module'

const prismaClient = new PrismaClient(...)

initShop({ prismaClient })

initShop would then assume that the passed prismaClient has at least prismaClient.product and prismaClient.order or so and that the objects returned have at least the properties defined in the interface.
If the names of "product" and "order" should be free to chose in the app space, you could just pass these models:

initShop({ prismaModels: {
  product: prismaClient.shopProduct,
  order: prismaClient.shopOrder
 })

Alternatives
it basically boils down to make the PrismaClient having certain models with properties. i mean you could also say in a readme that certain models have to exist. When initShop in the example is properly typed, you would see immediately with typescript if your prisma clients fullfill the requirements of initShop. It would still be cool if my-fancy-prisma-shop-module could provide additional guideance in the form of interfaces.

any update ?


fix hub clusterClaim is not created at the beginning

Signed-off-by: Zhiwei Yin<EMAIL_ADDRESS>

/assign @clyang82
/assign @morvencao

/hold

/unhold

/LGTM


Pipelining - How to change the outformat to json-ld?

I already tried the following but I'm getting a error.
{
  "timestamp":<PHONE_NUMBER>371,
  "message": "Error parsing NIF input",
  "error": "Bad Request",
  "status": 400,
  "exception": "eu.freme.broker.exception.BadRequestException",
  "path": "//e-terminology/tilde"
}

This is the json I used in the body request. I just added  "outformat": "json-ld" but seems to not be the right way to do it.
[
{
  "method": "POST",
  "endpoint": "http://api.freme-project.eu/current/e-entity/freme-ner/documents",
  "parameters": {
    "dataset": "dbpedia",
    "language": "en",
    "outformat": "json-ld"
  },
  "headers": {
    "content-type": "text/plain",
    "accept": "text/turtle"
  },
  "body": "Madrid is home to two world-famous football clubs, Real Madrid and Atlético de Madrid."
},
{
  "method": "POST",
  "endpoint": "http://api.freme-project.eu/current/e-terminology/tilde",
  "parameters": {
    "source-lang": "en",
    "target-lang": "es",
    "outformat": "json-ld"
  },
  "headers": {
    "content-type": "text/turtle",
    "accept": "text/turtle"
  }
}
]

I need somehow to have the response in json-ld format.
Thank you in advance for your help.

You have to choos eone of following:

query parameters informat and outformat
headers content-type and accept.
Not both to avoid misunderstandings (query parameters are stronger).

So you are doing so:

sent plaintext to e-entity ("content-type": "text/plain")
asked from e-entity and got json-ld ("outformat": "json-ld")
sent to e-terminology turtle ( "content-type": "text/turtle",)
,but content actualy was json-ld from e-entity <-- here is the errror
asked json-ld from e-terminology("outformat": "json-ld")

One variation with query parameters would be:
[
{
  "method": "POST",
  "endpoint": "http://api.freme-project.eu/current/e-entity/freme-ner/documents",
  "parameters": {
    "dataset": "dbpedia",
    "language": "en",
    "outformat": "json-ld",
    "informat": "text"
  },
  "body": "Madrid is home to two world-famous football clubs, Real Madrid and Atlético de Madrid."
},
{
  "method": "POST",
  "endpoint": "http://api.freme-project.eu/current/e-terminology/tilde",
  "parameters": {
    "source-lang": "en",
    "target-lang": "es",
    "outformat": "json-ld",
    "informat": "json-ld"
  }
}
]

I believe I already tried that and didn't worked  I'm on my phone so I cannot test it but surely I sent  some wrong parameters in that case also.
Anyway thank you for your help.


Add Parameter content type to swagger UI

Currently only application/json is supported as content type for payloads.

Fix issue by adding other content type
encode cert files into a json structure.

Swagger issue not dmon or flask.