403 error using AWSAppSyncClient in lambda function created with CLI

I've setup a trigger function in Lambda on a DynamoDB stream using the CLI.  I'm trying to utilize the app-sync sdk within the function, but whenever I execute a query, I get:
there was an error with the story query ApolloError: Network error: Response not successful: Received status code 403

I have both cognito user pools and IAM setup on the API, and I have provided the Lambda function access to the API, all via the CLI.
I've read entirely too many issues, posts, docs etc trying to get this to work.  I'm hoping its something simple I'm missing.
Which Category is your question related to?
Amplify functions
Amplify CLI Version
4.17.1
What AWS Services are you utilizing?
Api
Auth
Storage
Analytics
Notifications
Function
Provide additional details e.g. code snippets
Here is how I am creating the client:
    const initialClient = new AWSAppSyncClient({
      url: process.env.API_STORY_GRAPHQLAPIENDPOINTOUTPUT,
      region: process.env.REGION,
      auth: {
        type: AUTH_TYPE.AWS_IAM,
        credentials: AWS.config.credentials,
      },
      disableOffline: true,
    });

Here is the call to the query itself
client
              .query({
                query: gql(getStory),
                variables: getStoryVariables,
                fetchPolicy: 'network-only',
              })
              .then(data => {
                console.log('result from story query', data);
              })
              .catch(e => {
                console.log('there was an error with the story query', e);
              })
              .finally(() => {
                resolve();
              });

It's the catch log that is showing the 403...
Here is the model I'm querying:
type Story @model
@key(name:"byCreatedAt", fields:["type", "createdAt"], queryField: "getStoriesByCreatedAt")
@auth (
  rules: [
    {allow: private}
    {allow: private, provider: iam, operations: [create, read, update, delete]}
  ]
)
{
  id: ID!
  type: String!
  title: String
  owner: String!
  createdAt: AWSDateTime!
  upVotes: Int!
  downVotes: Int!
  video: S3Object!
  thumbnail: S3Object!
  takes: [Take] @connection(keyName:"byStoryID", fields:["id"])
}

Here is the backend-config.json
{
    "auth": {
        "storyAuth": {
            "service": "Cognito",
            "providerPlugin": "awscloudformation",
            "dependsOn": []
        }
    },
    "storage": {
        "storyMedia": {
            "service": "S3",
            "providerPlugin": "awscloudformation"
        }
    },
    "api": {
        "story": {
            "service": "AppSync",
            "providerPlugin": "awscloudformation",
            "output": {
                "authConfig": {
                    "additionalAuthenticationProviders": [
                        {
                            "authenticationType": "AWS_IAM"
                        }
                    ],
                    "defaultAuthentication": {
                        "authenticationType": "AMAZON_COGNITO_USER_POOLS",
                        "userPoolConfig": {
                            "userPoolId": "authstoryAuth"
                        }
                    }
                }
            }
        }
    },
    "analytics": {
        "story": {
            "service": "Pinpoint",
            "providerPlugin": "awscloudformation"
        }
    },
    "notifications": {
        "story": {
            "service": "Pinpoint",
            "channels": [
                "APNS",
                "FCM"
            ]
        }
    },
    "function": {
        "notifyUsersOnNewContent": {
            "build": true,
            "providerPlugin": "awscloudformation",
            "service": "Lambda",
            "dependsOn": [
                {
                    "category": "api",
                    "resourceName": "story",
                    "attributes": [
                        "GraphQLAPIIdOutput",
                        "GraphQLAPIEndpointOutput"
                    ]
                }
            ]
        }
    }
}

Let me know if you need any other info...

of course, as soon as I ask all works.  Now if I only knew why...

This helped me out.
I forgot to specify the credentials when defining the client:
      auth: {
        type: AUTH_TYPE.AWS_IAM,
        credentials: AWS.config.credentials,
      },

This helped me out.
I forgot to specify the credentials when defining the client:
      auth: {
        type: AUTH_TYPE.AWS_IAM,
        credentials: AWS.config.credentials,
      },


[REQUEST] Add a torrent/magnet download button

Is your feature request related to a problem? Please describe.
I went to download a game that wasn't a repack, I ended up downloading dozens of optional languages and videos that I will never use, as we still don't have a way to choose this
Describe the solution you'd like
They could add a button to download the .torrent directly in the Downloads folder, so I can do this job manually in my magnets app.
Describe alternatives you've considered
.
Additional context
.

Seconded. This would also allow those users who don't want to put the gaming machine on a VPN to still be able to cover their asses by using a different client to obtain the data.

It would be quite useful if you could obtain the torrent file or the magnet of the game that is being downloaded, in case you want to use another service for the download, for example alldebrid.com

outdated by #633


Remix + Ganache - Cannot call one contract from another

I have an innocent looking contracts that work painlessly in Remix. Test contract can easily call Another if I use JavaScript VM in Remix.
I also have ganache-cli running on port 7454. If I connect Remix to ganache-cli, each of these contracts work well individually. But I cant call Another from Test. Remix console says transact to Test.send errored: VM Exception while processing transaction: revert
My contracts look like:
    pragma solidity 0.4.25;

    contract Another {
        uint public balance;
        function sendToAnother() public {
            balance += 10;
        }
    }

    contract Test {
        function send(address another) public {
            Another(another).sendToAnother();
        }
    }

Expected Behavior
The contract works as is in JavaScript VM and Ropsten (with Metamask) as expected. Also, individual contacts work with ganache-cli. Just calling one contract from another doesnt seem to work.
Current Behavior
transact to Test.send errored: VM Exception while processing transaction: revert
Possible Solution
NA
Steps to Reproduce (for bugs)

Put he given contract in Remix Editor
Run ganache-ui. It starts on port 7545
Run the SmartContract after setting the Environment to Web3 Provider
Deploy the Another Contract first
Deploy the Test Contract next
Call the method send() with address of Another contract

Your Environment

Version used ; ganache-ui 1.2.2, Solidity 0.5.0

Thanks David. If this is happening with everyone (unable to call one contract from another), then it’s a serious impediment, and should be given a higher priority. If this is a version incompatibility type issue, we can perhaps leave it on a medium priority.
For myself, I am currently manoeuvring by routing these inter-contract calls through my Dapp for development purposes.

I am facing the same problem :(

Yeah I just turned away from Ganache. Used Roosten test network directly.
On Tue, 19 Feb 2019 at 5:17 am, fbalwy<EMAIL_ADDRESS>wrote:

I am facing the same problem :(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/trufflesuite/ganache-core/issues/242#issuecomment-464833738,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJzPf9rTz1z0UCwn33K9TE_ySU-vujQ2ks5vOu5GgaJpZM4Y_rzk
.

@fbalwy, @anandamarsh this is caused by an out of gas error within the call to the nested contract (which bubbles up to the initial contract call and gets treated as a revert) and we are very close to releasing a beta with a fix for it. PR is here: https://github.com/trufflesuite/ganache-core/pull/292

It's been 25 days since labeling this issue as  priority-high. Any news about releasing a beta with a fix for this issue?

@fbalwy I'll finally be releasing the beta on Monday!

This should now be fixed in the latest beta tagged releases of ganache-cli and ganache-core.
This fix involved pretty significant code changes; check out the release notes for details.
We'd love it if you'd test this beta out to make sure things are good to go before we release to stable.
If you using ganache-cli, run:
npm install -g ganache-cli@beta

If you are using ganache-core, run:
npm install ganache-core@beta

Let us know if you discover any bugs with this new beta release! Thanks!


Can css be styleInjected  in library mode?

Is your feature request related to a problem? Please describe.
I'm using vite to build a library, and sometimes the library requires a dozen lines of simple styles. After building, a style.css file will be generated. But I think it is not necessary to generate two files, it may be enough to generate only one file. Is there any way to add style.css to the target js file?
The styleInject helper function is used in rollup and babel plug-ins. In iife/umd mode, the style is automatically injected when library loaded.

The same here

The same here

The problem is injecting the style assumes a DOM environment which will make the library SSR-incompatible.
If you only have minimal css, the easiest way is to simply use inline styles.

The problem is injecting the style assumes a DOM environment which will make the library SSR-incompatible.
If you only have minimal css, the easiest way is to simply use inline styles.

Generally, existing style libraries are used in a dom environment.
Now I am using ts/vite/preact/module less to build a library. If I use the inline style, then there is no way to use modular less.
Maybe you are right. It may be a better choice to directly use inline styles, but still hope to provide more library mode options.
Thanks for your reply.

Generally, existing style libraries are used in a dom environment.
Now I am using ts/vite/preact/module less to build a library. If I use the inline style, then there is no way to use modular less.
Maybe you are right. It may be a better choice to directly use inline styles, but still hope to provide more library mode options.
Thanks for your reply.

I know you already answered that assuming a DOM environment will make the library SSR-incompatible, but maybe it would be possible to provide an option for enabling inlining of the styles?
I have made a reproduction project showing a component being created in the ui-components project then after being built and installed in the separate project not including any styles. vite-library-style-repro
@yyx990803 how would you suggest making a library of components that can be included without importing a global styles.css, possibly including styles that are unneeded or clashing with other styles?

I know you already answered that assuming a DOM environment will make the library SSR-incompatible, but maybe it would be possible to provide an option for enabling inlining of the styles?
I have made a reproduction project showing a component being created in the ui-components project then after being built and installed in the separate project not including any styles. vite-library-style-repro
@yyx990803 how would you suggest making a library of components that can be included without importing a global styles.css, possibly including styles that are unneeded or clashing with other styles?

In pass, I use rollup build vue2 library, I found that the style will auto inject to

I've been running into this for the past week and pulling my hair out, as this is not a documented behavior. I was about to file an issue (repro: https://github.com/richardtallent/vite-bug-cssnotimported) and just came across this one.
Requiring non-SSR users to manually import a CSS file to get a component's default style to work is suboptimal DX, and an unfamiliar surprise for anyone accustomed to importing components under Vue 2.
Inline CSS is not a viable alternative, at least for a non-trivial component. Inline CSS also creates additional challenges for a user who wants to override the default style.
Is there a middle ground here to help developers who want to support the SSR use case, without making non-SSR users jump through an extra hoop to style each component they use?

@richardtallent Sharing my experience here, I moved to inline all CSS and moved all <template> into render function.
I was following this issue for over 2 weeks now, I was stumbled upon how to effectively inject style into the head. Effectively for DX, requiring the user to import style was suboptimal for my use case. By comparison Vue 2 was much easier to install for the users than Vue 3, so this was a no go for me.
My trivial library target SSR/SSG/SPA and is e2e tested on all 3 modes which makes it an extra headache to move to Vue 3 in Vite. There was also some quirks with head injected css for my use case so inlining style was not something I was entirely against. (In fact I wanted to for consistency sake.)
For inline CSS overriding, what I did to allow default style override is to explicitly state how to with ::v-deep and !important in the documentation. reference
.some-component ::v-deep(.v-hl-btn) {
  width: 8px !important;
}

Not all css can be inlined directly (pseduo, media query, '>' and many more), which require me to rewrite my entire component into render function. reference
export default defineComponent({
  render() {
    return h('div', {
      class: 'vue-horizontal',
      style: {
        position: 'relative',
        display: 'flex',
      }
    }, [...])
  }
})

I hope this helps anyone down this road.

Thanks @fuxingloh! This sounds like an interesting workaround, but I don't want to give up on writing idiomatic SFCs (with template and style blocks) and allowing users to override styles with standard CSS. However, I have bookmarked your component since I like how you've done your testing and I hope to learn from it!

I am using the style-inject now. I wonder if this problem has been solved? Eventually a css file will be generated, and the style code is also included in js.
import { computed, defineComponent, ref } from 'vue';
import { queryMedia } from '@convue-lib/utils';
import styleInject from 'style-inject';
import css from './index.less';

styleInject(css);

export default defineComponent({
  name: 'Container',
  props: {
    fuild: {
      type: Boolean,
      default: false,
    },
  },
  setup(props, { slots }) {
    const media = ref('');
    queryMedia((data: string) => (media.value = data));
    const className = computed(() => ({
      'convue-container': true,
      fuild: props.fuild,
      [media.value]: true,
    }));

    return () =>
{slots.default?.()}
;
  },
});

https://github.com/ziping-li/convue-lib/blob/master/packages/container/src/index.tsx

Inlining style won't work with the transition also. Requiring users to explicitly import the style is not really an option. Is there anything we can do to settle down this problem?

Any update on this issue?

@ziping-li @hiendv @aekasitt
I used a method similar to @ziping-li  to solve this thorny problem.
// index.ts entry point

import styleInject from 'style-inject'

styleInject('__STYLE_CSS__') // __STYLE_CSS__ is a placeholder pseudo code

// gulpfile.js build script file

const { readFileSync, rmSync, writeFileSync } = require('fs')

function readWriteFileSync(path, callback) {
    writeFileSync(path, callback(readFileSync(path, { encoding: 'utf8' })), { encoding: 'utf8' })
}

function readRemoveFileSync(path, callback) {
    callback(readFileSync(path, { encoding: 'utf8' }))
    rmSync(path, { force: true })
}

async function clean() {
    exec('rimraf ./dist ./coverage ./.eslintcache ./.stylelintcache')
}

async function build_library() {
    exec('tsc')
    exec('copyfiles -u 1 ./src/**/* ./dist') // copy style to tsc dist
    exec('vite build')

    readRemoveFileSync('./dist/style.css', css => {
        // __STYLE_CSS__ replace by style.css
        readWriteFileSync('./dist/library.umd.js', js => replace(js, '__STYLE_CSS__', css))
    })
}

exports.build = series(clean, build_library)

// package.json

{
    "scripts": {
        "build": "gulp build"
    }
}

+1 for this feature.

I encountered the same problem, css cannot be loaded correctly when building lib mode.
I created a plugin to temporarily solve this problem.
import fs from 'fs'
import { resolve } from 'path'
import type { ResolvedConfig, PluginOption } from 'vite'

const fileRegex = /\.(css)$/

const injectCode = (code: string) =>
  `function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(\`${code}\`)`
const template = `console.warn("__INJECT__")`

let viteConfig: ResolvedConfig
const css: string[] = []

export default function libInjectCss(): PluginOption {
  return {
    name: 'lib-inject-css',

    apply: 'build',

    configResolved(resolvedConfig: ResolvedConfig) {
      viteConfig = resolvedConfig
    },

    transform(code: string, id: string) {
      if (fileRegex.test(id)) {
        css.push(code)
        return {
          code: '',
        }
      }
      if (
        // @ts-ignore
        id.includes(viteConfig.build.lib.entry)
      ) {
        return {
          code: `${code}
          ${template}`,
        }
      }
      return null
    },

    async writeBundle(_: any, bundle: any) {
      for (const file of Object.entries(bundle)) {
        const { root } = viteConfig
        const outDir: string = viteConfig.build.outDir || 'dist'
        const fileName: string = file[0]
        const filePath: string = resolve(root, outDir, fileName)

        try {
          let data: string = fs.readFileSync(filePath, {
            encoding: 'utf8',
          })

          if (data.includes(template)) {
            data = data.replace(template, injectCode(css.join('\n')))
          }

          fs.writeFileSync(filePath, data)
        } catch (e) {
          console.error(e)
        }
      }
    },
  }
}

https://github.com/ohbug-org/ohbug-extension-feedback/blob/main/libInjectCss.ts

I encountered the same problem, css cannot be loaded correctly when building lib mode.
I created a plugin to temporarily solve this problem.
import fs from 'fs'
import { resolve } from 'path'
import type { ResolvedConfig, PluginOption } from 'vite'

const fileRegex = /\.(css)$/

const injectCode = (code: string) =>
  `function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(\`${code}\`)`
const template = `console.warn("__INJECT__")`

let viteConfig: ResolvedConfig
const css: string[] = []

export default function libInjectCss(): PluginOption {
  return {
    name: 'lib-inject-css',

    apply: 'build',

    configResolved(resolvedConfig: ResolvedConfig) {
      viteConfig = resolvedConfig
    },

    transform(code: string, id: string) {
      if (fileRegex.test(id)) {
        css.push(code)
        return {
          code: '',
        }
      }
      if (
        // @ts-ignore
        id.includes(viteConfig.build.lib.entry)
      ) {
        return {
          code: `${code}
          ${template}`,
        }
      }
      return null
    },

    async writeBundle(_: any, bundle: any) {
      for (const file of Object.entries(bundle)) {
        const { root } = viteConfig
        const outDir: string = viteConfig.build.outDir || 'dist'
        const fileName: string = file[0]
        const filePath: string = resolve(root, outDir, fileName)

        try {
          let data: string = fs.readFileSync(filePath, {
            encoding: 'utf8',
          })

          if (data.includes(template)) {
            data = data.replace(template, injectCode(css.join('\n')))
          }

          fs.writeFileSync(filePath, data)
        } catch (e) {
          console.error(e)
        }
      }
    },
  }
}

https://github.com/ohbug-org/ohbug-extension-feedback/blob/main/libInjectCss.ts

@chenyueban Hi, friend. I use your plugin in my lib code, and it doesn't work. Do I need  to add the code console.warn("__INJECT__") into my code? Thank you so much.

I encountered the same problem, css cannot be loaded correctly when building lib mode.
I created a plugin to temporarily solve this problem.
import fs from 'fs'
import { resolve } from 'path'
import type { ResolvedConfig, PluginOption } from 'vite'

const fileRegex = /\.(css)$/

const injectCode = (code: string) =>
  `function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(\`${code}\`)`
const template = `console.warn("__INJECT__")`

let viteConfig: ResolvedConfig
const css: string[] = []

export default function libInjectCss(): PluginOption {
  return {
    name: 'lib-inject-css',

    apply: 'build',

    configResolved(resolvedConfig: ResolvedConfig) {
      viteConfig = resolvedConfig
    },

    transform(code: string, id: string) {
      if (fileRegex.test(id)) {
        css.push(code)
        return {
          code: '',
        }
      }
      if (
        // @ts-ignore
        id.includes(viteConfig.build.lib.entry)
      ) {
        return {
          code: `${code}
          ${template}`,
        }
      }
      return null
    },

    async writeBundle(_: any, bundle: any) {
      for (const file of Object.entries(bundle)) {
        const { root } = viteConfig
        const outDir: string = viteConfig.build.outDir || 'dist'
        const fileName: string = file[0]
        const filePath: string = resolve(root, outDir, fileName)

        try {
          let data: string = fs.readFileSync(filePath, {
            encoding: 'utf8',
          })

          if (data.includes(template)) {
            data = data.replace(template, injectCode(css.join('\n')))
          }

          fs.writeFileSync(filePath, data)
        } catch (e) {
          console.error(e)
        }
      }
    },
  }
}

https://github.com/ohbug-org/ohbug-extension-feedback/blob/main/libInjectCss.ts

Is this the only way to do it? I think this is very hack - -.
Is there any other way, please? I see that rollup can directly output an esm file and include css.

I faced the same issue. I wrote a Vue composition function that injects scoped CSS from a string at runtime that uses the same approach as Kremling for React.
It is not a perfect solution, since I imagine the majority of Vue users would prefer to use the standard SFC

  )
}

I have no method to reference the moduled CSS class name.

I just spent hours converting my Vue library to work with Vite (because the rollup plugin for vue said it wasn't maintained anymore and to move to vite), only to realise at the very end when trying to use the package that no CSS gets included in the library and there's no way to fix it.
I don't think Vite should claim to have a library mode in the docs and talk about being able to build components libraries if it sneakily strips all the CSS.
It's not a nice surprise to arrive at after you've done a whole migration to using vite.

For me, it was also big surprise, but I can suggest a more or less compromise solution that can cover the main requirements from the UI Kit.
In a nutshell, you should do something like this:

use tsc to build your components to compile .ts files into .js with .d.ts;

then just copy (not by hand, of course, but by the power of Node JS) .vue sources to dist;

you can do the same with the scss global styles (which contains the reset of native browser styles, including fonts, etc.). Although you can build it, here as you wish;

debug and develop UI Kit components through Storybook;

if the main project is built by ViteJS, then you will face the problem of importing assets (importing fonts in style files, for example). This is solved like this:

import { defineConfig, searchForWorkspaceRoot } from 'vite'

let cwd = process.cwd()
export default defineConfig({
    server: {
        fs: {
            allow:[
                searchForWorkspaceRoot(cwd),
                path.resolve(cwd, '@ui-kit/dist')
            ]
        }
    }
})

I have not yet checked what is there with webpack.

then you will face the interesting task of implementing the  component if you want to embed icons in the UI Kit with a classic svg sprite. But this is also a solvable (already solved) problem. At the same time, you can make it beautiful and implement both support for icons from a set and custom ones from the project to which you connect your library of components.

PS1. Sorry, that I describe the solution only thesis. When I agree on the issue of publishing the source code, I will put together a small "UI Kit Template" with the solution to all this, which can be downloaded and adapted for yourself.
PS2. In fact, you can not wait for such a publication, but look towards the sources of [VitePress] (https://github.com/vuejs/vitepress). Evan and Kiaking solved this problem in much the same way.

I had some issues with the other plugin mentioned here to solve this issue so I built a simpler one. This is zero dependency and 39 LOC.
https://github.com/itsyjs/vite-css-inject
For minification or any other changes to the CSS just use Vite's built-in PostCSS pipeline.

I hope this plugin will be useful.
vite-plugin-style-inject

this  works in iife mode as well

While digging through Vite's cssPostPlugin() I noticed, that you need to set
{
	build: {
		cssCodeSplit: true,
		lib: {
			format: ['umd'],
		}
	}
}

in order for the styles to be injected into the chunk, see line 414 to line 456:
Unfortunately this currently only works with UMD modules.

It's weird that build-csscodesplit says

If you specify build.lib, build.cssCodeSplit will be false as default.

and it does work well.

This works in iife mode as well

hey, the libinjectcss solution was working for me perfectly, then suddenly it stopped and i have no idea why

In 3.0.8 and before it was possible to use cssCodeSplit: true with UMD library build output and have inlined CSS automatically.
After upgrading to 3.1.0 that functionality is gone, CSS is not inlined at all, there's not even a separate CSS file generated.

I need this feature.

+1 to this issue

I expect vite to implement this feature, too. This plugin supports inserting css into the top of head without outputting additional css files. I hope it will be helpful to you. @senojs/rollup-plugin-style-inject

For those who use Typescript in their project alongside a vite.config.ts:
You might try using this plugin, but you will most likely get the following error:
Error [ERR_REQUIRE_ESM]: require() of ES Module ...
Changing the format of vite.config.ts to vite.config.mts will fix the issue. At least for me it did.
PS: Good issue, I hope the Vite folks will resolve this soon.

I found this plugin https://www.npmjs.com/package/vite-plugin-css-injected-by-js
Looks like it does what we need

I found this plugin https://www.npmjs.com/package/vite-plugin-css-injected-by-js Looks like it does what we need

This plugin worked for me!!

Referring to the inspiration from the above students, I wrote a plug-in to solve this problem，the link address: https://www.npmjs.com/package/vite-plugin-lib-inject-style

I found this plugin https://www.npmjs.com/package/vite-plugin-css-injected-by-js Looks like it does what we need

It works for me too, and even with vite@4 :fire:
You can see my config here: https://github.com/LouisMazel/maz-ui/blob/3dba08e7e2ec0953675f23aec220188e2d4168c7/packages/lib/build/vite.config.ts
I build each components separately

+1 add this feature one day

+1 to adding this as feature also

i find a new method, without any plugin!
just define the format as "umd", then vite will automatically inject the css into js file.
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
// import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js' // 将css打包注入到js中，避免css文件单独加载

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), ],
  build: {
    rollupOptions:{
      input:{
        main: resolve(__dirname, 'src/main.ts'),
      },

      output:{
        entryFileNames: '[name].js',
        format: 'umd',
      }
    }
  }
})

As a library, we don't need to manually write code like document.createElement('script') to inject the style into the page, that isn't graceful.
Just inject one line like import './style.css' at the top of each chunk file, and then add '**/*.css' to the 'sideEffects' field in the package.json to avoid unexpected tree-shaking by the user's building tool.
So the main problem becomes to how do we know which style files are involved in one chunk file?, fortunately vite has injected viteMetadata property on each chunk file which help us work it out.
We can do some modifications on a generated chunk file by using plugin hook renderChunk and viteMetadata property as following:
{
  name: 'vite:inline-css',
  config(){
    return {
      build: {
        cssCodeSplit: true, // Don't forget to enable css code split, otherwise there's only one style.css
        lib: {
          formats: ['es'],
          // Multi-entry building configuration.
          entry: [
            'src/component-one/index.ts',
            'src/component-two/index.ts',
          ]
        }
      }
    }
  },
  renderChunk(code, chunk) {
    if (chunk.viteMetadata?.importedCss.size) {
      let result = code;
      // Inject the referenced style files at the top of the chunk.
      for (const cssName of chunk.viteMetadata!.importedCss) {
        let cssFilePath = path.relative(path.dirname(chunk.fileName), cssName);
        cssFilePath = cssFilePath.startsWith('.') ? cssFilePath : `./${cssFilePath}`;
        result = `import '${cssFilePath}';\n${result}`; // style inject
      }
      return result;
    }
  }
}

I made vite-plugin-lib-inject-css to solve this prolem. This plugin inject css at the top of each chunk file in lib mode using import statement like this:
// bundled js file, with import css at top (if any)
import './style.css';
// rest of the file
// ...

It delegates the task of how to handle these css files to the user's build tool. And here is an example shows that how should we config to create a multiple entry point component library, which can auto import styles and has out-of-box tree-shaking functionality:
// vite.config.ts
import { libInjectCss, scanEntries } from 'vite-plugin-lib-inject-css';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    libInjectCss(), // For a simple usage
    // Parameters are optional, which is only an alias, aim to make configs concise.
    libInjectCss({
      format: ['es'],
      entry: {
        index: 'src/index.ts', // Don't forget the main entry!
        button: 'src/components/button/index.ts',
        select: 'src/components/select/index.ts',
        // Uses with a similar directory structure.
        ...scanEntries([
          'src/components',
          'src/hooks',
        ])
      },
      rollupOptions: {
        output: {
          // Put chunk files at <output>/chunks
          chunkFileNames: 'chunks/[name].[hash].js',
          // Put chunk styles at <output>/styles
          assetFileNames: 'assets/[name][extname]',
        },
      },
    }),
  ],
})

I am building a simple design system and was running into this issue. Basically I have a few components I want to use in other applications that also have a bundler setup.
I guess I could just use tsc instead and leave the css module files untouched. But for me compiling the css modules fixes a compatibility issue when the package is consumed in both, environments that support named import for css modules and don't.
Importing one stylesheet to use the package would not be a big issue. And with vitejs-plugin-inject-css the css import can be injected into the package main file.
But by doing so every consumer would end up having all styles in the bundle even when only using some of the components.
To split up the css I tried preserveModules with cssCodeSplit but this just leads to a bunch of unassignable css files (https://github.com/vitejs/vite/issues/8057).
Ideally I would like to use @emosheeep solution vite-plugin-lib-inject-css together with preserveModules.

When rollupOptions.output.preserveModules is true, the association between a chunk and the css it referenced will lose for some reason, in which case style injection will be skipped.
@emosheeep Are you sure about this, what was the issue? I tried it and it did look like it does work.
I was accidentally using the deprecated rollupOptions.preserveModules instead of rollupOptions.output.preserveModules and saw that the imports your plugin injects were correct in my case.

I now use the plugin in combination with manualChunks to create a chunk for every module that is imported in the main file.
But beware, if one junk would import anything from another junk the css in the other chunk will also be imported.
And in the package.json the css imports might need to be declared as a side effect by setting sideEffect: '**/*.css to not get tree shaken downstream.
import { defineConfig } from 'vite'
import { resolve, dirname, sep } from 'path'
import react from '@vitejs/plugin-react'
import { libInjectCss } from 'vite-plugin-lib-inject-css'

const libEntryFile = resolve(__dirname, 'lib/main.ts');
const libEntryFileDir = dirname(libEntryFile);

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react({ jsxRuntime: 'classic' }),
    libInjectCss(),
  ],
  build: {
    lib: {
      entry: libEntryFile,
      formats: ['es'],
      fileName(format, entryName) {
        return ${entryName}.js
      }
    },
    rollupOptions: {
      external: ['react'],
      output: {
        assetFileNames: 'assets/[name]-[hash][extname]',
        manualChunks(id, { getModuleInfo }) {
          const entryModuleInfo = getModuleInfo(libEntryFile);
          const entryModuleImportedIds = entryModuleInfo.importedIds;
          if (entryModuleImportedIds.includes(id)) {
            return dirname(id).replace(libEntryFileDir + sep, '');
          }
        }
      },
    },
  },
})

Hey, I created a pr for this issue #13565.
Feel free to look into it.

I encountered the same problem, css cannot be loaded correctly when building lib mode.
I created a plugin to temporarily solve this problem.
import fs from 'fs'
import { resolve } from 'path'
import type { ResolvedConfig, PluginOption } from 'vite'

const fileRegex = /\.(css)$/

const injectCode = (code: string) =>
  `function styleInject(css,ref){if(ref===void 0){ref={}}var insertAt=ref.insertAt;if(!css||typeof document==="undefined"){return}var head=document.head||document.getElementsByTagName("head")[0];var style=document.createElement("style");style.type="text/css";if(insertAt==="top"){if(head.firstChild){head.insertBefore(style,head.firstChild)}else{head.appendChild(style)}}else{head.appendChild(style)}if(style.styleSheet){style.styleSheet.cssText=css}else{style.appendChild(document.createTextNode(css))}};styleInject(\`${code}\`)`
const template = `console.warn("__INJECT__")`

let viteConfig: ResolvedConfig
const css: string[] = []

export default function libInjectCss(): PluginOption {
  return {
    name: 'lib-inject-css',

    apply: 'build',

    configResolved(resolvedConfig: ResolvedConfig) {
      viteConfig = resolvedConfig
    },

    transform(code: string, id: string) {
      if (fileRegex.test(id)) {
        css.push(code)
        return {
          code: '',
        }
      }
      if (
        // @ts-ignore
        id.includes(viteConfig.build.lib.entry)
      ) {
        return {
          code: `${code}
          ${template}`,
        }
      }
      return null
    },

    async writeBundle(_: any, bundle: any) {
      for (const file of Object.entries(bundle)) {
        const { root } = viteConfig
        const outDir: string = viteConfig.build.outDir || 'dist'
        const fileName: string = file[0]
        const filePath: string = resolve(root, outDir, fileName)

        try {
          let data: string = fs.readFileSync(filePath, {
            encoding: 'utf8',
          })

          if (data.includes(template)) {
            data = data.replace(template, injectCode(css.join('\n')))
          }

          fs.writeFileSync(filePath, data)
        } catch (e) {
          console.error(e)
        }
      }
    },
  }
}

https://github.com/ohbug-org/ohbug-extension-feedback/blob/main/libInjectCss.ts

the id and the entry was different in windows.
use "resolve(id)" to compare with "resolve(viteConfig.build.lib.entry)" will be great.

If you only have minimal css, The easiest way to do use rollupOption configuration:
{
  rollupOption: {
    output: {
        intro: 'import "./style.css";',
    }
  }
}

If you only have minimal css, The easiest way to do use rollupOption configuration:

{

  rollupOption: {

    output: {

        intro: 'import "./style.css";',

    }

  }

}

hahahaha，can't believe it could be done in this way

If you only have minimal css, The easiest way to do use rollupOption configuration:
{
  rollupOption: {
    output: {
        intro: 'import "./style.css";',
    }
  }
}

You should probably also add ./style.css to the sideEffects field in your package.json

When building components using rollup in our project, we used https://www.npmjs.com/package/rollup-plugin-postcss - this automatically inject styles from Vue SFC into the head of the page (per component). Unfortunately, the above plugin does not work with Vite. We have several components that load asynchronously, the styles of these components should also load asynchronously.
Our library is used by an external client directly as a JS script on the external site, so importing styles at the top of the chunks is not an option, we have to inject them.
I haven't found any solution in the entire thread that would meet this condition, is it even possible?

Re: Using sideEffects in package.json
There's a lot of references to this, but AFAIK isn't this a Webpack-specific feature? I use Vite everywhere.

I am using vite with Vue to build a component library with multiple entry points (to enable imports like import { MyInput } from '@orgname/repo-name/inputs' as well as a global css import such as import '@orgname/repo-name/styles'; ). The existing solutions in this thread didn't exactly fit my needs, but between the solutions here and some help from ChatGPT, I was able to arrive at a working solution. It relies on the same mechanism as @emosheeep's npm package where css files are imported at the top of the generated .js files, so the consuming project must have a build process that supports such imports. The difference is that this solution keeps each component's CSS with its JS code while also allowing for a global stylesheet to be generated (for things like fonts that your library relies on). Defining the plugin this way also removes the need to rely on an external package. In particular, this is created with Vue SFC's in mind which use


More cleanups to Lt

This includes a deprecation of two properties that were probably intended to be private anyway,

Failure is #441


Add improved assertion library from folio

At the moment we're unopinionated about assertions, but, this is something we should probably bake in. One thing to consider would be Microsoft's folio/expect.
We would alias it, so users could import it like import { expect } from '@elastic/synthetics'
As-is, we rely on assert in examples, which is too minimal. While users can use any library, it's good to have one sanctioned one, especially for inline examples (where we should just provide expect.
@vigneshshanmugam @jahtalab @paulb-elastic would love your thoughts here

I agree we should make this easier with a more out of the box solution, and this seems a good choice (given the wider Framework’s association with Playwright/runner).  As the framework is still only in preview with potential breaking changes, would we want to hold off implementing this into Synthetics GA until it’s ready (users still have the freedom to use assertions like we document today, or add Folio or an alternative)?

It's important we do something prior to GA that users can depend on. assert is just not great, and I can't see a downside to this approach. We really want 95% of use cases to be able to be accomplished without external libraries IMHO. It will tighten our documentation, and let users focus on writing tests rather than choosing tools.

I agree with that the majority of use-case should be supported out of the box without an external lib.
Re. the breaking changes in folio, since we are exposing the methods from our library, we should be able to handle these changes as we keep up with folio releases.

Not sure if you are aware, Folio assertion (expect) uses the Jest's expect which is what we should be going for and its released as a standalone package - https://www.npmjs.com/package/expect.
Another cool thing is that we can also add our own matchers by extending the expect.extend - https://jestjs.io/docs/expect#expectextendmatchers and provide functionality like comparing steps screenshots or performance timing events values. Just thinking out load, we don't need it for the first phase.

+1 on just using Jest directly


Add skeletons to collections

When user opening collection, would be amazing to have a skeleton at

collection name
creator
analytics like items, owned, floor price volume traded 24h volume traded
items

https://kodadot.xyz/rmrk/collection/0E76E3AC15B4C1FA1E-FROST

Let me take a look

@yangwao Seems like the details above are already implemented.

Hey, skeletons are used when data is loading to the client to keep users' attention in place where data show up

pass issue to @roiLeo as I think that it's better to handle on his end with the necessary details further.

closed in #1147


hPa decimals

Thanks for your work; love it!
But how do I round the decimals for hPa using Pirateweather? When using yr.no or Swedish SMHI as provider, there are "normal" decimals...

Thanks for pointing this out (and using this service)! I thought I'd fixed this bug, but apparently not! Let me dig into it and see if I can't tease this one out for good.

Got it! Turns out that I fixed it (nothing fancy, just a python round() ) for currently and hourly conditions, but forgot about daily. It's updating now, so should work its way through the cache in about half an hour or so

Thank you for a fast reply! Great, dig when you have the time, and thanks for your effort!

Hi, same problem here. There is a solution?

That's weird- I thought I fixed this one, but clearly not!
What unit system are you using?

The unit system is metric

Ok, fixed this one for real this time! The values were rounded, but when they were multiplied by the units for the pressure, Python would sometimes have issues with the floating points, leading to this issue.
I added another rounding statement at the output step, so should be good to go here!
Sorry about this, and thanks again for bringing it to my attention

FYI: I'm just edited one line in "/config/custom_components/pirateweather/weather.py" file, and it works for me

Great point! It should be fixed on the back end with the last API update, but I like this solution too, since this integration does its own processing. Just pushed this commit: https://github.com/alexander0042/pirate-weather-ha/commit/2ead9649ec2439d8b6825bf1a25ede004e8063e5

Problem solved. Thank you very much!


Add npx op 'index_add'

Description
Forward for index_add.
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.

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

Changes

[ ] Feature1, tests, (and when applicable, API doc)
[ ] Feature2, tests, (and when applicable, API doc)

Comments

If this change is a backward incompatible change, why must this change be made.
Interesting edge cases to note here

Is it using the new FFI?

Related to #17823

It seems that this operation currently only supports floating type. In addition, it would be great if the data types of indices can be extended to np.ndarray instead of only tuple and list as
import mxnet as mx
a = mx.np.zeros((2,6))
val = mx.np.arange(6)
x = [1,0,0,0,0,0]
y = [0,2,3,4,0,1]
# indices = [list, list]
mx.npx.index_add(a, val, [x, y])
# indices = (list, list)
mx.npx.index_add(a, val, (x, y))
# indices = [np.ndarray, np.ndarray]
x = mx.np.array(x).astype('int32')
y = mx.np.array(y).astype('int32')
mx.npx.index_add(a, val, [x, y])

>>> MXNetError: MXNetError: Invalid Parameter format for ind expect tuple of <Shape(tuple)>
but value='[array([1, 0, 0, 0, 0, 0], dtype=int32), array([0, 2, 3, 4, 0, 1], dtype=int32)]', in
operator _npx_index_add(name="", ind="[array([1, 0, 0, 0, 0, 0], dtype=int32), array([0, 2, 3, 4, 0, 1], dtype=int32)]")

For npx.index_add(a, ind, val), now it supports int32 or int64 tensor ind, and both int or float tensor  a and val. But it requires the dtype of 'a' and 'val' keep same.

LGTM overall. Needs to fix the CudaMalloc + cudaFree.

@mxnet-bot run ci [unix-gpu, windows-cpu, windows-gpu]

run ci [unix-gpu, unix-cpu, centos-gpu]

@mxnet-bot run ci [unix-gpu, unix-cpu, centos-gpu]

@mxnet-bot run ci [centos-gpu] [unix-cpu] [unix-gpu] [windows-cpu] [windows-gpu]

@mxnet-bot run ci [unix-cpu, unix-gpu, windows-cpu, windows-gpu]

Thanks @JiangZhaoh , this is merged.


Can't import vue-tabs-component

Hello, when I'm trying to import library: import Tabs from 'vue-tabs-component';
I see, Error: Cannot find module '../expiringStorage' from ...
What could be the problem?

+1

+1
Using Browserify, Vueify, and Babelify.  If that gives a hint.  Bummer, this component is dead in the water if it won't compile in my project.

I have no experience with module resolution in browserify. Can anyone tell me what causes this?

I wish I knew more about it.  I googled a bit and found this interesting bit:
https://github.com/browserify/browserify/issues/1310#issuecomment-113143686
Appears it could be addressed with this tweak to the Browserify config. But I haven't had time to test this out.

Hello, someone has a result about this bug ? i'm on it and i'm stuck on it ...

[17:03:30] gulp-notify: [Compile Error] Error: Cannot find module './components/Tabs' from [localpath]\client\node_modules\vue-tabs-component\dist'

[17:03:30] gulp-notify: [Compile Error] Error: Cannot find module './components/Tab' from '[localpath]\client\node_modules\vue-tabs-component\dist'

[17:03:30] gulp-notify: [Compile Error] Error: Cannot find module '../expiringStorage' from '[localpath]\client\node_modules\vue-tabs-component\dist'

I'm using browserify, but i'm a newbies of that ... if anyone has an idea.
thanks a lot, bests regards all


Include non-ASCII character in integration test folder path

This is to shake out more issues where encoding might not be handled properly.
There are a few changes:

Instead of tmp/test files use tmp/teșt files (see https://www.compart.com/en/unicode/U+0219). Unless the test is marked with @DoesNotSupportNonAsciiPaths, in which case we use the old test files folder. We have two such tests:

Checkstyle fails because of this bug: https://github.com/checkstyle/checkstyle/issues/13012
Our Java 6 wrapper tests fail because Java 6 barfs at our "s with a comma" character 🤷

URIs are now converted to strings using toASCIIString() instead of toString(). This is the canonical form of a URI, and is the intended way to go when the string form is passed to places where we can't ensure that it will be read with the right encoding. (See https://www.w3.org/Addressing/URL/3_URI_Choices.html)
An ArchUnit test has been added to make sure we don't accidentally use URI.toString().
The LANG, LANGUAGE and LC_* (including LC_ALL) environment variables are now passed to worker API daemon processes on Unix. This fixes a problem where on Linux worker daemons would try to access the file system with the default ASCII encoding.
Fixed a few path escaping errors.

Currently, the following commands are supported:
@bot-gradle test <BuildTrigger1> <BuildTrigger2> ... <BuildTriggerN>

A trigger is a special build for this PR on TeamCity, common triggers are:

SanityCheck/CompileAll/QuickFeedbackLinux/QuickFeedback/PullRequestFeedback/ReadyForNightly/ReadyForRelease
Shortcuts: SC/CA/QFL/QF/PRF/RFN/RFR
Specific builds:

BD: BuildDistributions/BuildDocs so that you can preview the generated docs/distribution.
PT: PerformanceTest, all performance tests for Ready For Nightly stage.
APT: AllPerformanceTest, all performance tests, including slow performance tests.
AST: AllSmokeTestsPullRequestFeedback
AFT: AllFunctionalTestsPullRequestFeedback
ASB: AllSpecificBuildsPullRequestFeedback
ACC: AllConfigCacheTestsPullRequestFeedback
ACT: AllCrossVersionTestsReadyForNightly
AFTN: AllFunctionalTestsReadyForNightly
ACTR: AllCrossVersionTestsReadyForRelease
AFTR: AllFunctionalTestsReadyForRelease

@bot-gradle test and merge

queues this PR for testing and merges if all tests pass by:

Creating a merge commit from your PR branch HEAD and the target branch
Running a ReadyForNightly build against the merge commit
When it passes, fast-forward the target branch to this merge commit (i.e. merge the PR)

The merge commit is called a pre-tested commit, which means that it fully tests the integration
of your branch HEAD and latest master, instead of only testing your branch HEAD.
@bot-gradle cherrypick to <branch>

Cherrypicks the current PR to another branch.
A new PR will be created and a build will triggered automatically if there is no conflict.

@bot-gradle cancel

cancel a running pre-tested commit build or remove it from queue

@bot-gradle clean

clear the conversation history

@bot-gradle help

display this message

To run a command, simply submit a comment.  For detailed instructions see here.

@bot-gradle test QF please.

I've triggered the following builds for you:

QuickFeedback build

@bot-gradle test AFT please.

@bot-gradle test RFN please.

I've triggered the following builds for you:

ReadyForNightly build

@bot-gradle test this please.

I've triggered the following builds for you:

PullRequestFeedback build

@bot-gradle test this please.

@bot-gradle test QF please.

I've triggered the following builds for you:

QuickFeedback build

@bot-gradle test this please.

I've triggered the following builds for you:

PullRequestFeedback build

@bot-gradle test RFN

I've triggered the following builds for you:

ReadyForNightly build

@bot-gradle test APT

I've triggered the following builds for you:

AllPerformanceTestsReadyForRelease build

I switched from ș (s with comma under) to ŝ (s with circumflex) on the suggestion of @blindpirate that it's easier to distinguish from the regular s.

What is then correct way to transform URI to a string and then back from a string to URI (e.g. for serialization)?

Using toASCIIString() gives you a canonical string representation of the URI. It's also the variant that works best when passing it to external consumers we can't trust with using the right encoding, as described here: https://www.w3.org/Addressing/URL/3_URI_Choices.html.

I've triggered a build for you. Click here to see all failures if there's any.

Pre-tested commit build failed. Click here to see all build failures.

@bot-gradle test and merge please.

Your PR is queued. See the queue page for details.

I've triggered a build for you. Click here to see all failures if there's any.


fix(idempotency): prevent persist idempotency data when the idempotency key is missing.

Issue number: #2465
Summary
Changes
This PR addresses the issue where idempotency data could be inadvertently persisted when the corresponding idempotency key is missing. This fix prevents any potential inconsistencies or undesired outcomes that may occur due to missing idempotency keys.
User experience

Please share what the user experience looks like before and after this change

Checklist
If your change doesn't seem to apply, please leave them unchecked.

[x] Meet tenets criteria
[x] I have performed a self-review of this change
[x] Changes have been tested
[x] Changes are documented
[x] PR title follows conventional commit semantics

Is this a breaking change?
RFC issue number:
Checklist:

[ ] Migration process documented
[ ] Implement warnings (if it can live side by side)

Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

Codecov Report
Patch coverage: 73.68% and project coverage change: -0.12 :warning:

Comparison is base (80dfdd0) 97.22% compared to head (61bb0d7) 97.10%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2477      +/-   ##
===========================================
- Coverage    97.22%   97.10%   -0.12%
===========================================
  Files          157      157
  Lines         7306     7317      +11
  Branches       523      514       -9
===========================================
+ Hits          7103     7105       +2
- Misses         158      161       +3
- Partials        45       51       +6

Impacted Files
Coverage Δ

...ws_lambda_powertools/utilities/idempotency/base.py
98.66% <66.66%> (-1.34%)
:arrow_down:

...wertools/utilities/idempotency/persistence/base.py
97.15% <75.00%> (-2.24%)
:arrow_down:

... and 4 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

looking

LGTM, sending an E2E test to be triple sure


[spin-operator] Quickstart Guide: error when creating "config/samples/shim-executor.yaml"

When following the spin-operator quickstart guide, I hit this error on the last step:
><> kubectl apply -f config/samples/shim-executor.yaml
Error from server (InternalError): error when creating "config/samples/shim-executor.yaml": Internal error occurred: failed calling webhook "mspinappexecutor.kb.io": failed to call webhook: Post "[https://spin-operator-webhook-service.spin-operator-system.svc:443/mutate-core-spinoperator-dev-v1-spinappexecutor?timeout=10s](https://spin-operator-webhook-service.spin-operator-system.svc/mutate-core-spinoperator-dev-v1-spinappexecutor?timeout=10s)": no endpoints available for service "spin-operator-webhook-service"

After a short period of time, I re-ran the command and it worked. However I did want to point it out that it was something I saw while copying and pasting the commands in the guide.

I'm not hitting that specific error, but when I copied and pasted the commands as fast as the terminal would allow, the installation failed during the helm install step:
><> # Install Spin Operator with Helm
helm install spin-operator \
  --namespace spin-operator \
  --create-namespace \
  --version 0.0.2 \
  --wait \
  oci://ghcr.io/spinkube/charts/spin-operator
Pulled: ghcr.io/spinkube/charts/spin-operator:0.0.2
Digest: sha256:1b26618e7a2ca08cf9a2db6061fdf6e6d61f6846c4eb0d4534261ee822a7894d
Error: INSTALLATION FAILED: 2 errors occurred:
        * Internal error occurred: failed calling webhook "webhook.cert-manager.io": failed to call webhook: Post "https://cert-manager-webhook.cert-manager.svc:443/validate?timeout=30s": no endpoints available for service "cert-manager-webhook"
        * Internal error occurred: failed calling webhook "webhook.cert-manager.io": failed to call webhook: Post "https://cert-manager-webhook.cert-manager.svc:443/validate?timeout=30s": no endpoints available for service "cert-manager-webhook"

After uninstalling and reinstalling the chart (and the shim executor), the process succeeded.

fixed in https://github.com/spinkube/documentation/pull/179


load script file from git repository

also add an api for webhook

for future design , it should not only support github;


Add new features

Adds bold and italic highlight(cripples bullet item '*' as it highlights whole line, otherwise nothing), tables now show each other column with a different color. Add 'w' to keyword highlighting for stuff such as ':width:'. Correct the language name in title. Change colors to more style-friendly(dark styles mainly) and eye-friendly.

Thanks you for the pull request. :)


BlockingRule: Clarify name of sql property

Type of PR

[ ] BUG
[ ] FEAT
[x] MAINT
[ ] DOC

Summary
This PR attempts to clarify the BlockingRule class.  It is a step towards enabling ExplodingBlockingRules
It will be the first in a set of three PRs which incrementally add clarifications.
Clarify name of sql property
🤔 Previously BlockingRule had a sql property which was unused, and a property called blocking_rule which returned the sql.  The later was confusing: did it return a BlockingRule or a sql string?.
Solution: There's now a single property called blocking_rule_sql
Blocking rule init argument allowed blocking_rule to be BlockingRule, dict or str
🤔 This made the code hard to read/unpredictable code because types were unclear
Solution It's now a string only
Clarify name methos
🤔 Previously BlockingRule had a sql property and_not_preceding_rules_sql(self).   Not very clear
Solution: I have clarified method names here toexclude_pairs_generated_by_this_rule_sql and exclude_pairs_generated_by_all_preceding_rules_sql.  This is partly because these implementations will differnt in #1692
Finally I've also added type hinting to make refactoring a bit easier

A wider thought for another PR/Splink 4 - I think apply_salt should be handled from within the BlockingRule class, not outside.
It wouldn't be too hard to set the dialect for each BR in a central settings class/area when we go to unpack the settings dictionary (assuming we are planning to continue forward with that).
It's generally bad practice to have high 'coupling' (dependence between functions), which this is a perfect example of - changes to the salting methodology needs to be closely mirrored in the function linked above.
On top of that, it's quite hard to follow if you're new to the code base.
It would be better if we simply had to call br.salted_blocking_rules to get the output. Whether it came from a SparkLinker would then ideally be handled by the BlockingRule class (or a salting subclass).

My comment above is already being addressed by - https://github.com/moj-analytical-services/splink/pull/1701. Glad to see we're thinking the same thing.


Indent ternaries

Fixes the part of https://github.com/jlongster/prettier/issues/317 not covered by https://github.com/jlongster/prettier/pull/473 as mentioned in  https://github.com/jlongster/prettier/issues/467#issuecomment-275476597.
Should probably wait for #473 to merge first, as this will have conflicts in the test output. Alternatively, would be happy to just have @vjeux add this commit to his PR.

Nice! I noticed this in a few other cases too, this makes sense. Checking out #473 right now.

Argh, snapshots conflicts. Can you rebase?

👍

Sweet, rebased and re-ran jest -u.

Yeah, I'm unsure about this issue. I've personally seen both in the fb codebase and could go either way. This one was the easiest to implement (which is in itself not a valid reason)


fix: func filter_matches issue, IndexError

when I input an image full of white or other pure colors, the scores tensor will have a dim less than 3, so the function filter_matches will have this IndexError error: max(): Expected reduction dim 0 to have non-zero size.

I think that PR https://github.com/cvg/LightGlue/pull/92 is a better fix.

Merged PR #92, closing this one.


Building with --release produces a runtime error

Steps to Reproduce
Pick a contact in this example: https://github.com/DRSchlaubi/contact_picker/tree/master/contact_picker/example
Expected results: Get same result as in debug mode
Actual results: Runtime error

Logs
js_helper.dart:1130 Uncaught TypeError: a.gAA is not a function
at Object.a6R (picker.js.dart:60)
at Ri.$1 (contact_picker_plugin.dart:129)
at at.aa (iterable.dart:411)
at cP.n (iterable.dart:340)
at Object.a09 (core_patch.dart:472)
at Object.ai (core_patch.dart:479)
at at.cb (iterable.dart:211)
at contact_picker_plugin.dart:130
at Wi.a (async_patch.dart:316)
at Wi.$2 (async_patch.dart:341)

D:\WORK\contact_picker\contact_picker\example>flutter analyze
Analyzing example...
No issues found! (ran in 11.7s)

D:\WORK\contact_picker\contact_picker\example>flutter doctor -v
[✓] Flutter (Channel master, 1.25.0-5.0.pre.100, on Microsoft Windows [Version 10.0.19042.610], locale en-US)
• Flutter version 1.25.0-5.0.pre.100 at C:\flutter
• Framework revision 03013ce42a (51 minutes ago), 2020-12-07 13:49:11 -0800
• Engine revision 69dacc4138
• Dart version 2.12.0 (build 2.12.0-121.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\micha\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
• Java binary at: C:\Users\micha\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Android Studio (version 4.1.0)
• Android Studio at C:\Users\micha\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\201.6953283
• 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 1.8.0_242-release-1644-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.2)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2020.2.3
• Flutter plugin version 52.0.2
• Dart plugin version 202.8070
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3)
• IntelliJ at C:\Users\micha\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\203.5981.155
• Flutter plugin version 52.0.5
• Dart plugin version 203.5981.152
[✓] VS Code, 64-bit edition (version 1.50.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.17.0
[✓] Connected device (3 available)
• Pixel 5 (mobile) • 0A021FDD4007SZ • android-arm64  • Android 11 (API 30)
• Chrome (web)     • chrome         • web-javascript • Google Chrome 86.0.4240.111
• Edge (web)       • edge           • web-javascript • Microsoft Edge 87.0.664.55
! Device emulator-5554 is offline.
• No issues found!

When I build my example app using flutter run everything works but if I build the release version of it a function that works completely fine in the debug version throws the error attached in the logs above. I have no way of debugging this error, as the function name is obfuescated and the chrome debugger sends me to something like https://C:/flutter/.pub-cache/hosted/pub.dartlang.org/contact_picker_web-4.0.2/lib/src/js/picker.js.dart, when trying tto clicck the line.
Is there any way to disable name obfuescation? compiling with --source-maps didn't help as it only seems to provide a source map for main.dart

@DRSchlaubi
this seems more an issue with the 3rd party package fluttercontactpicker
rather than flutter itself

The problem is it's my plugin and the error is not giving me enough information to fix it

@DRSchlaubi
Since it's an issue with your plugin and not Flutter, your question is better suited for StackOver flow. Please see https://flutter.dev/community for resources and if you need help with your code, please see https://www.reddit.com/r/flutterhelp/
You may also see this link and see if it helps.
Closing from here.

If the dart Dev compiler is able to compile my plugin just fine but the production compiler compiles it so it produces a unreadable runtime error how exactly is this a problem with my plugin @darshankawar

After further testing I am pretty sure  the issue is caused by minification of the js code which i can't disable


Update versions in cw-bundle.yaml

Test name
Status

scaling
passed

haproxy
passed

recreate
passed

storage
passed

big-data
passed

self-healing
passed

scaling-proxysql
passed

init-deploy
passed

upgrade
passed

restore-to-encrypted-cluster
passed

limits
passed

self-healing-advanced
passed

upgrade-consistency
passed

monitoring
passed

security-context
passed

monitoring-2-0
passed

affinity
passed

one-pod
passed

demand-backup
passed

operator-self-healing
passed

auto-tuning
passed

proxysql-sidecar-res-limits
passed

users
passed

scheduled-backup
passed

tls-issue-self
passed

tls-issue-cert-manager
passed

tls-issue-cert-manager-ref
passed

demand-backup-encrypted-with-tls
failed


[osg] Update osg version to 3.6.4

Updated OpenSceneGraph to the latest stable version 3.6.4.

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

Thanks for the PR!


Cannot start K8s Developer VMs off of master

Reproducing steps:

Check out master git checkout master
From the root of the cilium repository, run the following:
NFS=1 K8S=1 ./contrib/vagrant/start.sh
The provisioning of the VMs fails:

...
    k8s1: ./ipvlan
    k8s1: ./macvlan
    k8s1: ./loopback
    k8s1: ./bridge
    k8s1: Hit:1 https://download.docker.com/linux/ubuntu artful InRelease
    k8s1: Get:2 http://security.ubuntu.com/ubuntu artful-security InRelease [83.2 kB]
    k8s1: Hit:3 http://archive.ubuntu.com/ubuntu artful InRelease
    k8s1: Get:4 http://ppa.launchpad.net/projectatomic/ppa/ubuntu xenial InRelease [24.3 kB]
    k8s1: Get:6 http://archive.ubuntu.com/ubuntu artful-updates InRelease [88.7 kB]
    k8s1: Err:4 http://ppa.launchpad.net/projectatomic/ppa/ubuntu xenial InRelease
    k8s1:   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8BECF1637AD8C79D
    k8s1: Hit:5 https://packages.cloud.google.com/apt kubernetes-xenial InRelease
    k8s1: Get:7 http://archive.ubuntu.com/ubuntu artful-backports InRelease [74.6 kB]
    k8s1: Reading package lists...
    k8s1: W: GPG error: http://ppa.launchpad.net/projectatomic/ppa/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8BECF1637AD8C79D
    k8s1: E: The repository 'http://ppa.launchpad.net/projectatomic/ppa/ubuntu xenial InRelease' is not signed.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

I am working on moving to ubuntu 18.04 in the developer VMs (see https://github.com/cilium/packer-ci-build/pull/57 ) ; this may be related to some EOL for Ubuntu Xenial repositories :(

Which VM is it?
As a workaround run
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 8BECF1637AD8C79D

that should be already in here https://github.com/cilium/packer-ci-build/blob/40e582a0dae8e266fd6ce9ac29216560bdf701ff/provision/ubuntu/crio.sh#L7

Version in Vagrantfile is: config.vm.box_version = "77"

i'll try the workaround. Thank you Andre!

Now I am facing other errors:
    k8s1: Setting up cri-o-1.10 (1.10.1-1~ubuntu16.04.2~ppa28) ...
    k8s1: Configuration file '/etc/crictl.yaml'
    k8s1:  ==> File on system created by you or by a script.
    k8s1:  ==> File also in package provided by package maintainer.
    k8s1:
    k8s1:    What would you like to do about it ?  Your options are:
    k8s1:     Y or I  : install the package maintainer's version
    k8s1:     N or O  : keep your currently-installed version
    k8s1:       D     : show the differences between the versions
    k8s1:       Z     : start a shell to examine the situation
    k8s1:  The default action is to keep your current version.
    k8s1: *** crictl.yaml (Y/I/N/O/D/Z) [default=N] ?
    k8s1: Configuration file '/etc/crictl.yaml'
    k8s1:  ==> File on system created by you or by a script.
    k8s1:  ==> File also in package provided by package maintainer.
    k8s1:    What would you like to do about it ?  Your options are:
    k8s1:     Y or I  : install the package maintainer's version
    k8s1:     N or O  : keep your currently-installed version
    k8s1:       D     : show the differences between the versions
    k8s1:       Z     : start a shell to examine the situation
    k8s1:  The default action is to keep your current version.
    k8s1: *** crictl.yaml (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package cri-o-1.10 (--configure):
    k8s1:  end of file on stdin at conffile prompt

investigating.

@ianvernon oh I see. comment these lines. https://github.com/cilium/cilium/blob/master/examples/kubernetes-ingress/scripts/03-install-kubernetes-worker.sh#L40-L52
I forgot to comment these lines since the VM was updated with the cri-o already installed.


Add in an assert family of functions

This will check values at runtime, allowing for users to ensure computed values do not violate static constraints.

overriding due to unrelated failures in ci

One of the failures was legit for generating the docs

But can do in another pr


Statically link libunwind

Currently stream manager links libunwind dynamically, which makes it harder to deploy heron in an Aurora cluster. This PR makes stream manager linking libunwind statically as other dependencies.
This is based on the previous work from @kramasamy @taishi8117 @zuyu (#923)
After this PR:
[heron-core]$ ldd bin/heron-stmgr
	linux-vdso.so.1 (0x00007ffc91ed2000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f6437e24000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f6437b22000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f6437903000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f64376fb000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f64374e4000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f6437122000)
	/lib64/ld-linux-x86-64.so.2 (0x000055f267a0c000)

This resolves https://github.com/twitter/heron/issues/505

LGTM. Make sure you run internal integration test.

LGTM


⚠ Bofrost.lu has degraded performance

In 7c5d086, Bofrost.lu (https://www.bofrost.lu) experienced degraded performance:

HTTP code: 200
Response time: 1666 ms

Resolved: Bofrost.lu performance has improved in 7d084c1 after 13 minutes.


"Câlnic" is listed in the drop-down menu

Description:
"Câlnic" is listed in the drop-down menu alongside its corresponding county and commune, according to the law
Precondition:
The website is up an running.

Step 1
Type "Câlnic" in the search bar.

Expected results
The location is listed in the drop-down menu as "Câlnic, Alba (Câlnic)".


🐛 RTL Style issue

Header Menu Margin

To Fix That

Go to 'assets'
Create folser 'css.'
Create file custom.css in folder css
Add this snippets into custom.css file

.space-x-5>a {
  --tw-space-x-reverse: 0;
  margin-right: calc(1.25rem * var(--tw-space-x-reverse));
  margin-left: calc(1.25rem * calc(1 - var(--tw-space-x-reverse)));
}

@zwebcourses thanks for this. Super helpful. I just closed your PR for the new language because there was a problem with it. Could you try re-submitting that so that I can work on this one? Thanks you so much.
Best

@zwebcourses could you re-submit your PR?


Investigate CMD scale workflows read from replicas downtime (polyglot)

We can see high downtime (~180 seconds) in CMD read from replica scale workflow tests.

Current status:
The issue is that the old server doesn't respond with ACK to new requests, leaving the connection hanged.
This issue is resolved by setting the TCP_USER_TIMEOUT, tested with polyglot.
Opened a feature request to redis-rs with couple suggestions: https://github.com/redis-rs/redis-rs/issues/1147


Refactor membership tests

Repair #234, at the expense of backwards incompatibility.
So as it turns out, QMetaType is gone (as Fredrik pointed out a few days ago) which means it can't be included per default by Qt.py anymore. They've essentially broken backwards compatibility for themselves, and in turn us as we depend on their implementation.
As for QtOpenGL (which I had to take out), it was only ever included for convenience and demo of Optional Submodules (#185) where modules were looked after, but included only if they existed. Rather than throwing an import error.
It simplifies things (by removing the separate membership test) and remains true to PySide2, at the cost of breaking backwards compatibility.
Thoughts? @MHendricks this affects your use of QMetaType and the way you'd have to work around it (if we merge this) is by leveraging QtSiteConfig to add it in yourself.

@mottosso Don't we still need a script to identify common members across all bindings and output that (for inclusion in Qt.py's _common_members)?

It seems the backwards breaking change may not have been intentional: https://gitter.im/PySide/pyside2?at=59a53033bc46472974d3410a

I'm starting to wonder if QtCore.QMetaType ever existed in PySide2...
$ docker run -ti --rm --entrypoint bash fredrikaverpil/qt.py:2017
$ python2.7
Python 2.7.11 (default, Aug 15 2017, 19:33:56)
[GCC 4.8.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PySide2 import QtCore
>>> QtCore.QMetaType
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'QMetaType'

How is it that this container manages to pass our current memberships test, where QtCore.QMetaType is included?!

Because it wasn't testing against _common_members, it was testing against the list built by the membership test module.
QMetaType can be included in _common_members and not trigger an error on import Qt for the same reason we can include QtOpenGL; it's optional. It's made available if it's available in the binding, such as PyQt5.
That's wrong though, we shouldn't let members through unless they have some chance of existing across all bindings. And it looks like QMetaType is not one of them.

I noticed you left the membership test in the entrypoint.sh and I just removed it.

Don't we still need a script to identify common members across all bindings

Yeah, we could still have that. But as a separate process perhaps? We could use it as a tool to update _common_members from time to time.

Because it wasn't testing against _common_members, it was testing against the list built by the membership test module.

But how come tests for VFX Platform 2018 started complaining about QtCore.QMetaType all of a sudden?

Yeah, we could still have that. But as a separate process perhaps? We could use it as a tool to update _common_members from time to time.

That's exactly what I was thinking of. Just a helper tool to populate _common_members.

But how come tests for VFX Platform 2018 started complaining about QtCore.QMetaType all of a sudden?

It's complaining because it found members in PySide2 that it couldn't find elsewhere, such as QtQml. My guess is that either PyQt5 was compiled without those in this Docker image, or PySide2 didn't include it in previous Docker images.
What we can do is either expand on that exclusion list I made at the bottom of the membership test module, or do what we do in #240 and test on _common_members instead.

I think we should merge this.

Perhaps add a tool to identify the common members first. It could run as part of the tests or independently. But in either case, it could be used with the latest docker container.

We could serially have each binding spit out its members to e.g. a json file. As a final step, the script collect the common members from the json files and output them in a separate json file. This could then be copy-pasted to be used in Qt.py.

Hm, that sucks. PyQt4/5 doesn't have __all__...

Ah, this was nice: https://docs.python.org/2/library/pkgutil.html

Hm. Not sure what we could do to parse down into e.g. QtWidgets... @mottosso any ideas?
$ chmod +x run_membership.sh
$ ./run_membership.sh
PySide.QtCore
PySide.QtDeclarative
PySide.QtGui
PySide.QtHelp
PySide.QtMultimedia
PySide.QtNetwork
PySide.QtOpenGL
PySide.QtScript
PySide.QtScriptTools
PySide.QtSql
PySide.QtSvg
PySide.QtTest
PySide.QtUiTools
PySide.QtWebKit
PySide.QtXml
PySide.QtXmlPatterns
PySide._utils
PySide.phonon
PySide.scripts
PySide.scripts.uic
PySide.shiboken
PySide2.QtConcurrent
PySide2.QtCore
PySide2.QtGui
PySide2.QtHelp
PySide2.QtNetwork
PySide2.QtPrintSupport
PySide2.QtQml
PySide2.QtQuick
PySide2.QtQuickWidgets
PySide2.QtScript
PySide2.QtScriptTools
PySide2.QtSql
PySide2.QtSvg
PySide2.QtTest
PySide2.QtUiTools
PySide2.QtWebChannel
PySide2.QtWebKit
PySide2.QtWebKitWidgets
PySide2.QtWebSockets
PySide2.QtWidgets
PySide2.QtX11Extras
PySide2.QtXml
PySide2.QtXmlPatterns
PySide2._utils
PySide2.scripts
PySide2.scripts.uic
PySide2.shiboken2
PyQt4.Qt
PyQt4.QtCore
PyQt4.QtDeclarative
PyQt4.QtDesigner
PyQt4.QtGui
PyQt4.QtHelp
PyQt4.QtMultimedia
PyQt4.QtNetwork
PyQt4.QtOpenGL
PyQt4.QtScript
PyQt4.QtScriptTools
PyQt4.QtSql
PyQt4.QtSvg
PyQt4.QtTest
PyQt4.QtWebKit
PyQt4.QtXml
PyQt4.QtXmlPatterns
PyQt4.phonon
PyQt4.pyqtconfig
PyQt4.uic
PyQt4.uic.Compiler
PyQt4.uic.Compiler.compiler
PyQt4.uic.Compiler.indenter
PyQt4.uic.Compiler.misc
PyQt4.uic.Compiler.proxy_metaclass
PyQt4.uic.Compiler.qobjectcreator
PyQt4.uic.Compiler.qtproxies
PyQt4.uic.Loader
PyQt4.uic.Loader.loader
PyQt4.uic.Loader.qobjectcreator
PyQt4.uic.driver
PyQt4.uic.exceptions
PyQt4.uic.icon_cache
PyQt4.uic.objcreator
PyQt4.uic.port_v2
PyQt4.uic.port_v2.as_string
PyQt4.uic.port_v2.ascii_upper
PyQt4.uic.port_v2.invoke
PyQt4.uic.port_v2.load_plugin
PyQt4.uic.port_v2.proxy_base
PyQt4.uic.port_v2.string_io
PyQt4.uic.port_v3
PyQt4.uic.port_v3.as_string
PyQt4.uic.port_v3.ascii_upper
PyQt4.uic.port_v3.invoke
PyQt4.uic.port_v3.load_plugin
PyQt4.uic.port_v3.proxy_base
PyQt4.uic.port_v3.string_io
PyQt4.uic.properties
PyQt4.uic.pyuic
PyQt4.uic.uiparser
PyQt5.Enginio
PyQt5.Qt
PyQt5.QtBluetooth
PyQt5.QtCore
PyQt5.QtDBus
PyQt5.QtDesigner
PyQt5.QtGui
PyQt5.QtHelp
PyQt5.QtLocation
PyQt5.QtMultimedia
PyQt5.QtMultimediaWidgets
PyQt5.QtNetwork
PyQt5.QtNfc
PyQt5.QtOpenGL
PyQt5.QtPositioning
PyQt5.QtPrintSupport
PyQt5.QtQml
PyQt5.QtQuick
PyQt5.QtQuickWidgets
PyQt5.QtSensors
PyQt5.QtSerialPort
PyQt5.QtSql
PyQt5.QtSvg
PyQt5.QtTest
PyQt5.QtWebChannel
PyQt5.QtWebKit
PyQt5.QtWebKitWidgets
PyQt5.QtWebSockets
PyQt5.QtWidgets
PyQt5.QtX11Extras
PyQt5.QtXml
PyQt5.QtXmlPatterns
PyQt5._QOpenGLFunctions_2_0
PyQt5._QOpenGLFunctions_2_1
PyQt5._QOpenGLFunctions_4_1_Core
PyQt5.uic
PyQt5.uic.Compiler
PyQt5.uic.Compiler.compiler
PyQt5.uic.Compiler.indenter
PyQt5.uic.Compiler.misc
PyQt5.uic.Compiler.proxy_metaclass
PyQt5.uic.Compiler.qobjectcreator
PyQt5.uic.Compiler.qtproxies
PyQt5.uic.Loader
PyQt5.uic.Loader.loader
PyQt5.uic.Loader.qobjectcreator
PyQt5.uic.driver
PyQt5.uic.exceptions
PyQt5.uic.icon_cache
PyQt5.uic.objcreator
PyQt5.uic.port_v2
PyQt5.uic.port_v2.as_string
PyQt5.uic.port_v2.ascii_upper
PyQt5.uic.port_v2.invoke
PyQt5.uic.port_v2.load_plugin
PyQt5.uic.port_v2.proxy_base
PyQt5.uic.port_v2.string_io
PyQt5.uic.port_v3
PyQt5.uic.port_v3.as_string
PyQt5.uic.port_v3.ascii_upper
PyQt5.uic.port_v3.invoke
PyQt5.uic.port_v3.load_plugin
PyQt5.uic.port_v3.proxy_base
PyQt5.uic.port_v3.string_io
PyQt5.uic.properties
PyQt5.uic.pyuic
PyQt5.uic.uiparser

Ok, I think I got it now.
$ ./run_membership.sh
...
PySide.QtGui.QPrinter
PySide.QtGui.QPrinterInfo
PySide.QtGui.QProgressBar
PySide.QtGui.QProgressDialog
PySide.QtGui.QProxyModel
PySide.QtGui.QPushButton
PySide.QtGui.QPyTextObject
...

The list is enormous. Now we just need that on JSON form and compare.

Turns out I did hit a couple of issues due to e.g. the PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class... so now each binding analysis is performed separately.
I also added JSON export, so now we'll get four JSON files; PySide.json, PySide2.json, PyQt4.json and PyQt5.json.

Okay, now I export one JSON file per binding and then those are compared and a common_members.json is spit out. But, ok, I'm dumb. Because this doesn't take into account that e.g. QtWidgets doesn't exist on PyQt4/PySide (as it's called QtGui there etc)... so the comparison is quite useless...
Sigh. Dead end then. How did I not see this coming?!
I'm going to sleep now.

@fredrikaverpil Should I merge this?

@mottosso I think we should merge your original PR, yes.
The work I added to his PR, however, should not be merged.
I added a script (run_membership.py) which will output PySide.json, PyQt4.json, PySide2.json, PyQt5.json. In each one, all of the binding's members are listed. Then, a comparison was made which produced a common_membership.json which would include the shared members throughout all of those JSON files. But what I didn't think of is that e.g. PySide has its widgets under QtGui and PySide2 has its widgets under QtWidgets. So the resulting common_membership.json is useless to us.
I'm not sure how we can make a script which properly helps us generate the membership dictionary.

I mean, I'm not sure how we can create a script which will help us identify common members without having to maintain the different changes between Qt4/Qt5 in such a script.

Hm... perhaps it's not too much to maintain, actually.
Since we do this for PySide2/PyQt4:
    if hasattr(Qt, "_QtGui"):
        setattr(Qt, "QtWidgets", _new_module("QtWidgets"))
        setattr(Qt, "_QtWidgets", Qt._QtGui)

...I should just be able to force the JSON comparison script to compare QtWidgets against QtGui for those bindings. And everything should actually work.

Holy crap, I think it worked.
 Since the keys were not sorted in Qt.py the diff became a little difficult to read... I haven't had time to read it through yet. But at first glance, looks like this'll work!

@mottosso I made it easier to spot the differences after having updated the Qt.py file's _common_members using the output from my comparison script. See here: https://github.com/mottosso/Qt.py/pull/240/commits/6198123ed497a55fdf02f2b4605e31e49660626a
After posting this message, I'll add the members back in, sorted. Which will make the overall diff a bit harder to read -- but will make future changes easier to read, as they are generated by the membership.py test the same way.
I think this is all actually really nice and think we should merge this as soon as possible, so that we can move on with other PRs like #234
The membership.py script could use some cleaning up to make code more grokable. But I have limited time on my hands and would prefer to do that down the line, if needed.
I don't think we need to edit the README.md for this change, as the fundamentals of Qt.py are the same (I'm reading what's under the "Project goals" headline.

@mottosso this is now ready to be merged as far as I can tell.

@fredrikaverpil Are you sure those new members exist across all bindings?

I'm pretty sure, yes.
Each binding is inspected and the script attempts to import all modules and their submodules/members. All successful imports are exported to a [binding_name].json file. Then all JSON files are compared and if a member exists across all JSON files, it is added to common_members.json.
So, all of those members in the latest Qt.py update are imported on all bindings successfully. I exit the Python script for each processing of every binding to prevent issues (with e.g. SIP between PyQt4/PyQt5). I made the script a bit more verbose to show each import being performed successfully. Here's the log showing all successful imports as well as all warnings where an import could not be made: https://gist.github.com/fredrikaverpil/6fb1e6a2273fcd877b4b56c91738d36f
I would be surprised if this list is not accurate.
You can just run ./run_membership.sh yourself and inspect the JSON files, but I uploaded the JSON files onto a public Google Drive folder. If you look inside the different JSONs, you'll see that some bindings (of course) have stuff which doesn't exist in the other JSON files, and therefore these members doesn't make it over onto common_members.json.

Hm..
======================================================================
FAIL: Doctest: test_caveats.test_13_qtwidgets_qapp
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/python2.7/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "/usr/local/python2.7/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for test_13_qtwidgets_qapp
  File "/workdir/Qt.py/test_caveats.py", line 211, in test_13_qtwidgets_qapp
----------------------------------------------------------------------
File "/workdir/Qt.py/test_caveats.py", line 220, in test_13_qtwidgets_qapp
Failed example:
    "qApp" in dir(QtWidgets)
Expected:
    False
Got:
    True

@mottosso sorry, didn't see your first post on qApp. I'll amend membership.py to exclude it.

Ok, I bumped the version too. Should be fine to merge now.

Looks very slick! Happy to merge after that one change.

Looking good, merge at will! Thanks @fredrikaverpil!

Awesome. This change is kickass, to be honest.


add teststep of browser window operations, switch to another popup window

add teststep of browser window operations, switch to another popup window

this is done. add windowsSwitchStep by page title


[WIP] 542 code coverage for js

Story / Bug id: https://github.com/CodeForPoznan/volontulo/issues/123
Reference person: @yourgithubname
Description:
Description of your changes.
New imports / dependencies:

package

Unit Tests:

apps/volontulo/tests/views/test_auth.py

What tests do I need to run to validate this change:
Description of testing workflow and potential affected places.

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@0aaf273). Click here to learn what that means.
The diff coverage is 100%.

@@           Coverage Diff           @@
##             master   #559   +/-   ##
=======================================
  Coverage          ?   100%
=======================================
  Files             ?      3
  Lines             ?     22
  Branches          ?      0
=======================================
  Hits              ?     22
  Misses            ?      0
  Partials          ?      0

Impacted Files
Coverage Δ

frontend/src/polyfills.ts
100% <100%> (ø)

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 0aaf273...a7aff44. Read the comment docs.