WIP: Feature/business user roles

Pull request checklist

[X] My code contains tests covering the code I modified
[X] I linted and tested the project with bin/check
[ ] I added significant changes and product updates to the changelog

Description
This PR updates the business logic of RailsDevs so that users can be associated with and act on behalf of multiple businesses (including buinesses they don't own.)
Opening as a work-in-progress for now as I work through the first set of steps outlined in issue #237

Hey again Jay – I'm going to close this for now. There are a lot of open PRs and I'm loosing a bit of focus.
Feel free to reopen this or open a new PR if you want to pick back up on Accounts vs. Users!

@joemasilotti Yeah, sorry, I should have closed this myself a while ago since it can always be re-opened.
I’m not working in Ruby at the new job 😢 😢 😢 , or any language I’ve done a substantial OSS PR in, so I had to prioritize building competence in the new language for a while.
Things are going pretty well, so I do hope to pick this back up this fall unless someone else jumps on it!

No worries – you're good!
And while it's a shame you won't be focusing on Ruby as much I'm glad to hear the new job is going well. 😀


[Witherspoon] Turn On/Off fault LED and verify via REST- Changing fault to rear_fault

In tests/test_led.robot 'Test Fault LED And Verify Via REST'

Changing from fault to rear_fault as the development code has been changed.

https://gerrit.openbmc-project.xyz/#/c/4779


jruby: changes to make it possible to use in development environment

Motivation for this change
When attempting to run JRuby (in Linux), I encountered a number of issues:

running gem errored out with syntax error, unexpected tSTRING_BEG;
it was not possible to use the jruby package with the bundler and bundix packages, due to errors to do with missing attributes in the jruby derivation, and missing environment variables.

This pull request does the following:

Updates jruby to the latest version;
Removes unnecessary JAVA_HOME wrapping from some jruby executables, such as gem;
Adds the rubyEngine and gemPath attributes, required by gem packages (e.g. bundler);
Copies some GEM_PATH envvar magic from the ruby package;
Adds a ruby -> jruby symlink, so that /usr/bin/env ruby hashbangs get resolved correctly;
Fixes the bundix package to inherit its ruby runtime from bundler (otherwise bundler could be built with one ruby, and bundix with another);

These changes make it possible for me to create a development environment for jruby as follows:
myJRubyEnv = callPackage <nixpkgs/pkgs/development/interpreters/ruby/dev.nix> {
  ruby = jruby;
};

I haven't been able to run nox-review due to some errors to do with golang and GHC.  I am presuming that these are not errors caused by my patch.
Things done

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

[ ] NixOS
[ ] macOS
[x] Linux

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[x] Fits CONTRIBUTING.md.

Ok, I'll follow that practice in the future.  Sorry about that.

@zimbatim, I've just pushed up a revised set of changes.  Differences are:

version bump no longer present, as it has already happened via another PR;
added the passthru attribute, including the libDir as per your suggestion;
changed the gem/lib folders to use the version.libDir logic from ruby-version.nix, inline with what bundler does;
added a devEnv attribute to passthru, like the one in the MRI package.  This is accomplished by putting the derivation into a let clause, and using overrideAttrs.

Happy to make any further changes as required.

Awesome work, @asppsa! Let me know if you have any problems with bundlerEnv, and I'll try to help out where I can.


How can I initialize the example project with this envirnment?

flutter doctor --verbose
[√] Flutter (Channel stable, 3.10.6, on Microsoft Windows [版本 10.0.19045.3324], locale zh-CN)
    • Flutter version 3.10.6 on channel stable at C:\Users\wei\Desktop\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (10 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\wei\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: D:\as\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

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

[√] Visual Studio - develop for Windows (Visual Studio 生成工具 2019 16.11.26)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio 生成工具 2019 version 16.11.33529.622
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at D:\as
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.81.1)
    • VS Code at C:\Users\wei\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.72.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.19045.3324]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 116.0.5845.188
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 117.0.2045.31

[√] Network resources
    • All expected network resources are available.

• No issues found!

java version :
Java15
/path/to/project/example/android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

/path/to/project/example/android/build.gradle
buildscript {
    ext.kotlin_version = '1.6.10'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.0.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

then run /path/to/project/example by use AndroidStudio with an error occurred! :
Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Could not open settings generic class cache for settings file 'C:\Users\wei\Desktop\�½��ļ���\video_editor\example\android\settings.gradle' (C:\Users\wei\.gradle\caches\7.0.2\scripts\1mfgee3p4vadd9ws314yxiovt).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s

┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project's Gradle version is incompatible with the Java version that Flutter is using    │
│ for Gradle.                                                                                │
│                                                                                │
│ To fix this issue, first, check the Java version used by Flutter by running `flutter doctor      │
│ --verbose`.                                                                                │
│                                                                                │
│ Then, update the Gradle version specified in                                                     │
│ C:\Users\wei\Desktop\新建文件夹\video_editor\example\android\gradle\wrapper\gradle-wrapper.properties │
│ to be compatible with that Java version. See the link below for more information on compatible   │
│ Java/Gradle versions:                                                                            │
│ https://docs.gradle.org/current/userguide/compatibility.html#java                                │
│                                                                                │
│                                                                                │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘

If you want to help me discuss and solve my problem after seeing it, please leave comment below. ThANKs your kindness!

It seems you're using a Java version not supported by the Gradle release.
More info on how to fix it there -> https://stackoverflow.com/questions/75651945/bug-exception-in-phase-semantic-analysis-in-source-unit-buildscript-unsup


Donation, Herbarium — SQL -> AR/Arel

Remove Herbarium.primer (per @pellaea)
Rewrite Donation.donor_list in AR with a touch of Arel

Coverage increased (+0.01%) to 93.046% when pulling 5ffa03c450697fc0b492e4fc6b6cb997159b0e45 on nimmo-SQL-in-models-donation-herbarium into eb867d5cb837f6056aeffcea875f7a9dcd50d1bd on master.

These pasted snippets return identical results for me on the production
server.  Maybe you "accidentally" corrected something while pasting them
into the email?
On Fri, May 27, 2022 at 2:29 PM andrew nimmo @.***>
wrote:

@.**** commented on this pull request.
In app/models/herbarium.rb
https://github.com/MushroomObserver/mushroom-observer/pull/925#discussion_r883889604
:

def self.primer

result = ""
if User.current

 result = connection.select_values(%(

   SELECT DISTINCT h.name AS x

   FROM herbarium_records s, herbaria h, herbaria_curators c

   WHERE s.herbarium_id = h.id

   AND h.id = c.herbarium_id

   AND c.user_id = #{user_id}

   ORDER BY s.updated_at DESC

   LIMIT 100

 )).sort

end
result
end
def self.find_by_code_with_wildcards(str)

Note it's not actually missing the backtick before herbaria, I just
accidentally deleted it while pasting
SELECT DISTINCT herbaria.name
—
Reply to this email directly, view it on GitHub
https://github.com/MushroomObserver/mushroom-observer/pull/925#discussion_r883889604,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAYTNNOB7MHGOVUTBNU4CY3VMEICBANCNFSM5VXK4VAQ
.
You are receiving this because you were mentioned.Message ID:
@.***>


error: Found argument '--enable-raw-queries' which wasn't expected, or isn't valid in this context

I got into this strange state, where at the end I got the error message from the title which is strange. This is what I did:

Global prisma2 install of version preview023.
Create folder C:\Users\Jan\Documents\throwaway\albertoRepro
prisma2 init
updated the connection string to a discourse schema
then opened VS Code on the project where I did:

Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\Jan\Documents\throwaway\albertoRepro>prisma2 introspect
Introspecting based on datasource defined in prisma\schema.prisma …

✔ Wrote Prisma data model into prisma\schema.prisma in 1.68s

Run prisma2 generate to generate Prisma Client.

C:\Users\Jan\Documents\throwaway\albertoRepro>prisma2 generate
✔ Created ./package.json
yarn add v1.22.0
warning ..\..\package.json: No license field
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
warning Your current version of Yarn is out of date. The latest version is "1.22.4", while you're on "1.22.0".
success Saved 1 new dependency.
info Direct dependencies
└─<EMAIL_ADDRESS>info All dependencies
└─<EMAIL_ADDRESS>Done in 13.91s.
yarn add v1.22.0
warning ..\..\package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─<EMAIL_ADDRESS>info All dependencies
└─<EMAIL_ADDRESS>Done in 3.05s.

✔ Installed the @prisma/client and prisma2 packages in your project
✔ Generated Prisma Client to .\node_modules\@prisma\client in 1.28s

You can now start using Prisma Client in your code:

import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

Explore the full API: http://pris.ly/d/client

C:\Users\Jan\Documents\throwaway\albertoRepro>node test.js
C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\@prisma\client\index.js:39484
const dmmfString = '{"datamodel":{"enums":[],"models":[{"name":"api_keys","isEmbedded":false,"dbName":null,"fields":[{"name":"allowed_ips","kind":"scalar","dbNames":[],"isList":true,"isRequired":false,"isUnique":false,"isId":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"created_at","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"created_by_id","kind":"scalar","dbNames":[],"isList":false,"isRequired":false,"isUnique":false,"isId":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"hidden","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":false,"type":"Boolean","default":false,"isGenerated":false,"isUpdatedAt":false},{"name":"id","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":true,"type":"Int","d

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:720:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (C:\Users\Jan\Documents\throwaway\albertoRepro\test.js:2:26)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)

C:\Users\Jan\Documents\throwaway\albertoRepro>npm install prisma2@alpha
npm WARN deprecated<EMAIL_ADDRESS>request has been deprecated, see https://github.com/request/request/issues/3142

><EMAIL_ADDRESS>install C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
[sqlite3] Success: "C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\sqlite3\lib\binding\node-v72-win32-x64\node_sqlite3.node" is installed via remote

><EMAIL_ADDRESS>install C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\prisma2
> node download-build/index.js

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.

+<EMAIL_ADDRESS>added 113 packages from 101 contributors, updated 1 package and audited 164 packages in 27.418s
found 0 vulnerabilities

C:\Users\Jan\Documents\throwaway\albertoRepro>yarn prisma2 generate
yarn run v1.22.0
warning ..\..\package.json: No license field
$ C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\.bin\prisma2 generate
✔ Generated Prisma Client to .\node_modules\@prisma\client in 1.20s

You can now start using Prisma Client in your code:

import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

Explore the full API: http://pris.ly/d/client

Done in 2.70s.

C:\Users\Jan\Documents\throwaway\albertoRepro>npm install @prisma/client@alpha

><EMAIL_ADDRESS>postinstall C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\@prisma\client
> node scripts/postinstall.js

✔ Generated Prisma Client to .\node_modules\@prisma\client in 913ms

You can now start using Prisma Client in your code:

import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

Explore the full API: http://pris.ly/d/client

npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.

+<EMAIL_ADDRESS>updated 1 package in 15.729s

C:\Users\Jan\Documents\throwaway\albertoRepro>yarn prisma2 generate
yarn run v1.22.0
warning ..\..\package.json: No license field
$ C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\.bin\prisma2 generate
✔ Generated Prisma Client to .\node_modules\@prisma\client in 886ms

You can now start using Prisma Client in your code:

import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

Explore the full API: http://pris.ly/d/client

Done in 2.31s.

C:\Users\Jan\Documents\throwaway\albertoRepro>node test.js
C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\@prisma\client\index.js:60
const dmmfString = '{"datamodel":{"enums":[],"models":[{"name":"api_keys","isEmbedded":false,"dbName":null,"fields":[{"name":"allowed_ips","kind":"scalar","dbNames":[],"isList":true,"isRequired":false,"isUnique":false,"isId":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"created_at","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"created_by_id","kind":"scalar","dbNames":[],"isList":false,"isRequired":false,"isUnique":false,"isId":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"hidden","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":false,"type":"Boolean","default":false,"isGenerated":false,"isUpdatedAt":false},{"name":"id","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":true,"type":"Int","defa

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:720:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (C:\Users\Jan\Documents\throwaway\albertoRepro\test.js:2:26)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)

C:\Users\Jan\Documents\throwaway\albertoRepro>prisma2 introspect
Introspecting based on datasource defined in prisma\schema.prisma …

✔ Wrote Prisma data model into prisma\schema.prisma in 1.32s

Run prisma2 generate to generate Prisma Client.

C:\Users\Jan\Documents\throwaway\albertoRepro>npm install @prisma/client@latest prisma2@latest

><EMAIL_ADDRESS>install C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\prisma2
> node download-build/index.js

><EMAIL_ADDRESS>postinstall C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\@prisma\client
> node scripts/postinstall.js

✔ Generated Prisma Client to .\node_modules\@prisma\client in 1.33s

You can now start using Prisma Client in your code:

import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

Explore the full API: http://pris.ly/d/client

npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.

+<EMAIL_ADDRESS>+<EMAIL_ADDRESS>removed 113 packages, updated 2 packages and audited 2 packages in 15.084s
found 0 vulnerabilities

C:\Users\Jan\Documents\throwaway\albertoRepro>prisma2 introspect
Introspecting based on datasource defined in prisma\schema.prisma …

✔ Wrote Prisma data model into prisma\schema.prisma in 1.12s

Run prisma2 generate to generate Prisma Client.

C:\Users\Jan\Documents\throwaway\albertoRepro>prisma2 introspect
Introspecting based on datasource defined in prisma\schema.prisma …

✔ Wrote Prisma data model into prisma\schema.prisma in 1.57s

Run prisma2 generate to generate Prisma Client.

C:\Users\Jan\Documents\throwaway\albertoRepro>npm install @prisma/client@alpha prisma2@alpha
npm WARN deprecated<EMAIL_ADDRESS>request has been deprecated, see https://github.com/request/request/issues/3142

><EMAIL_ADDRESS>install C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
[sqlite3] Success: "C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\sqlite3\lib\binding\node-v72-win32-x64\node_sqlite3.node" is installed via remote

><EMAIL_ADDRESS>install C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\prisma2
> node download-build/index.js

><EMAIL_ADDRESS>postinstall C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\@prisma\client
> node scripts/postinstall.js

✔ Generated Prisma Client to .\node_modules\@prisma\client in 994ms

You can now start using Prisma Client in your code:

import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

Explore the full API: http://pris.ly/d/client

npm WARN<EMAIL_ADDRESS>No description
npm WARN<EMAIL_ADDRESS>No repository field.

+<EMAIL_ADDRESS>+<EMAIL_ADDRESS>added 113 packages from 101 contributors, updated 2 packages and audited 164 packages in 22.517s
found 0 vulnerabilities

C:\Users\Jan\Documents\throwaway\albertoRepro>node test.js
C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\@prisma\client\index.js:60
const dmmfString = '{"datamodel":{"enums":[],"models":[{"name":"api_keys","isEmbedded":false,"dbName":null,"fields":[{"name":"allowed_ips","kind":"scalar","dbNames":[],"isList":true,"isRequired":false,"isUnique":false,"isId":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"created_at","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":false,"type":"DateTime","isGenerated":false,"isUpdatedAt":false},{"name":"created_by_id","kind":"scalar","dbNames":[],"isList":false,"isRequired":false,"isUnique":false,"isId":false,"type":"Int","isGenerated":false,"isUpdatedAt":false},{"name":"hidden","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":false,"type":"Boolean","default":false,"isGenerated":false,"isUpdatedAt":false},{"name":"id","kind":"scalar","dbNames":[],"isList":false,"isRequired":true,"isUnique":false,"isId":true,"type":"Int","defa

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:720:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (C:\Users\Jan\Documents\throwaway\albertoRepro\test.js:2:26)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)

C:\Users\Jan\Documents\throwaway\albertoRepro>prisma2 generate
✔ Generated Prisma Client to .\node_modules\@prisma\client in 852ms

You can now start using Prisma Client in your code:

import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()

Explore the full API: http://pris.ly/d/client

C:\Users\Jan\Documents\throwaway\albertoRepro>node test.js
(node:24300) UnhandledPromiseRejectionWarning: Error:
Invalid `prisma.application_requests.findMany()` invocation in
C:\Users\Jan\Documents\throwaway\albertoRepro\test.js:6:29

error: Found argument '--enable-raw-queries' which wasn't expected, or isn't valid in this context
        Did you mean --enable_raw_queries?
USAGE:
    query-engine-windows.exe --enable_raw_queries
For more information try --help
    at PrismaClientFetcher.request (C:\Users\Jan\Documents\throwaway\albertoRepro\node_modules\@prisma\client\runtime\index.js:1:47328)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
(node:24300) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:24300) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I kind of assume this problem appeared because I ran prisma2 generate at the end instead of yarn prisma2 generate and so global install (preview023) and local install (alpha.883) got messed up?

Can you please share the contents of the test.js file? Without that I wasn't able to reproduce this.

See https://github.com/prisma/prisma-client-js/issues/559#issue-578630713, but the content does not matter at all as long as it runs any query that triggers the QE.

I am still unable to reproduce this. If you are still able to reproduce, I will add this to my list of things to test on windows.

Thanks a lot for reporting 🙏
This issue is fixed in the latest alpha version of @prisma/cli.
You can try it out with npm i -g @prisma/cli@alpha.
In case it’s not fixed for you - please let us know and we’ll reopen this issue!


Adding support for partial returns under context deadlines

Motivation
We'd like to support taking in a timeout/deadline at the request level and returning as many of the fields as we can within that deadline.
Initial investigations showed that if any resolvers take longer than the deadline then no data is returned.
Within the scope of this PR
We add the ability to return all fields that have completed if a context times out or is canceled.
Adding two test cases that verify behavior for context timing out as well as context cancellation.
Outside the scope of this PR

Extending this support to cover the synchronous code path. This currently only supports the async code path.
Add an error message that identifies which field timed out
Supporting context canceling properly for subscriptions

Misc
Additionally it looks like we've added support for building the response & returning it as soon as the context times out. Previously if we gave a context deadline but our resolvers did not respect it then we'd block until the http request is closed or the resolver returns, at which point we'd throw away the output & return an error.

It looks like the case where there is a timeout on a non-nullable field is not handled properly. I'll be adding tests for that and fixing it shortly.

This appears to introduce a race condition because modifying the out bytes.Buffer can happen before and after the waitgroup.Wait().
This means that to accomplish this we'd need more significant changes. I'll take a look at a reasonable path forward. If any maintainers have an opinion please let me know!

go test -race timeout_test.go is passing, but go test -race ./... is failing. Working on that.

go test -race ./... appeared to be failing erroneously due to insufficient separation between the timeout tests.
It doesn't look like there is any benchmarking code so I can't say definitely how much the locking & unlocking matters, but there should only be lock contention after a timeout has already occurred so I believe it is unlikely to matter in the happy case. Furthermore the lock is only acquired before performing tasks that are well timebounded (e.g. out.WriteString("{"))

Wondering, how does this interact with the opentracing library? This library has really nice out-of-the-box open tracing and one of those is that fields that error out are called out in open tracing. If we aren't doing that with this PR we're going to lose that visibility in jaeger traces.

Converting to draft because the following features are still not supported:

Adding an error when we haven't even started processing the field before the context deadline is exceeded.
Handling lists of fields properly

Other things that we don't support, but I wasn't going to include:

Handling context timeouts when running synchronously properly.

@pavelnikolov Apologies if this is just noise, but given the issues that cropped up above and the potential scope of necessary changes I was going to pause work on this until there is some guidance from you or another maintainer as to whether this change or a similar one could eventually get merged into master.
Obviously there are some outstanding issues and increasingly it's looking like there isn't a simple fix, I'd love to hear your thoughts as to whether this is a feature you'd like to have & directions as to how you'd like to accomplish it.
Thanks for all your work & cheers!
p.s. Please let me know if there is someone else that might have opinions on the matter! I pinged you because you were the last person to merge something, I couldn't find a maintainers document.

@pavelnikolov Appologies for the ping, but I'm currently trying to figure out whether I was going to put in the effort to fix all of the outstanding issues & get this working with the other parts (e.g. lists).
do you think that this feature & the general approach outlined in this PR is something you'd like to see merged?

Closing this as it has conflicts with master, hasn't pasted CR & we've found a work around.


Extreme Slow on Google Pixel 9 XL

Title: I am useing the normal Code as always with the newest version of the google_ml_kit_flutter package but the respons from the text ml kit is extreme slow. The barcode ml kit is working fast and fine.
To Reproduce
Steps to reproduce the behavior:

Use normal demo on Google Pixel 9 Pro Text ML Kit

Expected behavior
Faster Result instead 3-4 seconds delay even after the text is gone, text is getting scanned,.
Platform (please complete the following information):

OS: Android 14
Device: Google Pixel 9 Pro XL
Flutter/Dart Version:  Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64, locale de-DE)
Plugin version:
camera: ^0.11.0+2
google_mlkit_barcode_scanning: ^0.12.0
google_mlkit_text_recognition: ^0.13.0

Can someone reproduce the error?
Additional context
The Barcode Scanning works as exspected and the Imageformat or changing Camera from CameraX to Camera1 doesn't change something
Older Versions works as exspected:
google_mlkit_text_recognition: ^0.9.0
and google_mlkit_text_recognition: ^0.4.0

Maybe we need to update to the newest text reco kit version for android 16.0.1
https://developers.google.com/ml-kit/release-notes

Fixed in PR: https://github.com/flutter-ml/google_ml_kit_flutter/pull/671


Jerone/userscripts

Changes in this PR:

GitHub Comment Enhancer is deprecated and partly replaced by Github Reply Comments.
A few of my UserScripts that I consider popular:

Github Commit Diff - Adds button to show diff (or patch) file for commit.
Github News Feed Filter - Add filters for Github homepage news feed items.
Github Pull Request From Link - Make pull request branches linkable.
Github Pages Linker - Add a link to Github Pages (gh-pages) when available.

Fix TOC links.

Thanks for your input @jerone


Missing Linked Library: pthread

It looks like the library pthread is missing as a dependency from the CMakeLists.txt files. The module does not install unless it is added.
Without it, I see the error:
    /home/utils/binutils-2.37/bin/ld: CMakeFiles/pytimeloop_cpptest.dir/test-main.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
    /home/utils/binutils-2.37/bin/ld: /lib64/libpthread.so.0: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    gmake[2]: *** [cpp_tests/pytimeloop_cpptest] Error 1
    gmake[1]: *** [cpp_tests/CMakeFiles/pytimeloop_cpptest.dir/all] Error 2
    gmake: *** [all] Error 2

I haven't encountered this issue in my environment, though it makes sense. Could you try adding pthread to the cpp_tests/CMakeLists.txt:
target_link_libraries(pytimeloop_cpptest PRIVATE
    ${LIBTIMELOOP}
    config++
    yaml-cpp
    rt
    define_gterminate
    pytimeloop
    Threads::Threads)

and let me know if that fixes the issue? I can't test it on my own since I didn't encounter the problem.


Update timezone doc

Add some clarifications for timezone conversion edge cases.

I think this is looking great, but would love some input from somebody who actually uses the API frequently. @kamilkp or @IShotTheSheriff maybe?


Fix Typo in README.md

Just fixing a small typo in the README file.
No actual code change.

Thank you!


First take the modulo and then convert to int

Fixes #3296

Codecov Report

Merging #3297 (fd120a4) into master (f59aeb3) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #3297      +/-   ##
============================================
- Coverage     60.43%   60.38%   -0.06%
+ Complexity     4808     4805       -3
============================================
  Files           741      741
  Lines         20973    20973
  Branches       1923     1923
============================================
- Hits          12675    12664      -11
- Misses         7170     7180      +10
- Partials       1128     1129       +1

Impacted Files
Coverage Δ

...va/org/apache/shenyu/common/timer/TimingWheel.java
90.47% <100.00%> (ø)

...a/org/apache/shenyu/common/utils/VersionUtils.java
67.85% <0.00%> (-10.72%)
:arrow_down:

...rg/apache/shenyu/plugin/rewrite/RewritePlugin.java
50.00% <0.00%> (-5.56%)
:arrow_down:

...in/response/strategy/NettyClientMessageWriter.java
69.56% <0.00%> (-4.35%)
:arrow_down:

...henyu/plugin/grpc/resolver/ShenyuNameResolver.java
59.57% <0.00%> (-4.26%)
:arrow_down:

...he/shenyu/plugin/grpc/client/ShenyuGrpcClient.java
8.00% <0.00%> (-4.00%)
:arrow_down:

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 f59aeb3...fd120a4. Read the comment docs.


Feedback: analyze lock files in post-events, analyze manifest in pre-events

locks will spot if a dev-dependency has been introduced transitively

Implemented, will release after adding UTs


Type seats

Hello, how can type seats be shown, without actually be selected ("clicked"), but only with a changed background colour? Thanks.

At the moment the library does not allow it, but it's in the todo list:

Add 'static' mode where seat types are defined by default

I think I'll work on it when I have time, but first I need to complete the porting to typescript (branch feature/typescript).

I think this is a duplicate of #26. As I said there it's in the to-do list. I know it's been a while but when I have time I'll merge the typescript porting (which is almost complete) and work on it.

Oh well, I needed a solution very fast, so I changed the code and all works fine now. :D
When a seat is unclicked, it gets painted with the colour of its category (in your code it becomes green, which is the colour of "Reduced") and it is also deleted right away from the basket. Still, thanks for the response. :)))

Nice, happy to hear that! With some tweaks it's definitely possible.


data sources monthly digest email

Context
We have mailgun set up for the password reset workflow. We should use that to make a monthly email to anyone who chooses to subscribe. The logic should be to use all data sources from the API that are edited within the last month, but in the future we will have parameters—for example, people can subscribe to updates for a specific search of data sources.
Requirements

[ ] get an API key from PDAP
[ ] create a script which hits our API and sends a Mailgun email with the below contents
[ ] test the script with your own Mailgun API key (free)

when you submit, include the test results

[ ] PDAP staff will set up the automation with Jenkins, our pipeline
[ ] The script should use environment variables: SECRET_KEY for the API key and MAILGUN_KEY for Mailgun.

Email Contents

New data sources: number of rows
Updates to existing sources: number of rows
Number of agencies affected by new/updated sources: number of agencies
Explore the data at https://pdap.io/data

Email Recipients
<EMAIL_ADDRESS>Email Frequency
Monthly, on the first at 12pm (noon) ET.

Hello Josh, I am new to the project and saw this under good first issue. Can I contribute to this task?

Hi there @aaryauchamkeri ! Yes, that would be much appreciated. I tweaked the issue to contain more detail and I'm going to cc @maxachis to answer a couple questions:

I'm thinking the v2 API is ready for this, because the needs are basic; it might save some effort later. Would you agree?

based on the answer to this, could you please create an account so our fine volunteer has an API key? I don't think we have self-serve signup live anywhere yet.

Can this live in the main app repo? If so, where should it go? I assume since it's so small that's simplest.

@josh-chamberlain @aaryauchamkeri
Yes, I believe this can get started now! There are a few components to this as I envision it:

[ ] Either adding a new endpoint to get information on new and updated data sources, or tweaking the data-sources endpoint to be able to get the requisite information on desired filters.
[ ] Developing an automated script which calls that endpoint and then performs the requisite mailgun wizardry (this I believe is where @aaryauchamkeri can come in most readily)
[ ] Putting together the Jenkins components along with a list of subscribers.

@aaryauchamkeri and I can chit-chat in discord about setting them up with an API key (I can be found as PDAP Staff with a fun little goose as my profile picture).

@josh-chamberlain Now that we have it so that people can, in fact, subscribe to specific searches, is this issue still germane?

@maxachis hey, we skipped the MVP! nice.


Add 1fichier and Journal du geek and remove Vine

Adding 1fichier (hard) and Journal du Geek (easy) and removing Vive, finished in 2019 - https://en.wikipedia.org/wiki/Vine_(service)

Thanks for your contribution!


Fatal error on FindReplaceFilter on stepping

From a stroom user:

I'm getting FATAL findReplaceFilter errors on a non UTF-8 character (\u200e) that is included in some json. It is working perfectly up until line 2979, with many replaces prior then errors. I have tried increasing the bufferSize parameter, but it makes no difference.
It appears to be working during the actual full stream processing rather than stepping. Any ideas on why this is happening?

Yes, I'm only seeing the issue during stepping.
We've hunted around and can't find any error being logged in the APP/User logs.
The error itself in the UI is "Unable to decode a UTF-8 character starting at byte offset 4,797,245. Showing ten bytes at this offset: [8E   etc....
I have a findReplace filter dealing with this, but it seems to not be coping with the volume on stepping.

Fixed in 7.2.23


Create APIView Subscribe Switch

Subscribe switch needs to be added to right panel in APIView. Functionality should match old UI and send notifications to subscribed users.

https://github.com/Azure/azure-sdk-tools/pull/8886


Storage write from developer console not working on system user: "Requires a valid user ID"

Description
Cannot modify objects that belong to system user "00000000-0000-0000-0000-000000000000" using console UI it gives an error: "Requires a valid user ID".

Steps to Reproduce

Login and open Storage
2.Try to modify objects with system user
3."Requires a valid user ID" is displayed and no data is modified

Expected Result
Successfully modify object value.
Actual Result
"Requires a valid user ID" is displayed and no data is modified.
Context

Developer Console UI

Your Environment

Nakama: 2.5.0
Cockroach: 2.1.6
MacOS HighSierra 10.13.4

Thanks for reporting this! This is fixed in 56c495bac134e345118aea3b6808e94b6bd3e164 and will be part of the next release.


bump apprise package version - slack markdown fix

Creating this issue to track bumping the apprise package version after the next release because it fixes https://github.com/caronc/apprise/issues/721 which caused Slack markdown not to render properly.

Perfect as soon as caronc has a released version we can bump this!

A new release was created yesterday https://github.com/caronc/apprise/releases/tag/v1.2.0


Balancer plugin

Balance traffic across multiple URLs. Those URLs could be provided via context or static configuration.

Deprecated. Won't do for now.


st-copyout does not work well with powerline prompts

I tested it with fish and zsh, several prompts and themes like agnoster, powerlevel10k(doesn't work with both) but prompts without powerline fonts it works well.

The only thing that matters is that the leftmost element. Not the shell or anything else. It works for zsh for me---the issue is just is the prompt distinct enough and constant.
An example, in my system, the leftmost independent non-whitespace word is: [luke@core which the script will find and locate and there will nearly certainly be no false positives unless that exact sequence is in the output at the very beginning of a line.
But say I had a prompt with the exact time on the left, so [15:41:33 then some more stuff. In that case, the script wouldn't be able to find any similar lines so it wouldn't work. Same is true if you have your directory on the left and then cd somewhere else.
If you have simple PRs to make this script a little better, I'm open to them, but I'll go ahead and say that in order for this little function to work on every possible prompt is basically impossible as is (or at least too much work for me). As it is, it works with most simple prompts and should be shell-independent.
Of course some brighter idea for finding the prompt might come to someone.

you need to patch st , it has a patch for powerline fonts. the patch name is font2.
i just did patch it now to my new laptop


[DO NOT MERGE][benchmark] Modernize benchmark definitions

This is an experiment in writing benchmark definitions in a way that's friendlier to actual Swift programmers.

Replace struct BenchmarkInfo with a more helpful protocol Benchmark
Stop Capitalizing Function And Parameter Names, That's Not How Swift Code Looks

The potential benefit is that it becomes easier for contributors to develop new benchmarks -- no more weird language dialect.
The risk as I see it is either

perturbing existing benchmarks (if they get adapted to use protocol Benchmark), or
diverging benchmarking definitions into an old and a new syntax, adding to confusion (if existing benchmarks are kept as is).

The basic idea with protocol Benchmark is that instead of creating a bunch of top-level functions and static lets / vars, then registering things using:
  BenchmarkInfo(
    name: "AngryPhonebook.ASCII2.Small",
    runFunction: { angryPhonebook($0*10, ascii) },
    tags: t,
    setUpFunction: { blackHole(ascii) }),
  BenchmarkInfo(
    name: "AngryPhonebook.Strasse.Small",
    runFunction: { angryPhonebook($0, strasse) },
    tags: t,
    setUpFunction: { blackHole(strasse) }),

we'd define a custom struct:
struct AngryPhonebook: Benchmark {
  let name: String
  let input: [String]
  let factor: Int

  init(name: String, input: [String], factor: Int = 1) {
    self.name = name
    self.input = input
    self.factor = factor
  }

  var tags: Tags { [.validation, .api, .String] }

  func run(iterations: Int) {
    ...
  }
}

and simply register instances of it as individual benchmarks:
  AngryPhonebook(
    name: "AngryPhonebook.ASCII2.Small",
    input: ascii,
    factor: 10),
  AngryPhonebook(
    name: "AngryPhonebook.Strasse.Small",
    input: strasse),
  AngryPhonebook(
    name: "AngryPhonebook.Armenian.Small",
    input: armenian),
  AngryPhonebook(
    name: "AngryPhonebook.Cyrillic.Small",
    input: cyrillic),

This gets rid of the closure stuff, and encourages encapsulating the preprocessed input data in the struct itself, preventing the preprocessing from leaking into the measurement. Currently we need to remember to do this by manually triggering swift_onces in the setUpFunction -- this is much too tricky.

Cc @glessard @eeckstein @gottesmm What do you think?

I'm particularly worried that this would disturb -Onone performance.
@swift-ci benchmark

I like it. I look forward to the first benchmark output.

Performance (x86_64): -O

Regression
OLD
NEW
DELTA
RATIO

Ackermann
299
992
+231.8%
0.30x

DictionaryOfAnyHashableStrings_insert
2940
5572
+89.5%
0.53x (?)

DictionaryKeysContainsNative
21
26
+23.8%
0.81x (?)

DictionaryKeysContainsCocoa
27
31
+14.8%
0.87x (?)

Improvement
OLD
NEW
DELTA
RATIO

FlattenListFlatMap
6871
4745
-30.9%
1.45x (?)

String.data.Medium
113
98
-13.3%
1.15x (?)

String.data.LargeUnicode
118
108
-8.5%
1.09x (?)

RandomShuffleLCG2
480
448
-6.7%
1.07x (?)

OpenClose
45
42
-6.7%
1.07x (?)

Code size: -O

Regression
OLD
NEW
DELTA
RATIO

Ackermann.o
1828
2603
+42.4%
0.70x

AngryPhonebook.o
8951
11941
+33.4%
0.75x

main.o
52761
60416
+14.5%
0.87x

DriverUtils.o
117639
120287
+2.3%
0.98x

Improvement
OLD
NEW
DELTA
RATIO

TestsUtils.o
25435
24789
-2.5%
1.03x

Performance (x86_64): -Osize

Regression
OLD
NEW
DELTA
RATIO

Ackermann
251
1166
+364.5%
0.22x

FlattenListLoop
1629
2552
+56.7%
0.64x (?)

FlattenListFlatMap
4355
6135
+40.9%
0.71x (?)

PointerArithmetics
31400
37100
+18.2%
0.85x

ReversedDictionary2
315
371
+17.8%
0.85x

ReversedArray2
200
228
+14.0%
0.88x

ConvertFloatingPoint.MockFloat64Exactly
8
9
+12.5%
0.89x

DataCountSmall
28
31
+10.7%
0.90x (?)

BinaryFloatingPointPropertiesBinade
28
31
+10.7%
0.90x (?)

DataCreateEmpty
200
220
+10.0%
0.91x

CreateObjects
20
22
+10.0%
0.91x

DataSubscriptSmall
31
34
+9.7%
0.91x

DataCountMedium
31
34
+9.7%
0.91x (?)

FloatingPointPrinting_Float_description_uniform
4800
5200
+8.3%
0.92x (?)

Improvement
OLD
NEW
DELTA
RATIO

ProtocolDispatch
371
342
-7.8%
1.08x (?)

Code size: -Osize

Regression
OLD
NEW
DELTA
RATIO

Ackermann.o
1662
2622
+57.8%
0.63x

AngryPhonebook.o
8227
11696
+42.2%
0.70x

DriverUtils.o
111849
115377
+3.2%
0.97x

Improvement
OLD
NEW
DELTA
RATIO

main.o
48064
10504
-78.1%
4.58x

TestsUtils.o
19338
18500
-4.3%
1.05x

Performance (x86_64): -Onone

Regression
OLD
NEW
DELTA
RATIO

Ackermann
2479
3570
+44.0%
0.69x

LineSink.scalars.alpha
321
348
+8.4%
0.92x (?)

ObjectiveCBridgeStubToNSDateRef
4700
5080
+8.1%
0.93x (?)

Improvement
OLD
NEW
DELTA
RATIO

StringToDataLargeUnicode
7200
6100
-15.3%
1.18x (?)

StringToDataMedium
6700
6100
-9.0%
1.10x (?)

Code size: -swiftlibs

How to read the data
The tables contain differences in performance which are larger than 8% and
differences in code size which are larger than 1%.
If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.
Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

Ah, too bad. AngryPhonebook results weren't perturbed at all, which is encouraging, but Ackermann was, which is too bad. On top of it all, there are huge code size changes that likely prevent us from adapting existing benchmarks.

(None of this would matter if we compared the same benchmark code across compiler versions, but that's not we do things right now.)

Applying Swift naming conventions seems like a good idea whether or not we replace/augment BenchmarkInfo.
In #39336, I'm updating the entire benchmark suite to read a little bit more like regular Swift code.

@lorentey That looks great!
I'm in favor of converting all benchmarks to this new scheme. So that we can get rid of the old BenchmarkInfo.
The one-time code size changes don't matter.


Short call leakage mitigation (v3)

This is a rebase of #610 against master for v3. I had to leave out 0279499dd2d1bd5116b21443874c7e1c263e2135 because it caused deadlocks when combined with de171a9669948a8bb8982c962e7c1a331fb4514b. All the tests are passing and I have confirmed that it has fixed the issue I was seeing. I suspect Travis will fail because Blather needs a new release with EventMachine pinned back but we'll see.

Coverage increased (+0.02%) to 97.876% when pulling 42e3a06799a6f0f76755d3d8ad16e02df8ed7a91 on bugfix/ordered-event-dispatch into 6db768c4675246a60b116e69de20d352be8cc4b5 on master.

The coverage decrease seems to be a result of the JRuby failure. As for the failure itself, I initially thought it might be due to the old Nokogiri as I believe it is also responsible for the crashes I have seen when shutting down Adhearsion. I am unable to reproduce these tests failures locally though. The failures are clearly unrelated to the changes being made. Can we get this merged anyway? I don't have permission to do that.


Detecting ToSchema fails when behind a cfg_attr flag

Hi! :wave:
I'm playing around with this crate and ran into an issue where schemas (and I'm guessing paths) aren't detected when behind a cfg_attr flag. E.g:
Works:
#[derive(ToSchema)]
struct Todo {
  // ...
}

Doesn't work:
#[cfg_attr(feature = "openapi", derive(ToSchema))]
struct Todo {
  // ...
}

Essentially, my use case is to only generate the OpenAPI spec when writing it to a file in my CI step, and I don't want to have to compile all my utoipa macros when running the webserver normally.
Thanks for the library, it's really nice!

Oh, thinking about this more, since the detection is done via the macro I'm guessing it might run before the cfg flags are applied? And you probably wouldn't want to include Schemas behind said feature flag if they're switched off...

From this https://stackoverflow.com/a/42551386, it seems that #[cfg_attr(feature = "openapi", derive(ToSchema))] is the same as derive(ToSchema) if the openapi flag is enabled.
So it seems that procedural macros are executed before feature flags, and I can't really find a way to see which feature flags are enabled from within the macro.
There is probably a solution to this but I don't know how to fix it yet...

Also:
ToSchema detection fails also when the struct is contained in a macro. (For example bitflags macro)

I was about to submit an issue for this… guess I'm stuck like you 😕 Has anyone found a solution/workaround?

I think this is doable.
cfg_attr flag
We could add the struct like this:
#[cfg(feature = "feature name")]
path::to::struct

to the OpenApi macro.
for macros like bitflags
I think this is quit unsovable because we cannot expand the macro.

This could work to remove a struct from the spec, but this wouldn't remove the compile time cost of the macro I believe...

No the macro would take the same amount of time and resources regardless if a feature is active or not.
But AFAIK we cannot get whether a feature is activated or not from a macro.
So this would be inevitable.


Fix text_classification example fails on Python 3 (#5590)

Fix text_classification example fails on Python 3 #5590
I have confirmed that it runs fine on Python 2.7.12, 3.4.3, 3.6.4.

I've pushed the fix.
Can you review the change as is, or do I have to make another PR?

LGTM! I'll add a test for text_classification example in another PR.


Test with clinical risk KP fails because data source changes

FAIL test/integration/TRAPIv1.test.js (97.982 s)
● Testing endpoints › POST /v1/query with clinical risk kp query
expect(received).toHaveProperty(path)

Expected path: "MONDO:0005249"
Received path: []

Received value: {}

  69 |                 expect(response.body.message.knowledge_graph).toHaveProperty("nodes");
  70 |                 expect(response.body.message.knowledge_graph).toHaveProperty("edges");
> 71 |                 expect(response.body.message.knowledge_graph.nodes).toHaveProperty("MONDO:0005249")
     |                                                                     ^
  72 |             })
  73 |     })
  74 |

  at __test__/integration/TRAPIv1.test.js:71:69
  at Object.<anonymous> (__test__/integration/TRAPIv1.test.js:60:9)

Fixed in: https://github.com/biothings/BioThings_Explorer_TRAPI/pull/28


go: Use vendor directory

To allow building inside certain virtual environments, we use vendoring
to avoid the module cache in Go. Since 1.14, the existence of a vendor
directory is sufficient to trigger vendored builds.

/retest

/retest

/lgtm


Add CATS With Eirini Enabled to KubeCF CI

Is your feature request related to a problem? Please describe.
Currently, the KubeCF CI pipeline does not include CATS with Eirini enabled.
Describe the solution you'd like
I would like to have a clone of the original pipeline where the CATS with Eirini would be included and as soon as we reach a good level of confidence we should promote to the main pipeline.
Describe alternatives you've considered
N/A
Additional context
N/A

Needs https://github.com/SUSE/catapult/pull/241

Closing, duplicate of https://github.com/cloudfoundry-incubator/kubecf/issues/1007 (took me waay to much to find the correct card)


Refactor search dialog to a searchbar like in browsers and text editors

Refactor search dialog to a searchbar, like in browsers and text editors
Add Key bindings: Enter for navigating to the next match, Shift+Enter for navigating to the previous match, and ESC to exit searchbar.
If the user selected a note before opening the search dialog, use the lyric of the selection as the search word.
Show both the count of matches and the index of current match.

The icons come from https://github.com/microsoft/vscode-icons , which is under the MIT License.

I'll create this PR towards openutau official repo.


Lost all the configuration while switch language

Describe the bug
Switching lang TSX / Rust / C# is resetting all the config set
To Reproduce

Go to 'Using https://zed-themes.com/themes/new'
Fillout some variable in the settings on the left bar
Change the language in the menu

All the configuration is lost

Expected behavior
The colors should be preserved

@mardiros Thank you so much for taking the time to report this issue, a fix is now deployed 🙌🏻


Add tests for moderation feature

Changelogs
Frontend

Fix e2e tests for Create Post flow
Add e2e tests for Post moderation
Add e2e tests for Comment moderation

Backend

Fix existing service layer unit tests
Add new service layer unit tests for moderation api
Fix existing repository layer integration tests for api (mainly posts, comments, categories in the main DB)
Add new repository layer integration tests for moderation api
Implement backward pagination for getMany of moderation posts and moderation comments
Adjusted seed files to be more deterministic and suitable for testing
Make post/comment frequency configurable through the config.yml file.

It currently takes in a unit and a value:

unit: minutes/hours/days
value: number
example: { unit: days, value: 1 }  means run the cronjob once daily

Todos:

Implement server-side pagination in the moderation list pages (FE)
Remove requiredModerations field values from the FE and instead fetch it from the config.yml file
Possibly Prisma query optimizations such as excluding unused fields (BE)
Guard GraphQL resolvers using session (BE)
And other modifications relating to the new auth/session implementation...

Known issues:

Generated unit test for SupertokensService throwing an error (Something to do with the testing modules imports)
E2E test for Create Comment still fails (I've avoided from fixing this since there is a new FE interface for creating comments. Expected to be fixed once @Mingye1Li 's changes gets reviewed and merged)

@chrimyn234 some build errors. Please have a look.


Extractor Returns Unsuitable URLs

Using the Sample app, input the following url: https://vimeo.com/1373038 and set the quality to 'Best'. And click the 'Play' button. This happens:

What happens is the extractor does not take into account that some URLs may not be playable by iOS or OS X natively. Sometimes, the url may be a Flash video.

I fixed it with this commit: 8ff8242. However, I don't intend for it to be merged with the master branch as yet. I'm working on other things ;) This issue was simply created as a reference point for now.

Hi @SoneeJohn,
Indeed vimeo sometime returns an unplayable stream URL. I quickly reviewed what you are doing in your various branches and it looks awsome, specially the test suite - exactly what we needed for version 1.0.0.
I'll fully review your pull request as soon as i'll have some free time.
Thank you for your great work ! Regards

@lilfaf Thank you very much. It's a pleasure to help.

@lilfaf I just opened a pull request now :)


added courtney's picture

Description of Proposed Changes

Added Courtney's photos

Steps to Test
Outline the steps to test
git fetch --all
git checkout addPic

Check to make sure courtney's photos are added
Impacted Areas in Application
List general components of the application that this PR will affect:

Cohort.json

Mentions @username
Tag users that need to review this code
@Chewieez @john-dulaney

👍


trilium: 0.40.3 -> 0.40.5

Things done

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

[x] NixOS
[ ] macOS
[ ] other Linux distributions

[x] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[x] Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
[x] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Ensured that relevant documentation is up to date
[x] Fits CONTRIBUTING.md.

@GrahamcOfBorg build trilium-desktop
@GrahamcOfBorg build trilium-server
@GrahamcOfBorg test trilium-server


Refactor to View Controller instead of action sheet

I think it would be beneficial if, instead of an action sheet, we presented a view controller / window or something instead. It would allow for a nicer looking UI; Android has something similar for debugging and its cool. I just think that if we stick with action sheet and encourage people to add as many debug options as necessary, an action sheet will cease to be adequate.

Resolved with #21


[Bug] Cannot convert undefined or null to object

When I create a new crud (this happen also in official backpack crud) I see an error in console:
module?intranet=0:582  Uncaught TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at document.onreadystatechange (module?intranet=0:582:20)

If I inspect the error is related to the alerts.blade.php file located in theme-tabler, in particular this line:
Object.entries($alerts_from_php).forEach(function(type) {
    if (typeof $alerts_from_localstorage[type[0]] !== 'undefined') {
        type[1].forEach(function(msg) {
            $alerts_from_localstorage[type[0]].push(msg);
        });
    } else {
        $alerts_from_localstorage[type[0]] = type[1];
    }
});

Weird thing is that I doesn't seems to find this error in the backpack demo, maybe there is a missing configuration or something that I can't see?
Thanks.

Hello @cod3rshotout
Could you provide more information, please?
Can you send screenshots of errors and share versions?
php artisan backpack:version

Thanks.
Cheers.

alerts_from_php

The version is the latest, I fixed updating as:
if ($alerts_from_php && typeof $alerts_from_php === 'object') {
    Object.entries($alerts_from_php).forEach(function(type) {
        if (typeof $alerts_from_localstorage[type[0]] !== 'undefined') {
            type[1].forEach(function(msg) {
                $alerts_from_localstorage[type[0]].push(msg);
            });
        } else {
            $alerts_from_localstorage[type[0]] = type[1];
        }
    });
}

but I don't know if this is a correct solution though.

I've reproduced the error, will work on the fix 👍
Thanks @cod3rshotout

Thanks again @cod3rshotout
I've released the fix in our 3 themes, you should be able to get the fix with a composer update 👍
Cheers


Fix "ext_modules option must be an Extension instance" error

Fixes build error:
distutils.errors.DistutilsSetupError: each element of 'ext_modules' option must be an Extension instance or 2-tuple
I get this error if building the latest master branch in Debian testing.
Apparently, this can occur if distutils is loaded before loading setuptools. See:
https://stackoverflow.com/questions/21594925/error-each-element-of-ext-modules-option-must-be-an-extension-instance-or-2-t

Maintainer merge checklist

[ ] Title is descriptive/clear for inclusion in release notes.
[ ] Applied a Component: xxx label.
[ ] Applied the api-deprecation or api-break label.
[ ] Applied the release-highlight label to be highlighted in release notes.
[ ] Added to the milestone version it was merged into.
[ ] Unittests are included in PR.
[ ] Properly documented, including versionadded, versionchanged as needed.

Hi @duelafn !
Well, we will need to migrate away from distutils, soon or later as is deprecated with removal planned for Python 3.12 😅
Is this issue happening with a specific version of setuptools ?

I do remember that at some point the order of imports as it currently is was deliberate. I'm not sure if whatever the reason was is still relevant.

We're using setuptools 65.5.0 with python 3.10 (and experimentally with python 3.11). I could do some experiments with moving to setuptools, but I don't have a way to test all your build environments (#5275 suggests that there was once issues on Android).

🥇Thank you @duelafn for the report and the PR which helped us to force the switch to setuptools.
Unfortunately, I'm not able to reproduce your issue on both CI and local environments.
But:
I'm running some tests at https://github.com/kivy/kivy/pull/8070 (even on Android and iOS) and looks like we can get rid of some complexity and of distutils (which is deprecated).
setuptools docs says that setuptools should be now imported before any distutils import, if any of it is really required.
I guess that previously we needed to explicitly import distutils before setuptools as setuptools wasn't implementing a logic to fallback on distutils (the vendored one) when Cython is not available, for build_ext.

Fixed via #8070


[Txpool] Prune stale enqueued transactions in tick

Description
This PR fixes the txpool not handle any transaction when full of future transactions.
The attacker would yields large nonce transactions, send them to nodes, and finally make the whole network jammed. Most importantly, it won't cost any gas, since those transactions can't be executed.
We bring the pruning policy from Ethereum, which is simple and elegant enough for the use case.
Changes include

[x] Bugfix (non-breaking change that solves an issue)
[ ] Hotfix (change that solves an urgent issue, and requires immediate attention)
[ ] New feature (non-breaking change that adds functionality)
[ ] Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

[x] I have assigned this PR to myself
[x] I have added at least 1 reviewer
[x] I have added the relevant labels
[ ] I have updated the official documentation
[x] I have added sufficient documentation in code

Testing

[x] I have tested this code with the official test suite
[x] I have tested this code manually

Manual tests

Build local binary.
Run a dev node.

Set the pruning duration reasonable for debugging.
./dogechain server --data-dir ./test-chain-1 --jsonrpc :15002 --dev --promote-outdate-seconds 30 --prune-tick-seconds 10 --prometheus :9999

Run a txpool event subscriber.

./main txpool subscribe --added --enqueued --pruned-enqueued --pruned-promoted --dropped --demoted

Watch txpool metrics in web explorer.
Use MetaMask to send some future transactions and some promotable transactions.

Expect results

Several PRUNED_ENQUEUED events after 30 seconds or so.
The dogechain_txpool_enqueued_transactions and dogechain_txpool_pending_transactions gauge should be right on every moment.

Examples
metrics
# HELP dogechain_txpool_enqueued_transactions Enqueued transactions in the pool
# TYPE dogechain_txpool_enqueued_transactions gauge
dogechain_txpool_enqueued_transactions{chain_id="dogechain-DarianShawn"} 0
# HELP dogechain_txpool_pending_transactions Pending transactions in the pool
# TYPE dogechain_txpool_pending_transactions gauge
dogechain_txpool_pending_transactions{chain_id="dogechain-DarianShawn"} 0

events
[TXPOOL EVENT]
TYPE = ADDED
HASH = 0xd247e04de81b66d6424af6b5702348ae2471cfc7b74e19ab2396a7985c32a95b

[TXPOOL EVENT]
TYPE = ENQUEUED
HASH = 0xd247e04de81b66d6424af6b5702348ae2471cfc7b74e19ab2396a7985c32a95b

[TXPOOL EVENT]
TYPE = PRUNED_ENQUEUED
HASH = 0xd247e04de81b66d6424af6b5702348ae2471cfc7b74e19ab2396a7985c32a95b

Codecov Report

Merging #105 (8dd8801) into dev (287dcf0) will increase coverage by 0.05%.
The diff coverage is 80.43%.

@@            Coverage Diff             @@
##              dev     #105      +/-   ##
==========================================
+ Coverage   50.98%   51.03%   +0.05%
==========================================
  Files         111      111
  Lines       16331    16410      +79
==========================================
+ Hits         8326     8375      +49
- Misses       7278     7303      +25
- Partials      727      732       +5

Impacted Files
Coverage Δ

txpool/metrics.go
28.57% <40.00%> (+6.34%)
:arrow_up:

txpool/account.go
93.43% <84.00%> (-1.37%)
:arrow_down:

txpool/txpool.go
73.33% <85.96%> (+0.85%)
:arrow_up:

network/server_discovery.go
73.88% <0.00%> (-7.65%)
:arrow_down:

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 287dcf0...8dd8801. Read the comment docs.


Kubernetes Watch bug

The watch request dont include the ca.crt ?
Error watching kubernetes events: failed to create watch failed to make request: GET \"https://<IP_ADDRESS>:443/apis/extensions/v1beta1/ingresses?watch&resourceVersion=2445422\": Get https://<IP_ADDRESS>:443/apis/extensions/v1beta1/ingresses?resourceVersion=2445422&watch=: x509: certificate signed by unknown authority

can you reproduce that ? ( Kube 1.2.2 )
Logs -> http://pasted.co/18838070

+1, same issue.

There was a last-minute-introduced-bug... Sorry for that.


new-line character '' returns an error

YIELD 11 +             \
/* Multiple-line comment       \
Use backslash as line break.   \
*/ 12

why you use + operator? It's not a nGQL.

'' in nGQL is for new line.

"" in nGQL is a line break.

You don't need to '\n' , just press enter to break line in our editor.


TypeError: Cannot read property 'connect' of null, js engine: hermes

Description
TypeError: Cannot read property 'connect' of null, js engine: hermes
Or code:
  const Connect = () => {
    const socket = TcpSocket.default.createConnection(
      { host: "<IP_ADDRESS>", port: 6215 },
      () => {}
    );
  };

I used a Button event to call

Relevant information

OS
Android

react-native
0.72.6

react-native-tcp-socket
6.0.6

I hope to get an answer. Thank you very much.

I'm using React-Native without error, I was using expo, it's great!

How did you fix it? @XiaoSGentle

How did you fix it? @XiaoSGentle

Expo doesn't support the use of TCP, downgrading to a normal ReactNative project is fine

Same here, I'm not using expo


OidcConfigurationController not a issue

But a request for information on how OidcConfigurationController works in Northwind trader
any reference to articles would help, have had not much luck finding any
any other code snippets or application which use the above would help
Kind regards
Peter

Resolved this issue

Thank you for your interest in this project. This repository has been archived and is no longer actively maintained or supported. We appreciate your understanding. Feel free to explore the codebase and adapt it to your own needs if it serves as a useful reference. If you have any further questions or concerns, please refer to the README for more information.


Ito/swift3

this updates the Navigator URL scheme for Swift 3 and adds a convenience constructor for a single destination
it also removes the dependency on the ArcGIS Runtime SDK

@JoelWhitney FYI


Checking for internet connectivity not correctly working

When it is waiting for internet connection in the beginning of the scripts, it prints out something like this
Usage: ping [-y ....]
As far as I know, this indicates that the command is not used correctly

ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3`

Works for now


Draft: PoC for splitting up a value into multiple cookie payloads

Description
Second shot at a solution for #1311. This should also be seen as more of a RFC than a final pull request. Also, at the moment this only covers SAML.
With this PR, we create additional cookies without changing the Dashboards core code. Unfortunately, this required some not very nice workarounds:

Setting a cookie value and clearing a cookie is done via the raw hapi request's cookieAuth.set() method. The cookieAuth in turn comes from the hapi cookie plugin. The reason for doing this is that we don't have access to the response.state() method with which we'd normally set the cookie
https://github.com/opensearch-project/security-dashboards-plugin/pull/1352/files#diff-0558556cc54b27144ba1c7e6c85065a7c37563f400171438153a8faca97bd757R26

While it is possible to write a cookie without registering it with the hapi server first, this led to some problems with the cookie not being properly cleared. Hence, we opted for another not so nice workaround: We access the SessionStorage object to access the hapi server, and there we add the cookies
https://github.com/opensearch-project/security-dashboards-plugin/pull/1352/files#diff-94c1c398c7b3a2cd568a7ac3bfcd72dc48428eb1995613276a013be4413338c6R60

Additional info

~For this PoC we have just added two extra cookies. However, the quantity of extra cookies could be made configurable.~
~At the moment, the cookies are not encoded using "Iron". This could be changed in the cookie options though. We'd just have to make sure that we account for the extra space required when using Iron when splitting up the value into the cookies.~
~The names for the cookies are hardcoded as well. They use the cookie.name from the config, and appends 'saml_1' and 'saml_2'. This should probably be made configurable.~
The number of extra cookies to use is now configurable
The name of the extra cookies are now configurable. The extra cookies will use the configuration value as a prefix, and the append _1, _2 and so on, depending on how many cookies are used

Regarding the additional cookies
The number of extra cookies is configurable now, and defaults to 3. When splitting up the value we take the iron encoding into account, which adds considerably to the written cookie's size
The logic for that can be found here: https://github.com/opensearch-project/security-dashboards-plugin/pull/1352/files#diff-0558556cc54b27144ba1c7e6c85065a7c37563f400171438153a8faca97bd757R82

We assume that Iron adds around 50%
Based on that we try to split up the value, using as few extra cookies as possible
If we know, based on the length of the value to written and the number of configured extra cookies, that we won't have enough cookies to account for the 50% we try to write anyway, but we divide the value evenly between all available cookies. Based on the value, Iron sometimes adds less overhead.
I'm not sure if this is the best way, so I would appreciate your input on this.

Another caveat with having the number of extra cookies configurable would be if the administrators decrease that number, then existing cookies would not be read correctly.
To mitigate this, I guess we could store the maximum number of cookies used in the authHeaderValueExtra when the cookies are written.
But - I would wait for your feedback first, maybe you'd prefer not having the number of cookies configurable at all?
I could also give making the number of cookies completely dynamic based on the needed length another try.
The issue I ran in with this was that I wasn't able to delete the cookies if I did not register them with the Hapi server first.
Iron cookie size
I ran some tests on how much Iron adds to the final cookie size.
This is highly depending on the string, though. In my tests I added different roles to the token, and then compared.
For the SAML provided by @nibix both the compression and the Iron overhead were much better.

Roles
Original JWT
Compressed
Final Cookie
Iron overhead, ca
Comment

5
733
764
1260
+65%

10
839
844
1367
+62%

50
1679
1464
2199
+50%

100
2791
2264
3266
+44%

150
3923
3036
!!! >4096

Too large for the browser

200
5065
3808
!!! >4096

Too large for the browser

Test SAML payload
14096
2860
4055
+42%
Tested with the SAML test token from the issue

Still open

[x] Test error handling if the unsplit value is missing/corrupted.
We added checks to the isValidCookie method that will invalidate the cookie if the value is corrupted somehow, or if writing the cookies did not work.
While this improves the situation a bit, the user will still run into the "too many redirects" error if they have an active session with the IdP, which will then just redirect back the user to Dashboards. If the token still can't be written the redirecting will commence...

[x]  ~The getCookie for SAML needs to be changed before writing the authorization header value https://github.com/opensearch-project/security-dashboards-plugin/pull/1352/files#diff-94c1c398c7b3a2cd568a7ac3bfcd72dc48428eb1995613276a013be4413338c6R118~

Untested

[ ] Setting cookies after an authorization header was found. E.g. here: https://github.com/opensearch-project/security-dashboards-plugin/pull/1352/files#diff-d782daf5a30c26f91c0430ed18479194b9b562026646e440521516a3e4290651R173
[ ] The refresh token flow in Openid

Category
Bug fix
Why these changes are required?
Allow users with many roles to authenticate with SAML in Dashboards.
What is the old behavior before changes and new behavior after changes?
Such users could not log in into Dashboards.
Issues Resolved

#1311
#516

Testing

Unit testing
We still need some sample payloads to verify the effectiveness

Check List

[ ] New functionality includes testing
[ ] New functionality has been documented
[ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

In this POC the token is split into 2 parts. Can we pull in a library that supports N chunks so we can support a larger upper bound?

In this POC the token is split into 2 parts. Can we pull in a library that supports N chunks so we can support a larger upper bound?

Absolutely can do that. :-) But first we should decide whether this is the way to go, as it is also a tradeoff solution with advantages and disadvantages. If we decide that the disadvantages are too heavy, then we should abandon this solution and look for new ones.
Advantages of this solution:

Self-contained, just implemented inside of the security plugin

Disadvantages:

In order to achieve the multi-cookie approach, we need to by-pass Dashboards core APIs in order to be able work on the underlying Hapi APIs. From a sustainability pov, this might be not desirable. However, this might be acceptable if this is just regarded as a temporary solution.

Hi @jochen-kressin and @nibix,
Thank you for sharing this proof of concept. I understand your concerns about the downsides of this implementation, so was wondering if you had found any alternatives in your work that had fewer? Is there another option which would offer more long-term stability?
I think that this option seems promising as a workaround but it is hard to give a strong opinion without knowing the other options you are considering. Do you mind sharing?
Thank you

@scrawfor99
Well, if we do not want to bypass Dashboards core APIs, we would need to modify Dashboards core by itself. I cannot give more detail about how this might look in detail, as we also would first need to explore this. Also, we would need to get the Dashboards core team into the boat. I am just wondering whether that would make sense if it is supposed to be just a temporary solution.

Hi @nibix,
Thank you for following up. That clarifies things a bit more for me. I agree with you that a temporary workaround like this may be the best option if we are going to just roll things back. This option seems acceptable for now in light of the future development plans and the tradeoffs. I am in favor of seeing this option implemented.

For this PoC we have just added two extra cookies. However, the quantity of extra cookies could be made configurable.

Hi, @nibix and @jochen-kressin, thanks for sharing this PoC! I do have a general question about the above comment. Let's say if the user reduces the role to less than the size limitation of one cookie? Will we still have two cookies to store these roles?

Hi @RyanL1997,
At the moment, yes. However, the logic for splitting up the payload into two cookies could easily be changed.
If I'm not completely mistaken, Hapi cookies have two steps involved:

Register the cookie with the Hapi server. This adds the cookie name, and also any settings related to the cookie (ttl, encoding, domain etc.). This doesn't automatically add the cookie to the browser though (I would need to double check this, but I'm quite sure). Instead, this only tells Hapi to parse cookies found in the request's set-cookie header.
Set the cookie with the state(cookieName, value, settings?) method. This is where the cookie is actually written and stored in the browser.

So in this case we would always have two cookies registered (step 1 above), but if we change the writing logic to not always split up the payload into two cookies (in step 2 above), I believe only one cookie will be set in the browser.
If we do change this, we need to make sure to account for the encoding setting for the cookie (there is no encoding configured in this PR, but that may be changed to e.g. "Iron"). I.e. it's not enough to just check the token/payload size and call it a day - Iron may add ~30% or more to the size before the value is written, so the "splitting logic" should be aware of that.

Hi @jochen-kressin thank you for taking the time to write up this PR. Overall, I think things look really good. I left a few questions and comments to do due diligence and make sure I understood your changes. The only thing I would add is that it would be great if the final PR could include some unit and integration tests demonstrating the splitting and recombining process.
For example, you could mock a cookie, split it, and recombine it show to show the process is efficient.
Thank you for all your contributions!

Thanks for the review and comments!
Hopefully I answered most of your questions, and I also left a question or two of my own :)
Will try to add some definitely well needed tests!

As mentioned in the RFC by @jochen-kressin

The main questions going forward whether you would like the number of cookies to be configurable. There are some drawbacks to that, mainly related to if the customer changes the number of cookies.

We are currently retrieving the value for ExtraAuthStorageOptions.additionalCookies directly from the configuration.
The number of spilts done on the JWT Token gets lost on a configuration update.
If we also store this data while writing multiple cookies ( maybe as another cookie ), then we can derive the parameter ExtraAuthStorageOptions.additionalCookies every time while reading them. This will give the end user flexibility on changing the configuration as they desire.
The configuration can only be read while splitting and writing the cookie.
References
ExtraAuthStorageOptions.additionalCookies - Variable in PR used to denote the number of splits done to a cookie.

@jochen-kressin We are currently keeping the number of cookies configurable an are using it to generate the number of split cookies.
I can see from the implementation that we will use these many cookies irrespective of whether the underlying data requires it or not.
Can we use this configuration as a upper bound instead ? This will ensure that for users with small number of roles we don't end creating empty cookies.

@jochen-kressin We are currently keeping the number of cookies configurable an are using it to generate the number of split cookies.
I can see from the implementation that we will use these many cookies irrespective of whether the underlying data requires it or not.
Can we use this configuration as a upper bound instead ? This will ensure that for users with small number of roles we don't end creating empty cookies.

@anijain-Amazon Regarding "creating empty cookies". I added some info about the cookie creation here: https://github.com/opensearch-project/security-dashboards-plugin/pull/1352#issuecomment-1456912828
While we do register the cookie with Hapi, we don't really write them to the browser if they aren't needed.
The reason that we register the cookies with Hapi is that we then get the (iron) decoding "for free" within the request.
Otherwise we'd need to parse the cookies ourselves. Also doable, but that comes with another set of required changes :)

@jochen-kressin, just to double-check, what would the behavior be during an upgrade for users already logged-in with "old style" cookies in their browsers, when the next call goes out to the backend that now understands the "new style" of cookies? Would they get logged off and prompted to log back in? or would they see some kind of error? If it is the latter, it might make for a frustrating/confusing user experience.

@jochen-kressin, just to double-check, what would the behavior be during an upgrade for users already logged-in with "old style" cookies in their browsers, when the next call goes out to the backend that now understands the "new style" of cookies? Would they get logged off and prompted to log back in? or would they see some kind of error? If it is the latter, it might make for a frustrating/confusing user experience.

@davidlago I tested this again to make sure, and a cookie created before the upgrade would still be valid.
The communication with the backend hasn't changed - it is still handled by the authorization header. Only the way the authorization header is retrieved has been changed.
So it goes something like this:

SAML or OpenId handles the request
Their respective buildAuthHeaderFromCookie methods first checks if the cookie has the property authHeaderValueExtra.
If yes - the new style is used, meaning that we retrieve the actual value from the new cookies and then use that for the authorization header.
If no - we fall back to look for the "old" authHeaderValue in the cookie and builds the authorization header as it did before this change.

That remains until the session expires or the user actively logs in again, at which point they would receive the "new format" in the cookie.

@anijain-Amazon

If a user reduces the number of additionalCookies in SAML Config, then their older cookies won't work.

Can't this be just handled by documenting it? Generally, it seems a very seldom thing that an administrator would want to reduce the number of cookies registered in Hapi. I am not sure whether big efforts should be spent on handling this in the code.

Thanks @anijain-Amazon for pointing this out. It is a good reminder that we need to make sure we document this (I am tagging the team to take a look). At this point I'm inclined to proceed with these changes as-is and prioritize the remaining time until code freeze making sure we have good test coverage for them.

Created documentation issue here

Created documentation issue here

@davidlago Maybe this should be added to the documentation as well?
https://github.com/opensearch-project/security-dashboards-plugin/issues/1311#issuecomment-1474074780
In short, I needed to add the following to opensearch.yml for larger cookie payloads:
http.max_header_size: 16kb

I just pushed a few unit tests for the new methods.
I also added a couple of tests for OpenId and SAML authentication types to make sure that both the old authHeaderValue and the new authHeaderValueExtra work when building the auth header from the cookie.
If there are any more tests that you would like to see, or if I didn't manage to write the tests in a consistent style, please let me know.
I will continue with some manual testing for now. Other than that, I would consider the code complete until I hear something else from you.
The default number for additional cookies for both SAML and OpenId are set to 5 in the plugin's config schema definition.
This can easily be changed though.

@jochen-kressin @nibix Could you please elaborate a little bit more on why additionalCookies was considered as a dynamic configuration ? As per my understanding, this acts a upper bound on the maximum number of cookies that will used for splitting the JWT Token.
As mentioned earlier, accidentally changing this property can lead to a bad user experience on clusters with large user base. I understand that changing this will require some efforts and given that we are close to the deadline for 2.7 release, it will be hard to accommodate.
@jimishs @varunml Should we push forward the release for this feature OR accept the current limitation and only rely on documentation as a safeguard to protect against any mishaps caused by it ? Please provide your inputs.

@anijain-Amazon

Could you please elaborate a little bit more on why additionalCookies was considered as a dynamic configuration ? As per my understanding, this acts a upper bound on the maximum number of cookies that will used for splitting the JWT Token.

Under the hood of Dashboards there is Hapi and Statehood responsible for cookie handling. With these frameworks, all cookies need to be pre-registered. Thus, there will be always an upper bound for the number of cookies. Such a upper bound can only be overcome by fundamental changes to the implementation of Dashboards.
One thing that should be pointed out: The number of cookies registered in Statehood is not equal to the number of Cookies set in the browser. The browser will always only get as many cookies as necessary.
We chose 5 by default, as this seems to give quite a lot of headroom for credential sizes. However, experience shows that everything is possible "out there", so there might be extreme cases where this 5 is not sufficient - for these, there would be the option to increase the value.
Alternatively, we could increase the number of registered cookies to - say - 100 - and hope that there will be never such an extreme case in reality that would require more data. As only actually needed cookies are transmitted, this won't cause an overhead in network transmission - possibly only a slight overhead for parsing, which is however likely negligible.
In this scenario, we could remove the config option.
One more thing I would like to point out: IMHO, this should be only considered as a quick fix. There are more recommendable solutions for the issue, see here: https://github.com/opensearch-project/security-dashboards-plugin/issues/1311#issuecomment-1429863876 However, these take a bit more time to implement. However, I understood that the issue currently causes so much pain, that speed of solving this is important here.

As mentioned earlier, accidentally changing this property can lead to a bad user experience on clusters with large user base. I understand that changing this will require some efforts and given that we are close to the deadline for 2.7 release, it will be hard to accommodate.

I really have to say again: There are many options in dashboards.yml, which will cause bad user experience when they are accidentally changed.

@jochen-kressin we need DCO sign-off for two of your commits, please amend them:
Commit sha: [0ac9b72](https://github.com/opensearch-project/security-dashboards-plugin/pull/1352/commits/0ac9b72e63badd9fe98247cad4ae15356439ea8b), Author: Jochen Kressin, Committer: Jochen Kressin; The sign-off is missing.
Commit sha: [ab28308](https://github.com/opensearch-project/security-dashboards-plugin/pull/1352/commits/ab2830833b28ff233b91ab8ffdfc5dd1ee5c252c), Author: Jochen Kressin, Committer: Jochen Kressin; The sign-off is missing.

Thanks @anijain-Amazon and @nibix . Given this is an implementation detail, do we have to put this in the yml file? If we set a reasonable default in the code, then customers will not need to change it. The more settings we add in the yml file, there is room to break things and confuse the end user.

@jimishs

Thanks @anijain-Amazon and @nibix . Given this is an implementation detail, do we have to put this in the yml file? If we set a reasonable default in the code, then customers will not need to change it. The more settings we add in the yml file, there is room to break things and confuse the end user.

The default is 5; by default, this setting does not need to be in the dashboards.yml file.

@jochen-kressin: A quick look at the UT run seems like they are failing on linting issues. I'd recommend running the linter locally before submitting to expedite/reduce cycles.

@davidlago Sorry, I missed a couple of files for the linting. Will change.
Also, the SAML integration tests fail because they explicitly look for a given (2) amount of cookies.
I'll try to adjust accordingly, but I'm guessing this may become a bit flakey depending on the final token size.
Will take a look though, maybe I'm wrong :)

Codecov Report

Merging #1352 (e5da67c) into main (da7d1fe) will not change coverage.
The diff coverage is n/a.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@           Coverage Diff           @@
##             main    #1352   +/-   ##
=======================================
  Coverage   71.67%   71.67%
=======================================
  Files          88       88
  Lines        2037     2037
  Branches      277      277
=======================================
  Hits         1460     1460
  Misses        511      511
  Partials       66       66

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@nibix: @scrawfor99 found the issue and is working on a fix for it here, hopefully we'll close this soon.

can you pls share tentative release date for this change?

@cwperks @scrawfor99 Will be this added as part of 2.7 release or do we need to manually backport the same ?
Since, there was no label added before the PR was merged.

@anijain-Amazon This will be included in the 2.7 release. I have added the backport labels to this PR and the v2.7.0 label to the associated issue. The backport PRs will be merged before code freeze tomorrow.


data problem

I meet errors when I convert the data format using sparse_molecular_dataset.py, like this:
[02:21:06] Explicit valence for atom # 1 C, 5, is greater than permitted
[02:21:06] ERROR: Could not sanitize molecule ending on line 9097
[02:21:06] ERROR: Explicit valence for atom # 1 C, 5, is greater than permitted
[02:21:06] Explicit valence for atom # 1 C, 5, is greater than permitted
[02:21:06] ERROR: Could not sanitize molecule ending on line 35785
[02:21:06] ERROR: Explicit valence for atom # 1 C, 5, is greater than permitted
[02:21:06] Explicit valence for atom # 4 C, 5, is greater than permitted
[02:21:06] ERROR: Could not sanitize molecule ending on line 62866
[02:21:06] ERROR: Explicit valence for atom # 4 C, 5, is greater than permitted
[02:21:06] Explicit valence for atom # 2 C, 5, is greater than permitted
[02:21:06] ERROR: Could not sanitize molecule ending on line 66832

and finally, the error message is
Traceback (most recent call last):
  File "sparse_molecular_dataset.py", line 326, in <module>
    data.generate('data/gdb9.sdf', filters=lambda x: x.GetNumAtoms() <= 9)
  File "sparse_molecular_dataset.py", line 53, in generate
    self._generate_AX()
  File "sparse_molecular_dataset.py", line 127, in _generate_AX
    pr = ProgressBar(60, len(self.data))
  File "/home/zeyuwen/workspace/anaconda3/envs/tf/lib/python3.6/site-packages/progress_bar.py", line 113, in __init__
    self.title = title + ": "
TypeError: unsupported operand type(s) for +: 'int' and 'str'

Can you give me some advice?

Hi,
The first part is not an error, it is rdkit that throws warnings. while converting. You should ignore that.
For the second part, it seems that either you are calling the script from a different path or you have another progress bar installed. Indeed, the error is thrown from File "/home/zeyuwen/workspace/anaconda3/envs/tf/lib/python3.6/site-packages/progress_bar.py", line 113, in __init__ which MolGAN does not have dependencies from. I have my own progress bar in utils/progress_bar.py. You might solve this changing the name of the file and import it differently.
I hope this helps.

thanks a lot!!! I solved the problem.


Moving over microsite pages to devsite

Nothing crazy, just same old content just moving over.
cc @kaycebasques

Whoops!
There were 2 warnings that will prevent this PR from being merged. Please take a look, and either fix, or provide a justification for why they can't be fixed.
WARNINGS
src/content/en/tools/workbox/index.md#L6 - WF Tag wf_updated_on must be within the last 7 days.
src/content/en/tools/workbox/index.md - No wf_blink_components field found in metadata. Add if appropriate.

There were 2 warnings that will prevent this PR from being merged.
Please take a look, and either fix, or provide a justification for why they
can't be fixed.
WARNINGS
src/content/en/tools/workbox/index.md#L6
https://github.com/Google/WebFundamentals/blame/6dda031be552fff81c23e058d2d7aad0f4e35fa9/src/content/en/tools/workbox/index.md#L6

WF Tag wf_updated_on must be within the last 7 days.
src/content/en/tools/workbox/index.md
https://github.com/Google/WebFundamentals/blame/6dda031be552fff81c23e058d2d7aad0f4e35fa9/src/content/en/tools/workbox/index.md
No wf_blink_components field found in metadata. Add if appropriate.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/google/WebFundamentals/pull/5159#issuecomment-337055194,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAqo0pBJTPULrF_StloVfVViqpZNp97Jks5ss9CmgaJpZM4P7S6i
.

@gauntface - do you want me to wait for @addyosmani to approve before i merge?

@petele happy for you to merge whenever. This is just a copy of https://workboxjs.org