Feature to execute failed tests only

As a end to end testing framework, it would be nice if Protractor provide a way to execute failed tests only from test suite(s) run.

Can you clarify which of the following use cases is the one you want?

Automatically rerun failed tests as part of the initial protractor run to deflake. i.e.

protractor config.js
running...A,B,D passed, C,E failed
running C,E again...C passed, E failed
running E again...E passed

Manually rerun failed tests after edits. i.e.

protractor config.js
running...A,B,D passed, C,E failed
vim test.js // try to fix C and E
protractor config.js --run-last-failed
running only C,E...C passed, E failed
vim test.js // try to fix E
protractor config.js --run-last-failed
running only E...E passed

the first one, so "1) Automatically rerun failed tests as part of the initial protractor run to deflake"
Also it would be nice if there would be a configurable value for the maximum retry count.
e.g.: in your example there was a 2 re-run, if you set the limit to 1 then the last one won't run.
I hope it was clear.

@hankduan @iamisti The first one for sure! In my case, when running tests on a CI server, having to redo an entire build/push because of a test timing out is frustrating.

+1 for first one

+1

+1

+1, any updates on this?

Not right now, but considering the big feedback, I'll see if I can do something about it in the near future

Please do it as soon as possible. This is almost the most important feature that we're missing from it.

+1

+1

+1, must have feature. have a suite of 1300+ TCs, 15~20 are failing and in teamcity and causing build failure, all are passing if running individually.

:+1:

Hi @hankduan , could you please let me know possible ETA for this feature. I need to decide whether i should have a workaround implemented or wait for this implementation from protractor team.

Likely some time between 1-2 months. I'm trying to get to it as soon as possible, but there are a few other pressing issues that are ahead of this.

We desparately need a way to retry tests in our pipeline, as we have reached critical mass of 100+ tests where likely one will fail. Is there an alternative workaround for retries, or is this the only way? @hankduan

You would need write a script to retry from a top level. (i.e. examine the output which test passed failed, and retry those --using grep). This is probably the approach I'll need to take (well, without the script part) when I do start investigating a way to do this, as there is no way for protractor to tell jasmine or mocha to retry a test directly.

hmm ok I was actually thinking about doing something like this myself. I might hack something together as a proof of concept to solve our immediate needs.

@ericedem
or at least you can share your changes and we can help to you. I don't have too much experience with that, but I can review your code, maybe have suggestions, etc...

+1

+1
the majority of the time all of our tests pass. then at random a test will fail. not always the same one, and by manually checking, it will pass. so a feature that would re-run those failed tests during the CI to not have the deploy/build fail would be great!

+1
For "Feature to execute failed tests only" :+1:

+1

+1

@hankduan and @juliemr, is this something that is in the near roadmap for Protractor?
Has anyone of this thread implemented such a logic in a script that they can share. +1 is an obvious on this one. Since E2E test tend to be more brittle than unit test, not having to re-run them all is a must.
Thanks you for your ongoing communication with your user community. Other open source project should take notes from you guys.

Hi folks, here's our current status update. We realize that this is an important feature request for many of you, but it's also a really tricky one for us. We're thinking about it, but there's a lot of other features we'd also like to add so this might not be in the near future.
Ideally, the logic to retry only failed tests would be implemented somewhere by the test framework (jasmine, mocha, cucumber, etc). Since it is not, Protractor would have to write its own shim for each different framework. This worries me, since it seems like a maintenance nightmare and it's breaking all sorts of walls around encapsulation.

@juliemr thanks for letting us know. I just wanted to folllow up an let everyone know that our team implemented a shim on top of protractor that parses output leveraging process id tags. Given that we are using the sharding feature for our tests we can leverage per spec id tags (i.e. #A2) from the output. We restrict our test files to use a minimal amount of actual tests, which we were doing anyway because having too many tests in one file was making saucelabs debugging very difficult.
Essentially we parse the output for /\[launcher\].*(#\w+.)*failed / Then we rerun whatever spec file the id corresponded to in the next run: protractor ... --specs=$listOfSpecFiles.
So far this has been working, but it is obviously not ideal if protractor output changes, and certainly not mergeable, but was pretty easy to do from outside of protractor and for our use case. Maybe if protractor provided this sort of functionality for the sharding case, rather than trying to rerun individual tests, you could do it. That would abstract the need for understanding individual frameworks, so you can just rerun the spec files as you please, which may be enough for some people.

It would not be a bad idea to extend Jasmine as Protractor is already overriding some of the standard behavior of the framework (Example resolving on expect). This is an interesting attempt forking Jasmine-to-WebDriverJS to add rdescribe and rit into jasmine to have an option to retry failed tests.

Mini update. I took a quick look at this and it's much more complicated/hackier than I had originally expected when it comes to the details of implementation.
On the Jasmine side: Jasmine runner isn't designed to be called more than once. https://github.com/jasmine/jasmine-npm/blob/master/lib/jasmine.js#L145. If you call the execute() twice, the second time would not run any tests (I'm guessing it somehow keeps track of what was run before although I haven't investigated too much). Part of this has to do with the fact that Jasmine first loads all the test files, and then runs the specs as a whole.
On the Protractor side: It is also not designed with retry in mind and there are many edge conditions like:

if 1/5 tests fails the first time, Protractor will print an error message for the 1 failed test, even if the test passes on a retry. Ideally, we want to hide the error message, or only print it with --verbose, if the test eventually passes.
The reporters also needs so restructuring to note the fact that there has been retries.

Folks,
I'm trying to pinpoint when this intermittent situations happen and here
are my findings so far:

These happen less when its running on my Win7x64 machine than on our
Ubuntu CI with XVFB. On the PC at least one test will intermittently fail 1
in 10 runs. On the CI it will be 1 in 3.
Using Expected conditions  reduced the failures by 10-20%.
We are heavily utilizing Angular Material which has rich animations and
transitions. It seems to be more of an issue because of asynchronous nature
of these renderings. With the risk of a slight double posting, I've created
a question related to issue in StackOverflow.
http://stackoverflow.com/questions/29966816/are-there-issues-using-angular-material-with-protractor-for-e2e-testing

On Mon, May 4, 2015 at 8:43 PM Hank Duan<EMAIL_ADDRESS>wrote:

Mini update. I took a quick look at this and it's much more
complicated/hackier than I had originally expected when it comes to the
details of implementation.
On the Jasmine side: Jasmine runner isn't designed to be called more than
once.
https://github.com/jasmine/jasmine-npm/blob/master/lib/jasmine.js#L145.
If you call the execute() twice, the second time would not run any tests
(I'm guessing it somehow keeps track of what was run before although I
haven't investigated too much). Part of this has to do with the fact that
Jasmine first loads all the test files, and then runs the specs as a whole.
On the Protractor side: It is also not designed with retry in mind and
there are many edge conditions like:

if 1/5 tests fails the first time, Protractor will print an error
message for the 1 failed test, even if the test passes on a retry. Ideally,
we want to hide the error message, or only print it with --verbose, if the
test eventually passes.
The reporters also needs so restructuring to note the fact that
there has been retries.

—
Reply to this email directly or view it on GitHub
https://github.com/angular/protractor/issues/1190#issuecomment-98894008.

@gkohen

We are heavily utilizing Angular Material which has rich animations and
transitions. It seems to be more of an issue because of asynchronous nature
of these renderings.

I'm not using Angular Material, but I do use a few transitions here and there and most of the random test fails happen in these places - with animations.
I have a minimal browser.sleep just in case, but even they won't be enough sometimes.

@ericmdantas browser.sleep may look tempting but it would make the tests more fragile, slow and unreliable. protractor has to be more natural with animations and transitions.

@alecxe, definetely. But, at least for now, it's either that or some tests wouldn't pass at all.

On top of excellent solution proposed by @ericedem, we built something that works for us.
Instead of relying on mocha's in-built reporters (which can change in future and also needs quite a bit of logic to figure out what failed looking at mocha's reporter), we created a tiny custom reporter that writes all failed tests in a text file. The parent process then reads that file and creates another protractor process with --specs=$listOfFailedSpecs

+1

+1

@hankduan @juliemr as far as I can see we should implement it somewhere around here:
Mocha: https://github.com/SeleniumHQ/selenium/blob/master/javascript/node/selenium-webdriver/testing/index.js#L128-L146
Jasmine: https://github.com/angular/jasminewd/blob/jasminewd2/index.js#L81-L102
Cucumber: haven't looked it up (I would even say it wouldn't make sense to repeat steps)
I've got a simple tweak working. We just need to repeat selenium-webdrivers control flow as often as we want to rerun flaky tests. Fortunately this wouldn't require any additional changes in the reporters as we don't trigger any information or events up the chain. For Mocha we would probably need to fork the adapter and make an own project (like jasminewd) as I don't think that the maintainer would like protractor specific stuff in their code.
What do you guys think? I would be happy to contribute because I also need it for a project.
Please let me know.

Feel free to create a PR. I haven't looked at this for a while, but from the last time that I took a look, I couldn't find any good solution unless we integrate directly with the frameworks (jasmine/mocha/etc) themselves.

Inspired by Eric's solution i've created a rudimentary wrapper to rerun failed spec cases. It's very much beta at the moment, but hopefully it would be helpful until we can find a better way to get this into protractor core.

+1

+1

+1

+1

Tested out the wrapper by @NickTomlin -- so far a great workaround.

I recently heard about how Walmart labs build a way for flaky tests to be re-run here https://medium.com/@geek_dave/zombies-and-soup-e346f0c8064f
Whatever the community in Protractor could do to implement this, would greatly help people who want to do continuous delivery.
I will try @NickTomlin 's solution as well

@tonytamsf I remember reading that article a while back. I don't remember them having a plugin when I read it though.
Seems like we should be able to just create a magellan plugin similar to the Nightwatch one and use Magellan as the Test Runner?

+1 this is really kind of a necessity...

+1

+1

+1

+1

+1

+1

+1

+1

Any details on the progress on this improvement?
The communication could be a little bit better, since this thread getting more and more popular.

+1, I need this for times when webdriver timeouts for no particular reason.  Very frustrating.

+1 It would be really nice to have this feature!

+1
We need this so much. My team is almost giving up e2e tests

Not sure who is interested, but you can contact me at<EMAIL_ADDRESS>if you would like to do this for a Continuous Integration environment, like Jenkins using Protractor. The idea behind it, is that you keep track of failures using:
var failures = jasmine.getEnv().currentSpec.results_.failedCount;
for each spec individually. You can use environmental variables to keep track of the failures for an individual spec, but since each node process is broken up individually for each test, I suggest to use a memory storage mechanism like Redis in order to keep track of failures across all tests or you can just use a write/read to a file.
At the end of all the tests running, you use the File System Library to write out environmental variables to a properties file, that then are "injected" into the rerun of the same job, but with different individual tests running.
I am pretty happy with it and it does take some time to set up, but it's worth it.

Coming at this from a slightly different angle, external to the main protractor process, there's this:
https://github.com/NickTomlin/protractor-flake
I'm using grunt-protractor-runner to kickoff protractor from Grunt, so now I'm trying to hack the two ideas together into a single grunt task.

@jeffsheets were you able to run protractor-flake with grunt-protractor-runner? How can we integrate both? Thanks!

@rohitkadam19 sorry but I never did get that running, and have since moved on to a different project. Would be great if someone could get that hooked up though.

+1
We need this so much. My team is almost giving up e2e tests

@premkh9, are you using gulp? If so I suggest using protractor flake mentioned above:
https://www.npmjs.com/package/protractor-flake

I've actually had to make a script that finds all the failures and re-runs them because there is sometimes one or two that fail but it was just a matter of communication with a service like browserstack or saucelabs taking too long or some other factor that wasn't a real positive failure.

Protractor-flake resolved this issue for me.

@gkohen, can you please help me how to implement protractor flake in protractor configuration file. I am not using gulp.

+1

if u guys are using Mocha, it already has retry

@longlho
Mocha's retry is mostly good, but there are still some issues:

It continues the test case even it encounters a failure, and retry after the whole test case has finished. It should stop and retry as soon as it encounters a failure to save time. It is especially important to test cases that involve a longer sequence of actions.

It doesn't handle failures thrown in beforeEach, including both things like browser.wait timeouts and expect. I probably don't use expect at all in beforeEach, but I use browser.wait a lot in beforeEach to make sure each test starts with the same common conditions. It would be great if it can support that.

can someone please help me how to implement protractor flake in protractor configuration file. I am not using gulp.

+1

+1

@juliemr @NickTomlin - Its really hard to configure protractor flakes from following documentation. Can you please explain in details, It would be really helpful to many of them
https://www.npmjs.com/package/protractor-flake

@premkh9 if you have an issue please raise it on the protractor flake repository. Protractor flake is not an official angular/protractor project.

Re running a failed tests are very useful feature for the frame work perspective. I tried flake but It did not help. Can you please suggest any other way to achieve this.

+1

For folks having trouble setting up protractor-flake, I've added it to my protractor-example tests on GitHub. Take a look at the flake file, which I use to kick off tests.
You could also always use it directly... for example, assuming you have protractor-flake installed as a dev dependency (--save-dev), you could then run it with node_modules/.bin/protractor-flake -- conf.js.

We could do this in jasminewd - no way to do this directly in protractor though.  If you need this for mocha or cucumber you'll have to ask them for this feature.
Jasmine wd issue: https://github.com/angular/jasminewd/issues/73

+1

+1

+1

+1

Hello,
I have just found a library. I think it solves our problem.
Protractor-retry

"Windows as an environment to launch & use this package is unfortunately not yet supported."

+1

This is an older issue, but if you are looking for this, you can achieve this using different npm packages, I'm using:
https://www.npmjs.com/package/protractor-flake
I've changed some stuff because I'm using typescript, and when a test fails protractor show the stack for typescript files, and flake looks the stack in order to rerun failed tests, so you need to point to transpiled JS files in order to be able to rerun failed tests, but should be pretty straightforward the implementation.

Also works out of the box with windows/mac/linux we are using it in a cross-platform development team (=


Feature request: transition effects

Hi, nice work on this Carousel. I really like it!
I was wondering, will you be adding more transition effects in the future, i.e. fade?
Thanks!

Thanks for the nice words, it's greatly appreciated. I'm going to start building a proper roadmap for the carousel soon, and more interesting transition effects will definitely be a part of that. Perhaps for the moment I'll scope this ticket to the fade effect so it can be handled in a more manageable chunk of work.
Cheers!

Is there any update on this - or alternatively any workaround that I can apply?
(by the way this is a fantastic component - many thanks!)


No librtlsdr-dev Raspbian Wheezy package available.

There is no librtlsdr-dev package available in the official Raspbian Wheezy package repositories which is causing a dependency issue when trying to build dump1090-mutability1.15~dev packages.

Debating even supporting old releases such as Wheezy at this point... Anyone see an issue with this? Until then support for older releases has been shelved at least for the time being if not for good.

@mgunther68
You are more familiar with setting up dump1090-mutability on Wheezy then I am. The following packages you suggested installing on the FlightAware forum should resolve this issue correct?
https://github.com/mutability/librtlsdr/releases/download/v0.5.4_git-1/librtlsdr0_0.5.4.git-1_armhf.deb
https://github.com/mutability/librtlsdr/releases/download/v0.5.4_git-1/librtlsdr-dev_0.5.4.git-1_armhf.deb

Yes I have these packages installed on my Wheezy Pi. I followed Oliver's directions here:
https://github.com/mutability/dump1090

You will need a librtlsdr0 package for Raspbian. There is no standard build of this. I have built suitable packages that are available from this release page: https://github.com/mutability/librtlsdr/releases

From my Pi:
pi@raspberrypi ~ $ apt-cache show librtlsdr0
Package: librtlsdr0
Status: install ok installed
Priority: extra
Section: libs
Installed-Size: 136
Maintainer: Adam Cécile (Le_Vert<EMAIL_ADDRESS>Architecture: armhf
Multi-Arch: same
Source: rtl-sdr
Version: 0.5.4~git-1
Depends: libc6 (>= 2.13-28), libgcc1 (>= 1:4.4.0), libusb-1.0-0 (>= 2:1.0.9)
Pre-Depends: multiarch-support
Conffiles:
 /etc/modprobe.d/rtl-sdr-blacklist.conf c05476dc82e6934185e8b55b4e84aa13
Description: Software defined radio receiver for Realtek RTL2832U (library)
 rtl-sdr is a software defined radio (SDR) receiver software for certain
 low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip.
 .
 This package contains the shared library.
Homepage: http://sdr.osmocom.org/trac/wiki/rtl-sdr

pi@raspberrypi ~ $ apt-cache show librtlsdr-dev
Package: librtlsdr-dev
Status: install ok installed
Priority: extra
Section: libdevel
Installed-Size: 145
Maintainer: Adam Cécile (Le_Vert<EMAIL_ADDRESS>Architecture: armhf
Source: rtl-sdr
Version: 0.5.4~git-1
Depends: librtlsdr0 (= 0.5.4~git-1)
Pre-Depends: multiarch-support
Description: Software defined radio receiver for Realtek RTL2832U (development files)
 rtl-sdr is a software defined radio (SDR) receiver software for certain
 low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U chip.
 .
 This package contains development files.
Homepage: http://sdr.osmocom.org/trac/wiki/rtl-sdr

@jprochazka
I have created a basic (minimal install) Debian 7.9 (wheezy) VM on my laptop for testing. As expected, the dump1090 installation currently fails:
Checking if the package rtl-sdr is installed... [PREVIOUS INSTALLATION FAILED]
Attempting to Install the package rtl-sdr again in 5 seconds (ATTEMPT 5 OF 5)...

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package rtl-sdr

Let me know when you want me to test things again.

OK, I think I have found a generic solution (i.e. not tied to downloading any specific files from any specific location).
Steps:

Edit /etc/apt/sources.list
Add this to the end:

#wheezy-backports
deb http://ftp.debian.org/debian wheezy-backports main

sudo apt-get update (I think that is already part of the install scripts.)

After doing the above, dump1090-mutability installed without any issues. I leave it up to you to perform the required version (wheezy/jessy) tests and add the wheezy-backports source.

Thinking about this a bit more and reading https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=58836 I'm not so sure anymore if the above will be a good idea on a Pi, especially Pi1.

I think the best way is to determine if the script is running on a Wheezy Pi device (armhf) and install the two required packages from here:
~ $ wget https://github.com/mutability/librtlsdr/releases/download/v0.5.4_git-1/librtlsdr0_0.5.4.git-1_armhf.deb
~ $ wget https://github.com/mutability/librtlsdr/releases/download/v0.5.4_git-1/librtlsdr-dev_0.5.4.git-1_armhf.deb
~ $ sudo dpkg -i librtlsdr0_0.5.4.git-1_armhf.deb
~ $ sudo dpkg -i librtlsdr-dev_0.5.4.git-1_armhf.deb

You could also check first if the packages are already available:
apt-cache show librtlsdr0
apt-cache show librtlsdr-dev

I don't think the back port idea that I posted earlier is such a good idea after all.

I no longer see the point in supporting Wheezy based releases due to the age.


Segmentation fault (core dumped)

Successfully installed torch-1.8.1+cu101 torchaudio-0.8.1 torchvision-0.9.1+cu101
$ python tools/dist_train.py     --cfg experiments/coco/higher_hrnet/w32_512_adam_lr1e-3.yaml
Segmentation fault (core dumped)

Error solved with cuda 12.4


[CPLP-1444] - enable-document-handling

@manojava-gk  can you please review the code for the document handling inside the registration approval board

@manojava-gk can you please review the code for the document handling inside the registration approval board

@jjeroch Looks fine to me


Python manage.py check

I have a bunch of issues that the color is yellow.

This issue makes no sense.


Added membranefilter

Implemented a membrane-detecting filter calculating the membraneness measure using eigenvalue and hessians.

membranenfilter.py
membraneness.py (renamed from vesselness.py)

Codecov Report

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

@@           Coverage Diff           @@
##           master     #246   +/-   ##
=======================================
  Coverage   60.79%   60.79%
=======================================
  Files           8        8
  Lines         352      352
=======================================
  Hits          214      214
  Misses        138      138

Continue to review full report at Codecov.

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

Merged to membranefiler-cli


Pre-release labels on extensions are inconsistent

Hovers

Detail

Proposal
IMO the labels should be consistent and we should use the icon + label as much as possible:

@misolori I like your idea of showing the icon + label. But would like to show it next to the version as they are coupled. Also showing an addition line for a pre-release extension in the hover seems redundant to me.
So, I just added icon to the existing label and this is how it looks:


XCode 10 GM and Swift 4.2 fails to compile

PPBadgeViewSwift v2.2.0 still fails to build in the latest Xcode with Swift 4.2
/Users/joelaws/Workspace/kratos/Pods/PPBadgeViewSwift/PPBadgeView/swift/PPBadgeLabel.swift:72:27: 'NSAttributedStringKey' has been renamed to 'NSAttributedString.Key'
/Users/joelaws/Workspace/kratos/Pods/Foundation.NSAttributedStringKey:2:18: 'NSAttributedStringKey' was obsoleted in Swift 4.2
/Users/joelaws/Workspace/kratos/Pods/PPBadgeViewSwift/PPBadgeView/swift/UIView+PPBadgeView.swift:178:22: 'bringSubview(toFront:)' has been renamed to 'bringSubviewToFront(_:)'
/Users/joelaws/Workspace/kratos/Pods/UIKit.UIView:17:15: 'bringSubview(toFront:)' was obsoleted in Swift 4.2

@jlaws I am sorry. I made a mistake and I forgot to update the code to swift 4.2 in #15 .
I will submit a pull request again to fix.
Or you can try my fork first.

I do not have Xcode10 and Swift4.2 environment yet. I will release it to CocoaPods after upgrading in a few days. You can install it in this way now: pod 'PPBadgeViewSwift', :git => 'https://github.com/jkpang/PPBadgeView.git', :tag => '2.2.1'   @jlaws

2.2.1 still has this issue: UIView+PPBadgeView.swift:178:22: 'bringSubview(toFront:)' has been renamed to 'bringSubviewToFront(_:)'
I fixed it in my fork.

Works great, thank you!


decimal rule failed

Indicative makes use to is.js in some rules and decimal rule fails at certain point.
Here is a reference to same
https://github.com/AdonisJs/indicative/issues/2
Also
is.decimal(10.0)
// returns false

Any Updates

Hey @thetutlage thanks for the heads up.
Isn't this the wanted behaviour or the nature of the language? When you wrote '10.0' to the browser console, it casts it to the '10' instead of '10.0'


Bug in factorial.c

Describe the bug
in Maths/Factorial/C/factorial.c:
scanf("%d",&n); n variable isn't declared
factorial function is not called in main function
Expected behavior
printf("Factorial = %lld", factorial(n)); should be added
and declare n

I want to contribute please assign the issue.


Add "target" path to .gitignore of the templates

target is generated when a dev eject the satellite and builds it - i.e. is generated by Rust. that is why we can exclude it by default in the list of folder to ignore and why we can add it in each .gitignore templates.

Resolved in 37ce01f6dd94d87bf2a816de22ef9dfdf73228c9


feat(dependency): Migrated to go modules

Why is this PR required? What issue does it fix?:
Go modules is a better dependency management than dep.
What this PR does?:
Migrates to use Go modules
Does this PR require any upgrade changes?:
Goinkgo and Gomega were upgraded
If the changes in this PR are manually verified, list down the scenarios covered::
Works on go 1.13 and 1.14
Checklist:

[ ] Fixes #
[x] PR Title follows the convention of  <type>(<scope>): <subject>
[ ] Has the change log section been updated?
[ ] Commit has unit tests
[ ] Commit has integration tests
[ ] (Optional) Are upgrade changes included in this PR? If not, mention the issue/PR to track:
[ ] (Optional) If documentation changes are required, which issue on https://github.com/openebs/openebs-docs is used to track them:

Codecov Report

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

@@           Coverage Diff           @@
##           master     #432   +/-   ##
=======================================
  Coverage   44.24%   44.24%
=======================================
  Files          60       60
  Lines        2859     2859
=======================================
  Hits         1265     1265
  Misses       1490     1490
  Partials      104      104

Continue to review full report at Codecov.

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

The changes looks good, Tried building and it all works fine. Can you also check if we need to pass -mod argument to gox command while building?

@harshthakur9030 You also need to remove Gopkg.lock and Gopkg.toml file since these files are not required anymore.

Done! @mynktl

I just noticed the integration test failed again.

Before merging, we might need to fix the weird error for integration test. No clue why that's happening @akhilerm @mynktl

Before merging, we might need to fix the weird error for integration test. No clue why that's happening @akhilerm @mynktl

I am trying to reproduce it locally, But with no result.

@harshthakur9030 , if you look at the log messages here, you can see that while running the integration test. the modules are not fetched. When tried locally, first it fetched the modules and then ran the integration test. Not sure if it is the exact cause. you may need to check on it.

Oh, can you compare your go env with Travis?

Closing this. I will send a new PR with clean commit history


Stdout already set error in macos

I'm using osx 10.9.5, and following snippet gives a strange output:
package main

import (
    "fmt";
    "github.com/robertknight/clipboard";
    "time";
)

func main() {
    for {
        s, err := clipboard.ReadAll();
        if err != nil {
            fmt.Printf("%s\n", err);
        }
        fmt.Printf("%s\n", s);
        time.Sleep(1000 * time.Millisecond);
    }
}

it prints:
whatever in clipboard
exec: Stdout already set
exec: Stdout already set
...
how can I fix this?

Hi,
I cannot reproduce it on my osx 10.9.5(go version go1.6.2 darwin/amd64) and 10.11.4(go version go1.6 darwin/amd64).
What version of Go are you using (go version)?
Maybe the error is coming from https://golang.org/src/os/exec/exec.go#L420 .
Thanks.

P.S.
I use the following code:
package main

import (
	"fmt"
	"time"

	"github.com/atotto/clipboard"
)

func main() {
	for {
		s, err := clipboard.ReadAll()
		if err != nil {
			fmt.Printf("%s\n", err)
		}
		fmt.Printf("%s\n", s)
		time.Sleep(1000 * time.Millisecond)
	}
}


Pyament Processor tries to send unconfirmed coins

Solution is in branch https://github.com/joshuayabut/z-nomp/tree/movrcx-hp but this makes the pool send unconfirmed coins. Better idea is to have the payment processor launch 10-20 minutes after the wallet interval in pool config or have the pool sending unconfirmed coins be an option in the config

I am working on reproducing this issue issue. I ran wiped out Redis and the wallet.dat file and am going to mine 100 blocks and see what happens...
redis-cli flushall
mv wallet.dat wallet.dat_back
(added new wallet addresses to zclassic.json)

Confirming this, for some reason it is trying to send coins without coinbase confirmation. For Zclassic it takes 100 blocks for a coinbase reward to be validated.
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 1% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 2% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 3% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 4% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 5% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 6.000000000000001% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 7.000000000000001% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 8% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 9% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 10% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 10.999999999999998% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 11.999999999999998% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 12.999999999999998% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 13.999999999999998% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 15% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 16% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 17% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 18.000000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 19.000000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 20.000000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 21.000000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 22.000000000000007% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 23.000000000000007% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 24.000000000000007% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 25.000000000000007% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 26.000000000000007% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 27.000000000000007% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 28.000000000000007% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 29.00000000000001% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 30.00000000000001% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 31.00000000000001% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 32.000000000000014% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 33.000000000000014% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 34.000000000000014% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 35.000000000000014% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 36.000000000000014% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 37.000000000000014% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 38.000000000000014% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 39.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 40.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 41.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 42.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 43.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 44.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 45.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 46.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 47.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 48.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 49.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 50.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 51.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 52.00000000000002% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 53.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 54.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 55.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 56.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 57.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 58.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 59.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 60.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 61.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 62.000000000000036% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 63.000000000000036% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 64.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 65.00000000000003% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 66.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 67.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 68.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 69.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 70.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 71.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 72.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 73.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 74.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 75.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 76.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 77.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 78.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 79.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 80.00000000000004% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 81.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 82.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 83.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 84.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 85.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 86.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 87.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 88.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 89.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 90.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 91.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 92.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 93.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 94.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 95.00000000000006% and retrying
2016-12-20 02:32:19 [Payments]	[zclassic] Not enough funds to cover the tx fees for sending out payments, decreasing rewards by 96.00000000000006% and retrying

running  MPOS now,Pyament  ok

same , need  say at  payment processor  take only avaible found

I found what's happening, the payment processor would trigger after 100 confirmations, but the coins from walletInterval hasn't arrived to the payment address, so the payment processor sends nothing or a small amount

This bugfix been pushed to master.


[tool_crash] WipError 9: {code: -32000, message: Cannot find context with specified id}

Command
flutter run -d chrome

Steps to Reproduce

...
...
...

Logs
WipError: WipError 9: {code: -32000, message: Cannot find context with specified id}
#0      Modules._initializeMapping (package:dwds/src/debugging/modules.dart:181:9)
<asynchronous suspension>
#1      Modules.initialize (package:dwds/src/debugging/modules.dart:53:5)
#2      ChromeProxyService.createIsolate (package:dwds/src/services/chrome_proxy_service.dart:162:14)
#3      DevHandler._handleIsolateStart (package:dwds/src/handlers/dev_handler.dart:347:11)
#4      DevHandler._handleConnection.<anonymous closure> (package:dwds/src/handlers/dev_handler.dart:225:19)
#5      _rootRunUnary (dart:async/zone.dart:1141:38)
#6      _CustomZone.runUnary (dart:async/zone.dart:1034:19)
#7      _CustomZone.runUnaryGuarded (dart:async/zone.dart:936:7)
#8      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#9      _DelayedData.perform (dart:async/stream_impl.dart:594:14)
#10     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:710:11)
#11     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:670:7)
#12     _rootRun (dart:async/zone.dart:1129:38)
#13     _CustomZone.run (dart:async/zone.dart:1026:19)
#14     _CustomZone.runGuarded (dart:async/zone.dart:928:7)
#15     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:968:23)
#16     _rootRun (dart:async/zone.dart:1133:13)
#17     _CustomZone.run (dart:async/zone.dart:1026:19)
#18     _CustomZone.runGuarded (dart:async/zone.dart:928:7)

[✓] Flutter (Channel master, v1.16.1-pre.34, on Microsoft Windows [Version 10.0.18363.720], locale en-US)
    • Flutter version 1.16.1-pre.34 at C:\Users\rbus\Documents\flutter
    • Framework revision e6b0f5f238 (24 hours ago), 2020-03-18 21:56:02 -0400
    • Engine revision 216c420a2c
    • Dart version 2.8.0 (build 2.8.0-dev.15.0 96cf889e6b)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at C:\Users\rbus\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[✓] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 44.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[✓] VS Code (version 1.43.1)
    • VS Code at C:\Users\rbus\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.8.1

[✓] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 80.0.3987.149
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

Flutter Application Metadata
Version: 1.0.0+1
Material: true
Android X: false
Module: false
Plugin: false
Android package: null
iOS bundle identifier: null

FYI @grouma this on dwds: 2.0.1

I believe this is resolved with: https://github.com/dart-lang/webdev/pull/929

Do we have better reproduction steps? I'll verify that it is resolved.

Thanks. @ugritboon are you able to repro this consistently?
At any rate, we should see it in the crash logging, so if it goes down after I update dwds we know its fixed


update python and django versions on travis

Update travis config:

add python 3.5
add python 3.6-dev
update to latest Django (1.10.3)

Python 3.5 is fine to add. But I would replace 3.4 for it.
Also Django 1.10.* does not support Python 3.6. This support doesn't happen until 1.11
Testing for it now would be a little early.

Current coverage is 90.83% (diff: 100%)

Merging #205 into master will decrease coverage by 5.79%

@@             master       #205   diff @@
==========================================
  Files            40         40
  Lines          2727       2727
  Methods           0          0
  Messages          0          0
  Branches          0          0
==========================================
- Hits           2635       2477   -158
- Misses           92        250   +158
  Partials          0          0

Powered by Codecov. Last update 4ef0252...c9ae9dc

That all makes sense, shall I open a new PR or force push to this one?

If could push the changes on this commit, that would be great.

Gonna close this in favour of a different PR.


Check whether the list element is present or not before accessing the index

Summary
Fix a crash when adding a user to a channel from the user popover.
This was caused due to not checking whether the content was being returned or not.
Ticket Link
https://mattermost.atlassian.net/browse/MM-36955
Related Pull Requests
None
Release Note
None

@saturninoabril @hanzei @hmhealey Whoever has time to review this, this would be good to merge before July 14th Cloud release this week.

What causes the array to be undefined to begin with?

/cherry-pick cloud

Cherry pick is scheduled.


ARM / Win10 IoT -- crashes when code contracts added

Questions:

Should one expected to be able to include Code Contracts in a Windows 10 UWP application?
Presuming yes, should one still expect them to work, where the target is Raspberry Pi 2 (running Win10 IoT)?
Presuming they should work on Win10 IoT, is the issue below a known bug?
Presuming it’s not a known bug, is there anything I can do to help the team track down and root-cause this issue, so it can be triaged and potentially fixed?

Note: I've created a minimal example project, so I can create a GitHub depot if requested.
Issue:
Adding Code Contracts to a Windows 10 UWP App (targeting Windows 10 IoT on the Raspberry Pi 2, ARM) causes application corruption / crashes [100% repro]
Steps to repro:
This may have more steps than needed.  Example source available.

Using Visual Studio 2015...
Create a simple headless, task-based app/service for IoT

Include at least one additional class (the target class) that is instantiated by the task
Have one public constructor with a first parameter being a class type, a second parameter being a struct type
See sample code block 1:

Load the UWP App on the RPi2 (under debugger)
Verify the app loads and runs as expected on the RPi2, including creating the class, etc.
Toss into source control for later comparison
Add some simple code contracts.

See sample code block 2

Load the UWP App on the RPi2 (under debugger)

    // Code Block 1
    using K = System.Diagnostics.CodeContracts;
    using IIC = Windows.Devices.I2C;
        public class TestClass {
            private class _Unusable { private _Unusable(); }
            private TestClass(IIC.Device device, byte v, _Unusable mustBeNull) {
                if (null == device) { throw new ArgumentNullException("device");
                m_Device = device;
            }
            public TestClass(IIC.Device device)
                : this(device, 0x04, (_Unusable)null) {}
    }

            // Code Block 2
            K.Contracts.Requires(null == mustBeNull);
            K.Contracts.Requires(null != device);
            K.Contracts.Requires((0 <= v) && (7 >= v)); // yes, I know first check is always true…

Expected Results:
The application continues to run perfectly.
Actual Results:
App starts, and runs fine until calling the class constructor that had Code Contracts added to it.
At that point, things go haywire.  No catchable exception occurs.  Often, the program simply terminates.  Twice, stepping into the constructor caused the app to appear to restart (instruction pointer corruption??).

Is it possible to look at compiled IL? Or Windows 10 UAP apps are using native compilation?

I'm working to provide some additional information.

I cannot commit to quickly providing the time to investigate.  Please feel free to close if having this open for a month or two is not quick enough....

I now believe the issue related to my inexperience with Win10 IOT.  :)  Thank you for allowing the issue to stay open, even when I could not commit to a quick follow-up.
Up soon: 2-3 new issues related to interface contracts silently being ignored... this time with source from the get-go.

@henrygab I would glad to hear, what led to those issues... Just out of curiosity... :)

I had a bug where the task was being prematurely terminated... Or at least I think that was the bug.  I rolled back to earlier version of the code, verified it was OK, and re-added the contacts without issue.
So, it wasn't hardware, software, our firmware, but a wetware bug (aka pebkas, aka ID:10T error 😊).
Specifically, I think I was trying to"play it safe", by ensuring I terminated my task, but failed to wait on the task completion.  Given the use of async, which is still fairly new to me, the termination of the task was attempted before I really wanted it to be.
But don't worry. I've added two more bugs that I think may be •real• issues for interface contract inheritance using ContractClassFor....  😊
Sent from my Windows Phone

From: Sergey<EMAIL_ADDRESS>Sent: 10/16/2015 10:12 PM
To<EMAIL_ADDRESS>Cc<EMAIL_ADDRESS>Subject: Re: [CodeContracts] ARM / Win10 IoT -- crashes when code contracts added (#253)
@henrygabhttps://github.com/henrygab I would glad to hear, what led to those issues... Just out of curiosity... :)
—
Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CodeContracts/issues/253#issuecomment-148886467.


error in use of Drupal.behaviors

In the c2pa.js file Drupal.behaviors is used with once("init-c2pa", "html").forEach(async (element) => { inside.
The behavior added in Drupal.behaviors.c2pa.attach() will get called every time new elements are added to the page via AJAX - documentation.
Adding the once  call to limit the number of times the behavior acts on any one element is ideal, though defining html as the element to be marked as having been acted upon will prevent the attach actions from occurring again whenever new content is added to the page. The documentation for once suggests that only a selector for the items being acted upon be passed through.

I am working on employer approval for the CLA in the mean time you can see the changes I intend in my fork or this patch
3.patch

Thanks @jrglasgow for this PR - these changes look good to me, once the CLA goes through I'd be happy to merge it in.

The CLA has gone through, so this can be merged


[performance] Avoid uneccesary vector copies in imperative_utils.cc

Description
see title
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.

[x] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
[x] Changes are complete (i.e. I finished coding on this PR)
[x] All changes have test coverage:
Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
[x] Code is well-documented:
For user-facing API changes, API doc string has been updated.
For new C++ functions in header files, their functionalities and arguments are documented.
For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
[x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@mxnet-label-bot add [performance,pr-awaiting-review]

@mxnet-label-bot add [backend,memory]

@mxnet-label-bot add [pr-awaiting-merge]

@mxnet-label-bot remove [pr-awaiting-review]

Merged. Thank you!

@larroy - I had quick question on this PR - Can we measure the impact here?

@sandeep-krishnamurthy Do we have some default go-to performance metric for our countributions? I find this would be very useful.


update signatures

Looks good. The change to README.md should've been a separate PR - at least a separate commit.

Slpitted it in two commits.


20170419 155000 tc release artfiact

Allows team city builds to be tagged especially different than travis Mac builds so they can be easily identified for uploading

Coverage remained the same at 91.211% when pulling f70b38511d54cbe0fe8dd73f2359fa054a4ff31f on 20170419-155000-tc-release-artfiact into b26aaf9e9f8b48a03d974e747cfb3408a8b65dfc on master.

Coverage decreased (-0.01%) to 91.197% when pulling f70b38511d54cbe0fe8dd73f2359fa054a4ff31f on 20170419-155000-tc-release-artfiact into b26aaf9e9f8b48a03d974e747cfb3408a8b65dfc on master.

Coverage increased (+0.03%) to 91.239% when pulling f70b38511d54cbe0fe8dd73f2359fa054a4ff31f on 20170419-155000-tc-release-artfiact into b26aaf9e9f8b48a03d974e747cfb3408a8b65dfc on master.


MINOR: Fix race condition with CameraKeyTrackAnimation

Changing look-at from within onFinish handler was not applied due to race condition with already stopped animation.

@harpgl-bot retest this please

@harpgl-bot retest this please


Python: generated minimum 'google-api-core[grpc]' should be '>= 1.4.1'

The generated code now relies on behavior of protobuf >= 3.4.0, and picking that up means we need to pin google-cloud-api[grpc] >= 1.4.1, < 2.0dev.
See: https://github.com/googleapis/google-cloud-python/issues/6128, etc.

Via #2405.


Nuxt 3 only

I want to take the opportunity to simplify the code base and make it nuxt 3 only with some breaking changes:

classSuffix will be '' by default

That's it for now 😃

@Atinux For your planned refactoring: Could you consider bringing back cookie storage, so that we know the user preference during SSR? This is useful to set the correct theme-color header, or to render the correct icon for the color mode menu on the server for example. Otherwise it leads to a flash.
Maybe there could be an option to decide which storage to use.
Also, there is an issue for a while related to the typings, which destroys Nuxt DX. I hope it can be fixed by only using Nuxt 3 syntax. https://github.com/nuxt-modules/color-mode/issues/138

Thanks for linking as well @P4sca1
We actually add a script in the <head> to update the value of the data-theme and class. This way you should not see any styling issue.
We had some issues with Cookies and Safari on mobile too: https://github.com/nuxt-modules/color-mode/issues/38
When do you have the flash?

E.g. you have theme-color blue for dark mode and white for light mode.
When you reload the page with dark mode enabled, the header in safari (compact mode) will first be white and  then switch to blue after the meta value has been updated on the client.
That is, because the server can't know the user preference during SSR and does not know which value to set for the theme-color meta tag.

Yes, I am using a Node.js server to deploy my app. I agree that for some deployments, cookies are not an option. So maybe the storage backend could be configurable in some way.

Any updates?

@cdwmhcc as soon as I get some time for it.


machine_batch should batch requests

If a user has a recipe containing the following:
machine_batch "apache cluster" do
  (1..10).each do |i|
    machine "apache_#{i}" do
      machine_options #...
      run_list ["recipe[apache]"]
    end
  end
end

We should be only be making 1 request to AWS to create all 10 machines.  With the AWS SDK V2 we can set a min_count and max_count parameter on the create_instances call.

See also #17, #227

This is useful for properly utilizing placement groups.


Add an expose function to make use of Ramda comfortable

Hi, I spent a while with ClojureScript and then came back to Ramda and I have, most probably, an silly idea. Ramda is a "core language", which means that write before every single function R. (or ramda. or whatever your import name is) prefix is pretty uncomfortable. Readability of code is bad, it's lot of "redundant" writing, ... So the idea is to provide an expose function:
ramda.exposeTo = function(target) {
  for (var f in ramda) target[f] = ramda[f];
};

// use
require('ramda').exposeTo(global);
map(f, filter(g, [1, 2, 3]));

What do you think?

First of all you should check if the property is already in the target and throw or log an error if it is. Otherwise unexpected things can happend when exposing to the root scope.
Regarding the proposal. I'm not sure.  But doing so is slightly sketchy. If a user does it himself he is responsible for any negative consequences. But if Ramda includes such a function we promote the behaviour and overtake responsibility.
It could be documented with a warning. But exposing more than 200 functions to the root scope is still kinda crazy.

We actually removed such a function not terribly long ago.
I think I was one of the few who actually wanted to keep it, as I like working in that manner, but I really couldn't argue against removing the only function that modified is input data.
Perhaps this should go in the Cookbook.

Perhaps this should go in the Cookbook.

:+1:

@honzabrecka: Would you be willing to add an entry to  the Cookbook Wiki page?

var R = require('ramda);
R.mixin(global, R);

Is this installTo sufficient?

Is this installTo sufficient?

You should check if the property is already in the target and throw or log an error if it is.

Is this installTo sufficient?

there is no R.mixin, especially not one that mutates its first argument.

I've experienced a very obscure bug as a result of extending global with Ramda, wouldn't recommend doing it except in REPL and small scripts.

@raine: Can you describe what happened?  I'd be curious.  I know that there are two or three functions with names that conflict with something on the native or browser host systems.  But that's all I know about.

I had an issue where through2 would not emit further any one of the chunks it received.
I didn't look into back then, but now at a closer inspection it seems isNaN is the reason. through2 has dependency that uses global isNaN and expects different behavior for undefined.
var R = require('ramda');
var stream = require('stream');
var through2 = require('through2');

global.isNaN = R.isNaN;

var s = new stream.PassThrough();
s.write('foo');

s.pipe(through2(function(chunk, enc, next) {
  this.push(chunk);
  next();
})).pipe(process.stdout);

node_modules/readable-stream/lib/_stream_readable.js
244:  if (n === null || isNaN(n)) {

global.isNaN = R.isNaN

isNaN(0) => false
isNaN(undefined) => false

// global.isNaN = R.isNaN

isNaN(0) => false
isNaN(undefined) => true
isNaN(undefined) => true

Well, that one at least should be going away, as our isNaN should be removed in the next release.  But we still overlap in the browser with find, and toString.
The reason for the discrepancy was the realization that isNaN had some pretty awful behavior, and  there was added to Number another version of it, with slightly better behavior.  Our version was modeled off this one.

with es6 modules you could just import what you need
import map from 'ramda'

The problem is that for even slightly complicated code, this can become unwieldy.  In our build script, we would have to do this:
import { __, curry, pipe, always, partialRight, ifElse, partial, concat, memoize, allPass,
        pathEq, tap, chain, prop, of, reject, either, map, forEach, cond, complement, pluck,
        converge, eqDeep, identity, sortBy, identity, path, concat, last, replace, nthArg,
        toUpper, takeWhile, both, all, contains, head, tail, append, sortBy, keys, join }
    from 'ramda'

Or maybe if we were organized and didn't add them haphazardly, this:
import { __, all, allPass, always, append, both, chain, complement, concat, concat, cond,
        contains, converge, curry, either, eqDeep, forEach, head, identity, identity, ifElse,
        join, keys, last, map, memoize, nthArg, of, partial, partialRight, path, pathEq,
        pipe, pluck, prop, reject, replace, sortBy, sortBy, tail, takeWhile, tap, toUpper }
    from 'ramda'

Granted, this was written by people who really understand Ramda.  But at fewer then 300 lines, it's not some monstrous file, either.

with(require('ramda')){
R.lolololol
}

In practice, you don't have much of a choice in a node environment. There is = no way (afaik) to reference the module-local "global" (|this| is undefined), and installing ramda into the global object (there's only one global for all modules) is a very bad idea - likely to break third-party modules and such - so, all in all, there's nothing to install ramda functions into.
What @CrossEye demonstrated is pretty much what I regularly do these days. It's not pretty but I prefer 4-5 ugly lines at the top of each module than prefixing everything with |R.|

I wrote a tool yesterday to help manage required Ramda functions when using destructuring assignment.
https://github.com/raine/ramda-destruct

closing w/o prejudice

Forgive me for commenting on a closing issue, but since this issue comes up fairly easy using google, here's how I just cherrypicked 'prop' in coffeescript:
prop = require 'ramda/src/prop'
data = [{ id: 'foo' }, { id: 'bar' }]
console.dir data.map prop 'id'

Which leads me to the question: are all ramda functions standalone?
Because the approach above could work nice for tools like browserify.

Forgive me for commenting on a closing issue, but since this issue comes up fairly easy using google, here's how I just cherrypicked 'prop' in coffeescript:
prop = require 'ramda/src/prop'
data = [{ id: 'foo' }, { id: 'bar' }]
console.dir data.map prop 'id'

Which leads me to the question: are all ramda functions standalone?
Because the approach above could work nice for tools like browserify.

They're not standalone. Many make calls to other functions. However the
source is broken up into many small files that are included via node
require so using browserify is pretty easy
On Fri, Jan 1, 2016, 3:09 PM coderofsalvation<EMAIL_ADDRESS>wrote:

Forgive me for commenting on a closing issue, but since this issue comes
up fairly easy using google, here's how I just cherrypicked 'prop' in
coffeescript:
prop = require 'ramda/src/prop'
data = [{ id: 'foo' }, { id: 'bar' }]
console.dir data.map prop 'id'
Which leads me to the question: are all ramda functions standalone?
Because the approach above could work nice for tools like browserify.
—
Reply to this email directly or view it on GitHub
https://github.com/ramda/ramda/issues/1166#issuecomment-168348864.


crictl should automate load config file from default path.

crictl should automate load config file from default path  no matter wether it is exist in command line args.
Now even though I has writed config file in /etc/crictl.yaml , I must enter "crictl  --config /etc/crictl.yaml".
@Random-Liu

@yanxuean would you like to file a PR for this?

@feiskyer   Yes,I would

@yanxuean thanks


Add Prometheus and Grafana dashboard

Following /u/SomerEsat's directions

Dashboards added for Lighthouse and Prysm


Add -c flag to build command

Purpose

Add -c flag to build command
Related to ballerina-platform/ballerina-lang#29032

Included in https://github.com/ballerina-platform/module-ballerina-websubhub/pull/53


Kind uses context now, drop KUBECONFIG

Description
Updated Kind is now using kubectl context to point to the right cluster. Drop all the oldschool kubeconfig-path references in the make machinery and in the docs.
Motivation and Context
The old way of referring to the cluster is obsoleted and will be deprecated at some point. It is automatically set now, so no need to do anything for a single deployed kind cluster.
How Has This Been Tested?

[x] Covered by existing integration testing
[ ] Added integration testing to cover
[x] Tested locally
[ ] Have not tested

Types of changes

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

[x] My change requires a change to the documentation.
[x] I have updated the documentation accordingly.

Nice, I really like this! I have been wondering why kind did not support using contexts.
From: Nikolay Nikolaev<EMAIL_ADDRESS>Reply-To: networkservicemesh/networkservicemesh<EMAIL_ADDRESS>Date: Wednesday, November 27, 2019 at 5:23 PM
To: networkservicemesh/networkservicemesh<EMAIL_ADDRESS>Cc: Subscribed<EMAIL_ADDRESS>Subject: [networkservicemesh/networkservicemesh] Kind uses context now, drop KUBECONFIG (#1938)
Description
Updated Kind is now using kubectl context to point to the right cluster. Drop all the oldschool kubeconfig-path references in the make machinery and in the docs.
Motivation and Context
The old way of referring to the cluster is obsoleted and will be deprecated at some point. It is automatically set now, so no need to do anything for a single deployed kind cluster.
How Has This Been Tested?

Covered by existing integration testing
Added integration testing to cover
Tested locally
Have not tested

Types of changes

Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

My change requires a change to the documentation.
I have updated the documentation accordingly.

You can view, comment on, or merge this pull request online at:
https://github.com/networkservicemesh/networkservicemesh/pull/1938
Commit Summary

Make kind create cluster wait for the control plane
Kind now usese contexts for kubectl

File Changes

M .cloudtest/kind.yamlhttps://github.com/networkservicemesh/networkservicemesh/pull/1938/files#diff-0 (1)
M .mk/kind.mkhttps://github.com/networkservicemesh/networkservicemesh/pull/1938/files#diff-1 (7)
M docs/guide-build.mdhttps://github.com/networkservicemesh/networkservicemesh/pull/1938/files#diff-2 (1)
M docs/guide-kind.mdhttps://github.com/networkservicemesh/networkservicemesh/pull/1938/files#diff-3 (28)

Patch Links:

https://github.com/networkservicemesh/networkservicemesh/pull/1938.patch
https://github.com/networkservicemesh/networkservicemesh/pull/1938.diff

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/networkservicemesh/networkservicemesh/pull/1938?email_source=notifications&email_token=AABBEGQIAPA6XZAK734XENDQV4MRPA5CNFSM4JSOBSPKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H4RXLIQ, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABBEGUQCY4A2635FNQC2ETQV4MRPANCNFSM4JSOBSPA.


Add a representation of load shedding to the demand flexibility model

Currently, all demand flexibility is implemented as "shiftable demand", where all curtailed demand must be recovered. However, flexible demand can also be classified as "sheddable demand", where curtailed demand does not have to be recovered. Sheddable demand is common in incentive-based demand response programs. Such a representation would be useful, especially considering the demand response with human-in-the-loop collaboration.
Implementing such a model would likely be easy, especially with much of the code infrastructure in place from the current shiftable demand model. Sheddable demand would be very similar, with the exceptions that (1) it would not need load balancing constraints and (2) it would not be able to be price responsive like the shiftable demand (due to the cost minimization, the sheddable demand would want to curtail its maximum amount every time step). For sheddable demand to adequately participate in the model, there will need to be a different representation of costs and benefits, as discussed in #124.
NOTE: Although load shedding does already exist in the model, this load shedding would be different (though not too different mathematically). While the current representation of load shedding is used mostly for feasibility purposes (e.g., extreme line congestion preventing a simulation from being feasible), the proposed load shedding discussed in this issue would be used to model the impact that demand response programs can have on the system.

@lanesmith Do we still need to work on this?

@lanesmith Do we still need to work on this?

Yeah, it's still not implemented. In the current way we model demand flexibility, which is solely through load shifting, load shedding would not work as intended because it would simply shed all demand that it could. Under the current framework, we will need to have costs associated with the load shedding so that shed decisions are more reasonable. We have a basic cost parameter associated with the demand flexibility model, but this is something that might change as our demand-response-with-human-in-the-loop collaborators continue to explore costs associated with demand flexibility. Unless we need this for something else, I would probably recommend holding off on this feature until the cost structure is better determined, just so we don't need to refactor too much in the future. However, if needed, it probably wouldn't be too difficult to get a basic model of load shedding implemented with the current cost framework.


🏃 Update golang to latest to match version across all repos

What this PR does / why we need it:
In order to avoid differences in go version across all repositories, this PR updates go to the latest in hack scripts. The motivation behind this is from project-infra/pull/124.

/assign @maelk
/test-integration

/test-integration

/lgtm

/lgtm

/approve


Add fuzzer for internal algos.c functions

This is intended to bring the fuzzer suite in uber/h3 to complete parity with what oss-fuzz is able to cover, since oss-fuzz also fuzzes the h3NeighborRotations internal function. Also I added a few advanced options which I hope will make oss-fuzz integration with the fuzzers here a little easier. google/oss-fuzz#8406

Coverage remained the same at 99.03% when pulling d85a9b2baf277b73beb9a60fa39cac9308e4a88c on isaacbrodsky:fuzz-algos-internal into befff57c0a3e51ee56814c7ca61a50dc9bdd474b on uber:master.


Extend InventoryComponent

Description
Task: Extend InventoryComponent.
Feature: Implement Player Inventory
For the inventory to function, it is important to store the positioning within the inventory and the count of the item. This allows the inventory to accurately display item counts and function as needs be.
Dependencies
Nill.
Milestones
List of steps that need to be completed for this task.

[x] Store Position of Items (Aug. 28)
[x] Track Count of Items (Aug. 28)

Completion Deadline: Aug. 28
Documentation

Main description of feature
JavaDoc
...

Member

Name (GitHub Username) (Slack Handle)
Abhinav @Abhinavmohindersingh

Merged into basic inventory branch


Core: Fix recursion level check for array stringification

Closes #55256.

Thanks!

Doesn't cherry-pick easily to 3.x, could use a dedicated PR.

In 3.x, printing a recursive array does not crash, this has been fixed by #28217 (using a stack instead of recursion_count). However, var2str still crashes. This is a VariantWriter bug, not Variant::stringify().
var a = []
a.append(a)
print(var2str(a))

Cherry-picked for 4.1.2.


Implement client-side list election polls

This will require the changes in OpenSlides/openslides-backend#1608 and any eventual autoupdate changes.
CREATION
In the assignment-poll dialog there should be an option allowing the user to switch between normal assignment polls and list-elections. (Something like a checkbox maybe)
For now those should use only one list per poll.
If, upon confirmation, that checkbox is toggled, the poll creation must be changed in the following ways:

Before anything else happens, the client should send a candidate_list.create action with the weight and user_ids of all assignment_candidates in the current assignment (list title should be determined through some method (maybe an additional input box? Maybe just use the title of the assignment))
The payload for poll.create will be handled only after that: Instead of the usual one option per candidate, there will be exactly one option for the entire poll and the content_object_id of that option will be the fqid of the candidate_list that was created in step 1.
The rest proceeds as usual

Displaying the poll
The candidate list should be sorted according to weight, numbered and displayed above the voting area. For the sake of comfort it should be expandable (closed by default?).
When the list is closed, instead of the title we may want to display a preview of the contained entries
Everything else should (hopefully) work just fine with the current system.

Waiting for results of discussion in https://github.com/OpenSlides/openslides-backend/issues/1608 - description will have to be adjusted afterwards

Waiting for OpenSlides/openslides-autoupdate-service#619


Add support for CSP hashes

Here is a really good blog post showing how it can be done.

Currently have the issue that some inline styles are not loading properly besides. having the .Self() defined. Support for hashes would solve that problem.
There should be support for unsafe inline, and a hash like hash 'sha256-dnk3F1ZGrgh9Kvk9Vn3ptiaFUoFeGRayv9lz2urXGw8='.

Note that nonces are already supported, those could perhaps solve the problem?

In fact, nonces is what I do. Still would prefer to use hashes instead.

Currently, I use the tag helpers. This gets rid of the browser issues, but it is not something that can be configured centrally and requires the usage of ASP.NET MVC. In other projects, it is more tricky to do that, since there might be no MVC at all.
Maybe there is a solution I have missed?

Pages with hashes in them can be cached, while nonces cannot.

I have the issue that a page gets generated by a library that I am using and I am unable to put a nonce on it. The current solution is to allow 'unsafe-inline', but would sleep much better with a hash instead, since it's always the same.

Why is this closed? It's a big issue right now since many web browsers block inline-scripting as well by ignoring things like safe-inline. How to add hashes to the white list in CustomSources?
I can't find documentation on how to use nonces either, except for using the NWebsec Tag Helpers package.

This seems like a bit of a no-brainer, can you allow a hash as a valid value for a script source? Nonces are a halfway-there approach and they're a good start, but it'd be great if NWebSec enabled a stricter definition of what's allowed to run.

Yup, it will be added but there are a couple of other things that need to be sorted first.

If one does not have many inline scripts the following workaround can be used:
            app.UseCsp(options => options
                .DefaultSources(s => s.Self())
                .ScriptSources(s =>
                {
                    s.Self().CustomSources("https://example.com/foo/lib.js",
                        "https://www.example.com/bar/lib.js");

                    // Force hashes into custom sources. Can't be done with CustomSources(...)
                    // because CustomSources() checks if strings are uris
                    s.CustomSources = s.CustomSources.Concat(new [] { "sha256-...="});
                })

If one does not have many inline scripts the following workaround can be used:
            app.UseCsp(options => options
                .DefaultSources(s => s.Self())
                .ScriptSources(s =>
                {
                    s.Self().CustomSources("https://example.com/foo/lib.js",
                        "https://www.example.com/bar/lib.js");

                    // Force hashes into custom sources. Can't be done with CustomSources(...)
                    // because CustomSources(...) checks if strings are uris
                    s.CustomSources = s.CustomSources.Concat(new [] { "'sha256-...='"});
                })

Released

If one does not have many inline scripts the following workaround can be used:
            app.UseCsp(options => options
                .DefaultSources(s => s.Self())
                .ScriptSources(s =>
                {
                    s.Self().CustomSources("https://example.com/foo/lib.js",
                        "https://www.example.com/bar/lib.js");

                    // Force hashes into custom sources. Can't be done with CustomSources(...)
                    // because CustomSources(...) checks if strings are uris
                    s.CustomSources = s.CustomSources.Concat(new [] { "'sha256-...='"});
                })

I have added the hashes but still getting the same CSP error. Would you please take a look at the below code snippet:
` app.UseCsp(options => options
.DefaultSources(s => s.Self())
.ScriptSources(s =>
{
                s.Self();
                s.CustomSources("http://localhost:xyz");
                s.CustomSources = s.CustomSources.Concat(new[]
                {

                    "'sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx='",
                    "'sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx='",
                    "'sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx='"

                });
                s.CustomSources = s.CustomSources.Where(x => x != "http://localhost:xyz").ToList();
            })

            .StyleSources(c =>
            {

                c.Self();
                c.CustomSources("http://localhost:xyz");
                c.CustomSources = c.CustomSources.Concat(new[]
                {
                    "'sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx='",
                    "'sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx='",
                    "'sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx='"
               });
                c.CustomSources = c.CustomSources.Where(x => x != "http://localhost:xyz").ToList();
            })
            .ImageSources(i =>
            {
                i.SelfSrc = true;
                i.Self().CustomSources(
                    "http://www.xyz.co.uk",
                    "https://www.xyz.co.uk",
                    "https://*.twitter.com/",
                    "https://*.twimg.com/",
                    "http://*.amazon.com/",
                    "http://*.twitter.com/",
                    "http://*.google-analytics.com",
                    "data:",
                    "https://maps.googleapis.com/",
                    "https://*.gstatic.com/",
                    "http://*.gravatar.com/",
                    "http://*.gravatar.com/",
                    "http://umbraco.tv/media",
                    "https://dashboard.umbraco.org",
                    "https://www.buysubscriptions.com",
                    "https://umbraco.tv"

                    );
            })
            .ConnectSources(c =>
            {
                c.SelfSrc = true;
                c.Self().CustomSources("https://secure.brightcove.com/",
                    "https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/",
                    "https://xyz1",
                    "https://xyz2");
            })
            .FrameSources(f =>
            {
                f.SelfSrc = true;
                f.Self().CustomSources("https://secure.brightcove.com/",
                    "https://www.youtube.com/embed/",
                    "http://www.youtube.com/embed/",
                    "https://syndication.twitter.com",
                    "https://platform.twitter.com",
                    "https://www.google.com/recaptcha/",
                    "https://www.gstatic.com/recaptcha/",
                    "https://players.brightcove.net/",
                    "https://xyz");
            })
            .FontSources(fn =>
            {
                fn.SelfSrc = true;
                fn.Self().CustomSources("fonts.gstatic.com/s/");

            })
        );`

Erorr Deatils:
For style: refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'sha256-xxxxxxxxxxxxxxxxxxxxx=' ......ither the 'unsafe-inline' keyword, a hash ('sha256-xxxxxxxxxxxxxxxxxxxxxxx='), or a nonce ('nonce-...') is required to enable inline execution.
for Script; Refused to load the script 'http://platform.twitter.com/widgets.js' because it violates the following Content Security Policy directive: "script-src 'self' 'sha256-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx='
Thanks,
Gadadhar

Where can we find documentation on the hash support?

How To:
https://blog.mozilla.org/security/2014/10/04/csp-for-the-web-we-have/#:~:text=You’d have a CSP containing a hash-source a bit like this%3A


[QUESTION] Attaching @Authorize('google', {scope: ['email']}) on routes just returns to callbackURL

When I attach @Authorize('google', {scope: ['email']}), the request is returned to the callbackURL. What I want to is to return to the route which I attached the @Authorize decorator: Here are my codes:
Route:
@Get('/')
@Authorize('google', { scope: ['email'] })
async get(){
    return 'Hello World'
}

Callback:
@Get('/google/callback')
@Authorize('google')
googleCallback(@Req() req, @Res() res) {
    return req.user;
}

Protocol:
@Protocol<StrategyOptions>({
  name: 'google',
  useStrategy: Strategy,
  settings: {
    clientID:
      'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com',
    clientSecret: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
    callbackURL: '/auth/google/callback',
  },
})
export class GoogleProtocol implements OnVerify {
  async $onVerify(
    @Req() req: Req,
    @Args() [accessToken, refreshToken, profile]: any
  ) {
    const user = await User.findOne({ email: profile.email });

    return user ? user : false;
  }
}

I read somewhere that in usual javascript, they create a middleware for routes and then check if req.user is available, if it is not then they redirect to login page. When I tried to do that in ts.ed, req.user is undefined in the middleware even if I am logged in to google.

Hello @lueenavarro
The req.user is undefined because you have to implement the mechanism to restore user for each request.
There is many way to persist or send access_token like:

session
cookies
send access_token via headers (Authorization)

This part is not implemented by Ts.ED and passport.js. The simple solution, is to use session and tell passport to store user in session. But this solution is simple when you have only one server but you deploy your server on Heroku or AWS, you'll probably have multiple instance and this solution will be a problem (statefull server).
For one of my project customer, is use Ts.ED and OIDC connection with Passport.js.
It's similar to Google OAuth2. To persist access_token, I use cookies.
Here the protocol example:
import {ACCESS_TOKEN} from "../../domain/auth";

@Protocol({
  name: "oauth2",
  useStrategy: Strategy,
  settings: {}
})
export class OAuth2Protocol implements OnVerify {
  @Inject()
  client: OAuth2Client;

  @Constant("domain")
  domain: string;

  @Constant("env")
  env: Env;

  async $onVerify(@Req() request: Req,
                  @Res() response: Res,
                  @Arg(0) accessToken: string) {

    const profile = await this.client.getUserInfo(accessToken, request.ctx);

    this.setCookies(request, response, accessToken, profile);

    return profile;
  }

  setCookies(req: Req, res: Res, accessToken: string, profile: UserInfo) {
    const context = req.ctx;
    const expires = getTokenExpirationDate(decodeToken(accessToken));
    const options = {
      expires,
      httpOnly: this.env === Env.PROD,
      domain: this.domain
    };

    res.header("cache-control", NO_CACHE);
    res.cookie(ACCESS_TOKEN, accessToken, options);

     // optional. Attach user also to the req.ctx and store access token
    context.set("user", profile);
    context.set("access_token", accessToken);
    context.set("auth", decodeToken(accessToken));
  }
}

// getTokenExpirationDate.ts
const MAX_AGE = 3600;

export function getTokenExpirationDate(token: any) {
  const expiration = token && token.exp;

  return !isNaN(expiration) ? new Date(expiration * 1000) : new Date(MAX_AGE * 1000);
}

// decodeToken.ts
const base64url = require("base64url");

export function decodeToken(token: string) {
  return JSON.parse(base64url.decode(token.split(".")[1]));
}

Now the access_token is set in the cookie. We have to read the cookie before all route handlers.
So, to doing that, we have to create a middleware:
import {ACCESS_TOKEN} from "../../domain/auth";
@Middleware()
export class OAuth2TokenMiddleware implements IMiddleware {
  @Inject()
  client: OAuth2Client;

  async use(@Req() req: Req,
            @Res() res: Res,
            @Cookies(ACCESS_TOKEN) accessToken: string, // it also possible to get your access_token from header with @HeaderParams('Authorization')
            @Context() context: Context) {

    if (accessToken) {
      try {
        // get user from the token. Replace this line by your call to the database
        req.user = await this.client.getUserInfo(accessToken, context);

        // optional. Attach user also to the req.ctx and store access token
        context.set("user", req.user);
        context.set("access_token", accessToken);
        context.set("auth", decodeToken(accessToken));

        return;
      } catch (err) {
        //optional: something is wrong about the token and OIDC server (getUserInfo fail)
        res.clearCookie(ACCESS_TOKEN);
      }
    }
  }
}

Note: @Context() decorator can be used on controller method parameter :). With that you can get auth, user and access_token information by using context.get('auth'), context.get('user'), context.get('access_token')

Now we have to register the middleware on the server.
@Configuration(configuration)
export class Server extends ServerLoader {
  $beforeRoutesInit() {
    this.app
      .use(cors())
      .use(GlobalAcceptMimesMiddleware)
      .use(cookieParser())
      .use(compress({}))
      .use(methodOverride())
      .use(bodyParser.json())
      .use(bodyParser.urlencoded({
        extended: true
      }))
      .use(OAuth2TokenMiddleware);

    return null;
  }
}

Now the my user is correctly attached to the request and all protected endpoint could be used with the current user :)
I think this solution is perfect for your use case but you can choose another one ;)
Tell me if you have any question about another method.
See you
Romain


How to store phone numbers in Postgres?

This could also be generalized to "How to make a custom type work with diesel?"
Basically, I'd like to be able to load and store phone numbers that I'm storing with the phonenumber crate into a postgres database.
It looks like there's a postges extension for this:
https://github.com/blm768/pg-libphonenumber
But I'd just be happy with being able to do it with a text type for now.
I tried implementing FromSql and ToSql for a wrapper type as seen in this example:
https://github.com/diesel-rs/diesel/blob/master/diesel_tests/tests/custom_types.rs#L42
But this approach gets stuck on "only traits in the current crate can be implemented for arbitrary types".
Thanks.

In general it is totally possible to implement custom types outside of diesel. The test case you linked is basically the blue print for implementing such an type.
It is really hard to answer this question without any code to reproduce this. Please add the your current code and the current (exact) error to the issue.
I will close this issue because it does not contain anything that actionable for us to fix in diesel.
Feel free to update the issue with more informations. We will continue to answer this questions here. Or ask in our gitter channel.


Code Cleanup with R# - File Layout is annoying

Some of the current settings are annoying and should be changed:
R# claims to support placing backing fields above their properties in FIle Layout.
But this does not work.
https://youtrack.jetbrains.com/issue/RSRP-484909/Support-Place-backing-field-above-property-in-file-layout
I want this, and it's super annoying that the global reformat we did screwed this up. To this end, I want to change the default Ctrl-E/C profile to NOT apply file layout.
It can be applied separrately with a "File Layout" profile.
Sorting is annoying
I configured properties, methods, etc... to sort based on name. This is annoying when it actually makes having related things near each other. For example in ViewLayout.cs, the logical order of X, Y, Width, Height is exactly that. But because we have sorting on, they get placed as Height, Width, X, Y.
What else?

I've noticed this for a long time and I thought you wanted it that way, anyway...

You should grab the file layout extensions R# extension, which actually provides this. I use that.
The settings are not quite right yet, even using that, but I just haven't cared enough since it's such a minor thing.

Also, there might be a way to make it ignore things like underscores for purposes of sorting.
But typical guidelines are to have private and static stuff up top (which includes constructors) and then everything else follows.
Personally, I like to also have all properties be placed before methods, but that's just my pref.


getOrElse("open") may cause IOException

https://github.com/freechipsproject/diagrammer/blob/35ccb8c62c8a408d0f82c1daaf5c9dd9c81fed63/src/main/scala/dotvisualizer/stage/phase/GenerateDotFilePhase.scala#L96
I'm running under WSL2, which doesn't have open command as default. So it throws the error log:
[error] (run-main-0) java.io.IOException: Cannot run program "open": error=2, No such file or directory

@kevin335200 You can set the open command to be whatever you want.
(I.e. a program that will render the generated .svg file in your browser.)
by adding the flag --open-command <program-name>". If you set the program name to ""` then it will not try to not try to open any diagram on its own.
I hope this helps.

Re-open if there is more to be done here


Implements back the port based SSL certificate fetching.

Implements back the port based SSL certificate fetching.
This modernize the Mono code base to allow booth, a in-memory cache and that same file-based cache if the in-memory cache doesn't contain the entry.
This makes the previous SetCertificate constructor obsolete, but for good, since we can now set a different certificate per ports.
This is not SNI level, but it's still leagues beyond the actual .NET implementation (the MYSTICAL null stubbed return value with the TODO ^^).

Do you have an actual use case for this? The reason the mono code even has that port-based logic is dated and ancient, I don't see any reason to keep it as functionality here.

I do have an use case if I host various CN names on various ports without having to rely on SAN attributes.

I do have an use case if I host various CN names on various ports without having to rely on SAN attributes.

Do you have an actual use case for this? Sure obviously this would allow you to have separate TLS certs served per port but what use case could that possibly have in 2024 to warrant implementing?
I would rather have a more flexible API that also incorporated SNI support or similar via e.g. a callback. Then you can just add the destination socket port in one of the parameters the selection logic and users that really need this can take it from there.

and HTTPListener will sign itself intermediate certificates that are instanced per-session.

Uh, what? Does that actually work? You can't self-sign certificates. And you can't get a root CA cert from anywhere? And isn't signing way too expensive to do for every TLS connection?

I can confirm it works just fine, the root CA will need to be obtained from an outside source (I can make a generator for it too if needed), then this CA cert will be used to sign all the certificates that are generated on the fly.
They are all valid for a period of 7 days to avoids making too much of them (this can be extended).


Extra config need to be passed during topic creation to the admin client

Currently only num of partitions and replication factor is passed to the admin client during topic creation. All passed good configuration options should be made available during this action.

Fixed with d43f40d1aa57be797eea0b9e86e50f478905682b


simply giving it for change

I don't understand the intent of this update. Feel free to edit and reopen the PR with an appropriate justification.