Let child routers run off empty URL fragments

As part of implementing authentication, I was trying to have a login page that looked different to the authenticated part of the application. To do this I set up a default route that went to a layout page which then had a child router that contained the other routes; for example, 'dashboard', 'orders', 'returns' etc.
In my main router configuration I had a default route and a login route:
{ route: '', moduleId: './layout', nav: false },
{ route: 'login', moduleId: './login', nav: false }

Then in the layout module I had defined a child router with a 'dashboard' route:
{ route: 'dashboard', moduleId: './dashboard', nav: true, title: 'Dashboard' }

When trying to navigate to #dashboard I was receving the following error: Route Not Found: dashboard.
I think this is a fairly common scenario and may not even be used for authentication, somebody could have a landing page that looked completely different to the rest of their site and expect something like this to work.
Perhaps the framework could check the root router for the route first, then do the child checks taking into account an empty fragment for the default route and then go through the same logic it currently uses to find child routes now and then if no route is found, it throws a "Route not found" error.

I can relate to this.. My landing pages usually look totally different to the rest of my site ..

So the logic would be that if we find no match for routes...then look for an empty route, load that if present and see if it has a child router that matches the next segment?

Yeah, that would work.

I'm looking to accomplish the same thing. Nesting my main application router at the second level for the sole purpose of having a login page with a different layout feels a bit workaround-ish though (to me anyways).
Wouldn't it also be possible to dynamically override / replace the current (i.e. root) view for specific routes? For example by setting an overrideView flag on the route config:
// app.js
{ route: 'login', moduleId: './login', overrideView: true }, //  view (e.g. app.html)
{ route: 'dashboard', moduleId: './dashboard', nav: true, title: 'Dashboard', auth: true },
{ ... }

If getViewStrategy() was re-evaluated on navigation – even when the module is already activated – it could also be done in there, I think.

So, perhaps what we need to do is this:

process the route matching like normal on the parent router
if a no match is found, check to see if there is an empty route
if there is an empty route, select that route and assume there's a child router that will match

Maybe something along those lines?

I think that sounds good. There might still be some weirdness if child routes overlap parent routes, like in the skeleton where it recursively registers child routers. In that case we'll always match the parent's route. It seems like a reasonable limitation. We might be able to reduce that case by adding special handling for child routes that specify alternate non-empty paths. Eg, { route: ['', 'layout'], moduleId: './layout', nav: false }, we could prefer the non-empty alternative 'layout' for the child router's baseUrl, so that its nav model would correctly generate unambiguous paths. That's probably a more extensive code change, and I'm unsure what it might break, though.

@bryanrsmith Can you look into that and see what would be involved and estimate how long it might take to do?

Yep.

On Apr 25, 2015, at 1:09 PM, Rob Eisenberg<EMAIL_ADDRESS>wrote:
@bryanrsmith Can you look into that and see what would be involved and estimate how long it might take to do?
—
Reply to this email directly or view it on GitHub.

Would the functionality be recursive.  That is if there are three levels of child routers with default routes will it work?
I had also thought of the possibility of the framework automatically assigning a route fragment to routes contained in child routers.  This would be much like the existing fragment which gets added to routes where the child router is not the default.

Yes, I would think so. We'll just need to make sure we don't infinitely match against child routes for cases like the skeleton that recursively register child routers using the same module.

+1

As an alternative to the proposed logic, you could instead encapsulate some logic into a getter for the href property, which would check if it's parent route is represented in the current route, and if not, prepend it.

Is there a work-around for this, for now?  Should we manually prepend the parent route to the hrefs of the child router?  How else can we get to the child routes, if the app is currently at the default route of the parent router?

If anyone is struggling with this issue, I have discovered the only current work-around is to setup a redirect route as your default route, so that your child routes will work when the default route is navigated to.  There is a code example (no documentation yet) of setting up a redirect route here:  http://aurelia.io/docs.html#customizing-the-navigation-pipeline

:+1:

Hi @bryanrsmith Do you have any update about this?

Sorry, I haven't had time yet.

For those requiring a workaround, the following is a stop-gap workaround I've been using until this has been implemented.
config.map([
            { route: "", redirect: "Dashboard" },
            { route: "Dashboard",     name: "Dashboard",     moduleId: "Dashboard/index",            nav: true, title: "Dashboard" }
]);

For all of you using this for a "landing page" - it's worth noting that there is a better way than using router defaults; use aurelia's setRoot method to accomplish this. There's an excellent question-and-answer here on StackOverflow.

@Jaans That doesn't seem to work. I start having problems using Redirect from an auth filter. Same error. I'm not ready to file a new bug for this one.
ERROR [app-router] Error: Route not found: /browse
Stack trace:
_createNavigationInstruction@http://localhost:3000/vendor/npm/aurelia-router@1.0.0-beta.1.1.3/aurelia-router.js:927:29
loadUrl@http://localhost:3000/vendor/npm/aurelia-router@1.0.0-beta.1.1.3/aurelia-router.js:1459:14
_loadUrl@http://localhost:3000/vendor/npm/aurelia-history-browser@1.0.0-beta.1.1.4/aurelia-history-browser.js:281:42
activate@http://localhost:3000/vendor/npm/aurelia-history-browser@1.0.0-beta.1.1.4/aurelia-history-browser.js:185:16
activate@http://localhost:3000/vendor/npm/aurelia-router@1.0.0-beta.1.1.3/aurelia-router.js:1514:7
registerViewPort/_ret5</_ret6</<.v.v<@http://localhost:3000/vendor/npm/aurelia-router@1.0.0-beta.1.1.3/aurelia-router.js:1485:23

and $ jspm inspect
                  github:components/jquery 2.2.1
                       github:github/fetch 0.10.1
               github:jspm/nodelibs-assert 0.1.0
                   github:jspm/nodelibs-fs 0.1.2
                 github:jspm/nodelibs-path 0.1.0
              github:jspm/nodelibs-process 0.1.2
                 github:jspm/nodelibs-util 0.1.0
        github:nakupanda/bootstrap3-dialog 1.34.9
                github:systemjs/plugin-css 0.1.20
               github:systemjs/plugin-json 0.1.0
               github:systemjs/plugin-text 0.0.4
                     github:twbs/bootstrap 3.3.6
                                npm:assert 1.3.0
                  npm:aurelia-animator-css 1.0.0-beta.1.1.2
                       npm:aurelia-binding 1.0.0-beta.1.2.2
                  npm:aurelia-bootstrapper 1.0.0-beta.1.1.4
          npm:aurelia-dependency-injection 1.0.0-beta.1.1.5
              npm:aurelia-event-aggregator 1.0.0-beta.1.1.1
                  npm:aurelia-fetch-client 1.0.0-beta.1.1.1
                     npm:aurelia-framework 1.0.0-beta.1.1.4
                       npm:aurelia-history 1.0.0-beta.1.1.1
               npm:aurelia-history-browser 1.0.0-beta.1.1.4
                        npm:aurelia-loader 1.0.0-beta.1.1.1
                npm:aurelia-loader-default 1.0.0-beta.1.1.3
                       npm:aurelia-logging 1.0.0-beta.1.1.2
               npm:aurelia-logging-console 1.0.0-beta.1.1.4
                      npm:aurelia-metadata 1.0.0-beta.1.1.6
                           npm:aurelia-pal 1.0.0-beta.1.1.1
                   npm:aurelia-pal-browser 1.0.0-beta.1.1.4
                          npm:aurelia-path 1.0.0-beta.1.1.1
                     npm:aurelia-polyfills 1.0.0-beta.1.0.1
              npm:aurelia-route-recognizer 1.0.0-beta.1.1.3
                        npm:aurelia-router 1.0.0-beta.1.1.3
                    npm:aurelia-task-queue 1.0.0-beta.1.1.1
                    npm:aurelia-templating 1.0.0-beta.1.1.4
            npm:aurelia-templating-binding 1.0.0-beta.1.1.2
          npm:aurelia-templating-resources 1.0.0-beta.1.1.3
             npm:aurelia-templating-router 1.0.0-beta.1.1.2
                            npm:babel-core 5.8.35
                         npm:babel-runtime 5.8.35
                  npm:bootstrap-datepicker 1.6.0
                               npm:core-js 1.2.6
                              npm:inherits 2.0.1
                                npm:jquery 2.2.1
                                npm:moment 2.11.2
                       npm:path-browserify 0.0.0
                               npm:process 0.11.2
                                  npm:util 0.10.3

Hey guys, any updates on this thread?

The best way to handle this is to make "empty" fragment redirect to a non-empty route.

I did that indeed, but it didn't worked as I expected.
What I'm trying to accomplish is when I hit the route #/login I have one template and when not, fallback to the default route, which have a common template, and then match the routes against the child router. The child router will have other routes like blog, portifolio and I want to reach them through the url #/blog or #portifolio.
Is this the better way to achieve that or there are more elegant ways to do this?
app.js
    configureRouter(config: RouterConfiguration, router: Router) {
        config.title = "Blog d'Okano";
        config.map([
            {route: '', redirect: 'site', nav: false},
            {route: 'login', moduleId: 'pages/login/login', nav: true, name: 'login'},
            {route: 'site', moduleId: 'pages/default/main', nav: true, name: 'site'}
        ]);

        this.router = router;
    }

main.js
    configureRouter(config: RouterConfiguration, router: Router) {
        config.map([
            {route: '', moduleId: './home', nav: true, name: 'home'},
            {route: 'blog', moduleId: './blog', nav: true, name: 'blog'},
            {route: 'sobre', moduleId: './sobre', nav: true, name: 'sobre'},
            {route: 'portifolio', moduleId: './portifolio', nav: true, name: 'portifolio'},
            {route: 'contato', moduleId: './contato', nav: true, name: 'contato'}
        ]);

        this.router = router;
        console.log(router);
    }

This is a very important need. I have this same issue. If this can be achieved today, my project will be completed tomorrow. Please @bryanrsmith what is the state of this enhancement?

You just need to have the parent route redirect to a non-empty route and you should be good to go.

@eisenbergeffect
Thanks a lot but I tried it and it didn't work.
Look at the app.js configureRouter
import { inject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';

@inject(EventAggregator)
export class App {
  constructor(events){
    events.subscribe('router:navigation:complete', this.navigationComplete);
  }
  configureRouter(config, router) {
    config.title = 'Delta State Polytechnic';
    config.map([
      { route: '', name: 'public-section', moduleId: './sections/public/public-section', nav: true, title: ''},
      { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
      { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }

    ]);

    this.router = router;
  }

  navigationComplete(){
    Waves.displayEffect();
  }
}

and look at the public-section.jjs configureRouter. This is not working for me
import { inject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';

@inject(EventAggregator)
export class App {
  constructor(events){
    events.subscribe('router:navigation:complete', this.navigationComplete);
  }
  configureRouter(config, router) {
    config.title = 'Delta State Polytechnic';
    // config.map([
    //   { route: ['', 'home'], name: 'home', moduleId: './sections/home/home', nav: true, title: 'Home', layoutView: 'layouts/default-layout.html', layoutViewModel: 'layouts/default-layout'},
    //   { route: 'about', name: 'about', moduleId: './sections/about/about', nav: true, title: 'About', layoutView: 'layouts/default-layout.html', layoutModel: './layouts/default-layout' },
    //   { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
    //   { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }
    // ]);

    //  config.map([
    //   { route: ['', 'home'], name: 'home', moduleId: './sections/home/home', nav: true, title: 'Home' },
    //   { route: 'about', name: 'about', moduleId: './sections/about/about', nav: true, title: 'About' },
    //   { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
    //   { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }
    // ]);

    config.map([

      { route: '', name: 'public-section', moduleId: './sections/public/public-section', nav: true, title: ''},
      { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
      { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }

    ]);

    this.router = router;
  }

  navigationComplete(){
    Waves.displayEffect();
  }
}

Your suggestion is highly valued

@eisenbergeffect
Thanks a lot but I tried it and it didn't work.
Look at the app.js configureRouter
import { inject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';

@inject(EventAggregator)
export class App {
  constructor(events){
    events.subscribe('router:navigation:complete', this.navigationComplete);
  }
  configureRouter(config, router) {
    config.title = 'Delta State Polytechnic';
    config.map([
      { route: '', name: 'public-section', moduleId: './sections/public/public-section', nav: true, title: ''},
      { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
      { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }

    ]);

    this.router = router;
  }

  navigationComplete(){
    Waves.displayEffect();
  }
}

and look at the public-section.jjs configureRouter. This is not working for me
import { inject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';

@inject(EventAggregator)
export class App {
  constructor(events){
    events.subscribe('router:navigation:complete', this.navigationComplete);
  }
  configureRouter(config, router) {
    config.title = 'Delta State Polytechnic';
    // config.map([
    //   { route: ['', 'home'], name: 'home', moduleId: './sections/home/home', nav: true, title: 'Home', layoutView: 'layouts/default-layout.html', layoutViewModel: 'layouts/default-layout'},
    //   { route: 'about', name: 'about', moduleId: './sections/about/about', nav: true, title: 'About', layoutView: 'layouts/default-layout.html', layoutModel: './layouts/default-layout' },
    //   { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
    //   { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }
    // ]);

    //  config.map([
    //   { route: ['', 'home'], name: 'home', moduleId: './sections/home/home', nav: true, title: 'Home' },
    //   { route: 'about', name: 'about', moduleId: './sections/about/about', nav: true, title: 'About' },
    //   { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
    //   { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }
    // ]);

    config.map([

      { route: '', name: 'public-section', moduleId: './sections/public/public-section', nav: true, title: ''},
      { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
      { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }

    ]);

    this.router = router;
  }

  navigationComplete(){
    Waves.displayEffect();
  }
}

Your suggestion is highly valued

@eisenbergeffect
Thanks a lot but I tried it and it didn't work.
Look at the app.js configureRouter
import { inject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';

@inject(EventAggregator)
export class App {
  constructor(events){
    events.subscribe('router:navigation:complete', this.navigationComplete);
  }
  configureRouter(config, router) {
    config.title = 'Delta State Polytechnic';
    config.map([
      { route: '', name: 'public-section', moduleId: './sections/public/public-section', nav: true, title: ''},
      { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
      { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }

    ]);

    this.router = router;
  }

  navigationComplete(){
    Waves.displayEffect();
  }
}

and look at the public-section.jjs configureRouter. This is not working for me
import { inject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';

@inject(EventAggregator)
export class App {
  constructor(events){
    events.subscribe('router:navigation:complete', this.navigationComplete);
  }
  configureRouter(config, router) {
    config.title = 'Delta State Polytechnic';
    // config.map([
    //   { route: ['', 'home'], name: 'home', moduleId: './sections/home/home', nav: true, title: 'Home', layoutView: 'layouts/default-layout.html', layoutViewModel: 'layouts/default-layout'},
    //   { route: 'about', name: 'about', moduleId: './sections/about/about', nav: true, title: 'About', layoutView: 'layouts/default-layout.html', layoutModel: './layouts/default-layout' },
    //   { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
    //   { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }
    // ]);

    //  config.map([
    //   { route: ['', 'home'], name: 'home', moduleId: './sections/home/home', nav: true, title: 'Home' },
    //   { route: 'about', name: 'about', moduleId: './sections/about/about', nav: true, title: 'About' },
    //   { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
    //   { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }
    // ]);

    config.map([

      { route: '', name: 'public-section', moduleId: './sections/public/public-section', nav: true, title: ''},
      { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
      { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }

    ]);

    this.router = router;
  }

  navigationComplete(){
    Waves.displayEffect();
  }
}

Your suggestion is highly valued

@eisenbergeffect
Thanks a lot but I tried it and it didn't work.
Look at the app.js configureRouter
import { inject } from 'aurelia-framework';
import { EventAggregator } from 'aurelia-event-aggregator';

@inject(EventAggregator)
export class App {
  constructor(events){
    events.subscribe('router:navigation:complete', this.navigationComplete);
  }
  configureRouter(config, router) {
    config.title = 'Delta State Polytechnic';
    config.map([
      { route: '', name: 'public-section', moduleId: './sections/public/public-section', nav: true, title: ''},
      { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
      { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students', layoutView: 'sections/students/students-layout.html' }

    ]);

    this.router = router;
  }

  navigationComplete(){
    Waves.displayEffect();
  }
}

and look at the public-section.jjs configureRouter. This is not working for me
import { inject, inlineView } from 'aurelia-framework';
import { Router } from 'aurelia-router';

@inlineView(
    `
    <template>
        <router-view></router-view>
    </template>
    `
)
@inject(Router)
export class PublicSection {
    constructor(router){
        this.router = router;
    }
    configureRouter(config, router) {
        config.map([
            { route: '', redirect: 'home'},
            // { route: '', name: 'home', moduleId: './sections/home/home', nav: false, title: 'Home'},
            { route: 'home', name: 'home', moduleId: './sections/home/home', nav: false, title: 'Home'},
            { route: 'about', name: 'about', moduleId: './sections/about/about', nav: false, title: 'About'}
        ]);
        this.router = router;
    }
}

Your suggestion is highly valued

You need the parent route to redirect, not the child route.

app.js
config.map([
      { route: '', redirect: 'public-section', nav: false},
      { route: '/', name: 'public-section', moduleId: './sections/public/public-section', nav: false, title: ''},
      { route: 'login', name: 'login', moduleId: './sections/login/login', nav: true, title: 'Login Page' },
      { route: 'students', name: 'students-section', moduleId: './sections/students/students-section', nav: true, title: 'Students' }

    ]);

public-section.js
configureRouter(config, router) {
        config.map([
            { route: '', name: 'home', moduleId: './sections/home/home', nav: false, title: 'Home'},
            { route: 'about', name: 'about', moduleId: './sections/about/about', nav: false, title: 'About'}
        ]);
        this.router = router;
    }

It loads the home page. But when I attempted to go about page, It is showing the below error

You still effectively, have an empty route because you have '/' as a route. Change that to 'public-section'.

This is a recurring issue, perhaps we should have a working example on the
docs?
El 19 oct. 2016 8:54 a. m., "Rob Eisenberg"<EMAIL_ADDRESS>escribió:

You still effectively, have an empty route because you have '/' as a
route. Change that to 'public-section'.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aurelia/router/issues/27#issuecomment-254819544, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAy9mXxwM93MIUx1ib_MeJt3iSEFeN0Oks5q1iEkgaJpZM4DfRLh
.

@eisenbergeffect
Of course that will cause the url to look like this http://localhost:8008/#/public-section/about. It doesn't look nice at all.
I will try another approach.

+1
Em qua, 19 de out de 2016 12:06, Samuel Smith<EMAIL_ADDRESS>escreveu:

@eisenbergeffect https://github.com/eisenbergeffect
Of course that will cause the url to look like this
http://localhost:8008/#/public-section/about. It doesn't look nice at all.
I will try another approach.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/aurelia/router/issues/27#issuecomment-254822815, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AForwqXmtD-mFG7ck3-BsntyZYyclxdkks5q1iPDgaJpZM4DfRLh
.

Yes, it is a workaround. It's not perfect but it will work.

@EisenbergEffect @bryanrsmith I was hoping the last update will include a solution to this issue. Please what is the state now? I wish I know how to help in this regard. If I can be exposed once, I will contribute greatly to this amazing framework.

Just start reading the router code and then start thinking about how this might be implemented.

@EisenbergEffect
Thanks a lot. I have cloned the router repo. I will look through. I wish there is a flowchart of the router. It will help a lot in contributing. Because one can easily know the entry point and how the other codes are connected. I will try though

@EisenbergEffect @PWKad
We're still having problems on aurelia-router version 1.3.0.
Basically, if we have a root router with an empty route, pointing to a child router with the route /foo, we cannot navigate to /foo - it just throws a Route not found error.
This appears to be the same issue described by @smithaitufe in https://github.com/aurelia/router/pull/470#issuecomment-287543082 on the pull request.
This is pretty critical for us, and having poked around in the router code, I have to say, I'm a bit lost as to where this is failing... is there any chance you could take a look and maybe prioritize a fix for this?

Have you tried using a redirect route?

Yeah, we can't do that, unfortunately - the thing is, we have multiple front pages, one for each of our products. Until now, they were each on their own path, so we had /flights, /hotels, etc.
But now we have a requirement that the "primary" front page, /flights must be on an empty route, but we can't really start changing the way things are nested at this point.
I suppose, upon further investigation, that we could maybe get around this by having two routes pointing to the same module id - but then I'm a little bit in doubt about how that would affect the lifecycles of the views, especially with named router views. Meaning, if we have two separate routes, one empty and one for /flights, both pointing to the same module id - then what happens when a user navigates from the flights home page, i.e. the empty route, to a flights sub page such as /flights/search? Wouldn't this cause the flights view to be destroyed and recreated?


Do not hot, and manually refresh the page after each change

Do not hot, and manually refresh the page after each change,.Check webpack.config.js
devServer: {
port: 7000,
hot: true,
historyApiFallback: true,
publicPath: "",
stats: {
colors: true
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
}
but it can work well,how to solve？

you loss inline:true in this,

Thanks for your advice.I have fixed it ^_^

Thanks for your advice.I have fixed it ^_^


Contribution for Hacktoberest

Changes proposed in this Pull Request :

1.Changed the image
2.  Changed the code as mentioned in readme file.
..

Other changes

Great Job!!


Remove Repos that are not Open Source

@andrew Created a list of projects that could have no open source license. Check which really have no licence and remove them from the dataset: https://gist.github.com/andrew/c21b243c555745f94ec686a276728436

Closed by #342


Support complex composed models by preventing name collisions

At the moment no matter what we do you can end up with situations where models can have name conclusions (i.e when they use a lot of latent models.
What should we do about this? #249 introduces a partial solution for observation models (that uses a prefix based on the named assigned by the user - partial as the uniqueness of this name is not enforced).
We also see this problem more generally (for example if ascertainment models are stacked and if multiple latent models are combined)
We have a few options as I see it.

Enforce prefix for all submodel calls so that a parameter name becomes dependent on its call stack
Introduce the pattern that all calls to a latent model should have a clear (and documented prefix) - potentially as in the above solution based on the type of the dispatching struct.

The latter seems preferable to me as variables names will be shorter and easier to reason on. There may also be other options.

The latter seems preferable to me as variables names will be shorter and easier to reason on. There may also be other options.

I agree here.

The problem with this proposed approach is what if you have the following:
Acercertainment(Ascertainment(...))

Here both would have the same prefix and so collide. you could argue that this is not a pattern we want to support and they should rather write
Ascertainment(model, CombineLatentModels(Ascr1, ascr2))

This would make sense but would be hard to steer people towards potentially, may have implications for hierarchical modelling, and would mean that utility helper functions for constructing common ascertainment models etc couldn't be used in these settings (without modification).

Wouldn't the approach we are thinking off parse the top example as having a prefix like asc_asc... which is obviously ugly but distinguishable?

So not if we made the prefix only on the latent model vs both the latent and obs model (which is what I was suggesting)

In my head I was agreeing to the call stack suggestion... and C&Ped the wrong bit. Is the main downside that its really ugly?

In my head I was agreeing to the call stack suggestion... and C&Ped the wrong bit. Is the main downside that its really ugly?

 It also makes it very hard to write code for multiple models.

Like CombineLatentModels, ConcatLatentModels (see #270) also has this problem.

Another option we could take here that would be less automated but maybe more informative is make defining the prefix part of the struct. This could look something like:
Ascertainment(NegativeBinomialError(), RW(), prefix = "IFR"

This could be nice as it lets the user set very clear names for things but it could also maybe cause issues as the models will error a few times (due to name collisions) and the user will need to know what to do (which maybe isn't the most fun way. to interact with a package). Some of this could be mitigated if we make a default prefix for these complex operators?

Yes! Instant reaction is that this is the best idea. I think the kind of users for want to construct a sufficiently complex model that naming collisions come into play, probably have their own namespace ideas for the model components.
This feels like a natural solution. And the defaults should be simple to select?

I like that it is 1. Simple and 2. Should be adaptable to all the issues we have identified above with automated strategies.

I've started looking at implementing this here: https://github.com/CDCgov/Rt-without-renewal/blob/issue252/EpiAware/src/EpiLatentModels/manipulators/CombineLatentModels.jl
One uncertainty is if we should let the user specify the prefix prefix (i.e here Combine) or not.
A slightly annoying issue is you can't have an empty prefix ("" will add "." on everything) so this can't be turned off as a feature.
Otherwise work to do here is:

[ ] Fix ConcatLatentModels constructor
[ ] Add prefixes for Ascertainment
[ ] Check where else prefixes may be needed.

Something this really does highlight is how much the named tuple returns of everything don't work this approach (as the returns now have a different name to the variables in the model).


Deinitializing SPI bus 'breaks' OV2640 (IDFGH-6877)

Environment

Development Kit:      ESP32-S3-DevKitC and ESP32-CAM (AiThinker)
Kit version: V1-N8R2
Module or chip used:  ESP32-S3-WROOM
IDF version: v4.4
Build System:         idf.py
Compiler version: xtensa-esp32-elf-gcc.exe (crosstool-NG esp-2021r2-patch2) 8.4.0
Operating System:     Windows 10
(Windows only) environment type: Plain Command Prompt.
Using an IDE?: Visual Studio Code with ESP-IDF extension
Power Supply:         USB

Problem Description
When using hardware which consists of an SD-card reader and an OV2640 connected to an ESP32-S3 DevKitC I'm unable to use the OV2640 after unmounting the SD-card. I've narrowed the problem down to spi_bus_free(host.slot); at line 240. When that function isn't called, the camera remains usable.
Expected Behavior
The OV2640 (which I'm using through the esp32-camera component) still works after deinitializing the SPI bus.
Actual Behavior
The OV2640 only prints cam_hal: Failed to get the frame on time!.
Steps to reproduce

Use the attached zip for a complete runnable project, or the GIST linked underneath.
Select the ESP32-S3 as build target.
Build, flash and monitor the project.
Observe taking pictures after spi_bus_free(host.slot); doesn't work.
Change build target to ESP32.
Build, flash and monitor the project.
Observe taking pictures after spi_bus_free(host.slot); still works.

Code to reproduce this issue
See code in GIST or project in sdspi.zip.

No longer relevant.


mk-ind-draft doesn't use the doc name specified

./mk-ind-draft --doc draft-bishop-litigious-flower -n <creds> produced a repo named "draft-mikebishop-bishop-litigious-flower" and instructions about adding a document by that name.
I kind of get it -- if I just pass in "litigious-flower" then you're going to format the draft name semi-properly.  However, if I've specified a doc name that begins with "draft-", shouldn't that be the name used?

I added an --asis flag to not standardize/mangle the name.  Does that seem good enough?  If not, please reopen this.


command:create handle empty editable repo list

Forrest should ask the user if he/she wants to create a local repo.
Validate repo ID

Done


Add etcdAnnotations field to Vault CR to annotate etcdcluster

This allows users to add spec.etcdAnnotations to the Vault Custom Resource object which is used to annotate the etcdcluster Custom Resource accordingly.
This is specifically for the etcd.database.coreos.com/scope=clusterwide annotation, however CoreOS allows for arbitrary annotations to the object so I figured I'd carry on with that and allow full passthrough of annotations.
Example usage:
apiVersion: vault.banzaicloud.com/v1alpha1
kind: Vault
labels:
  version: latest
  group: security
  app: vault
metadata:
  name: vault
spec:
  size: 3
  image: vault:0.11.0
  bankVaultsImage: banzaicloud/bank-vaults:latest
  securityContext:
    runAsUser: 100
  supportUpgrade: true
  etcdAnnotations:
    etcd.database.coreos.com/scope: clusterwide
  unsealConfig:
    kubernetes:
      secretNamespace: default
...

This means that you can have a Cluster Wide ETCD Operator in one namespace, and then create an etcdcluster in a different namespace and have it automatically annotated.

Looks good @rblaine95, could you please add the example annotation to the etcd example just as a comment, that this is possible?

@bonifaido, just added the example as a comment


[SPARK-47666][SQL][3.5] Fix NPE when reading mysql bit array as LongType

What changes were proposed in this pull request?
This PR fixes NPE when reading mysql bit array as LongType
Why are the changes needed?
bugfix
Does this PR introduce any user-facing change?
no
How was this patch tested?
new tests
Was this patch authored or co-authored using generative AI tooling?
no

Could you take a look at UT failure, @yaooqinn ?
[info] MySQLOverMariaConnectorIntegrationSuite:
[info] - SPARK-47537: ensure use the right jdbc driver (2 milliseconds)
[info] - Basic test (29 milliseconds)
[info] - Numeric types *** FAILED *** (63 milliseconds)
[info]   Array([false,549,17,77777,123456789,123456789012345,123456789012345.12345678901234500000,42.75,1.0000000000000002,-128,255], [null,null,null,null,null,null,null,null,null,null,null]) had length 2 instead of expected length 1 (MySQLIntegrationSuite.scala:107)

Merged to branch 3.5， thank you @dongjoon-hyun @HyukjinKwon


Enum request on table 7000002 - Cartera Doc. ESP Location

Hello,
I need an enum for the field 1 - "Type"
Thanks!

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.


linux/grpc_build_packages failing on Ruby package build (CBF)

Looks like protoc_macos artifact is failing to build in linux/grpc_build_packages since July 5:
+ [[ macos_x64 == \m\a\c\o\s\_\x\8\6 ]]
+ input_dir=/var/local/jenkins/grpc/input_artifacts/protoc_macos_x64
+ output_dir=/var/local/git/grpc/src/ruby/tools/bin/x86_64-macos
+ mkdir -p /var/local/git/grpc/src/ruby/tools/bin/x86_64-macos/google/protobuf
+ mkdir -p /var/local/git/grpc/src/ruby/tools/bin/x86_64-macos/google/protobuf/compiler
+ cp '/var/local/jenkins/grpc/input_artifacts/protoc_macos_x64/protoc*' '/var/local/jenkins/grpc/input_artifacts/protoc_macos_x64/grpc_ruby_plugin*' /var/local/git/grpc/src/ruby/tools/bin/x86_64-macos/
cp: cannot stat `/var/local/jenkins/grpc/input_artifacts/protoc_macos_x64/protoc*': No such file or directory
cp: cannot stat `/var/local/jenkins/grpc/input_artifacts/protoc_macos_x64/grpc_ruby_plugin*': No such file or directory
+ FAILED=true

Example failure: https://source.cloud.google.com/results/invocations/a46267f6-2f6d-4ecd-bbfe-32f1773de2cc/targets/github%2Fgrpc/tests;group=tasks;test=build_package.ruby_package;row=2

Seems like the issue is long gone (original reported in July 2021). Closing.


It's hard to tell which gallery region is emitting an ApplicationInsights event

Right now cloud role name is "NuGetGallery" and cloud role instance is a specific instance. However, if you want to know USNC vs USSC vs staging slot vs production slot, it's hard to tell.

As a mitigation, I was using the URL to identify region:
requests
| sort by timestamp desc
| extend trimmedUrl = trim("http(s)*://", url)
| extend domain = substring(trimmedUrl, 0, indexof(trimmedUrl, '/'))
| summarize count(itemCount) by bin(timestamp, 1m), domain

...but this is obviously not ideal.


Conflict with sqlite struct - Conan recipe

Hi,
Im trying update conan sqlitecpp recipe to version 2.5.0 but get this error:
-- Build files have been written to: /tmp/c3ipr/pr_643_7_1_0/.conan/data/sqlitecpp/2.5.0/_/_/build/5ea64b7ccbed5c393974c5c75c50c8ee9845b7b5/build_subfolder
Scanning dependencies of target SQLiteCpp
[ 14%] Building CXX object source_subfolder/CMakeFiles/SQLiteCpp.dir/src/Backup.cpp.o
[ 28%] Building CXX object source_subfolder/CMakeFiles/SQLiteCpp.dir/src/Column.cpp.o
[ 42%] Building CXX object source_subfolder/CMakeFiles/SQLiteCpp.dir/src/Database.cpp.o
In file included from /tmp/c3ipr/pr_643_7_1_0/.conan/data/sqlitecpp/2.5.0/_/_/build/5ea64b7ccbed5c393974c5c75c50c8ee9845b7b5/source_subfolder/src/Backup.cpp:16:0:
/usr/include/sqlite3.h:3455:20: error: conflicting declaration ‘typedef struct Mem sqlite3_value’
 typedef struct Mem sqlite3_value;
                    ^
In file included from /tmp/c3ipr/pr_643_7_1_0/.conan/data/sqlitecpp/2.5.0/_/_/build/5ea64b7ccbed5c393974c5c75c50c8ee9845b7b5/source_subfolder/include/SQLiteCpp/Backup.h:14:0,
                 from /tmp/c3ipr/pr_643_7_1_0/.conan/data/sqlitecpp/2.5.0/_/_/build/5ea64b7ccbed5c393974c5c75c50c8ee9845b7b5/source_subfolder/src/Backup.cpp:12:
/tmp/c3ipr/pr_643_7_1_0/.conan/data/sqlitecpp/2.5.0/_/_/build/5ea64b7ccbed5c393974c5c75c50c8ee9845b7b5/source_subfolder/include/SQLiteCpp/Database.h:22:30: note: previous declaration as ‘typedef struct sqlite3_value sqlite3_value’
 typedef struct sqlite3_value sqlite3_value;
                              ^
source_subfolder/CMakeFiles/SQLiteCpp.dir/build.make:62: recipe for target 'source_subfolder/CMakeFiles/SQLiteCpp.dir/src/Backup.cpp.o' failed
make[2]: *** [source_subfolder/CMakeFiles/SQLiteCpp.dir/src/Backup.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /tmp/c3ipr/pr_643_7_1_0/.conan/data/sqlitecpp/2.5.0/_/_/build/5ea64b7ccbed5c393974c5c75c50c8ee9845b7b5/source_subfolder/src/Database.cpp:17:0:
/usr/include/sqlite3.h:3455:20: error: conflicting declaration ‘typedef struct Mem sqlite3_value’
 typedef struct Mem sqlite3_value;
                    ^
In file included from /tmp/c3ipr/pr_643_7_1_0/.conan/data/sqlitecpp/2.5.0/_/_/build/5ea64b7ccbed5c393974c5c75c50c8ee9845b7b5/source_subfolder/src/Database.cpp:11:0:
/tmp/c3ipr/pr_643_7_1_0/.conan/data/sqlitecpp/2.5.0/_/_/build/5ea64b7ccbed5c393974c5c75c50c8ee9845b7b5/source_subfolder/include/SQLiteCpp/Database.h:22:30: note: previous declaration as ‘typedef struct sqlite3_value sqlite3_value’
 typedef struct sqlite3_value sqlite3_value;
                              ^
source_subfolder/CMakeFiles/SQLiteCpp.dir/build.make:88: recipe for target 'source_subfolder/CMakeFiles/SQLiteCpp.dir/src/Database.cpp.o' failed
make[2]: *** [source_subfolder/CMakeFiles/SQLiteCpp.dir/src/Database.cpp.o] Error 1
CMakeFiles/Makefile2:93: recipe for target 'source_subfolder/CMakeFiles/SQLiteCpp.dir/all' failed
make[1]: *** [source_subfolder/CMakeFiles/SQLiteCpp.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
sqlitecpp/2.5.0:

PR:
https://github.com/conan-io/conan-center-index/pull/643
The conanfile already set "SQLITECPP_INTERNAL_SQLITE" to "OFF", so i think that it is not the problem.
Can you see another thing that can be the problem?
Thanks.

Sorry,
I need add the same patch:
else (SQLITECPP_INTERNAL_SQLITE)
    target_link_libraries(SQLiteCpp PUBLIC CONAN_PKG::sqlite3)
 endif (SQLITECPP_INTERNAL_SQLITE)

This is necessary?
if (MINGW)
    MESSAGE ( STATUS "Running on MinGW - no -fstack-protector" )
    add_compile_options(-Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline)
else ()
    add_compile_options(-fstack-protector -Wall -Wextra -Wpedantic -Wno-long-long -Wswitch-enum -Wshadow -Winline)
endif ()

Hello,
Not sure yet, but it reminds me of something, perhaps try a search on the issues...
I think we do redefine this struct for some version of sqlite3

And about the other patchs, I don't have much time to think about it right now.
We can certainly cleanup some code
I am currently not testing Mingw so we might need to add it to the CI testing matrices

Let me know if you need anything or if I can help

Hi,
I made all the patchs and it is working now.
Thanks.

Ok, so you don't need / want any change on the SQLiteCpp project?

No,
The patch already change some lines to include sqlite from conan:
https://github.com/conan-io/conan-center-index/pull/643/files
Thanks.

Hi,
If you want, can add on that IF statement a ELSEIF for conan include sqlite3 and we don't need the patch.
Today the patch convert your IF into THIS:
if (SQLITECPP_INTERNAL_SQLITE)
    # build the SQLite3 C library (for ease of use/compatibility) versus Linux sqlite3-dev package
    add_subdirectory(sqlite3)
    target_include_directories(sqlite3 PUBLIC "${PROJECT_SOURCE_DIR}/sqlite3")
    target_include_directories(SQLiteCpp PRIVATE "${PROJECT_SOURCE_DIR}/sqlite3")
else (SQLITECPP_INTERNAL_SQLITE)
    target_link_libraries(SQLiteCpp PUBLIC CONAN_PKG::sqlite3)
endif (SQLITECPP_INTERNAL_SQLITE)

You can add some option to conan case if you want like "SQLITECPP_INTERNAL_SQLITE_BY_CONAN".
Or add internal provide options, like "SQLITECPP_INTERNAL_SQLITE_PROVIDER" with values "DEFAULT, CONAN, others".
Thanks.

Hi,
You can let "SQLITECPP_INTERNAL_SQLITE" as it is ON/OFF and inside it check the provider by "SQLITECPP_INTERNAL_SQLITE_PROVIDER".
This is my suggestion.
Thanks.


Enable figures to be saved directly to clipboard

...instead of saving to specific directory each time

This issue is relevant to the graphic user interface of Eddington, therefore transferring the issue there


Some problems were found with the configuration of task ':mdsflutter:extractDebugProto' (type 'ProtobufExtract').

i'm developing a flutter app, i'm using mdsflutter: ^1.1.0 (also tried beta) with mdslib-1.10.0(1)-release.aar (also tried mdslib-1.6.0(1)-release.aar, mdslib-3.15.0(1)-release.aar).
i followed the README https://pub.dev/packages/mdsflutter but i get this error.
FAILURE: Build failed with an exception.

What went wrong:
Some problems were found with the configuration of task ':mdsflutter:extractDebugProto' (type 'ProtobufExtract').

In plugin 'com.google.protobuf' type 'com.google.protobuf.gradle.ProtobufExtract' property 'destDir' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:

Add an input or output annotation.
Mark it as @Internal.

Please refer to https://docs.gradle.org/7.5/userguide/validation_problems.html#missing_annotation for more details about this problem.

In plugin 'com.google.protobuf' type 'com.google.protobuf.gradle.ProtobufExtract' property 'isTest' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:

Add an input or output annotation.
Mark it as @Internal.

Please refer to https://docs.gradle.org/7.5/userguide/validation_problems.html#missing_annotation for more details about this problem.

Please try the version 2.0.0-beta2 which has a fixed the issue #4 which I think is duplicate of this one. Also don't use mds libraries older than 1.68.0 or 3.15 (latest is preferred).


Fix incorrect download links and file names in installation doc

Adds "v" in front of everywhere ${RELEASE_VERSION} is used. Without it,
the download links and resulting downloaded file paths are not found.

Description of the change:
Motivation for the change:
Checklist
If the pull request includes user-facing changes, extra documentation is required:

[ ] Add a new changelog fragment in changelog/fragments (see changelog/fragments/00-template.yaml)
[ ] Add or update relevant sections of the docs website in website/content/en/docs

nm...can't just set RELEASE_VERSION to include v as is documented


Service without selector

Hi everyone,
I'm very new in using istio so be kind :)
In my application I have a postgres deployed over 3 pods with a statefulset, one of the 3 pods is the master, the other two are replicas. Postgres app has 3 applicationPorts 8008,5432,8080.
This is exposed via a LoadBalancer service without selector. The service expose the tcp port 5432
When I try to enable istio, I see the listener for the service (<IP_ADDRESS>:5432) but the istio-proxy gives me the following error.
2019-09-27T10:10:01.377890Z	info	Envoy proxy is NOT ready: 4 errors occurred:
* failed checking application ports. listeners="<IP_ADDRESS>:15090","<IP_ADDRESS>:8086","<IP_ADDRESS>:443","<IP_ADDRESS>:8443","<IP_ADDRESS>:443","<IP_ADDRESS>:80","<IP_ADDRESS>:42422","<IP_ADDRESS>:443","<IP_ADDRESS>:9710","<IP_ADDRESS>:443","<IP_ADDRESS>:15020","<IP_ADDRESS>:443","<IP_ADDRESS>:53","<IP_ADDRESS>:44134","<IP_ADDRESS>:5000","<IP_ADDRESS>:80","<IP_ADDRESS>:26379","<IP_ADDRESS>:15443","<IP_ADDRESS>:5432","<IP_ADDRESS>:443","<IP_ADDRESS>:443","<IP_ADDRESS>:9300","<IP_ADDRESS>:443","<IP_ADDRESS>:443","<IP_ADDRESS>:5473","<IP_ADDRESS>:15011","<IP_ADDRESS>:15443","<IP_ADDRESS>:9901","<IP_ADDRESS>:15010","<IP_ADDRESS>:15004","<IP_ADDRESS>:15014","<IP_ADDRESS>:8080","<IP_ADDRESS>:9200","<IP_ADDRESS>:8060","<IP_ADDRESS>:80","<IP_ADDRESS>:9091","<IP_ADDRESS>:15020","<IP_ADDRESS>:15001"
* envoy missing listener for inbound application port: 8008
* envoy missing listener for inbound application port: 5432
* envoy missing listener for inbound application port: 8080
My question is, is there a best practice to handle services without selector?

Can you provide the config you have? Is this a service without selector + Endpoints?
If you give config we can apply and easily reproduce it will help a lot in solving this. Thanks!

Hi John,
here the config of the service, the endpoints and the statefulset.. hope this help
$kubectl get svc atom-db -o yaml
apiVersion: v1
kind: Service
metadata:
annotations:
external-dns.alpha.kubernetes.io/hostname: db.atom.staging.db.example.com
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "3600"
creationTimestamp: 2019-09-26T14:40:23Z
labels:
application: spilo
spilo-role: master
team: atom
version: atom-db
name: atom-db
namespace: default
resourceVersion: "54034"
selfLink: /api/v1/namespaces/default/services/atom-db
uid: 92480a81-e06b-1ee9-a311-c4d455a74c57
spec:
clusterIP: <IP_ADDRESS>
externalTrafficPolicy: Cluster
loadBalancerSourceRanges:

<IP_ADDRESS>/32
ports:
name: postgresql
nodePort: 32576
port: 5432
protocol: TCP
targetPort: 5432
sessionAffinity: None
type: LoadBalancer
status:
loadBalancer: {}

$kubectl get endpoints atom-db -o yaml
apiVersion: v1
kind: Endpoints
metadata:
creationTimestamp: 2019-09-26T14:40:22Z
labels:
application: spilo
spilo-role: master
team: atom
version: atom-db
name: atom-db
namespace: default
resourceVersion: "53700"
selfLink: /api/v1/namespaces/default/endpoints/atom-db
uid: 920fd92b-e06b-11e9-a406-c8d3ffa74c57
subsets:

addresses:

hostname: atom-db-1
ip: <IP_ADDRESS>
nodeName: mm1
targetRef:
kind: Pod
name: atom-db-1
namespace: default
resourceVersion: "53699"
uid: 6515ce42-e06b-12e9-a406-c8d3ffa74c57
hostname: atom-db-2
ip: <IP_ADDRESS>
nodeName: mm1
targetRef:
kind: Pod
name: atom-db-2
namespace: default
resourceVersion: "53696"
uid: 67d0b684-e06b-11e9-a406-c8d3ffa74c57
hostname: atom-db-0
ip: <IP_ADDRESS>
nodeName: mm1
targetRef:
kind: Pod
name: atom-db-0
namespace: default
resourceVersion: "53693"
uid: 3fe9b567-e06c-11e9-a406-c8d3ffa74c57
ports:
name: postgresql
port: 5432
protocol: TCP

$kubectl get statefulset atom-db -o yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
zalando-postgres-operator-rolling-update-required: "false"
creationTimestamp: 2019-09-30T09:55:25Z
generation: 1
labels:
application: spilo
team: atom
version: atom-db
name: atom-db
namespace: default
resourceVersion: "871076"
selfLink: /apis/apps/v1/namespaces/default/statefulsets/atom-db
uid: 6d35c3a5-e368-11e9-a406-c8d3ffa74c57
spec:
podManagementPolicy: OrderedReady
replicas: 3
revisionHistoryLimit: 10
selector:
matchLabels:
application: spilo
version: atom-db
serviceName: atom-db
template:
metadata:
creationTimestamp: null
labels:
application: spilo
team: atom
version: atom-db
namespace: default
spec:
containers:
- env:
- name: SCOPE
value: atom-db
- name: PGROOT
value: /home/postgres/pgdata/pgroot
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: POD_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: PGUSER_SUPERUSER
value: postgres
- name: KUBERNETES_SCOPE_LABEL
value: version
- name: KUBERNETES_ROLE_LABEL
value: spilo-role
- name: KUBERNETES_LABELS
value: application=spilo
- name: PGPASSWORD_SUPERUSER
valueFrom:
secretKeyRef:
key: password
name: postgres.atom-db.credentials
- name: PGUSER_STANDBY
value: standby
- name: PGPASSWORD_STANDBY
valueFrom:
secretKeyRef:
key: password
name: standby.atom-db.credentials
- name: PAM_OAUTH2
value: https://info.example.com/oauth2/tokeninfo?access_token= uid realm=/employees
- name: SPILO_CONFIGURATION
value: '{"postgresql":{"bin_dir":"/usr/lib/postgresql/10/bin","pg_hba":["hostssl
all all <IP_ADDRESS>/0 md5","host    all all <IP_ADDRESS>/0 md5"]},"bootstrap":{"initdb":[{"auth-host":"md5"},{"auth-local":"trust"},"data-checksums",{"encoding":"UTF8"},{"locale":"en_US.UTF-8"}],"users":{"zalandos":{"password":"","options":["CREATEDB","NOLOGIN"]}},"dcs":{}}}'
- name: DCS_ENABLE_KUBERNETES_API
value: "true"
image: registry.opensource.zalan.do/acid/spilo-cdp-11:1.5-p70
imagePullPolicy: IfNotPresent
name: postgres
ports:
- containerPort: 8008
protocol: TCP
- containerPort: 5432
protocol: TCP
- containerPort: 8080
protocol: TCP
resources:
limits:
cpu: "3"
memory: 1Gi
requests:
cpu: 100m
memory: 100Mi
securityContext:
privileged: true
procMount: Default
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /home/postgres/pgdata
name: pgdata
- mountPath: /dev/shm
name: dshm
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: postgres-operator
serviceAccountName: postgres-operator
terminationGracePeriodSeconds: 300
volumes:
- emptyDir:
medium: Memory
name: dshm
updateStrategy:
type: OnDelete
volumeClaimTemplates:

metadata:
annotations:
volume.alpha.kubernetes.io/storage-class: default
creationTimestamp: null
name: pgdata
spec:
accessModes:

ReadWriteOnce
dataSource: null
resources:
requests:
storage: 5Gi
volumeMode: Filesystem
status:
phase: Pending
status:
collisionCount: 0
currentReplicas: 3
currentRevision: atom-db-587b8f4446
observedGeneration: 1
readyReplicas: 2
replicas: 3
updateRevision: atom-db-587b8f4446
updatedReplicas: 3

An update, if I check the endpoint list I see that there are no endpoints for the atom-db. Below the related yaml
$kubectl get endpoints
NAME                              ENDPOINTS                                               AGE
atom-db                                                                             20m
atom-db-repl                                                                        7d
$kubectl get endpoints atom-db -o yaml
apiVersion: v1
kind: Endpoints
metadata:
creationTimestamp: 2019-10-03T13:25:22Z
labels:
application: spilo
spilo-role: master
team: atom
version: atom-db
name: atom-db
namespace: default
resourceVersion: "1550465"
selfLink: /api/v1/namespaces/default/endpoints/atom-db
uid: 40c14c30-e5e1-11e9-a406-c8d3ffa74c57

An update, if I check the endpoint list I see that there are no endpoints for the atom-db. Below the related yaml

That seems like it could be the problem

Thanks John,
By the way according to kubernetes docs, service without selector not generating endpoints are a  valid configuration https://kubernetes.io/docs/concepts/services-networking/service/#without-selectors .. now is istio not handling at all this kind of scenario or is there a way or a workaround to make istio works?

@mc1711 correct me if I am wrong but when you have a service without a selector you have to make the Endpoint objects yourself

Yes John I do agree with you in principle.
If it is not a problem, I would keep this issue open as I need to investigate the deployment a bit further (this is an existing system). I need to understand if there is a specific reason why there are no endpoints (and everything it is still working fine) and if this is still a kubernetes valid configuration.

@howardjohn I think I figured out the issue with my configuration.
The configuration has:

3 postgres pods (db-0,db-1,db-2), one is the master the other two are replicas.
2 Services (db, db-repl). One to expose the master pod the other to expose the 2 replicas.

$kubectl get svc
NAME                              TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)              AGE
db                           LoadBalancer   <IP_ADDRESS>    <pending>     5432:31383/TCP       20h
db-repl                      ClusterIP      <IP_ADDRESS>     <none>        5432/TCP             8d

$kubectl get pod
NAME                                               READY     STATUS    RESTARTS   AGE
db-0                                          1/1       Running   0          17h
db-1                                          1/1       Running   0          17h
db-2                                          1/1       Running   0          18h

The deployment is done via a postgres operator. The operator creates the 3 pods and then it injects inside each pod a label (role) to decide who is the master and who are the replicas. The operator then uses this label to create the endpoints and associate them to the proper services, db service is associated to the master labeled pod and db-repl is associated to the two replicas (like below). Consider that this operation takes few seconds.
$kubectl get pod db-0 -o yaml | grep role
    role: replica
$kubectl get pod db-0 -o yaml | grep " podIP:"
  podIP: <IP_ADDRESS>

$kubectl get pod db-1 -o yaml | grep role
    role: master
$kubectl get pod db-1 -o yaml | grep " podIP:"
  podIP: <IP_ADDRESS>

$kubectl get pod db-2 -o yaml | grep role
    role: replica
$kubectl get pod db-2 -o yaml | grep " podIP:"
  podIP: <IP_ADDRESS>

$kubectl get endpoints
NAME                              ENDPOINTS                                                  AGE
db                           <IP_ADDRESS>:5432                                          20h
db-repl                      <IP_ADDRESS>:5432,<IP_ADDRESS>:5432                        8d

When I use sidecar injection, the sidecar-proxy run before the operator has labeled the pods, so the endpoints are not yet created and the sidecar-proxy shows as not ready (with the error of my first comment).
At that point, when the postgres operator tries to label the pods it cannot reach them because the sidecars are not working properly.

I think this would work on Istio 1.3, what version are you using?
cc @hzxuzhonghu @mandarjog another case of label updates

I'm using 1.2.5

@howardjohn  I updated to istio 1.3.0 and what I see is that the error on sidecar-proxy not ready is gone, but the postgres operator still not able to to label the pods.

@mc1711 What do you mean by  the postgres operator still not able to to label the pods. ?  How does postgress operator label pods?

Hi @hzxuzhonghu and @howardjohn, sorry for the late reply.
After further investigation we found out that the 1.3.1 actually solved the issue, so everything is working fine.
The postgres-operator not able to label the pods was actually related to another bug from the operator itself.
Thanks a lot for your help and responsiveness.

Glad its working


change display name key

The old key NSLocale.Key.languageCode will display both zh-Hant and zh-Hans as Chinese. It made me confuse when choosing the fit language for me.
I changed to use NSLocale.Key.identifier so it will show Chinese (Traditional) and Chinese (Simplified).
I also added zh-Hant language file so while playing Example, you can see the difference.
Please see the different screenshot below

Thanks @jhihguan. I'm sure this will help many users of Localize. Merging.


No documentatio non how to manipulate a python.data.ops.dataset_oops.BatchDataset

Thank you for submitting a TensorFlow documentation issue. Per our GitHub
policy, we only address code/doc bugs, performance issues, feature requests, and
build/installation issues on GitHub.
The TensorFlow docs are open source! To get involved, read the documentation
contributor guide: https://www.tensorflow.org/community/contribute/docs
URL(s) with the issue:
https://keras.io/api/preprocessing/image/
Description of issue (what needs changing):
the documentation says that the object returned from the tf.keras.preprocessing.image_dataset_from_directory function is a tf.data.Dataset object.  However, there is no documentation on how to manipulate it or get details how to use it. I
Clear description
I have a large dataset and i am trying to split it into testing and training, however while i can "complete a validation split in the  function (as documented) this is no documentation on how I can address the training or validation subsets.  Should i convert the objects to np array or can it be manipulated within TF and if so how?
Correct links
Is the link to the source code correct?
Parameters defined
train_ds = tf.keras.preprocessing.image_dataset_from_directory(
wk_dir,
labels="inferred",
label_mode="int",
class_names=None,
color_mode="grayscale",
batch_size=batches,
image_size=image_dim,
shuffle=True,
seed=1968,
validation_split=0.2,
subset="training",
interpolation="bilinear",
follow_links=False,
)
Returns defined
Found 127842 files belonging to 3 classes.
Using 102274 files for training.
print(type(train_ds))
<class 'tensorflow.python.data.ops.dataset_ops.BatchDataset'>
what are the attributes which can be used to , get details and possible split this object type?
AttributeError: 'BatchDataset' object has no attribute 'eval'
Raises listed and defined

I think the function returns an instance of tf.data.BatchDataset, you can read the documents of tf.data API here tf.data.

@Cillinc
Please update as per above comment

thanks - i am reading the documentation and struggling to get things to work.  if it is a tf.datch.BatchDataset then i will continue to work with the documentation.  one would assume that one of the most common things people did once they imported files into a TF was to split them into training and validation....but this is not clear in the documentation as to how to do it.  I have set the , validation_split=0.2,
subset="validation",
and that works, but i do not see how to address the subsets and AttributeError: 'BatchDataset' object has no attribute 'subset'
so working ahead and trying everything i can find......

Try making two sets one for training and one for validation. (I include my setup in COLAB).
By the way do you have any idea how to extract class_names and labels that are derived from the sub-directories? I need that to decode the outcome when I test an image. I have no idea how to get that working, yet.
I am new in CNN so I cannot explain most of the issues. Got this together by trial and error.

import numpy as np
import IPython.display as display
from PIL import Image
import matplotlib.pyplot as plt
import os
import IPython.display as display
import glob

!pip install tf-nightly --quiet

import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import preprocessing
import time

image_size = (331,331)
batch_size = 32
train_ds=` tf.keras.preprocessing.image_dataset_from_directory(
    "/content/drive/My Drive/AR",
    labels="inferred",
    label_mode="categorical",
    class_names=None,
    batch_size=batch_size,
    image_size=image_size,
    color_mode =  "rgb",
    shuffle=True,
    seed=142,
    validation_split=0.2,
    subset= "training",
    interpolation="bilinear",
    follow_links=False,
)

validation_ds= tf.keras.preprocessing.image_dataset_from_directory(
    "/content/drive/My Drive/AR",
    labels="inferred",
    label_mode="categorical",
    batch_size=batch_size,
    image_size=image_size,
     color_mode =  "rgb",
    shuffle=True,
    seed=142,
    validation_split=0.2,
    subset= "validation",
    interpolation="bilinear",
    follow_links=False,
    )

That results in:
Found 34 files belonging to 3 classes.
Using 28 files for training.
Found 34 files belonging to 3 classes.
Using 6 files for validation.

Those two sets can then be entered in your convnet. Below what I use.

#Note: num_classes must be similar to the train_ds dataset 3 in this particular case.

data_augmentation = keras.Sequential([
  layers.experimental.preprocessing.RandomFlip('horizontal'),
  layers.experimental.preprocessing.RandomRotation(0.1),
])

train_ds = train_ds.prefetch(buffer_size=32)
validation_ds = validation_ds.prefetch(buffer_size=32)
model = tf.keras.applications.InceptionResNetV2(input_shape=(331,331, 3), include_top=False, weights='imagenet')

def make_model(input_shape, num_classes):
  inputs = keras.Input(shape=input_shape)
  # Image augmentation block
  x = data_augmentation(inputs)

  # Entry block
  x = layers.experimental.preprocessing.Rescaling(1./255)(x)
  x = model(x)

  previous_block_activation = x  # Set aside residual

  x = layers.GlobalAveragePooling2D()(x)
  if num_classes == 2:
    activation = 'sigmoid'
    units = 1
  else:
    activation = 'softmax'
    units = num_classes

  x = layers.Dropout(0.5)(x)
  outputs = layers.Dense(units, activation=activation)(x)
  return keras.Model(inputs, outputs)

model = make_model(input_shape=image_size + (3,), num_classes=3)
keras.utils.plot_model(model, show_shapes=True)

Now that is my model. Below code for training en storing the best model on your googleDrive for later tests.

epochs = 10
#model = make_model(input_shape=image_size + (3,), num_classes=3)
file_path = "/content/drive/My Drive/TrainedNetwork/."

checkpoint = tf.keras.callbacks.ModelCheckpoint("/content/drive/My Drive/TrainedNetwork/model-{epoch:03d}-{accuracy:03f}-{val_accuracy:03f}.h5", verbose=1, monitor='val_loss',save_best_only=True, mode='auto')

#model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
model.compile(optimizer=keras.optimizers.Adam(1e-3),
              loss='categorical_crossentropy',
              metrics=['accuracy'])
model.fit(train_ds, epochs=epochs, validation_data=validation_ds, callbacks=[checkpoint], verbose=2)

thanks in my case I was not worried about what values were given to the class names - just that there was 3 classes which the model could work with.  SO i used each of the subdirectories as their own classes and it is working for me.
now my only problem is that the image files are all B&W and the distinguishing attributes to tell one class from another is not enough for the model i have.  So might have to rethink things and put 3 filters into a RGB type image and try again......but this is the fun of things - and also a great way to learn.

@Cillinc
As you have a solution, should we move this issue to closed status

thanks for thew suport!!!!!


Spike: git submodule, subtree or subrepo for barretenberg

@ludamad To clarify, I am not opposed introducing a new tool in our tooling box if existing ones are not solving our problems. Originally, I mistakenly interpreted that git subtree was part of core git which is not and wanted to emphasize to favor existing tooling whenever possible.

@ludamad apologies for not providing more input here. Are we still considering git subtree and if so are there any new opinions or developments?

I'm possibly not up for introducing a new paradigm and getting everyone trained up on it, I guess I realized after some thinking. It'd need a fair bit of buy-in, and probably not comparable to the smoothness of a single repo anyway. At least it would make PRs less of a dance, but everyone would need to agree to some diligence in making sure our barretenberg tree doesn't drift, I guess, and I'm not sure it's worth the disruption

Got it, thanks for the update and for exploring this. In that case, going to close this spike. Can reopen if we ever revisit this.


Added OptClientManualServerAddress option

Fixes: https://github.com/pilosa/pilosa/issues/1857
~TODO: integration test~

I've added more tests.


docs: Correct some spelling mistakes and add some missing full stops at end of the sentence.

 Docs has some errors.
Testing plan:
GIFs or screenshots:

Merged, after simplifying the commit message title to fit within the standard Git length guidelines.  Thanks @nikhilmaske-2001!
Check out the Zulip commit message guidelines for more details: https://zulip.readthedocs.io/en/latest/contributing/version-control.html#commit-messages


fix ExprDedupMap Comparer function to also check type

Root Cause
A bug is observed for the following expression
if(a > 0, (coalesce(cast(b as decimal(24,2)), 0) * 1), 0)
The bug for the IF statement is actually coming up due to an incorrect result while looking for already compiled expression in scope->visited hashmap. To understand this we make note of the parser inferred types for the subexpressions with numbered ordering in then-clause and else-clause as follows:
if -> condition: (gt
                 -> a
                 -> 0)
   -> then-clause: (multiply                // 5. Decimal(34, 2) add both the precision, scale of expr1 & expr2
                 -> (coalesce               // 3. Decimal(24, 2)
                       -> (cast -> b),      // 1. Decimal(24, 2)
                       -> 0)                // 2. Decimal(24, 2)
                 -> 1)                      // 4. Decimal(10, 0) -> default for short decimal type
   -> else-clause: 0)                       // 6. Decimal(34, 2)

After inferring the types, the expressions are compiled.

During this phase, the 0 from coalesce() expr is compiled and stored in the hashmap ExprDeDup under scope->visited.
When compiling the else-clause, hashmap is searched for an already compiled 0. Here the hashmap uses '==' operator within the comparer function.

Since == ignores the precision & length difference, the 0 with type decimal(24,2) from 2. and 0 with type decimal(34, 2) from 6. are treated as the same ITypedExpression and cache in the same key in the hashmap. This results in the following VELOX_CHECK failure:
thenType->equivalent(*elseClauseType) Else clause of a SWITCH statement must have the same type as 'then' clauses. Expected DECIMAL(34,2), but got DECIMAL(24,2).
Solution
This issue is unique to decimal type as the other types don't differ in precision / length. So this PR adds explicit type checking to the comparator logic to differentiate them. The impact should be minimal as there can be more expressions cached in the hashmap but it doesn't impact the correctness.
Also moved the comparer to .h file and out of anonymous namespace in order to test it directly with constExprDecimalTypeCheck unit test in ExprCompileTest.cpp

@pedroerp @mbasmanova Will you be available to review this, thx?


Removed pantry pod and codabled everything

Only thing that needs to stick around is a new wrapper struct that we discard. Fixes #182

Not entirely sure why the tests are failing on circle, they seem to build OK locally.

Testing via fastlane fails too. It appears that NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true) isn't a good choice for headless testing.
Not a huge fan of how I use a different path when detecting tests but it seems to work OK. I tried creating a directory at the application support path if it didn't exist but that also failed.


Words not getting highlighted properly

There seems to be a shift of one character when I tried to highlight a word today. Interesting thing is, it's not happening for every word in the file. I tried disabling every other extension and this still persists. Following is the screenshot of such occurance: (file in the image below)

Apart from that, when I tried it with refined-github enabled, I got the following behaviour. I think it's because of the feature: Tabs are shown as 4 spaces instead of 8 (I'm not able to find which file does that in RGH so I couldn't disable that feature and test)

Thanks for your report.

It seems GitHub's first tab indent is 7, not 8. I don't know if it is a bug or by design. Already submit it to https://github.com/contact.

Currently GitHub determines tab size by checking project's .editorconfig. Octohint follows it. It seems more reasonable to determine tab size by page content already rendered, since other extensions or user scripts may change the default behavior

@tanmayrajani Tab size is compatible with refined-github at v2.0.6, which is already published to Chrome Web Store. Should be auto updated soon.
The first issue is confirmed by GitHub Team. They are working on it.

Thank you for the quick implementation. Just verified the fix with Refined GitHub. I'll go ahead and close this issue now since the remaining part is from GitHub itself. Cheers! :)


Code chunks not highlighted and CodeLens commands not showing in Rmd files

Describe the bug
When editing Rmarkdown files the code chunks are not highlighted and CodeLens commands not showing.
To Reproduce
Create new Rmd file and create code chunk.
Do you want to fix by self? (I hope your help!)
Don't know how.
(If yes,) what kind of help do you want? (e.g. Which file should I fix, Survey (related documents)
(If related)setting.json
  "r.bracketedPaste": true,
  "r.sessionWatcher": true,
  "r.rterm.linux": "/home/nicolai/miniconda3/bin/radian",
  "r.rmarkdown.enableCodeLens": true,
  "r.rmarkdown.codeLensCommands": [
        "r.runCurrentChunk",
        "r.runAboveChunks",
        "r.runNextChunk"
    ],
  "r.rpath.linux": "/usr/lib/R/bin/R",
  "r.rmarkdown.chunkBackgroundColor": "rgba(128, 128, 128, 0.3)"

Expected behavior
Code chunks highlighted and CodeLens commands shown above the chunk.
Screenshots

Environment (please complete the following information):

OS: Pop_OS 20.10
VSCode Version: 1.55.1
R Version: 4.0.2
vscode-R version: 1.6.5

Could you confirm that your Rmd document is using R Markdown language?
You could also associate *.rmd files with rmd language via the following setting:
"files.associations": {
        "*.rmd": "rmd"
}

Thank you so much! I have been trying to make it work for hours.
It was somehow set to "markdown". Changing it to "rmd" solved it.
Thanks again! and tanks for making this great extension.

I was missing your first part:
(I've included both parts here)
  "r.rmarkdown.enableCodeLens": true,
  "r.rmarkdown.codeLensCommands": [
        "r.runCurrentChunk",
        "r.runAboveChunks",
        "r.runNextChunk"
    ],

    "files.associations": {
      "*.rmd": "rmd",
      "*.Rmd": "rmd"
    },


something about k-fold cv

as mention in this work:
For the submission to KITTI test server, we
follow the training protocol mentioned in (Shi et al. 2020a),
where 80% labeled point cloud images are used for training
and the rest 20% images are used for validation.

it means you use 80% of that to train and 20% to turn parameters, and then summited the best one to KITTI test server?
and where could I get this 5-fold cv split files?( or just done by simply skip 4 sample,if so i can do by myself)

Hi,
Yes, we randomly pick 80% labeled examples for training and use the remaining 20% for validation. You can simply write a script to generate the split or just follow the strategy you've mentioned.

Hi,
Yes, we randomly pick 80% labeled examples for training and use the remaining 20% for validation. You can simply write a script to generate the split or just follow the strategy you've mentioned.

awesome! thanks for rapid reply


Update the addTransaction command prefix to something more intuitive

Suggestions: pay, payer, pa

@ongkc did you change the prefixes? I don't see any differences


DURABLE_WRITES setting test

There's some cleanup in this PR. I can remove it if you don't want to review commit-by-commit. 1177cc0 is just whitespace fixes, and 10f640e cleans up imports, both in the file where I've added a test.
5a44306 is where it's at. On trunk, and on HEAD for 2.2, 2.1, and 2.0, this fails when the new setting for DURABLE_WRITES isn't respected.
I don't know if I'm happy with how readable this test is, so I'm looking for feedback there.

+1

Thanks for the review. I squashed in a @reqiure for the test, since it fails.
Merging.


Wrong call for modules

Using the following action:
- name: Installing QT
      uses: jurplel/install-qt-action@v2
      with:
        modules: qtscript xmlpatterns

produces the following call:
[command]python -m aqt install -O d:\a\meshlab/Qt 5.12.6 windows desktop win64_msvc2017_64 "-m qtscript xmlpatterns"

I think the quotes are wrong.

Can i see the workflow where this is occurring?

Of course:
https://github.com/alemuntoni/meshlab/commit/a9d2c2ef19670cf0294d71eb6ddac1071bca8648/checks?check_suite_id=349452823

Have you tried in the last 30 minutes or so? I just pushed an update that fixed a lot of stuff related to modules

Oh ok, cool! Now it's working! 😄
Thank you very much!

Great! tell me if you need anything else!


Mr

Context
Add the ability to push inferences to a given integration

Actions

[ ] Add UI for exporting integrations

cc/ @martham93


fix(15874): fix the go to home link on blocking views

Details

This PR fixes the Go to home link that appears on the blocking views for small screens.
Fixed Issues

$ https://github.com/Expensify/App/issues/15874
PROPOSAL: https://github.com/Expensify/App/issues/15874#issuecomment-1477763221
Tests

Launch the NewDot app
Login with any account
Type something in URL to land on not existing page
Check that Link to go back exists
Click on URL should move back to main / home screen

[x] Verify that no errors appear in the JS console

Offline tests

N/A
QA Steps

Launch the NewDot app
Login with any account
Type something in URL to land on not existing page
Check that Link to go back exists
Click on URL should move back to main / home screen

[x] Verify that no errors appear in the JS console

PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android / native
[x] Android / Chrome
[x] iOS / native
[x] iOS / Safari
[x] MacOS / Chrome / Safari
[x] MacOS / Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If a new component is created I verified that:

[x] A similar component doesn't exist in the codebase
[x] All props are defined accurately and each prop has a /** comment above it */
[x] The file is named correctly
[x] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[x] The only data being stored in the state is data necessary for rendering and nothing else
[x] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[x] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[x] All JSX used for rendering exists in the render method
[x] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)

[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
https://user-images.githubusercontent.com/30054992/227266156-8b5b7087-61b8-4a2e-a956-5e0a78f8e00a.mov

Mobile Web - Chrome
https://user-images.githubusercontent.com/30054992/227266303-ea748d3a-9340-4796-a181-494089110d1f.mov

Mobile Web - Safari
https://user-images.githubusercontent.com/30054992/227266588-3d483d32-cf13-41c1-8b0c-fdfcdff7f908.mov

Desktop
https://user-images.githubusercontent.com/30054992/227266507-f31bb592-c04d-4430-8937-b73171255e99.mov

iOS
https://user-images.githubusercontent.com/30054992/227266682-6b361e2c-049e-4ac1-b1b1-d96690895748.mov

Android
https://user-images.githubusercontent.com/30054992/227266752-e8a8132f-cbd2-402a-bf6e-f7db44c55a4d.mov

@madmax330 @sobitneupane One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

cc: @madmax330

🚀 Deployed to staging by https://github.com/madmax330 in version: 1.2.92-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/luacmartins in version: 1.2.92-2 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


Add loki not running alert to avoid high cloud costs

Before adding a new alerting rule into this repository you should consider creating an SLO rules instead.
SLO helps you both increase the quality of your monitoring and reduce the alert noise.

How to create a SLO rule: https://github.com/giantswarm/sloth-rules#how-to-create-a-slo
Documentation: https://intranet.giantswarm.io/docs/monitoring/slo-alerting/

Towards: https://github.com/giantswarm/giantswarm/issues/30124 and https://github.com/giantswarm/giantswarm/issues/30381
This PR adds a new alerts that will transcend all pipelines to make sure atlas is paged (during business hours) for loki statefulsets not running to prevent high cloud costs due to loki hammering the object storage api if it is crashlooping for any reasons.
We only care about the statefulsets as those are the only components that are accessing S3 but maybe we need the same alert for the loki deployments.
I initially experimented with increase(loki_s3_request_duration_seconds_count{status_code=~"5.*"}[5m] but this metric gets reset and rate did not work either so I settled on the statefulset not running alert for 30m
Unit tests are on the way but I wanted eyes first
Checklist

[x] Update CHANGELOG.md
[ ] Add Unit tests
[ ] Follow Alert structure
[ ] Consider creating a dashboard (guidelines) (if it does not exist already) to help oncallers monitor the status of the issue.
[ ] Request review from oncall area, as well as team (e.g: oncall-kaas-cloud GitHub group).

How / In which situation can the kube_statefulset_status_replicas value be higher than the kube_statefulset_status_replicas_current one ?

Fairly easily, kube_statefulset_status_replicas is basically spec.replicas where kube_statefulset_status_replicas_current is the number of running replicas

We could also replace kube_statefulset_status_replicas_current with kube_statefulset_status_replicas_ready and that should serve the same purpose. The list of statefulset metrics can be found here https://github.com/kubernetes/kube-state-metrics/blob/main/docs/statefulset-metrics.md

The origin of those metrics is that:
FIELDS:
   availableReplicas	<integer>
     Total number of available pods (ready for at least minReadySeconds)
     targeted by this statefulset.

   collisionCount	<integer>
     collisionCount is the count of hash collisions for the StatefulSet. The
     StatefulSet controller uses this field as a collision avoidance mechanism
     when it needs to create the name for the newest ControllerRevision.

   conditions	<[]Object>
     Represents the latest available observations of a statefulset's current
     state.

   currentReplicas	<integer>
     currentReplicas is the number of Pods created by the StatefulSet controller
     from the StatefulSet version indicated by currentRevision.

   currentRevision	<string>
     currentRevision, if not empty, indicates the version of the StatefulSet
     used to generate Pods in the sequence [0,currentReplicas).

   observedGeneration	<integer>
     observedGeneration is the most recent generation observed for this
     StatefulSet. It corresponds to the StatefulSet's generation, which is
     updated on mutation by the API Server.

   readyReplicas	<integer>
     readyReplicas is the number of pods created for this StatefulSet with a
     Ready Condition.

   replicas	<integer> -required-
     replicas is the number of Pods created by the StatefulSet controller.

   updateRevision	<string>
     updateRevision, if not empty, indicates the version of the StatefulSet used
     to generate Pods in the sequence [replicas-updatedReplicas,replicas)

   updatedReplicas	<integer>
     updatedReplicas is the number of Pods created by the StatefulSet controller
     from the StatefulSet version indicated by updateRevision.

In light of that, maybe we should use kube_statefulset_status_replicas_available instead

This would turn the query into
kube_statefulset_replicas{cluster_type="management_cluster", namespace="loki"}
  -
kube_statefulset_status_replicas_available{cluster_type="management_cluster", namespace="loki"}
> 0

@giantswarm/team-atlas what do you think?

I feel like kube_statefulset_status_replicas_available would suit better here

Moved to kube_statefulset_status_replicas_available

I'm concerned the pods could be flapping, ie ok/bad/ok/bad at short intervals. Isn't there something like a restart counter we could rely on? Are we sure it never gets to be available between 2 restarts and still be a problem?
Also, this alert won't cover the case when it's getting denied access to S3 and hammers network infrastructure with retries (ie proxies). So maybe we should have a separate alert for it.

@hervenicol you're right about flapping and we could use this kube_pod_container_status_restarts_total metric for that. Do you think we should make this another alert? I still think we need the alert based on kube_statefulset_status_replicas_available because from what I've seen on snail, the pods took some time to be scheduled (i think due to pending state) and this specific alert would haved paged for snail as you can see https://grafana.snail.gaws.gigantic.io/explore?schemaVersion=1&panes={"87p":{"datasource":"PBFA97CFB590B2093","queries":[{"refId":"A","expr":"kube_statefulset_status_replicas{cluster_type%3D\"management_cluster\", namespace%3D\"loki\"}\n        - \n        kube_statefulset_status_replicas_current{cluster_type%3D\"management_cluster\", namespace%3D\"loki\"}\n        > 0","range":true,"instant":true,"datasource":{"type":"prometheus","uid":"PBFA97CFB590B2093"},"editorMode":"code","legendFormat":"__auto"}],"range":{"from":"now-30d","to":"now"}}}&orgId=1

I agree with you about the network access, I'll try to find one by blocking the CNP but this is not about cost

So both alert makes sense and I'm not sure which one is better than the other.

But thinking about the proxy hammering, the issue is that loki was restarting too often so if we have this alert, it should cover the network hammering as we would be alerted about the symptom

I think the restarts_total is easier to read and understand.

It is but it is missing the pending pods but that's okay :)

Changed to pod container restarts

You might be correct @QuantumEnigmaa but this alert (cannot access s3) is not going to work if the container restarts all the time

I still want to experiment with cutting the cnp to test but I'd like to have this out first


[Task]: Remove the Dataflow JRH requiring all JRH users to use Runner V2 for 2.45.0+

What needs to happen?
The Java Runner Harness (aka JRH) was an earlier implementation of the portability effort for Dataflow users powering Python, Go and Java portable pipelines.
Since then it has been superseded by the Runner V2 effort for Dataflow.
There are very few portable pipelines using the JRH on Dataflow and the purpose of this task is to require portable pipelines to use Runner V2.
Note that there will be no change to existing non-portable pipelines.
Issue Priority
Priority: 2
Issue Component
Component: runner-dataflow

@lukecwik is this ready for 2.45? or should it be delayed to 2.46?

All the work for 2.45 has been completed that was necessary. The remaining code clean-up is nice to have for 2.45.0 but shouldn't block the release. I cut https://github.com/apache/beam/issues/25103 for the clean-up work.


LMS1xx automatic protocol switch seems to fail

Doing some quick trials using roslaunch sick_scan sick_lms_1xx.launch . With use_binary_protocol=true I get the message
`[1669718290.032772035] [ INFO] [/sick_lms_1xx:SickScanCommon::init] Failed to init scanner Error Code: 1
Waiting for timeout...
If the communication mode set in the scanner memory is different from that used by the driver, the scanner's communication mode is changed.
This requires a restart of the TCP-IP connection, which can extend the start time by up to 30 seconds. There are two ways to prevent this:

[Recommended] Set the communication mode with the SOPAS ET software to binary and save this setting in the scanner's EEPROM.
Use the parameter "use_binary_protocol" to overwrite the default settings of the driver.`

So I get the impression that it would fix this problem in 30 seconds, but it seems it doesn't. I just get more error messages and no data.
Then trying with with use_binary_protocol false instead I get
[1669718973.874550634] [ERROR] [/sick_lms_1xx:SickScanFieldMonSingleton::parseAsciiDatagram] SickScanFieldMonSingleton::parseAsciiDatagram not implemented.
I get the impression that there is a lot of automagic stuff not working here. I would prefer a fault handling that would throw/abort earlier in the startup process instead of this happening.

Hello,
thank you for reporting this issue. Together with issue #128, it looks like a bug in switching between ASCII and binary protocols. As a workaround until we can fix it, can you configure the scanner for binary communication via SOPAS ET, save the settings in the EEPROM and ensure that the port used matches with the one specified in the sick_lms_1xx.launch file ()? Then, retry with use_binary_protocol=true.
Best regards,
Manuel

Thanks for your feedback.  Use of binary communication mode (i.e. setting use_binary_protocol=true) is recommended. If the lidar is still in Ascii-mode after start, the driver switches automatically into binary mode and reinitializes the lidar intentionally.
If you still get error messages in binary mode after reinitialization, the problem appears to be somewhere else. Which error messages do you get? Can you post a complete logfile or screenshots from the startup sequence?

Close due to inactivity.


add_parameter and nested Parameterized

ALL software version info
python 3.9.6
param 1.13.0
Description of expected behavior and the observed behavior
if I use .param.add_parameter() to add (nest) a param.ClassSelector(Parameterized, default=A()) parameter to a Parametrized class, all instances of B() seem to contain the same A() instance in that parameter.
In the output of the code below, I expect the last line to say b2.parameterized_dynamic.p_static = default_p_static
Perhaps I am missing an instantiate or per_instance argument, but the help for add_paremeter() says Should result in a Parameter equivalent to one declared in the class's source code., and that is not what I see.
Complete, minimal, self-contained example code that reproduces the issue
import param

class A(param.Parameterized):
    p_static = param.Parameter("default_p_static")

    def __init__(self, **params):
        super().__init__(**params)
        self.param.add_parameter("p_dynamic", param.Parameter("default_p_dynamic"))
a1 = A()
a2 = A()
a1.p_static = "new_p_static"
print("a1.p_static = " + a1.p_static)
print("a2.p_static = " + a2.p_static)
a1.p_dynamic = "new_p_dynamic"
print("a1.p_dynamic = " + a1.p_dynamic)
print("a2.p_dynamic = " + a2.p_dynamic)

class B(param.Parameterized):
    parameterized_static = param.ClassSelector(A, default=A())

    def __init__(self, **params):
        super().__init__(**params)
        self.param.add_parameter("parameterized_dynamic", param.ClassSelector(A, default=A()))
b1 = B()
b2 = B()
b1.parameterized_static.p_static = "new_p_static"
print("b1.parameterized_static.p_static = " + b1.parameterized_static.p_static)
print("b2.parameterized_static.p_static = " + b2.parameterized_static.p_static)
b1.parameterized_dynamic.p_static = "new_p_static"
print("b1.parameterized_dynamic.p_static = " + b1.parameterized_dynamic.p_static)
print("b2.parameterized_dynamic.p_static = " + b2.parameterized_dynamic.p_static)

Output
a1.p_static = new_p_static
a2.p_static = default_p_static
a1.p_dynamic = new_p_dynamic
a2.p_dynamic = default_p_dynamic
b1.parameterized_static.p_static = new_p_static
b2.parameterized_static.p_static = default_p_static
b1.parameterized_dynamic.p_static = new_p_static
b2.parameterized_dynamic.p_static = new_p_static

Hi @samimia-swks, I wouldn't be surprised to see bugs with add_parameter. Even if it's been available in the code base for a very long time, it's basically untested (I added a first simple test recently). However, running your code against the main branch I get this output which seems fine. I'd be nice to write a test that capture this behavior to avoid any potential regression.
a1.p_static = new_p_static
a2.p_static = default_p_static
a1.p_dynamic = new_p_dynamic
a2.p_dynamic = default_p_dynamic
b1.parameterized_static.p_static = new_p_static
b2.parameterized_static.p_static = default_p_static
b1.parameterized_dynamic.p_static = new_p_static
b2.parameterized_dynamic.p_static = default_p_static

Thanks for the quick response. I tried v2.0.0a3 and got the same (correct) result as you, but when trying this version with my main code base, encountered an unrelated bug which I just filed (#837). I am going to see if I can get around this seperate issue and confirm that my original issue is solved.

Note that Param 2 does have breaking changes; some previously accepted code will no longer be accepted in Param 2. But as the release notes will show, we think these changes are all improvements, and I hope you'll agree!

I think this issue can be closed since the related issue has its own solution, but feel free to reopen if that's not the case!


[Build] Use -I when building C targets within a package

According to behavior decribed in the original C language proposal, we
were passing -iquote for search paths between targets in a package.
Historically, this helps users in distinguishing project headers vs
dependencies. This is not really very useful anymore and prevents some
use cases like compiling an upstream library without factoring it out
into its own package.
This simplifies the behavior by using -I for all cases and is
a backwards compatible change since -I allows both quote and angled
bracket style includes.
rdar://problem/44308356 [SR-8620]: SwiftPM should use -I instead of -iquote for public headers of a target dependency in the same package

@swift-ci smoke test