Appstudio update test-component-pac-adzc

Pipelines as Code configuration proposal
To start the PipelineRun, add a new comment with content /ok-to-test
For more detailed information about running a PipelineRun, please refer to Pipelines as Code documentation Running the PipelineRun
To customize the proposed PipelineRuns after merge, please refer to Build Pipeline customization

Pipelines as Code CI/test-component-pac-adzc-on-pull-request has successfully validated your commit.

StatusDurationName

✅ Succeeded
7 seconds
init

✅ Succeeded
18 seconds
clone-repository

✅ Succeeded
46 seconds
build-container

✅ Succeeded
21 seconds
deprecated-base-image-check

✅ Succeeded
23 seconds
inspect-image

✅ Succeeded
17 seconds
clair-scan

✅ Succeeded
1 minute
clamav-scan

✅ Succeeded
14 seconds
sbom-json-check

✅ Succeeded
11 seconds
label-check

✅ Succeeded
11 seconds
show-sbom

✅ Succeeded
10 seconds
show-summary


Bluetooth: deadlock when canceling db_hash.work from settings commit handler

Describe the bug
There is a deadlock when cancelling db_hash.work:
	/* Stop work and generate the hash */
	(void)k_work_cancel_delayable_sync(&db_hash.work, &db_hash.sync);

from db_hash_commit. db_hash_commit is called with settings_lock mutex held and cancelling db_hash.work will never finish, as settings_save_one("bt/hash", ...) is waiting on settings_lock mutex as well and never continues.
This can be workarounded by adding some arbitrary sleep in application code.
To Reproduce
I was not successful with reproducing it with upstream code/sample. I have downstream project, which triggers this case every time, so I can test possible fixes.
Expected behavior
Deadlock case prevented.
Impact
Annoyance for now, but it could be triggered on real devices in the field and cause deadlock in boot process.
Logs and console output
main thread backtrace:
#0  arch_swap (key=0) at /project/zephyr/arch/arm/core/aarch32/swap.c:53
#1  0x0003fa7c in z_swap_irqlock (key=<optimized out>) at /project/zephyr/kernel/include/kswap.h:173
#2  z_swap (key=..., lock=0x200170f0) at /project/zephyr/kernel/include/kswap.h:173
#3  z_pend_curr (lock=lock@entry=0x200170f0, key=..., wait_q=wait_q@entry=0x20006610 <db_hash+72>, timeout=...)
    at /project/zephyr/kernel/sched.c:699
#4  0x0003f4c4 in z_impl_k_sem_take (sem=sem@entry=0x20006610 <db_hash+72>, timeout=...)
    at /project/zephyr/kernel/sem.c:159
#5  0x000539be in k_sem_take (timeout=..., sem=0x20006610 <db_hash+72>) at zephyr/include/generated/syscalls/kernel.h:769
#6  k_work_cancel_delayable_sync (dwork=dwork@entry=0x200065d8 <db_hash+16>, sync=sync@entry=0x20006608 <db_hash+64>)
    at /project/zephyr/kernel/work.c:1005
#7  0x0001552a in db_hash_commit () at /project/zephyr/subsys/bluetooth/host/gatt.c:5158
#8  0x0000b828 in settings_commit_subtree (subtree=subtree@entry=0x0 <_vector_table>)
    at /project/zephyr/subsys/settings/src/settings.c:249
#9  0x0000b5ba in settings_load_subtree (subtree=subtree@entry=0x0 <_vector_table>)
    at /project/zephyr/subsys/settings/src/settings_store.c:60
#10 0x000442da in settings_load () at /project/zephyr/subsys/settings/src/settings_store.c:39
#11 0x00002608 in bt_init (dev=<optimized out>) at /project/app/src/bt.c:209
#12 bt_init (dev=<optimized out>) at /project/app/src/bt.c:195
#13 0x0003e97c in z_sys_init_run_level (level=level@entry=3) at /project/zephyr/kernel/device.c:87
#14 0x0003ebe0 in bg_thread_main (unused1=<optimized out>, unused2=<optimized out>, unused3=<optimized out>)
    at /project/zephyr/kernel/init.c:161
#15 0x00040c5c in z_thread_entry (entry=0x3ebc9 <bg_thread_main>, p1=<optimized out>, p2=<optimized out>, p3=<optimized out>)
    at /project/zephyr/lib/os/thread_entry.c:29
#16 0x0000f004 in arch_switch_to_main_thread (main_thread=<optimized out>,
    stack_ptr=0x20021480 <z_idle_stacks> '\252' <repeats 200 times>..., _main=0x3ebc9 <bg_thread_main>)
    at /project/zephyr/arch/arm/core/aarch32/thread.c:539

sysworkq thread backtrace:
#0  arch_swap (key=0) at /project/zephyr/arch/arm/core/aarch32/swap.c:53
#1  0x0003fa7c in z_swap_irqlock (key=<optimized out>) at /project/zephyr/kernel/include/kswap.h:173
#2  z_swap (key=..., lock=0x200170f0) at /project/zephyr/kernel/include/kswap.h:173
#3  z_pend_curr (lock=lock@entry=0x200170f0, key=<EMAIL_ADDRESS>wait_q=wait_q@entry=0x20003300 <settings_lock>, timeout=...)
    at /project/zephyr/kernel/sched.c:699
#4  0x0003f2e6 in z_impl_k_mutex_lock (mutex=0x20003300 <settings_lock>, timeout=...)
    at /project/zephyr/kernel/mutex.c:164
#5  0x0000b52e in k_mutex_lock (mutex=<optimized out>, timeout=...) at zephyr/include/generated/syscalls/kernel.h:674
#6  settings_save_one (name=name@entry=0x6075a "bt/hash", value=value@entry=0x200065c8 <db_hash>, val_len=val_len@entry=16)
    at /project/zephyr/subsys/settings/src/settings_store.c:104
#7  0x00014740 in db_hash_store () at /project/zephyr/subsys/bluetooth/host/gatt.c:678
#8  0x0001544e in db_hash_gen (store=store@entry=true)
    at /project/zephyr/subsys/bluetooth/host/gatt.c:717
#9  0x000154c6 in db_hash_process (work=<optimized out>)
    at /project/zephyr/subsys/bluetooth/host/gatt.c:727
#10 0x0003f69a in work_queue_main (workq_ptr=0x20007270 <k_sys_work_q>, p2=<optimized out>, p3=<optimized out>)
    at /project/zephyr/kernel/work.c:680
#11 0x00040c5c in z_thread_entry (entry=0x3f5a1 <work_queue_main>, p1=<optimized out>, p2=<optimized out>, p3=<optimized out>)
    at /project/zephyr/lib/os/thread_entry.c:29
#12 0xaaaaaaaa in ?? ()

Environment (please complete the following information):

OS: Linux
Toolchain Zephyr SDK 0.12.4
Commit SHA or Version used: 92d80d50b9b33e660a6ab3287d6505c212929557

@mniestroj Can you check if https://github.com/zephyrproject-rtos/zephyr/pull/35225 has any effect on this issue?

Why is a deadlock a low-priority bug?
The problem will occur if the work queue thread takes &db_hash.work off the queue then releases the spinlock, but before it can invoke the handler is preempted by something that invokes db_hash_commit() (via `settings_commit()) from a thread context.
I don't believe the synchronous cancel from db_hash_read() (a GATT read for the hash characteristic) would deadlock, though it would sleep until the work handler regained control and completed the item.
#35225 will not fix the problem.

If both settings_commit() and settings_save_one() have the sleep attribute, which I think they do, a fix could be difficult because neither has a no-sleep path that would allow simultaneous callers to avoid the deadlock.
A fix may require extending the settings API to support no-sleep failable API calls, and refactoring this module to always use the work item (or a dedicated thread) to maintain the hash, where if the update fails the work item is immediately rescheduled so that whatever holds the settings lock is given an opportunity to complete.
That would interfere with desire to be able to update the hash without sleeping, but I suspect that desire is ultimately unsatisfiable.

Switching the priority to medium as per @pabigot's assesment of the issue.

Can you give #35403 a try?

Issue is no longer reproducible with that PR, so it helps.

I can believe that eliminating a window where a cancellation can be initiated in a single-processor system would help, but my analysis above took that change into account: the basic problem remains.


Adding the AppManager. Still missing GUI.

Adding a new version of the AppManager, used to manage and communicate with apps running in different QProcesses. You can send messages to the apps to change the parameters that live inside of them.
For more information on how it works, check the correct docstrings.
The AppManager has been tested in linux and windows.

I have added an issue to be close with this PR. Another 2 open issues that are related but I am not sure if they should be closed:
https://github.com/toolsforexperiments/plottr/issues/205
https://github.com/toolsforexperiments/plottr/issues/91 -> This one seems to be very similar to issue #228 but with extra features (like logging) Those are not yet implemented in the launching script. I have opened another issue to add logging and a way to see the messages the other app is showing. When opening an app from the script itself from terminal, you can see the messages it sends

The mypy error is a known issue with python 3.10.7 and mypy. There is a solution coming but the work around is to downgrade to python 3.10.6 for now: https://github.com/python/mypy/issues/13627

@marcosfrenkel mypy 0.981 is out and https://github.com/toolsforexperiments/plottr/pull/331 will fix this


Narrow type of constructor.name

Suggestion
🔍 Search Terms
class
constructor.name
✅ Viability Checklist
My suggestion meets these guidelines:

[x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
[x] This wouldn't change the runtime behavior of existing JavaScript code
[x] This could be implemented without emitting different JS based on the types of the expressions
[x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
[x] This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion
class Foo {}

type FooName = typeof Foo.constructor.name; // Should be literal `"Foo"`, but is instead `string`

In the context of this issue, I am not sure whether this is a "bug" or a "suggestion", but I went with a suggestion for now.
📃 Motivating Example
I want to use TypeScript to ensure that all of my classes meet some criteria. Consider the following trivial example:
class Foo {}
class Bar {}
class Baz {}

/** We organize them into an array so that we can instantiate them all at the same time with some common parameters. */
const MY_CLASSES = [
  Foo,
  Bar,
  Baz,
] as const;

/** Helper type to retrieve the class names of a tuple containing classes. */
type MyClassNames = InstanceType<typeof MY_CLASSES[number]>["constructor"]["name"]
// Oops! TypeScript messed up, and `MyClassName` is `string` instead of `"Foo" | "Bar" | "Baz"`.

const CLASSES_TO_METADATA = {
  Foo: "something",
  Bar: "something else",
} as const satisfies Record<MyClassNames, string>

Oops, I forgot to put an entry for my Baz class inside of my CLASSES_TO_METADATA object. Even though I carefully took the time to specify a satisfies constraint, TypeScript doesn't care!
I do not think there are any workarounds for this "bug" right now other than to explicitly duplicate the name of the class inside of the class itself, like this:
class Foo {
  readonly name = "Foo" as const;
}
class Bar {
  readonly name = "Bar" as const;
}
class Baz {
  readonly name = "Baz" as const;
}

/** We organize them into an array so that we can instantiate them all at the same time with some common parameters. */
const MY_CLASSES = [
  Foo,
  Bar,
  Baz,
] as const;

/** Helper type to retrieve the class names of a tuple containing classes. */
type MyClassNames = InstanceType<typeof MY_CLASSES[number]>["name"]

const CLASSES_TO_METADATA = {
  Foo: "something",
  Bar: "something else",
} as const satisfies Record<MyClassNames, string>

Very ugly! But in this second code snippet, the satisfies part works properly.

Duplicate of #37340.
Trying to narrow via constructor.name is a fairly bad choice. The class may be subclassed, in which case the name will be different, but it will still be a valid instance.
class Base {}
class Derived extends Base {}

const base: Base = new Derived();
console.log(base.constructor.name); // base is typed Base, but logs "Derived"

Ok. Forgetting constructor.name for a moment, is there a way to go from Foo to the name of the method, purely at compile-time? I'm not interested in any run-time behavior, only compile-time.

No. See #43325.


Complete failure on a slashed minipool

The calculation fails and shows no result at all on this rocket pool node: 0x5E24351eCDAe0a0b85199c58778c9fc704bcC2D2
Error:

Failed to get rewards - Request failed with status code 500 Full withdrawal detected where withdrawal value<PHONE_NUMBER>7000000000) is less than minipool capital<PHONE_NUMBER>0000000000) for minipool 0x88a829a06849193041187f9ce9851fcce7a51a16 - unable to determine node operator share

The reason is that 1 of its 31 minipools has been slashed.
Correct behaviour: calculate that as a negative income, i.e 31.5 - 32 ETH equals -0.5 ETH income.
Since the other 30 minipools have positive income, the result is still very useful.

I never got around to handle these slashed cases for the Rocket Pool mode, just getting the "happy path" right without accounting for slashing incidents was already a lot of work.
The reason it fails completely is I prefer to have the website error out instead of showing a wrong result.
Isn't the RPL collateral used in some way when a slashing incident occurs?
I don't really have the time (to learn how) to account for these kinds of things properly on the website. I can probably retrieve the partial/incorrect data for you and send it over, without accounting for the slashing incident, if you'd like to account for it yourself manually. If so, let me know and I can attach it here.

OK, thanks, I would indeed love to have the data. Can you post it here in a reply?
Appreciate it!

Hey, sorry it took a while to get back to you here.
I tried to get the data for you but I ran into another issue, which is that some of your validators were later converted into a minipool (0x1dd302e2a3cd9b8034619fe5172cbb7f73b29d5a) / promoted.
Unfortunately, validator conversion into a minipool is also not supported by ethstaker.tax , see the known limitations.

Since my grant request to the GMC was only partially approved I haven't really found the motivation to continue working on this.
I'm afraid all I can do for you here is send you the indexed withdrawal data for your validators - here it is:
0x5E24351eCDAe0a0b85199c58778c9fc704bcC2D2-withdrawals.csv


feat: add mobile open transition

What does this PR do and why?
Provide a description of what this PR does. Link to any relevant GitHub issues, Notion tasks or Discord discussions.
Screenshots or screen recordings
If applicable, provide screenshots or screen recordings to demonstrate the changes.
Acceptance checklist

[ ] I have evaluated the Approval Guidelines for this PR.
[ ] (if relevant) I have tested this PR in all supported browsers.
[ ] (if relevant) I have tested this PR in dark mode and light mode (if applicable).

Current dependencies on/for this PR:

main

PR #3451

PR #3456

PR #3457

PR #3458

PR #3459   👈

This comment was auto-generated by Graphite.

@wraeth-eth queued this pull request to merge with Graphite.

Graphite rebased this pull request as part of a merge.

@wraeth-eth merged this pull request with Graphite.


Print to PDF call not working as expected in example?

In the example:
await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle'});
await page.pdf({path: 'hn.pdf', format: 'A4'});

This output is generated (for me at least)
hn.pdf
But below is what I get if I manually print from a Chrome browser on the same page.
FromChrome.pdf
Some other sites work as expected, maybe an issue with HN?

Printing uses the print css defined in the stylesheet. Generating a PDF via puppeteer is grabbing the rendering as it is on the page. That explains the discrepancy.
A method could be added to trigger print style emulation to get the right effect.

A print property could be added to the emulate method for a page. This would trigger print styles for the rendering. So then you should get the same PDF output between a manual and automated run.

This seems to be a little inconsistent though?
For example this:
await page.goto('https://www.washingtonpost.com/sports/capitals/coming-home-cullen-picks-wild-for-21st-nhl-season/2017/08/16/5dfe7858-82b7-11e7-9e7a-20fa8d7a0db6_story.html', {waitUntil: 'networkidle'});
await page.screenshot({path: 'example.png'});
await page.pdf({path: 'test.pdf', format: 'Letter'});

generates  this screenshot

but this pdf?
Uploading test.pdf…
Sometimes print style sheets seem to work.

Maybe the A4 vs Letter format triggers it?

@campbecf: there are different defaults. Puppeteer defaults printBackground to false, whereas chrome has it set to true by default.
There are also other defaults, like margins, which you can tweak to achieve the same results.

@aslushnikov
const puppeteer = require('puppeteer');

(async() => {

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({width: 1920, height: 1200})
await page.goto('https://news.ycombinator.com/', {waitUntil: 'networkidle'});
await page.screenshot({path: 'example.png'});
await page.pdf({path: 'test.pdf', format: 'A4', printBackground: true});

browser.close();
})();

From chrome:
FromChrome.pdf
Puppeteer screenshot:

Puppeteer PDF with printBackground true:
test.pdf
Puppeteer PDF with printBackground false:
test.pdf

Ahh, that's a bug! Thanks!

Should work now. Feel free to write here or create another issue if page.pdf() is still broken for you.

Hi @aslushnikov!
I'm having an issue regarding the PDF printing which might or might not be related to this one. It might also be related to #312 or perhaps even related to this Chromium bug (https://bugs.chromium.org/p/chromium/issues/detail?id=749080).
Consider the following script:
const puppeteer = require('puppeteer');

(async() => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();

  await page.goto('http://example.com', {waitUntil: 'networkidle'});

  await page.emulateMedia('screen');
  await page.pdf({path: 'sample.pdf', format: 'A4', printBackground: true}
});

The expected output PDF would be something like:
sample.pdf
But the actual output is:
sample 2.pdf
This also happens when printing to PDF directly through Chrome/Chromium browser itself. It might be related to what @Garbee mentioned above:
Maybe the A4 vs Letter format triggers it?
What I've observed is a really strange behavior that by selecting Landscape as orientation OR formats larger than A4 (A3, A2, etc), the problem is solved, both through Puppeteer or the browser itself. Maybe it's a parameter or config that I'm missing or it is indeed a Chromium bug.
Can you guys take a look? Much appreciated!

@oliveiraethales that's because example.com has a media query css rule:
    @media (max-width: 700px) {
        body {
            background-color: #fff;
        }
        div {
            width: auto;
            margin: 0 auto;
            border-radius: 0;
            padding: 1em;
        }
    }

@aslushnikov Indeed, I was so focused on finding the issue that I haven't considered the CSS rules themselves. Cheers!

printBackground: true solved my problem. But why should I ever print a website without background? OK, maybe when I just want the text out of the website. But maybe this setting should be by default true.

printBackground: true solved my problem. But why should I ever print a website without background? OK, maybe when I just want the text out of the website. But maybe this setting should be by default true.

Commonly it is defaulted to false, most browsers do not allow you to override it. Generally, you don't want to print the background of a page - consider an off-white #fdfdfd would you really want to print that?
It may not be intuitive to some but as PDF rendering is ultimately printing then it makes sense to keep defaulted as false.

printBackground: true worked for me as well.
Thanks

@campbecf how does your PDF has 2 pages split according to the content . Sorry for asking it in here .
Can you please help me here. I am successfully able to PDF a long pages of content but in a single page . I wanted to split it like your example pdf according to content.

@Optimusbumble try this way:


Move pixldc commands into PIXL CLI

Fixes #392

Add pixl up command to launch Docker services
Add pixl down to bring Docker services down
Use pixl docker commands in system test
Remove pixldc
Update docs

Periphery changes:

Use common pixl-db envvars for orthanc-anon
Remove obsolete cli._utils

Reverted back to using docker compose directly in run-system-test.sh because attempting to use pixl up/down requires the following:

They need to be run from the project root directory (though the exact reason for this is still vague to me)
They require all of the environment variables in test/.env to be set, because running the CLI through Python results in a series of imports and config() calls, which will fail when the envvar is not set

There's a couple of workarounds for this, like temporarily copying over the test/.env file to project root, or loading the test/.env file through Python. But I'm going to leave it at this because this PR already took way too much time for what should have been a simple change 🫠
More importantly though, I think this points to some not-so-ideal design choices in the way we're handling these environment variables and .env files. Because when I'm running pixl up, I don't really care whether RABBITMQ_HOST is defined or not, but at the moment that will result in an error. Might be worth having a think about!


Documentation: pio_sm_clkdiv_restart(): Misleading Description

The documentation says on pio_sm_clkdiv_restart():
"Restart a state machine's clock divider (resetting the fractional count)"
This sounds, like only the fractional part would be reset, if the phrase in parentheses is taken as an explanation for the phrase before.
In fact, the integer count value is reset and the fractional accumulator (this is not a count!) is cleared, according to RP2040 datasheet, Sect. 3.7, Table 379.
Same for pio_clkdiv_restart_sm_mask().

Thank you, sounds great!  Just a single nitpick:

"This function clears the divider's integer and fractional phase accumulators"

I would have expected "accumulator" (singular form), since the integer part is (in contrast to the fractional part) used as a counter, at least as far as I understand.  (The integer part is increased by one whenever the accumulator overflows, but otherwise solely acts as a decreasing counter.  In contrast, upon each clock cycle, the fractional divider part is added to the accumulator (thus effectively accumulating the summed up fractional time) and wraps around upon overflow). :-)

Whether a downcounter can be considered an accumulator where only -1 is added, in the digital design sense, is a philosophical question that is beyond me -- what I am certain of is that it accumulates phase :)
Thanks for raising this by the way, there were some other things in there that needed clearing up.


How do you record the screen?

I've been looking for python bindings for a screen recorder, and I can't seem to get anywhere near 60fps.
PIL.ImageGrab is about 8-9 FPS
mss.grab is about 15-16 FPS
This is on an i7 2600K as well... so -- really surprised how slow those two are.

Doing raw video processing directly in Python is going to be slow no matter what. Libraries like PIL are designed to work with all of the image data in memory directly accessible from Python, but it's slow, and there's a limit to how fast you can process image data in this manner.
With ffmpeg-python, instead the processing is done indirectly by shelling out to a separate ffmpeg process. All of the work is done in ffmpeg so it's a lot faster, but the downside is that you don't work with individual frames.
So it depends what you're trying to do. Does the captured video data just need to go to a file, or streamed over a socket, or do you also need to do additional processing on the video?

Streaming to a file is easy - just specify the correct output.
Streaming across a socket requires simply having ffmpeg write to stdout (probably .output('file:stdout') or something like that)
If you have to do additional processing on the video data, it's best to do it with ffmpeg rather than trying to do frame-by-frame processing in python, which is a computation bottleneck.


Best practice for localizing within a config file

Out of the box my code has a configuration file
export const siteConfig = {
  name: "My website",
}

And then in the React component it has something like
import { siteConfig } from '...'

export default async function Page() {
  return (

{siteConfig.name}

  )
}

All else equal, I would like to have my string ID just be the strings themselves, for readability in a simple project. So ideally it would be something like:
import { getI18n } from '@/locales/server'

const t = await getI18n() // Wouldn't work because it's outside of a function

export const siteConfig = {
  name: t('My website'),
}

... and/or ...
import { siteConfig } from '...'
import { getI18n } from '@/locales/server'

export default async function Page() {
  const t = await getI18n()
  return (

{t(siteConfig.name)}

  )
}

This may be a niche question, but Is there recommended best practice for this, or do I have to settle for including the string ID itself in the component? That solution would look like:
import { siteConfig } from '...'
import { getI18n } from '@/locales/server'

export default async function Page() {
  const t = await getI18n()
  return (

{t('My website')}

  )
}

The main reason this is not desirable is that the config file is used in multiple components. With the strings themselves as IDs, then it's harder to remember and standardize this way. (Although with an ID like site_title it would not be a problem.)
Thanks for your help!

I've worked on this a bit more and the function approach only works when importing to server components:

This fails when you reference them within a client component

The obvious alternative of useI18n isn't a good solution because that's meant for react components

I'm not sure if this is addressed in 1.0, but I think it's important because this is a common pattern for NextJS, e.g. https://github.com/shadcn-ui/ui/tree/main/apps/www/config
Just looking at NextJS docs, it could be simplest to write a quick importer and then pass in the locale from the generate function (https://nextjs.org/docs/app/building-your-application/routing/internationalization).
So like generateSiteConfig('en') and then load that dictionary dynamically in config/site.ts ... I'm not sure about the performance implications off-hand, if there would be any. It's not super elegant though.

One other approach I've considered is calling t() on the variable in the component instead of the config file. So you just leave the config file as is and then in your component do:
{t(siteConfig.title)}

The main issue (feature not a bug!) is type checking doesn't like that, and (less important) it's marginally harder to keep track of which strings you are localizing.

I ended up with a not-so-good solution that works but I believe loads 4x more data than it should. Any ideas how to make it work better?
What I've done is make a new file that can be imported everywhere:
import en from './en.json'
import pt_BR from './pt-BR.json'
import es from './es.json'
import fr from './fr.json'

const locales = {
  'en': en,
  'pt-BR': pt_BR,
  'es': es,
  'fr': fr
}

export const getDictionary = (locale: string) => {
  const dictionary = locales[locale]
  return (str: string) => {
    return dictionary[str]
  }
}

And then calling getDictionary to create the t function inside another function that takes a locale parameter
import { getDictionary } from '@/yuzu/hybrid'

export const generateSiteConfig = (locale: string) => {
  const t = getDictionary(locale)

  return {
    name: "Supervideos",
    description:
      t("Create fully edited videos in seconds!"),
    url: "https://supervideos.app",
    ogImage: "https://supervideos.app/og.jpg",
    links: {
      twitter: "https://twitter.com/supervideosapp",
      github: "https://github.com/xdaluca",
    },
  }
}

Then using in a server environment:
export const generateMetadata = async () => {
  const locale = getCurrentLocale()
  const siteConfig = generateSiteConfig(locale)
  const t = await getI18n()

  return {
    title: {
      default: siteConfig.name,
      template: `%s | ${siteConfig.name}`,
    },
    description: siteConfig.description,
    keywords: [
      t("Video Creation"),
      t("AI generated"),
      t("Editing tool"),
      t("Marketing Videos"),
      t("Make videos"),
    ],
    authors: [
      {
        name: "supervideos",
        url: "https://supervideos.app",
      },
    ],
...

Or a client one:
export async function MobileNav({ items, children }: MobileNavProps) {
  useLockBody()

  const locale = useCurrentLocale()
  const siteConfig = generateSiteConfig(locale)

  return (

        <Link href="/" className="flex items-center space-x-2">
          <Icons.logo />
          {siteConfig.name}
        </Link>
...

It's also worth noting that this simple implementation doesn't support plurals.

The main issue in your solution is (as you mentioned) that you're loading too much data. Probably not an issue when used on the server, but should be avoided on the client:
// All locales are loaded immediately because of this
const locales = {
  'en': en,
  'pt-BR': pt_BR,
  'es': es,
  'fr': fr
}

You can try to replace these values with dynamic imports, similar to createI18n*:
const locales = {
  'en': () => import('./en.json'),
  'pt-BR': () => import('./pt-BR.json'),
  'es': () => import('./es.json'),
  'fr': () => import('./fr.json'),
}

export const getDictionary = async (locale: string) => {
  const dictionary = await (locales[locale])()
  return (str: string) => {
    return dictionary[str]
  }
}

On the server, you can then await getDictionary(locale), and on the client use(getDictionary(locale)).
Just to make I sure understand correctly your pain point, do you wish to be able to use getI18n inside generateMetadata, or be able to split locales in multiple files and use getI18n with it?

My goal is the first one: using getI18n inside generateMetadata, which may be called on the client or the server. The goal is simply to be able to have one config file instead of server + client.

The challenge with what you suggested is that I'm calling getDictionary inside a file that needs to work on server and client, so at that point I don't know if I'll be awaiting or useing.
It feels like I either need to hardcode the string key into the server and client files (meaning it's duplicated) OR call t() on a variable, which violates type assumptions and also make related tasks like extraction more difficult (but not impossible).

The goal is simply to be able to have one config file instead of server + client

Not sure to understand correctly this part. Are you referring to the options passed to createI18nClient & createI18nServer?

Sorry for not being more clear. I'm referring to the config file in my app prior to doing localization.
For example, here ui.shadcn.com config directory, where for example in site.ts, siteConfig.description is defined as 'Beautifully designed components built with Radix UI and Tailwind CSS.'
https://github.com/shadcn-ui/ui/tree/c21ecfb665214e18cd5914ea319f925cd676e786/apps/www/config
Since that is where the raw string lives, it is desirable to call the t() function there. I am using the string itself as the i18n key, by the way.
--
Then it is included in two different files (but often many more in more complex projects):
https://github.com/search?q=repo%3Ashadcn-ui%2Fui+siteConfig.description&type=code
If one of those files were a client file and the other were server, it would complain because the t() function called in the site.ts file would not be able to run on both client and server.

I've got a bunch of strings in config files and still getting errors, is there any development on this?

My latest approach here is to just use server-side tools (e.g. getI18n) and then to pass the config object as a prop into any client components that need it.
@QuiiBz I'm curious if this sounds like a practice worth recommending?

hey there 👋🏼 I've got a bunch of strings in config files and still getting errors, is there any development on this?

Maybe these strings don't have the correct type? They should be narrowed down to match a key (usually with as const), so instead of their type being string, it should be "a.key".
We don't have any recommendations as it's highly dependent on each existing setup. Trying to make something generic would probably not work for everyone.

I'm curious if this sounds like a practice worth recommending?
This seems absolutely fine to me.

Closing as the original question seems resolved, feel free to re-open an issue if you have more questions on this topic!


Nuxt 3 with nuxi/vite support

Hi, there,
I was looking for a solution to automate the bundle size check with Github and came across your repo.
I had a look and unfortunately I can't setup with Nuxt 3 under Vite. I don't think it's supported.
I've tried to adapt the build/analyze settings to Vite (doc):
  build: {
    analyze: {
      template: 'raw-data',
      open: false,
    },
  },

Are you planning to make a solution for Vite or have I misconfigured the plugin?
Thanks for your feedback!

Currently vite is not supported.
We are thinking about supporting it, but it will take time to release it.


Support rustc_skip_array_during_method_dispatch

Likely part of the 2021 edition, so this is just so we don't forget about this: https://github.com/rust-lang/rust/pull/84147
(Actually if we don't support this type inference will be wrong for 2015 and 2018.)

Note that this is already part of Rust 1.53.0 (to be released June 17th) and active in the current editions.


[QUESTION]The ReadOptions uses the different snapshots when getting metadata and subkey values

The ReadOptions uses the different snapshots when getting metadata and subkey values. Could there be inconsistencies?

Yes, but it seems ok for most scenes, implementation in this way can keep the code more clean and simple.


NO-JIRA: Bump github dependencies

What this PR does / why we need it:
Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story:
Fixes #
Checklist

[ ] Subject and description added to both, commit and PR.
[ ] Relevant issues have been referenced.
[ ] This change includes docs.
[ ] This change includes unit tests.

/test unit
/test verify
/test images
/test e2e-aws

/test unit
/test verify
/test images
/test e2e-aws

I opened a ticket in our backlog for updating the cluster-node-tuning operator dependency - HOSTEDCP-1386.

/area ci-tooling

/retitle: NO-JIRA: Bump github dependencies

/retitle NO-JIRA: Bump github dependencies

/test unit
/test verify
/test images
/test e2e-aws

/test e2e-aws

/test e2e-aws

/test unit
/test verify
/test images
/test e2e-aws

/test unit
/test verify
/test images
/test e2e-aws

I'll just open a new PR
/close


0.8.13 release on 5/12/2017

Release notes for 0.8.13

@jinglouMSFT,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot


swirl behind traefik?

I was wondering if anyone ever tried using swirl behind traefik, as I have not found a way to make it work with a base path other than / as the ui has all the references pointing to that.
This is the traefik config I'm trying to use:
    deploy:
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.swirl.entrypoints=https"
        - "traefik.http.routers.swirl.tls=true"
        - "traefik.http.services.swirl.loadbalancer.server.port=8001"
        - "traefik.http.routers.swirl.rule=PathPrefix(`/swirl`)"
        - "traefik.http.routers.swirl.middlewares=swirl-stripprefix"
        - "traefik.http.middlewares.swirl-stripprefix.stripprefix.prefixes=/swirl"
        - "traefik.http.middlewares.swirl-stripprefix.stripprefix.forceslash=true"

I'm not sure this will be helpful, but I did try running swirl with traefik and after 2 weeks of not even being able to recognize services properly. I ultimately ended up replacing it with apache web server.
But still, here are some things that might help:

Make sure swirl and traefik are on the same docker network.
Try to run it locally in docker-compose with docker as a provider.
Make sure you have set the provider to swarm correctly(not just docker).
Check the service is even visible at all in the traefik dashboard.

The labels do look correct, but as I've said, I couldn't do it either.

Yup, it's not really a problem of the ingress config but of swirl not being able to handle a path other than the root path as it's base path
I'll have to give this experimental plugin a go: https://github.com/traefik/plugin-rewritebody

Is it possible for you to paste your swirl and traefik docker compose labels in here?


(G)ATT transactions shall be queued by host

NimBLE host seems to allow to send subsequent ATT requests without waiting for previous one to complete. This behavior is invalid as per Core 5.0, Vol 3, Part F, Section 3.3.2:

Once a client sends a request to a server, that client shall send no other request to the same server until a response PDU has been received.

We could just let application handle this, however:

it makes apps more complicated
there are already sample apps which seem to assume that multiple concurrent requests are handled properly (see blecent_read_write_subscribe in apps/blecent)

Since we already have ble_gattc_procs, we should leverage this to implement proper handling of GATT procedures inside host.

And, I should add, responses should be assigned properly. Right now it is possible to send two GATT reads but responses can get mixed up - when processing a response, the first proc from the queue will be used, which in fact it could be the wrong one (different handle).


What does Missing Edit actually imply?

OK, so I get that "If the Edit button (pencil icon) is missing, that means the documentation page is not available to be changed.", but what does that ACTUALLY mean? Has this part of the docs not been transitioned to GitHub (yet?)? Does MS not wish feedback on that part of the docs? How can - or should? - I request - or provide - a doc fix on a docs page that cannot be Edited and that has no feedback option?
To wit: https://docs.microsoft.com/en-us/windows/desktop/com/runas

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: 70fbb1c8-1435-e762-8824-78cf96faed84
Version Independent ID: 062879b5-72cf-2353-63f2-d862fe1b40ba
Content: Microsoft Docs contributor guide overview - Contributor Guide
Content Source: Contribute/index.md
Product: non-product-specific
GitHub Login: @BillWagner
Microsoft Alias: wiwagn

OK: https://github.com/MicrosoftDocs/Contribute/issues/198 explains that "Reference content is generally not open to public edits, since there is automation behind the scenes that generates those pages from the source code and other upstream areas, so changes won't stick."
And this explains that I cannot contribute by Editing. How else should one give feedback on wrong information on these pages? Didn't the old msdn have a comment section to the articles?

@MicrosoftDocs/windows-authoring  in case anyone knows from the Windows doc team.

@bilbothebaggins Some of our API reference docs do supporting editing (see our WinRT docs). When the edit button is missing, it means that public contributions aren't enabled for that content. When a documentation set doesn't support editing or issues, it means that we haven't hooked up the contribution mechanisms that support editing yet, or we're unable to process content edits and/or GitHub issues for that content (we don't want to ask for issues or contributions unless we can respond to them in a timely manner), or the content is considered archived and we're not publishing updates. (This is the case for the content in our "Previous versions" archive.)
Public contributions for this particular content might be enabled at some point in the future, but I don't have a date.

@bilbothebaggins Hope this thread helped some. I'll resolve the thread for now, but if you need other input please let us know. Thanks, Jason


dm.datadev and dm.metadatadev missing from bash completion

see https://github.com/docker/docker/blob/master/man/dockerd.8.md#dmdatadev and https://github.com/docker/docker/blob/master/man/dockerd.8.md#dmmetadatadev
This two option is missing from cli completion.
ping @albers

Possibly, this is on purpose, because:

It is better to use dm.thinpooldev - see the documentation for it above for discussion of the advantages.

The docs explicitly mark these options as deprecated.
I always remove / do not add deprecated options so that people are not encouraged to use them.
@coolljt0725 do you really need these options or are you just concerned about completeness?

@thaJeztah  @albers  I didn't notice these options is already marked as deprecated.  thanks for the clarification, I always remove / do not add deprecated options so that people are not encouraged to use them make sense.

Thanks!


Focus handler breaks when Scribe's content has been set to ''

The handler for the focus event breaks when scribe.el.firstChild is null, which happens if the editor has been emptied using scribe.setContent(''). The specific error is Uncaught TypeError: Failed to execute 'createTreeWalker' on 'Document': parameter 1 is not of type 'Node'..
I'm prepared to accept "don't do that" as an answer, but it'd be pretty inconvenient. It naively seems like var focusElement = getFirstDeepestChild(scribe.el) might fix it?

I see what you're saying but if there isn't a child you don't want to do the walk right? So in getFirstDeepestChild you shouldn't do the walk but maybe return undefined and then in the focus function focus the scribe root element if getFirstDeepestChild didn't return an element.

Yeah, that's reasonable. getFirstDeepestChild is already capable of returning the same element you pass to it though (like if scribe.el.firstChild exists but has no children), so it seems simpler to just start the descent one level higher instead of adding a special case.

Okay, I'll look at making the change

@rrees I'm having the same issue, any plans to merge in a fix for it?

Yes. I know you're not going to believe me but I thought I might tackle it tomorrow. Nag me if I don't.

Hat bow.

@gon @rf- Can you retest the fix in 1.3.9?

Assuming this is good now.

Sorry, this has been near the top of my todo list for like a month. :( I'm actually about to resume work on the part of our app that uses Scribe, so I'll move us back onto upstream and let you know if there are any issues.

I just tried upgrading the app that @rf- has been working with to 1.4.15, and things seem to be working fine. Thanks for fixing this!


MAINT: Fix search

Ideally we'd wait for the upstream PR to be merged and for a release to be made. But in the meantime we can fix the search by merging this, and update our requirements_doc.txt as those other steps occur.
That is assuming this actually fixes search. Current other PR builds like this one show the issue so if this PR fixes it we should be good.
Closes #8705

Seems to work
https://24506-1301584-gh.circle-artifacts.com/0/dev/search.html?q=norm

Seems to work
https://24506-1301584-gh.circle-artifacts.com/0/dev/search.html?q=norm

@drammock okay with you?

@drammock okay with you?

Thanks a million @larsoner !

Thanks a million @larsoner !

backported

backported


Errror

Before he find bug, and i put url again and he said this,
[Info]Collecting URLs from the target website...
Collecting URLs:   0%|                                                     | 0/1ERROR - Request Exception for URL: http://'https://www.yoti.com/' , Error: HTTPConnectionPool(host="'https", port=80): Max retries exceeded with url: //www.yoti.com/'%20 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f19d6c650>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Collecting URLs: |                                                         | 1/0
Found 0 URLs to scan.
[Info]Scanning collected URLs for vulnerabilities...
[Error]Error occurred during the scan process: 'module' object is not callable
Choose an option:
What i have to do?

The issue relay on your connection and the block of the website itself not the tool


Port ctypes.sh to FreeBSD

Fix a number of platform agnostic Clang warnings:

ffi_prep_closure_loc()'s callback returns void; fix
execute_bash_trampoline to match
Fix a few instances of the wrong pointer type being passed to
check_parse_ulong()
Pull decode_element closures (GCC extension) out of
pack_prefixed_array(), unpack_prefixed_array()

Fix a number of Glibcisms and Linuxisms:

FreeBSD doesn't need -ldl
RTLD_DEEPBIND is a Linuxism
Implement vaguely portable strndupa() and mempcpy

There is still some trouble loading the library; in particular I see: bash: enable: cannot open shared object /usr/local/lib/ctypes.so: /usr/local/lib/ctypes.so: Undefined symbol "list_optarg".
Bash is installed stripped by default (ports or pkg). I rebuilt the port unstripped, but still have trouble loading the .so (same error). I know that linking from libraries to binaries can be handled ok by FreeBSD RTLD, so I expect the error lies in enable. Still digging into it.

$ objdump -t ctypes.so
...
0000000000000000         *UND*<PHONE_NUMBER>000000              reset_internal_getopt
0000000000000000         *UND*<PHONE_NUMBER>000000              list_optarg

$ objdump -t /usr/local/bin/bash
...
00000000004b3c70 g     F .text<PHONE_NUMBER>000035              reset_internal_getopt
00000000007432a8 g     O .bss<PHONE_NUMBER>000008              list_optarg

So, they're globals and one is a function and the other is an object. No surprises there. Hmmm.

Thanks, really appreciate the patch. Is there an LD_DEBUG equivalent on FreeBSD so you can get some debugging output from the loader?

rtld-elf definitely checks LD_DEBUG, and I've tried setting LD_DEBUG=1 first — but I didn't get anything useful. (Looking at the source dbg() is conditional on both LD_DEBUG=1 and -DDEBUG.)
I guess I should bite the bullet and rebuild rtld-elf -DDEBUG and with debug symbols.

One option if the freebsd  rtld doesn't support this would be to make a constructor that resolves it post-load, like
``
void attribute((constructor)) freebsdinit()
{
list_optargptr=dlsym(0, "list_oparg").
}

I'd be open to making that change if it works...

Nothing is jumping out at me from LD_DEBUG:
$ source ./ctypes.sh
"exit" in "bash" ==> 0x800e6d540 in "libc.so.7"
reloc_jmpslot: *0x7367a0 = 0x800e6d540
"__cxa_finalize" in "libc.so.7" ==> 0x800ecee70 in "libc.so.7"
reloc_jmpslot: *0x801133198 = 0x800ecee70
rtld_exit()
calling fini function for /usr/local/bin/bash at 0x5028b8
calling fini function for /lib/libncurses.so.8 at 0x800999f18
"__cxa_finalize" in "libncurses.so.8" ==> 0x800ecee70 in "libc.so.7"
reloc_jmpslot: *0x800bad5d0 = 0x800ecee70
"_rtld_addr_phdr" in "libc.so.7" ==> 0x80073e310 in "ld-elf.so.1"
reloc_jmpslot: *0x801133120 = 0x80073e310
calling fini function for /usr/local/lib/libintl.so.8 at 0x800bb7488
"__cxa_finalize" in "libintl.so.8" ==> 0x800ecee70 in "libc.so.7"
reloc_jmpslot: *0x800db92b8 = 0x800ecee70
calling fini function for /lib/libc.so.7 at 0x800efaa08
"_exit" in "libc.so.7" ==> 0x800e8a1c0 in "libc.so.7"
reloc_jmpslot: *0x8011334f8 = 0x800e8a1c0
loading "/home/cmeyer/src/ctypes.sh/ctypes.so"
Ignoring d_tag<PHONE_NUMBER> = 0x6ffffff9
/home/cmeyer/src/ctypes.sh/ctypes.so valid_hash_sysv 1 valid_hash_gnu 1 dynsymcount 75
  0x801152000 .. 0x801359fff: /home/cmeyer/src/ctypes.sh/ctypes.so
 Searching for "libffi.so.6"
lm_find("(null)", "/usr/local/bin/bash")
lmp_find("$DEFAULT$")
  Trying "/usr/local/bin/bash/libffi.so.6"
search_library_pathfds('libffi.so.6', '(null)', fdp)
lm_find("(null)", "/lib")
lmp_find("$DEFAULT$")
  Trying "/lib/libffi.so.6"
lm_find("(null)", "/usr/lib")
lmp_find("$DEFAULT$")
  Trying "/usr/lib/libffi.so.6"
lm_find("(null)", "/usr/lib/compat")
lmp_find("$DEFAULT$")
  Trying "/usr/lib/compat/libffi.so.6"
lm_find("(null)", "/usr/local/lib")
lmp_find("$DEFAULT$")
  Trying "/usr/local/lib/libffi.so.6"
loading "/usr/local/lib/libffi.so.6"
Ignoring d_tag<PHONE_NUMBER> = 0x6ffffff9
/usr/local/lib/libffi.so.6 valid_hash_sysv 1 valid_hash_gnu 1 dynsymcount 66
  0x801c00000 .. 0x801e06fff: /usr/local/lib/libffi.so.6
relocating "/home/cmeyer/src/ctypes.sh/ctypes.so"
unloading "/home/cmeyer/src/ctypes.sh/ctypes.so"
unloading "/usr/local/lib/libffi.so.6"
bash: enable: cannot open shared object /home/cmeyer/src/ctypes.sh/ctypes.so: /home/cmeyer/src/ctypes.sh/ctypes.so: Undefined symbol "list_optarg"

I guess I'll try out the ctor approach.

So, it's more than just list_optarg. It appears to also trip over functions (e.g. find_or_make_array_variable). We can try the hacky constructor game for all of these, but that's too much mess, I think.

Well, damn. One final idea, can you see if there's an -rdynamic or -export-dynamic equivalent clang flag? Maybe the default visibility rules are breaking this, and recompiling bash with one of those flags will fix it.

Building bash with -Wl,-export-dynamic seems to do the trick :-).

Wow, I guess that means you're the first person to ever use enable -f on FreeBSD. That sounds like a freebsd ports bug, because plugins can't work without it...can you file that?
If the tests all parse in the test directory I'll merge your patch.

Wow, I guess that means you're the first person to ever use enable -f on FreeBSD. That sounds like a freebsd ports bug, because plugins can't work without it...can you file that?

Yep and yep.
Well, math.sh fails. FBSD libm sin(inf) returns nan, not -nan.

For some reason libc needs to be loaded explicitly... so qsort fails as-is (can't find malloc).

Possibly because libc.so is a linker script?
$ dlopen libc.so
bash: dlopen: dlopen("libc.so", 0x1) failed, /usr/lib/libc.so: invalid file format
$ cat /usr/lib/libc.so
/* $FreeBSD: head/lib/libc/libc.ldscript<PHONE_NUMBER>-11-17 22:52:17Z peter $ */
GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a /usr/lib/libssp_nonshared.a )

Ah, close enough, need some better arch testing in those scripts anyway, they're very Linux specific.

Thanks! :)

Try libc.so.7

Yeah, I know — but without an explicit dlopen libc.so.7 in bash, I can't invoke libc symbols. It looks like Linux gets them implicitly.

Ah, I see. But it does work with ${DLHANDLES[libc.so.7]} instead of $RTLD_DEFAULT?
I guess I should do that anyway.

Bug filed on bash, btw: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201959 / https://reviews.freebsd.org/D3231 .

But it does work with ${DLHANDLES[libc.so.7]} instead of $RTLD_DEFAULT?

Nope.
$ dlcall ${DLHANDLES[libc.so.7]} puts 'hello, world'
bash: dlcall: warning: handle puts 0x0 is not well-formed

I guess that means $DLHANDLES doesn't get populated for some reason (dlcall sees an empty parameter and thinks puts is the handle). Hmm.

The init() may not be running at all. I don't see RTLD_ in env either.


Logging issues with discord bot (hashtag702)

Hello, I am currently working on a discord bot using discord.py version 2.0+. So far having two main issues when trying to log the time a user executes a command.
Here is a sample snippet of my code:
from __future__ import annotations
from typing import TYPE_CHECKING
from loguru import logger

from discord.ext import commands

if TYPE_CHECKING:
    from launcher import MyBot

class TEST_COMMAND(commands.Cog):
    def __init__(self, bot: MyBot) -> None:
        self.bot: MyBot = bot

     description="test!", aliases=["t"])
    async def test(
        self,
        ctx: commands.Context[commands.Bot],
    ) -> None:
        logger.add(
            f"logs/user/{ctx.author.id}.log",
            format="{time:YYYY-MM-DD at HH:mm:ss} {message}",
        )
        logger.log("INFO", "/test")

async def setup(bot: MyBot):
    await bot.add_cog(TEST_COMMAND(bot))

The first issue I am having with is that assuming there are two users, A and B, executing the command, "2022-09-08 at 20:11:06 test" will be logged on both A and B's log file once user B executes the command after user A.
The Second issue I noticed is the duplicate loggings. For instance, I noticed that when executing the command 2 times, "2022-09-08 at 20:11:06 test" was logged 3 times instead of the expected result of 2 times.
However, the logs shown on the terminal looks fine and working as intended.
Any help is appreciated =)

I've just noticed someone else had a similar problem and by simply adding logger.remove() solved both of my issues, my apologies.

Hi
I'm not sure how is your application used but keep in mind that logger.add() should not be called repeatedly. You should add one handler per user (from what I understand) in a "configuration step" and maybe use a custom filter to avoid duplicated logs based on bind() argument.
See examples in the documentation: [Creating independent loggers with separate set of handlers](

Hello
Thank you for your response and feedback. Could you explain briefly the consequences of repeating logger.add() repeatedly? Because I am having trouble replicating the "One handler per user", and I assume mainly because of the filtering concept.
So assume that I have a discord command /register, where user will have to register before interacting with the bot. What this command basically does is add user's id into the database, and this might be a good place to create user's log file?
register.py file
def register():
     ... database stuff
     logger.add(
            f"logs/user/{ctx.author.id}.log",
            format="{time:YYYY-MM-DD at HH:mm:ss} {message}",
            filter=lambda record: record["extra"]["task"] == f"{ctx.author.id}",
        )

command.py file
def my_command()
        logger_a = logger.bind(task=f"{ctx.author.id}")
        logger_a.info("Starting task A")
        ... Do stuff
        logger_a.success("End of task A")

This does not log anything and I'm assuming it's bad filtering and the logger.add() is on a different file, or maybe I'm in a completely wrong path. Adding logger.add() file also seems to only make sense to add it inside the my_command() function, which again I felt like this violate what you suggest earlier where logger.add() should not be called repeatedly.
So I'm kinda lost now >.>, so any help is really appreciated :)

Hi
Now I understand why you need to call .add() multiple times. Although I don't recommend it (for performances reason mainly), it's acceptable.
You make a good usage of filter and bind(), it should work well.
However, I suspect you're facing a common pitfall of using a global variable in a closure function: [Creating functions (or lambdas) in a loop (or comprehension)](
The problem is likely because the {ctx.author.id} value changed between the time .add() was called and filter was executed.
You need to capture the task identifier like so:
filter=lambda record, task=ctx.author.id: record["extra"]["task"] == f"{task}",

If that still doesn't work, try printing the values in your register and my_command functions to help debugging.

Hello
It is working as intended now. Thank you for your help and suggestions =)

You're welcome, glad it worked. :+1:
I'm closing the issue then. ;)


NestedControlPlane & NestedCluster Controllers

This PR adds in the NCP and NC controllers for orchestrating the control plane creation by setting up all PKI and creating necessary components.
TODO:

[x] Create NestedControlPlane controller
[x] Create NestedCluster controller
[x] Generate CAs for all components
[x] Generate client certs from component CAs
[x] Setup status management
[x] Verify clusterctl works for kubeconfigs
[x] Write tests

Related
closes #33
closes #32

/assign @charleszheng44 @Fei-Guo

LGTM. I will leave Chao to give another pass.

lgtm

/lgtm