fix: Do not unmount sidebar content when data is being re-fetched

Closes #1459
This PR makes use of keepPreviousData property in data fetching hooks to not unmount sidebar contents on option change. It also improves the situation around content jumps when changing chart type.
How to test
PR

Go to this link.
✅ Change chart type from column to line back and forth several times and see that there is only a small blink when doing so.
Open Horizontal Axis.
Change year filter either by using a slider or time picker.
✅ See that the sidebar is slightly dimmed when data is being loaded, mirroring the chart's behavior.

TEST

Go to this link.
❌ Change chart type from column to line back and forth several times and see that it's noticeable that chart footnotes jump to the top for a brief moment when doing so.
Open Horizontal Axis.
Change year filter either by using a slider or time picker.
❌ See that the sidebar content is completely unmounted when the data is being loaded.

Thanks 💯


Remove leading uppercase from FMA-derived syns

Example:
[Term]
id: CL:0002072
name: nodal myocyte
namespace: cell
def: "A specialized cardiac myocyte in the sinuatrial and atrioventricular nodes. The cell is slender and fusiform confined to the nodal center, circumferentially arranged around the nodal artery." [FMA:67101, GOC:tfm, http://<IP_ADDRESS>/OpenFMA/Nodal myocyte.html]
***synonym: "Myocytus nodalis" EXACT []
synonym: "P cell" EXACT []
***synonym: "Pacemaker cell" EXACT []
xref: BTO:0004190
xref: FMA:67101
is_a: CL:0002086 ! specialized cardiac myocyte
created_by: tmeehan
creation_date: 2010-06-29T11:41:37Z
obviously P cell remains the same
Original comment by: cmungall

Capitalization in the example has been fixed since. I presume other cases were addressed as part of #438 , so I'll close.


ruby 1.9 support

seems like its not supported, if not super hard I am willing to contribute. do you have any input about this?

I don't personally have any interest in Ruby 1.9. It's currently in security maintenance mode, and all support is due to be dropped next month:

After February 23 2014, we will only provide security fixes for 1.9.3 until February 23 2015, after which all support will end for 1.9.3.
— https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/

Once security fixes are discontinued, I think it's actually dangerous to encourage its continued use by backporting new libraries like this one.
From a technical point of view, I've taken considerable advantage of keyword-arguments introduced in Ruby 2.0, so I think changes to support Ruby 1.9 would weaken the library.
I certainly appreciate the offer to help, but I'd rather not go ahead with this. Thanks anyway!


Gives a 404 if I have an /about/index.html and access /about

Would happy to take a PR to support this. Not a feature I need though.

Hmm, for an nginx noobie, what changes does nginx.conf need? I can send you a PR :) @KyleAMathews

@cggaurav What is it that you want to happen, try to explain the use case in a extensive way 👍

@cggaurav Almost none! specially if you don't know what you are doing. If you have moved your configuration settings from /etc/share/nginx/conf.d/default.conf then you need to update the include value in nginx, so it can find where your virtualhost files are found


Analysis endpoints update

Resolves #1058
Breaking changes
Create analysis with job
Old - fails schema validation
POST /api/<cont_name>/<cont_id>/analyses?job=true

{"analysis": {"label": "with-job"},
 "job": {"gear_id": gearid,
         "inputs": {"csv": {"type": "acquisition", "id": acqid, "name": "file.csv"}}}

New - no URL param, analysis payload contains job
POST /api/<cont_name>/<cont_id>/analyses

{"label": "with-job",
 "job": {"gear_id": gearid,
         "inputs": {"csv": {"type": "acquisition", "id": acqid, "name": "file.csv"}}}

Create analysis without job
Old - accepted as legacy method
POST /api/<cont_name>/<cont_id>/analyses

// File form with both input and output files, plus metadata below
{"label": "no-job",
 "inputs": [{"name": "input.txt"}],
 "outputs": [{"name": "output.txt"}]}

New - JSON payload instead of file form, inputs only, inputs are filerefs
POST /api/<cont_name>/<cont_id>/analyses

{"label": "no-job",
 "inputs": [{"type": "acquisition", "id": acqid, "name": "input.txt"}]}

Get analysis
GET /api/<cont_name>/<cont_id>/analyses/<analysis_id>
GET /api/analyses/<analysis_id>

Old response - inputs and outputs under files, tagged
{ ...
 "files": [{"name": "input.txt", ... , "input": true},
           {"name": "output.txt", ... , "output": true}],
... }

New response - inputs under inputs, no input/output tag
{ ...
 "inputs": [{"name": "input.txt", ... }],
 "files": [{"name": "output.txt", ... }],
... }

Download analysis file(s)
GET /api/<cont_name>/<cont_id>/analyses/<analysis_id>/files[/filename]
GET /api/analyses/<analysis_id>/files[/filename]

Old response - for inputs and outputs
New response - for outputs only
Additive changes
Download analysis input(s) - works exactly like outputs (/files)
GET /api/<cont_name>/<cont_id>/analyses/<analysis_id>/inputs[/filename]
GET /api/analyses/<analysis_id>/inputs[/filename]

Note that creating an inputs only download ticket via /downloads is NOT supported.
Upload analysis outputs - only allowed when it's without a job
POST /api/<cont_name>/<cont_id>/analyses/<analysis_id>/files
POST /api/analyses/<analysis_id>/files

// File form with output files, plus metadata below
[{"name": "output1.txt", ... },
 {"name": "output2.txt", ... }]

Review Checklist

Tests were added to cover all code changes
Documentation was added / updated
Code and tests follow standards in CONTRIBUTING.md

This is a breaking change for scitran/client and scitran/python-client.

@nagem Please see summary below.
Breaking changes
Create analysis with job
Old - fails schema validation
POST /api/<cont_name>/<cont_id>/analyses?job=true

{"analysis": {"label": "with-job"},
 "job": {"gear_id": gearid,
         "inputs": {"csv": {"type": "acquisition", "id": acqid, "name": "file.csv"}}}

New - no URL param, analysis payload contains job
POST /api/<cont_name>/<cont_id>/analyses

{"label": "with-job",
 "job": {"gear_id": gearid,
         "inputs": {"csv": {"type": "acquisition", "id": acqid, "name": "file.csv"}}}

Create analysis without job
Old - accepted as legacy method
POST /api/<cont_name>/<cont_id>/analyses

// File form with both input and output files, plus metadata below
{"label": "no-job",
 "inputs": [{"name": "input.txt"}],
 "outputs": [{"name": "output.txt"}]}

New - JSON payload instead of file form, inputs only, inputs are filerefs
POST /api/<cont_name>/<cont_id>/analyses

{"label": "no-job",
 "inputs": [{"type": "acquisition", "id": acqid, "name": "input.txt"}]}

Get analysis
GET /api/<cont_name>/<cont_id>/analyses/<analysis_id>
GET /api/analyses/<analysis_id>

Old response - inputs and outputs under files, tagged
{ ...
 "files": [{"name": "input.txt", ... , "input": true},
           {"name": "output.txt", ... , "output": true}],
... }

New response - inputs under inputs, no input/output tag
{ ...
 "inputs": [{"name": "input.txt", ... }],
 "files": [{"name": "output.txt", ... }],
... }

Download analysis file(s)
GET /api/<cont_name>/<cont_id>/analyses/<analysis_id>/files[/filename]
GET /api/analyses/<analysis_id>/files[/filename]
GET /api/download?ticket= {"nodes": [{"level": "analysis", "_id": <analysis_id>}]}

Old response - for inputs and outputs
New response - for outputs only
Additive changes
Download analysis input(s) - works exactly like outputs (/files)
GET /api/<cont_name>/<cont_id>/analyses/<analysis_id>/inputs[/filename]
GET /api/analyses/<analysis_id>/inputs[/filename]

Note creating an analysis input download ticket via /api/download is not supported!
Upload analysis outputs - only allowed when it's without a job
POST /api/<cont_name>/<cont_id>/analyses/<analysis_id>/files
POST /api/analyses/<analysis_id>/files

// File form with output files, plus metadata below
[{"name": "output1.txt", ... },
 {"name": "output2.txt", ... }]

@lmperry mind taking a look at the changes described above and let us know if anything isn't how you would expect it?

LGTM other than the comment I mentioned above. Let's hold off on a merge until @lmperry gets a chance to take a look, though.

@nagem, thanks for pinging me on this. LGTM.

@ambrussimon and I talked about this offline but we'll also need a db update to bring existing analysis into the new format (separate input and output arrays).

@ambrussimon I made a small change to be kind to requests that don't specify the correct filegroup type when trying to download an individual file. Makes it less of a breaking change for the frontend client.

Overall this looks like a positive change, nice work @ambrussimon. Quick questions:

I don't see a database migration, so the DB format is staying the same, correct? If so, does the change to gears.py still make sense?
Is it worth fixing TargetedPlacer to take multiple files, rather than splitting off a fixed version into TargetedMultiPlacer?

I don't see a database migration, so the DB format is staying the same, correct? If so, does the change to gears.py still make sense?

The DB migration was referenced in a comment above, it's currently under construction.

I notice from the SDK PR that we're using a user string on AdhocAnalysis. Any chance that could just be a normal origin struct?
Sanity check, it's now entirely up to the analysis creator if a job should be created, right? There's no field you have to set to prevent that from happening?

@nagem solid, let's double-check that change after the upgrade. I'd be a fan of outputs on files which wouldn't require any further change, but anything works :)

3
Nice catch, that should be set by core based on request origin, not specified by the user. I think that was old logic from the original legacy style that ended up sticking around.

4
Correct

2

Schema-wise that's non-reconcilable (cannot make endpoints accept {one} OR [{more}, {files}]), or at least not easily/I failed at it. I also imagine it's non-trivial to handle such a schema in the SDK. I'm already sort of pushing the limits of what can/should be handled in a single endpoint with analyses.
Instead, I'd suggest a breaking change in the future, where TargetedPlacer := TargetedMultiPlacer, eg. we use a list of files even if length == 1. Unless anyone's aware of clients or something heavily relying on that not breaking.

Upgrade looks good 👍


Use related name template

Codecov Report

Merging #31 (ad81f9b) into main (3e8d112) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main      #31   +/-   ##
=======================================
  Coverage   76.21%   76.21%
=======================================
  Files          23       23
  Lines         656      656
=======================================
  Hits          500      500
  Misses        156      156

Impacted Files
Coverage Δ

...o_nats_nkeys/migrations/0009_auto_20221105_1755.py
100.00% <100.00%> (ø)

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


nerdctl compose issues with ulimit

I see here no mention that nerdctl compose does not support ulimits. This is something Docker Compose supports, see here.
In my compose.yml I have:
version: '1'
services:
  foo:
    ulimits:
      nofile:
        soft: 1048576
        hard: 1048576
...

However, when I nerdctl compose up -d and then exec into that container, the ulimit setting hasn't applied:
$ nerdctl exec -it 810c4ccc66a6 /bin/bash
[appuser@foo ~]$ cat /proc/1/limits
Limit                     Soft Limit           Hard Limit           Units
Max cpu time              unlimited            unlimited            seconds
Max file size             unlimited            unlimited            bytes
Max data size             unlimited            unlimited            bytes
Max stack size            8388608              unlimited            bytes
Max core file size        unlimited            unlimited            bytes
Max resident set          unlimited            unlimited            bytes
Max processes             15536                15536                processes
Max open files            1024                 1024                 files
Max locked memory         513875456            513875456            bytes
Max address space         unlimited            unlimited            bytes
Max file locks            unlimited            unlimited            locks
Max pending signals       15536                15536                signals
Max msgqueue size         819200               819200               bytes
Max nice priority         0                    0
Max realtime priority     0                    0
Max realtime timeout      unlimited            unlimited            us

I'm new to nerdctl, but I wonder if this has something to do with rootless?
How can I increase the open file limits for one of my compose containers when using nerdctl?

Seems we have implemented nerdctl run --ulimit at https://github.com/containerd/nerdctl/pull/370. Do we have any plan to bring it to compose too?

PR is welcome


During local development, how can I simultaneously debug multiple services?

Ask your question here
My scenario:
I have N daprized services and all of them act as both a server and a client, and I want to be able to debug multiple services locally at the same time.
The challenge:
In order to debug them in parallel I must run a sidecar for each of them. This means I need to manually allocate a different dapr-http-port to each sidecar in addition to manually allocating different app-ports. In addition to that I need to hold a config to tell each client at which dapr-http-port to find the sidecar of the dapr server running each target method.
The question:
Is there a better way? What would be the recommended approach?
Some thoughts I've had:

Create a dapr-mock lib and use that locally and during testing. Seems like the least involved option and most transparent to developers.
Create a docker-compose to run all my local sidecars. Would still require manual or automatic port allocation. And would require developer to add a sidecar definition to that docker-compose when creating a new service.
Create some more advanced tooling to dynamically create local sidecars with dynamic ports and some kind of local method->port discovery which the services can use.

Any input would be much appreciated. Thanks!

I create a service map that shows the ports and I then put those in the npm run command
you could normally use dynamic ports but it’s easier to know the ports as you can then debug it more easily and call manually as well
I do this for a production workload with ~7 services


Non accurate generation of stubs for methods which may return object or null

For the following Zephir code:
/**
 * Returns the internal event manager
 */
public function getInternalEventsManager() -> <ManagerInterface> | null
{
    return this->eventsManager;
}

The following sub was generated:
/**
 * Returns the internal event manager
 *
 * @return mixed
 */
public function getInternalEventsManager(): ?ManagerInterface
{
}

It is a bit non accurate and should be as follows:
/**
 * Returns the internal event manager
 *
-* @return mixed
+* @return ManagerInterface|null
 */
public function getInternalEventsManager(): ?ManagerInterface
{
}

Implemented in development branch


Add query capability to the List method of wishlist items

This PR supports query wishlist items by name and category.

Codecov Report

Merging #67 (5403e6e) into main (d327fe4) will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #67      +/-   ##
==========================================
+ Coverage   97.18%   97.31%   +0.12%
==========================================
  Files           7        7
  Lines         355      372      +17
==========================================
+ Hits          345      362      +17
  Misses         10       10

Impacted Files
Coverage Δ

service/models.py
100.00% <100.00%> (ø)

service/routes.py
100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more


Possibility for AudioFocus release for the YouTubePlayerView

A loaded YouTube video is muted, but I would like to have the existing audioFocus be retained, so that when YouTubePlayerView starts playing, it would not pause the existing audio source, e.g. Spotify, or any other app.
This issue relates to #397 however I'm thinking more of how to get it programmatically functioning, whether it be a bypass or a workaround.
Thanks!

As said in #397, i don't know how to do this. Let us know if you make progress :)

As said in #397, i don't know how to do this. Let us know if you make progress :)

I do see that the mobile version of YouTube on Google Chrome has this "Tap to Unmute" functionality, where it starts playing the YouTube video without hijacking the audioFocus when the YouTube page loads.

I do see that the mobile version of YouTube on Google Chrome has this "Tap to Unmute" functionality, where it starts playing the YouTube video without hijacking the audioFocus when the YouTube page loads.

@PierfrancescoSoffritti I have found a few methods of executing this requestAudioFocus() removal, however it is merged into my custom fork of this library.
https://github.com/nicholaschum/android-youtube-player
In general, we must add autoplay: 1, mute: 1 into the playerVars in ayp_youtube_player.html. This would allow the IFrameAPI loaded WebView to automatically play the video in muted mode.
My library already has implemented hooks so that I can call it and it will dynamically load it into <<injectedPlayerVars>>.
Next, I have also modified the ayp_youtube_player.html, under events for onYouTubeIframeAPIReady(), I've set it to mute: onReady: function(event) {                         event.target.mute();                         YouTubePlayerBridge.sendReady();                     },
For library purposes, I could also create a commit that makes this perform the same way as <<injectedPlayerVars>>.
Also, from my testing, we must also ensure visibility of the YouTubePlayerView is set to android:visibility="visible" or else it would still try to requestAudioFocus(). I initially wasted a lot of time trying to set it to "gone" at first, and it kept stealing audio focus.
My fork is pretty much tailored for my app's purposes, but it includes other functions such as initializing the WebViewYouTubePlayer without focusable traits, e.g. focusable = false or focusableInTouchMode = false as I needed to make it so keyboard/DPAD functions won't touch the WebView objects, as well as adding other IFrameAPI playerVars.

@PierfrancescoSoffritti I have found a few methods of executing this requestAudioFocus() removal, however it is merged into my custom fork of this library.
https://github.com/nicholaschum/android-youtube-player
In general, we must add autoplay: 1, mute: 1 into the playerVars in ayp_youtube_player.html. This would allow the IFrameAPI loaded WebView to automatically play the video in muted mode.
My library already has implemented hooks so that I can call it and it will dynamically load it into <<injectedPlayerVars>>.
Next, I have also modified the ayp_youtube_player.html, under events for onYouTubeIframeAPIReady(), I've set it to mute: onReady: function(event) {                         event.target.mute();                         YouTubePlayerBridge.sendReady();                     },
For library purposes, I could also create a commit that makes this perform the same way as <<injectedPlayerVars>>.
Also, from my testing, we must also ensure visibility of the YouTubePlayerView is set to android:visibility="visible" or else it would still try to requestAudioFocus(). I initially wasted a lot of time trying to set it to "gone" at first, and it kept stealing audio focus.
My fork is pretty much tailored for my app's purposes, but it includes other functions such as initializing the WebViewYouTubePlayer without focusable traits, e.g. focusable = false or focusableInTouchMode = false as I needed to make it so keyboard/DPAD functions won't touch the WebView objects, as well as adding other IFrameAPI playerVars.


FFT along a dimension?

Has anyone actually implemented this, that is, similar functionality to fft(X, dim) for CPU?  I'm trying to understand how to implement using cufftPlanMany, but wanted to find out if anyone was already doing this?  For example, I have a 3D dataset and want to do a series of 2D FFT along the first dimension.

Not to my knowledge, but perhaps others will know. Would make a nice contribution.


[HOLD for payment 2024-08-02] [Wave Collect] [Ideal Nav] Improve "Hmm... it's not there" being duplicated across two content areas

Coming from here.
Problem
With the new ideal navigation layout, we'll run into an instance where the "page not found" illustration is duplicated across two content areas on web/desktop. For example, when you try to access a workspace that has been deleted via a URL link to its settings:

Solution
Instead of showing it twice, we'll instead:

Use a full page instead
Clicking the back caret brings you back to the screen which you were at when you tried to access the missing workspace.
If you don’t have a previous screen to return to, we return to the Chats tab of the “All” view.

CC: @hayata-suenaga @mountiny @shawnborton @JmillsExpensify @kosmydel @adamgrzybowski @s77rt
Issue OwnerCurrent Issue Owner: @trjExpensify

looking at the discussion in the linked Slack thread

This is what it looks like at full screen btw:

Hey, here is a preview of what it looks like.

That seems good to me!

Nice! So I think we can take this off planning. @kosmydel, are you taking care of this so I can assign you? Also if so, can you link the PR to this issue? Thanks!

Not overdue, I think we're still making progress here?

@kosmydel Please also refer to this regression and check that the issue reported there is also fixed with your PR 🙇

Hey, I started working on this issue today. I'm trying to find a solution to cover all cases in a clean way. However, it looks like a more complex problem, especially for RHP modals.

@hayata-suenaga I've prepared a very early draft of the PR. I still have to test it thoroughly.

I found a one issue which makes it impossible to test it:

Log out
Go to some WS link, e.g. https://staging.new.expensify.com/workspace/adsasddssad/rateandunit (doesn't matter if policy exist or not)
Log in
Infinity loading

Workaround:
Go to the chat list, wait until all reports are loaded, try to open the link again.
Loading the Onyx state doesn't work from deeplinks at all.

@hayata-suenaga should I complete the checklist and open the PR anyway? Or should I wait until the reported issue is solved?

you can open the PR 👍

Conflicts resolved yesterday, over to @situchan to re-review!

Commented in the PR and switched back to weekly.

PR merged.

I see that the PR got reverted. I will prepare a new version, but now I'm focusing on the new architecture issues. We should also probably wait for https://github.com/Expensify/App/pull/40598 to be merged, as it collides a bit with my changes.
FYI: I'm OOO next week.

This one is being reviewed by @situchan.

Payment summary as follows:

$250 to @situchan for the PR review

Offer sent.

Can this be 500?
reasoning:

super old issue (before price change)
size of PR which fixes multiple issues at once
required lots of testing as seen in QA Steps of PR

super old issue (before price change)

Fair. Can you accept the offer so I can pay it though?

Not overdue

Paid, closing!


Switch mapBlockIndex to unordered_map

Since we do not need the order and since we already have the hash in form of the uint256 we can replace the usage of std::map for mapBlockIndex with std::unordered_map which is more beneficial for larger maps.
See:
https://github.com/bitcoin/bitcoin/issues/4237
https://stackoverflow.com/a/36398429

Duplicate of #679.


Access to request object in register_user_listing_buttons

Is your proposal related to a problem?
In Wagtail 6.1, the register_user_listing_buttons hook signature changed to remove the context.
In migrating one of my sites to 6.1, I realised that one of the the buttons I add to the user listing is an 'Impersonate' button, making use of django-hijack to impersonate a specific user.
This button is implemented like:
class HijackFormButton(UserListingButton):
    def __init__(self, *, user_pk, request):
        self.user_pk = user_pk
        self.request = request
        super().__init__(
            "Impersonate",
            None,
            priority=10,
        )

    def render(self):
        csrf_token = csrf.get_token(self.request)
        return f"""
        <form method="POST" action="{reverse("hijack:acquire")}">
            <input type="hidden" name="csrfmiddlewaretoken" value="{csrf_token}">
            <input type="hidden" name="user_pk" value="{self.user_pk}">
            <button class="button button-secondary button-small" title="Login as this user">{self.label}</button>
        </form>
        """

@hooks.register("register_user_listing_buttons")
def user_listing_hijack_button(context, user):
    yield HijackFormButton(
        user_pk=user.pk,
        request=context.request,
    )

Where the request object is used to generate a CSRF token for the form submission.
With the new hook signature, I don't have a clean way to make the request object available to the button.
I'm wondering what the justification for removing access to the request was, and whether there's any reason it couldn't be added back?
Describe the solution you'd like
Adding a request parameter to the register_user_listing_buttons hook.
Alternatively, a hook for adding a common context to all buttons might be useful - in the above example this could be used to generate a single CSRF token that could be reused between instances, and may be useful for performance optimisations in cases where buttons need to retrieve additional data.
Working on this
I'm happy to work on this once I understand the reason it was removed in the first place to avoid repeating or reintroducing any issues that this caused.

The change happened in #11823

Thanks for the report, and sorry for the trouble! Here's my investigation results.
Rationale
The idea was that I wanted to allow the UserViewSet to be customised, just like the GroupViewSet. From there, overriding the listing buttons would be done by creating a custom subclass of the view and overriding the appropriate methods, e.g. https://github.com/wagtail/wagtail/blob/538365fcfc5ea9135663a1b8c2511c499910e419/wagtail/admin/views/generic/models.py#L375
Then, the custom view subclass would be specified in the custom viewset. This would align better with how we're moving towards the viewsets being the one place to configure your views, instead of individual hooks. It also encourages working with the view directly to do any logic instead of treating the context as a grab-bag and relying on whatever is in it.
Another reason is that, none of the other register_{foo}_buttons (i.e. register_snippet_listing_buttons, register_page_listing_buttons, register_page_listing_more_buttons, register_page_header_buttons) hooks give you the context. Apart from a few small differences (e.g. view_name next_url), they all have one thing in common: passing the row's instance as the first argument, and the request's user as the second. The hook was never documented until #9162 and even after that PR, it had no tests, so I opted to remove the context support in favour of making it more consistent with the other hooks.
In the future, I'm imagining a dedicated/expanded section in the Wagtail docs on how to work with and customise Wagtail's generic views and viewsets, so that it includes things like customising the listing view buttons, and the header buttons (the ones you see in the breadcrumbs). Ideally, the guide would be applicable to all views that are customisable, including ModelViewSet, SnippetViewSet, etc.
Unfortunately, we were short on time and I didn't get to implement the ability to customise the UserViewSet before the feature freeze.

Alternatively, a hook for adding a common context to all buttons might be useful - in the above example this could be used to generate a single CSRF token that could be reused between instances, and may be useful for performance optimisations in cases where buttons need to retrieve additional data.

With the move towards using Component classes (now extracted into the laces library), I don't think this is something we want to do (read https://github.com/tbrlpld/laces#using-the-parent-context for more, um, context).
The preferred way would be to pass anything you need in the button directly to the button's constructor, which makes it more explicit compared to accessing the context (which may or may not have what you want, e.g. due to the use of only keyword when using {% include %} in the templates). Moving the button customisation to the view allows you to pass any information available in the view to the button more easily and explicitly.
Reinstating support for the given customisation
Anyway... back to the issue at hand. I couldn't get the provided example to work as expected in 6.0.x nor 5.2.x. Which version was the latest where this still worked @tomusher?
To make it work, I had to change render to render_html (accepting a parent_context argument) and wrapping the return value in mark_safe():
class HijackFormButton(UserListingButton):
    def __init__(self, *, user_pk, request):
        self.user_pk = user_pk
        self.request = request
        super().__init__(
            "Impersonate",
            None,
            priority=10,
        )

    def render_html(self, parent_context):
        csrf_token = get_token(self.request)
        return mark_safe(
            f"""
        <form method="POST" action="{reverse("hijack:acquire")}">
            <input type="hidden" name="csrfmiddlewaretoken" value="{csrf_token}">
            <input type="hidden" name="user_pk" value="{self.user_pk}">
            <button class="button button-secondary button-small" title="Login as this user">{self.label}</button>
        </form>
        """
        )

@hooks.register("register_user_listing_buttons")
def user_listing_hijack_button(context, user):
    yield HijackFormButton(
        user_pk=user.pk,
        request=context.request,
    )

After the above changes, the hook works as expected on 5.2.x and 6.0.x.
With that out of the way, there are a few things that unfortunately make it tricky to fix this in a 6.1.x patch release with minimal impact. I'll separate this into two steps.
1. Ensuring each button can define how it can render itself
The BaseDropdownMenuButton we use for rendering the ... button in listing views unfortunately render the buttons using a template include directly instead of rendering each Button instance as a component (with {% component %}):
https://github.com/wagtail/wagtail/blob/8aaa579befd1cb9ce829c7301ecffc37912af6a2/wagtail/admin/widgets/button.py#L170-L171
https://github.com/wagtail/wagtail/blob/8aaa579befd1cb9ce829c7301ecffc37912af6a2/wagtail/admin/templates/wagtailadmin/pages/listing/_button_with_dropdown.html#L3
https://github.com/wagtail/wagtail/blob/8aaa579befd1cb9ce829c7301ecffc37912af6a2/wagtail/admin/templates/wagtailadmin/pages/listing/_dropdown_items.html#L3-L10
This means that the Button's render_html (or the "deprecated" render() like in your example) isn't used in the rendering process.
We need to fix this if we want to allow a button to have its own markup. This potentially affects the page listing buttons too, so I'd be wary to do it in a patch release. Might be OK if we're extra careful, though.
2. Passing the request
The hook is now called in the view before the context is finalised by get_context_data:
https://github.com/wagtail/wagtail/blob/8aec935f6962f5c6416dc06c28c6590067e85d45/wagtail/users/views/users.py#L200-L236
As such, we're no longer able to give the full context to the hook. However, we can still include the request. In fact, we pass a RequestContext to support the old signature during the deprecation process, as seen in the code above.
This means that with the fix for (1), the customisation will continue to work using the old hook signature (since request is all you need from the context), but you'll get a deprecation warning due to the signature change.
If we want to use the new signature for the hook, we can't retrieve the request from the parent_context argument in Component.get_context_data/Component.render_html because the "parent" BaseDropdownMenuButton component only specifies the following context: https://github.com/wagtail/wagtail/blob/8aaa579befd1cb9ce829c7301ecffc37912af6a2/wagtail/admin/widgets/button.py#L180-L187
Option A: pass the request via parent_context
If we want the individual child button to have access to the request in the context, we need to include it in the parent BaseDropdownMenuButton's context. So if we add something like "request": parent_context.get("request") to the get_context_data() above, we can achieve the customisation with the following:
class HijackFormButton(UserListingButton):
    def __init__(self, *, user_pk):
        self.user_pk = user_pk
        super().__init__("Impersonate", None, priority=10)

    def render_html(self, parent_context):
        csrf_token = get_token(parent_context.get("request"))
        return mark_safe(
            f"""
        <form method="POST" action="{reverse("hijack:acquire")}">
            <input type="hidden" name="csrfmiddlewaretoken" value="{csrf_token}">
            <input type="hidden" name="user_pk" value="{self.user_pk}">
            <button title="Login as this user">{self.label}</button>
        </form>
        """
        )

@hooks.register("register_user_listing_buttons")
def user_listing_hijack_button(user, request_user):
    yield HijackFormButton(user_pk=user.pk)

I'm not too keen with this, as it goes against the plan of not relying on the parent context. That said, I can accept request as an exception to the rule.
Option B: pass the request directly to the hook
Alternatively, we can also pass the request to the hook directly, either by replacing the request_user parameter, or adding a new parameter. If we do it by replacing request_user, this is a breaking change to a breaking change we already made. If we add a new parameter, it's also going to be a breaking change unless developers update the signature to match (or use *args/**kwargs). We can do this a bit more safely by inspecting the hook's signature with accepts_kwarg or catching any TypeErrors, but that adds noise to the code. Not to mention that this goes against the other register_{foo}_buttons hooks.
Option C: do nothing
Or, as another alternative, we can also skip fixing (2) by saying "if you need the request, you need to use the old signature for now, and disregard the deprecation warning until we have a better way to support the use case".
Thoughts @gasman @zerolab?

Hope I'm not too late to the party here :-)

Ensuring each button can define how it can render itself

As just discussed in https://github.com/wagtail/wagtail/pull/12211#issuecomment-2305832623, supporting items with custom renderings (i.e. not plain links) within dropdowns may be a good thing, or may be opening an enormous can of worms. :-) But I'd like to put forward an alternative: anything that isn't a plain link should remain as a top-level button rather than placed inside the 'more' dropdown. We already carve out an exception for items passed to register_user_listing_buttons that are themselves dropdowns:
https://github.com/wagtail/wagtail/blob/a59a2d0585f9b2ee4ff94152a5de4c66b02819df/wagtail/users/views/users.py#L231-L237
so it wouldn't be a huge stretch to treat this in the same way. In principle we could do this automatically by checking whether the render_html method has been overridden from UserListingButton's default, but that feels like a bit too much magic - I'd be inclined to have an explicit "don't put me inside a dropdown" flag instead.

Passing the request

I would support "Option A: pass the request via parent_context" here. In fact, are we absolutely sure we aren't already doing that? From what I can see, the wagtail.admin.ui.tables.BaseColumn class passes request in the context when rendering cells, and the buttons are rendered within that template using {% component button %}, so it should be coming through in parent_context. Either way, I'm satisfied that that would be an acceptable use of the context and the request object - the CSRF token is a detail of how the button should be rendered on this particular request, and not a detail of what the button is, so it makes sense to pick it up in the render method and not the button constructor.

In principle we could do this automatically by checking whether the render_html method has been overridden from UserListingButton's default, but that feels like a bit too much magic

Checking for render_html wouldn't work for custom buttons that only override template_name/get_context_data anyway, so that's not really an option.

I would support "Option A: pass the request via parent_context" here. In fact, are we absolutely sure we aren't already doing that? From what I can see, the wagtail.admin.ui.tables.BaseColumn class passes request in the context when rendering cells, and the buttons are rendered within that template using {% component button %}, so it should be coming through in parent_context.

While it is true that the column passes request, the ButtonWithDropdown parent component doesn't. We need to ensure ButtonWithDropdown takes the request from the parent context (the Column's context), then we need to ensure Button does the same from its parent ButtonWithDropdown. Conveniently, ButtonWithDropdown is also a subclass of Button itself, so we should be able to just change Button.get_context_data here and have it apply to both:
https://github.com/wagtail/wagtail/blob/84b3bf70349171e44f283085f1d89ccd9deed40e/wagtail/admin/widgets/button.py#L46-L47
Although, this makes me think whether the Laces library should just do this by default in Component.get_context_data() – then, all components get the request for free as long as their ancestors use super().get_context_data(). Then, having request can be opt-out by not using super().get_context_data().

More thoughts on the rest of the listing buttons situation in https://github.com/wagtail/wagtail/pull/12211#issuecomment-2343301068.


Update regex for soundcloud application ID (#636)

It seems that soundcloud have updated their script so the current regex is no longer valid, since it looks for a comma where there is none:
{client_id:"t2YeOwu4P7hh0iGXpwrDt3g2QllKhBTq"}

This PR changes the regex to instead exclude underscores (so we don't match apple_client_id and google_client_id which are also present). Alternatively, we could probably match [\{, ] for a more restrictive approach.
Note: This PR has not been tested whatsoever. I just fiddled with the regex and was able to propose a potential fix, my hope is that the affected people can test.

@MCOfficer Just tried but it still seems to give a 401 error

Update: Ended up getting a fix from the JDA Lavaplayer channel
(Thanks @Walkyst!)


Error when creating the experiment with artifact_location - bucket

When creating the experiment using Python mlflow library and selecting artifact_location to the bucket (not a folder in the bucket) there is an error response of too many 500s.
Code:
experiment_id = mlflow.create_experiment(name="Wine Experiments", artifact_location="s3://my-bucket")

Response:
MlflowException: API request to http://mlflow-server.kubeflow.svc.cluster.local:5000/api/2.0/mlflow/experiments/create failed with exception HTTPConnectionPool(host='mlflow-server.kubeflow.svc.cluster.local', port=5000): Max retries exceeded with url: /api/2.0/mlflow/experiments/create (Caused by ResponseError('too many 500 error responses'))

I could not find the root cause of it. This can be the upstream issue or some missing configuration or missing privileges.

It works perfectly fine without artifact_location only artifact_location is corrupted.

Let's try to reproduce this with our current MLFlow charm

This might be a good thing to add to our integration tests, regardless of whether it is currently working

Hello, I am having a similar issue. Has it been resolved?


New server response format when not 200 code in playground looks unreadable

Component(s)
studio
Is your feature request related to a problem? Please describe.
I extremely dislike the way it now shows responses not having a 200 code

it's unreadable, although the idea to show what came over HTTP is understandable, but it's better to add some custom fields to the standard GraphQL response structure. Now I don't understand how to try to read responseBody during debugging, and other fields don't give useful load
We subgraphs return 4** error codes in case of non-significant problems, 5** in case of unknown server errors. At the same time they describe the standard GraphQL response structure, deviations from this logic are possible only in case of some serious problems, but it seems Playground should be used mainly for debugging, why should I deviate from this structure trying to invent another one?

Describe the solution you'd like

Return to the old format
Extend the standard GraphQL answer with fields that you think should be useful for non-200 codes
Do not change the structure of the response display for non-200 codes

Describe alternatives you've considered
No response
Additional context
No response

Hi @flymedllva . As we cover more use cases we update the ui accordingly. We have an idea on how this can be improved. Thanks for the insight.

Hi! @thisisnithin
Is there no information on what this will look like in the future? Is it possible at least for 4** response codes not to change the GraphQL structure of the response?

Hi, this is in progress as part of a bigger PR


Api catalog

@nannanli - Hi Ashley - i just uploaded an SVG file that you can test for editing/translation capabilities.  I created by exporting it from our Gliffy tool..

@JamesBauman Hi Jim, SVG works! You can start exporting other diagrams into SVG and upload now. Thanks much!

HI @nannanli -  Sadly, this our only image/diagram for which we have source. everything else is screen shots.


Broken with neovim 0.6?

Hello.
In neovim 0.5.1, I can bring up the fzf window for code action, and execute these actions. For example, add a missing import.
However, in 0.6, the same action brings up the window, but upon pressing <enter> nothing happens. I couldn't find anything in the lsp logs and don't know how to debug that.

Hi, that's weird, i tried with the 0.6 and it works fine for me, can you give me more information about your setup please?
For example:

is this happening for all language servers? (right now i use mostly gopls for example, maybe try with that)
your lsp configuration for that specific language server
the fzf-lsp.nvim specific configuration

Can you also share your neovim version? (nvim --version)

I reproduced it with a minimal configuration \o/
Here's the vim config I used:
call plug#begin('~/.config/nvim/plugged')
Plug 'neovim/nvim-lspconfig'

Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
Plug 'gfanto/fzf-lsp.nvim'

call plug#end()

lua << EOF

vim.lsp.set_log_level("debug")

local nvim_lsp = require('lspconfig')

-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
  local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
  local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end

  -- Enable completion triggered by <c-x><c-o>
  buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')

  -- Mappings.
  local opts = { noremap=true, silent=true }

  -- See `:help vim.lsp.*` for documentation on any of the below functions
  -- buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
  buf_set_keymap('n', '<space>ca', '<cmd>CodeActions<CR>', opts)
end

-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { 'jedi_language_server', 'rust_analyzer', 'clojure_lsp', 'dhall_lsp_server' }
for _, lsp in ipairs(servers) do

  local setup_opts = {
    on_attach = on_attach,
    flags = {
      debounce_text_changes = 150,
    },
  }

  if lsp == 'rust_analyzer' then
    setup_opts.init_options = {
      procMacro = { enable = true }
    }
  end

  nvim_lsp[lsp].setup(setup_opts)

end

EOF

With 0.5, nvim --version gives me:
NVIM v0.5.1
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim/src/neovim-0.5.1/build/config -I/build/neovim/src/neovim-0.5.1/src -I/usr/include -I/build/neovim/src/neovim-0.5.1/build/src/nvim/auto -I/build/neovim/src/neovim-0.5.1/build/include
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

And with 0.6 I have:
NVIM v0.6.0
Build type: Release
LuaJIT 2.0.5
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

I also created a small asciinema to display the problem.
If I change the codeAction to use the native lsp function instead of fzf-lsp then it works fine.
This problem also seems to happen for all my lsp (python, clojure and rust).

Thank you i'll look into that today :+1:

I found the problem, the have probably introduced some incompatibility with the sync call, so i will fix that.
If you want a fast solution until i make the fix, you can just replace:
buf_set_keymap('n', '<space>ca', '<cmd>CodeActions<CR>', opts)
with
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
that you already have in your config, but commented.
I will tell you when the fix will be ready


Display metadata that attached to postings

I just found that metadata could be attached not only to transactions, but also to postings: Beancount - Language Syntax §Metadata. (Not sure if Martin added this syntax recently or there is a memory gap in my head.)
However in Fava, only metadata that attached to transactions are shown. It would be nice if metadata attached to postings could be shown as well.

Good catch!

Fixed in #185


SMPPSession is getting disconnected very frequently

Hi,
Please give us some suggestions on below error, unable to debug what is the issue.
In one of our production environments we are facing below error
org.jsmpp.session.state.AbstractGenericSMPPSessionBound - No request found for PDUHeader(16, 80000015, 00000000, 121735)
This is just an error logger in JSMPP library and no exception is thrown.
When this issue occurs?
After this issue occurs current SMPPSession is getting disconnected.
We are not facing this error with simulators it occurs only in production environment.

This error is logged, when an enquire_link response (80000015) is received, but the corresponding request cannot be found. The sequence number 121735 could not be found. A detailed trace should reveal if the sequence was sent by the session. How is the setup? Do you use a single session, or do you have multiple sessions ?

This error is logged, when an enquire_link response (80000015) is received, but the corresponding request cannot be found. The sequence number 121735 could not be found. A detailed trace should reveal if the sequence was sent by the session. How is the setup? Do you use a single session, or do you have multiple sessions ? Is the session dropped by the remote party or your jSMPP client ?

We have multiple SMPP sessions, by the dumps we are not able to rectify which side is the issue.
According to TCP dumps enquirelink response is received but in our logs we have seen above error.
Due to which session is getting disconnected. Below is the snapshot of enquire link request and response

If there is delay in network will this issue pop up?

The delay is minimal (2ms) according to the TCP dump. The standard transaction timer is 2000ms. Did you use another value? Does the logging indicates other problems? Is the problem under heavy traffic or also when the session is idle ?


Fixes #15743

(Write your motivation here.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)

@facebook-github-bot no-template


Wrong Hyper-V module used inside 'Foreach-object -Parallel' reported as wrong, but Ok out side of loop.

Prerequisites

[X] Write a descriptive title.
[X] Make sure you are able to repro it on the latest released version
[X] Search the existing issues.
[X] Refer to the FAQ.
[X] Refer to Differences between Windows PowerShell 5.1 and PowerShell.

Steps to reproduce
I am remotely controlling a Hyper-V cluster, I need to import the correct Hyper-V module.
That works and I can call Get-VM fine.
I then call Get-VM from inside a  'Foreach-object -Parallel' loop and am told I am using the incorrect module.
Import correct Hyper-V version
Remove-Module Hyper-V
Import-Module Hyper-V -RequiredVersion 1.1
Get-Module Hyper-V
Clear-Host
$postClusterPatchVMStates = @{}
$Object = New-Object PSObject -Property @{
VMName       = 'AUECKA01'
Hostname     = 'AUECKHV01'}
$postClusterPatchVMStates.Add('AUECKA01', $Object)
$Object = New-Object PSObject -Property @{
VMName       = 'AUECKAP01'
Hostname     = 'AUECKHV01'}
$postClusterPatchVMStates.Add('AUECKAP01', $Object)
Outside of 'Foreach-object -Parallel' all works fine
Get-VM -Name $postClusterPatchVMStates['AUECKA01'].VMName -ComputerName $postClusterPatchVMStates['AUECKA01'].Hostname
Get-VM -Name $postClusterPatchVMStates['AUECKAP01'].VMName -ComputerName $postClusterPatchVMStates['AUECKAP01'].Hostname
$postClusterPatchVMStates.Values | Foreach-object -Parallel {
$node = $_.Hostname
$vMName = $_.VMName

# Outside of 'Foreach-object -Parallel', not so much, says that I am using the wrong module.
(Get-VM -Name $vMName -ComputerName $node)

}
Expected behavior
Name             : AUECKA01
State            : Running
CpuUsage         : 0
MemoryAssigned   :<PHONE_NUMBER>4
MemoryDemand     : 0
MemoryStatus     :
Uptime           : 04:24:27
Status           : Operating normally
ReplicationState : Disabled
Generation       : 1

Name             : AUECKAP01
State            : Running
CpuUsage         : 0
MemoryAssigned   :<PHONE_NUMBER>
MemoryDemand     : 0
MemoryStatus     :
Uptime           : 04:24:44
Status           : Operating normally
ReplicationState : Disabled
Generation       : 1

Name             : AUECKA01
State            : Running
CpuUsage         : 0
MemoryAssigned   :<PHONE_NUMBER>4
MemoryDemand     : 0
MemoryStatus     :
Uptime           : 04:24:27
Status           : Operating normally
ReplicationState : Disabled
Generation       : 1

Name             : AUECKAP01
State            : Running
CpuUsage         : 0
MemoryAssigned   :<PHONE_NUMBER>
MemoryDemand     : 0
MemoryStatus     :
Uptime           : 04:24:44
Status           : Operating normally
ReplicationState : Disabled
Generation       : 1

Actual behavior
Name             : AUECKA01
State            : Running
CpuUsage         : 0
MemoryAssigned   :<PHONE_NUMBER>4
MemoryDemand     : 0
MemoryStatus     :
Uptime           : 04:24:27
Status           : Operating normally
ReplicationState : Disabled
Generation       : 1

Name             : AUECKAP01
State            : Running
CpuUsage         : 0
MemoryAssigned   :<PHONE_NUMBER>
MemoryDemand     : 0
MemoryStatus     :
Uptime           : 04:24:44
Status           : Operating normally
ReplicationState : Disabled
Generation       : 1

Get-VM:
Line |
   7 |      (Get-VM -Name $vMName -ComputerName $node)
     |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The Hyper-V module used in this Windows PowerShell session cannot be used for remote management of the server 'AUECKHV01'. Load a compatible version of the Hyper-V module, or use Powershell remoting to connect directly to the remote server. For more information, see http://go.microsoft.com/fwlink/p/?LinkID=532650.
Get-VM:
Line |
   7 |      (Get-VM -Name $vMName -ComputerName $node)
     |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Hyper-V was unable to find a virtual machine with name "AUECKA01".

Exception             : Microsoft.HyperV.PowerShell.VirtualizationException: Hyper-V was unable to find a virtual machine with name "AUECKA01".
TargetObject          : AUECKA01
CategoryInfo          : InvalidArgument: (AUECKA01:String) [Get-VM], VirtualizationException
FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 7
PipelineIterationInfo : {0, 1}

Get-VM:
Line |
   7 |      (Get-VM -Name $vMName -ComputerName $node)
     |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The Hyper-V module used in this Windows PowerShell session cannot be used for remote management of the server 'AUECKHV01'. Load a compatible version of the Hyper-V module, or use Powershell remoting to connect directly to the remote server. For more information, see http://go.microsoft.com/fwlink/p/?LinkID=532650.
Get-VM:
Line |
   7 |      (Get-VM -Name $vMName -ComputerName $node)
     |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Hyper-V was unable to find a virtual machine with name "AUECKAP01".

Exception             : Microsoft.HyperV.PowerShell.VirtualizationException: Hyper-V was unable to find a virtual machine with name "AUECKAP01".
TargetObject          : AUECKAP01
CategoryInfo          : InvalidArgument: (AUECKAP01:String) [Get-VM], VirtualizationException
FullyQualifiedErrorId : InvalidParameter,Microsoft.HyperV.PowerShell.Commands.GetVM
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 7
PipelineIterationInfo : {0, 1}

Error details
No response
Environment data
Name                           Value
----                           -----
PSVersion                      7.2.2
PSEdition                      Core
GitCommitId                    7.2.2
OS                             Microsoft Windows 10.0.14393
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           <IP_ADDRESS>
WSManStackVersion              3.0

Visuals
No response

Aye, Foreach-Object -Parallel executes each branch in a separate runspace. If you want a specific version of the module imported for all the parallel executions, you'll need to run the import as part of the scriptblock provided to Foreach-Object -Parallel as well.


image copied by 'image copy ubuntu-daily:zesty local: --alias zesty --auto-update' disappeared

The template below is mostly useful for bug reports and support questions.
Feel free to remove anything which doesn't apply to you and add more information where it makes sense.
Required information

Distribution: ubuntu

Distribution version: zesty

lxd version: 2.9.3-0ubuntu2

lxc info:
 config: {}
 api_extensions:
 - storage_zfs_remove_snapshots
 - container_host_shutdown_timeout
 - container_syscall_filtering
 - auth_pki
 - container_last_used_at
 - etag
 - patch
 - usb_devices
 - https_allowed_credentials
 - image_compression_algorithm
 - directory_manipulation
 - container_cpu_time
 - storage_zfs_use_refquota
 - storage_lvm_mount_options
 - network
 - profile_usedby
 - container_push
 - container_exec_recording
 - certificate_update
 - container_exec_signal_handling
 - gpu_devices
 - container_image_properties
 - migration_progress
 - id_map
 - network_firewall_filtering
 - network_routes
 - storage
 - file_delete
 - file_append
 - network_dhcp_expiry
 api_status: stable
 api_version: "1.0"
 auth: trusted
 public: false
 environment:
   addresses: []
   architectures:
   - x86_64
   - i686
   certificate: |
     -----BEGIN CERTIFICATE-----
     MIIHhjCCBW6gAwIBAgIQTrZA/IdKStvMzx/cpZ0F8TANBgkqhkiG9w0BAQsFADA2
     ..
     rvc10de6jzB7zw==
     -----END CERTIFICATE-----
   certificate_fingerprint: 79835e469ddd6eb1c253801988b8b950bbe87e83c1d21ee8bea8ff2b6ec4df95
   driver: lxc
   driver_version: 2.0.7
   kernel: Linux
   kernel_architecture: x86_64
   kernel_version: 4.9.0-15-generic
   server: lxd
   server_pid: 1181
   server_version: 2.9.3
   storage: zfs
   storage_version: <IP_ADDRESS>-0ubuntu7

Issue description
Yesterday I ran the following (following https://github.com/lxc/lxd/issues/1746)
$ lxc image copy ubuntu-daily:zesty local: --alias zesty --auto-update
$ lxc launch zesty z1
$ lxc delete --force z1

Today I came in and ran
$ lxc launch zesty z1
error: can't get info for image 'zesty': not found

I expected that the '--auto-update' would keep this around even after all containers from it were deleted.  If that is not the case, what is the proper way to do that?

Isn't the point of #1746 to turn off the auto update flag?

Well, see the orginal issue.
I wanted to just run something that populated images, basically saying "I want to 'track' ubuntu images for releases X Y Z".
Stephane gave the 'copy' command above, which used to do what i wanted.
At the end of that bug, I suggested that there should be a way to add an alias that gets kept around but does not automatically get moved forward.

This sounds like what I fixed yesterday.
https://github.com/lxc/lxd/commit/806d55c88562ab82b32d2d8563c20a8ec9bdac98
@smoser your understanding is right. The problem is that there is a bug where LXD deletes all images its updating on startup if it's not used by any downstream storage pools... Will be in tomorrow LXD 2.10 release.


Feature: Add machine-readable remediation to the hasDangerousWorkflowScriptInjection probe

Is your feature request related to a problem? Please describe.
The finding.Finding.Remediation.Patch field is meant to store machine-readable patches to fix the finding:
https://github.com/ossf/scorecard/blob/6fc7d4c061d2276fdf2427e40cd736e98598f476/finding/probe/probe.go#L45-L47
Fixing script injection in workflows is pretty straightforward and can be solved procedurally, but the probe's findings don't include the patch.
Describe the solution you'd like
The findings generated by hasDangerousWorkflowScriptInjection should include a remediation patch that is machine-readable, and preferably human-recognizable. I'd propose the "unified diff" format used by git diff or diff -u.
The utopian solution would allow us to create a single "global" patch that maintainers could then apply to the project, entirely fixing all the dangerous script injections. However, my understanding of the probe architecture leads me to believe we can only fix individual findings, one at a time.
I have already created some first-draft code that can perform this operation. Running it, we get output such as:
{
  # ...
  "findings":
    [
      {
        # ...
        "remediation":
          {
            "patch": "--- a/.github/workflows/pull_request_open_polling.yml\n+++ b/.github/workflows/pull_request_open_polling.yml\n...",
            # ...
          },
      },
      {
        # ...
        "remediation":
          {
            "patch": "--- a/.github/workflows/pull_request_update_polling.yml\n+++ b/.github/workflows/pull_request_update_polling.yml\n...",
            # ...
          },
      },
    ],
}

Pretty-printing each of those patches, we get a git diff-like* "unified" output that can be used to fix the relevant finding:
--- a/.github/workflows/pull_request_open_polling.yml
+++ b/.github/workflows/pull_request_open_polling.yml
@@ -8,10 +8,13 @@
   pull_request:
     types: [opened, reopened]

+env:
+  PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
+
 jobs:
   build:
     runs-on: jenkins-polling

     steps:
       - name: Run PullRequestJenkinsPoller
-        run: ... ${{ github.event.pull_request.head.ref }} ...
+        run: ... $PR_HEAD_REF ...

I'll be happy to send this code as a PR once I've polished it up.
However, there are several issues with my current implementation that I wish to discuss before moving forward:
git diff-like output
The biggest problem is generating the git diff output. It'd be great if we could use a dependency to create this output given two versions of a file, but a reasonable dependency doesn't really exist, as far as I can tell:

go-git (already used by Scorecard) can generate slices describing all the changes between the files (https://github.com/go-git/go-git/blob/master/utils/diff/diff.go), but it can't create the output in the "unified" format we need for git apply. That functionality is basically just a wrapper for sergi/go-diff, which isn't currently used by Scorecard, so this would need to be added to Scorecard's go.mod.
hexops/gotextdiff and akedrou/textdiff are effectively identical packages that can create the necessary git diff output. However, these packages simply export an internal module used by Go tools (x/tools/internal/diff). However, given their "one-and-done" concept, they've been archived by their maintainers (and, unsurprisingly, have poor Scorecard scores: 2.9).

I've explored two alternatives:

Using hexops/gotextdiff works just fine to generate the "unified diff", as far as I can tell. But it really is a lousy dependency to add to Scorecard.
I've also written some code to generate the "unified diff" ourselves based on go-git's output. It works for the handful of tests I've run, but it'd probably have to be more thoroughly tested to make sure it covers edge cases, etc.

How to store expected unit test outputs
This code would naturally need to be tested. Each test case will be composed of a workflow that needs to be fixed and all the information we'd receive from the finding (location, unsafe variable, etc). However, the unit tests also need to know what the expected output of each test would be. We need to decide how we wish to store this information. As I see it, our options are:

we can store the expected "fixed workflow" (i.e. workflow-fixed.yml), and then generate the git diff-like output during the test and compare it to ours. Conceptually, this would be the best solution, but the only way I see to generate that output would be to... run git diff using exec.Cmd() or something, which has all the downsides of using exec.
In this particular case, I don't think it'd be toooooo problematic, though? Any machine running tests on Scorecard likely has git installed on the $PATH (and we can simply skip the test if it's not found), and the "unified format" has been stable since its release in 1990, so there isn't much risk of different results on machines with different versions of git.
store the expected git diff file (generated by running git diff on the broken workflow and a fixed version – which is untracked) and compare our output directly to it. This makes the test code simple, but means we're storing a human-legible-but-unfriendly format. It's also somewhat brittle: if we modify the original workflow (i.e. adding comments), that will change the git diff output as well (modified line positions, maybe even changing the diff itself), so the .diff file would also need to be updated, which may not be immediately obvious.
store the .diff file and the fixed version of the workflow (i.e. workflow-fixed.yml). The fixed workflow wouldn't actually be used for the tests, but would serve as useful context, showing what we expect the output to be. But this would also be vulnerable to drift over time: we might change the broken workflow and the diff and forget to update the fixed workflow.

This solution could be enhanced by adding another step to make all that runs git diff (again, assuming it exists) on the broken and fixed versions of the workflows and updates the respective .diff files (this would need to be verified in the CI/CD tests)

Let me know which options you prefer for these two questions and I'll send a PR taking them into account.

* One perhaps-notable difference between this output and an actual git diff is that git diff adds the "scope" after the @@ anchors (i.e. @@ -1,2 +3,4 @@ func foo() {), while my code does not. However, this data isn't actually used by git apply or patch, so this is a meaningless difference.

PR #4218 was sent last week to resolve this issue.


Job socket revamp

This pr is really all about make it easier to report errors when starting a job. In job-socket we now have a clean start event that's a promise that actually throws errors when things go wrong.
I'll merge this into errors-revamp branch that's a list of the reverted commits from last Friday.
@go-oleg

some naming stuff, but looks great besides that


Provide full request object to renderer

To provide cookies to your Angular app, it is sometimes necessary to provide it to your Angular from the server entrypoint prior to the Angular app taking over. Cookies, for example, are sometimes omitted due to Angular's xhr2's strictCookies setting.
I have observed this both in my local analogjs app and pure Angular apps with ssr and express. To avoid this in an express-angular project, I simply provide the REQUEST to my app using the nguniversal token:
  server.get('*', (req, res, next) => {
    const { protocol, originalUrl, baseUrl, headers } = req;
    commonEngine
      .render({
        bootstrap,
        documentFilePath: indexHtml,
        url: `${protocol}://${headers.host}${originalUrl}`,
        publicPath: browserDistFolder,
        providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }, { provide: REQUEST, useValue: req } ], // <--- provided here
      })
      .then((html) => res.send(html))
      .catch((err) => next(err));
  });

Analog does not yet provide a way to do this. The request object handled by a load hook, for example, which is really just a route resolver, is already sanitized by the framework; it is not a raw request and hence, in my case, lacked cookies.
I noticed that modifying the lines highlighted below gave me the full request with the cookies I needed:
https://github.com/analogjs/analog/blob/main/packages/vite-plugin-nitro/src/lib/runtime/renderer.js#L14-L15
https://github.com/analogjs/analog/blob/c812260168f86fd6e5fee2287e5e1f9848a63008/packages/vite-plugin-nitro/src/lib/plugins/dev-server-plugin.ts#L46
I am looking for either advice on how to make a backwards compatible PR that will work with different deployments, or from an existing contributor to take point on a solution. This is unfortunately a blocker for me :-(

Thanks @Jefftopia. This isn't currently officially supported. As a workaround, you can define a custom renderer and server entry point.
I put together a repo below that shows the changes needed in a commit.
https://github.com/brandonroberts/analog-server-request
It's not supported in dev mode unless you patch this file for the Vite dev server to pass the request/response the same way to the renderer.
https://github.com/analogjs/analog/blob/main/packages/vite-plugin-nitro/src/lib/plugins/dev-server-plugin.ts#L46

Thank you @brandonroberts. If I were to create a PR to pass the full object, what are some test cases you would want covered?

I think it would be enough to add a page to the analog-app and E2E test that handles injecting and use a request/response in client code.
We don't have any InjectionTokens defined for those either, so those could be defined in the analog-app for now. I'm not sure provided easy access to injecting request/response into client code is the long term goal, but it is useful in some cases.

Thanks. I agree that it is not ideal to have these in client code, particularly the response. Two observations:

I only need the request, does it makes sense to have both for completeness?
I only need these on the server; on the client, I have access to all of the cookies from the document (and credentials: 'include' / withCredentials: true behaves in a more expected way there). That said, is there a straightforward way in Angular to scope the provider to the server only?

I think both should be provided
You would only provide them in the main.server.ts with the platformProviders. When you try to access them in the client app, they should be injected as optional because they will be undefined.

You can't scope it to the server only without using the isPlatformServer() checks if you want to use Angular patterns.
Vite also has an import.meta.env.SSR you could wrap the code in that causes it to get tree-shaken in the client build.

@brandonroberts Working on a PR now, but it looks like the event passed to export default eventHandler in renderer.js only has the equivalent of a Request object, and no response object.

Am I missing a step?
If not, do you want to revisit including the Response?
Or just have the Response be undefined when running deployed?


Words position from terminal panel is incorrect

VSCode Version:1.11.2
OS Version: Windows 10

Steps to Reproduce:

Duplicate of #24941 / #19665


Try lowercasing all the keys if a path lookup fails

https://github.com/rancher/rancher/issues/1908


Problem with running SBETool

I try to compile the SbeTool.java in the command prompt but i get this error.Anybody run into problem like that.here is the link of the screen shoot
https://www.screencast.com/t/Hs1cKH5zJ
I am trying to run the simple binary encoding under VS2015 but i first need to get that tool working for me.If you could post a compiled recent sbetool i would appreciate it

You build by running the gradle on the command line. This is covered on the home page read me.
> gradlew


Add counters for active/running tasks

Feature Request Description
We want to be able to have precise batch metrics, especially task volume metrics.
Describe Preferred Solution
At this time the active & running task metrics are gauge metrics describing the amount of active/running tasks at a given time. Although useful it would be great to have also total counters for active & running tasks to be able to compute volumes (delta).
Current
// TaskCounts ...
type TaskCounts struct {
    autorest.Response `json:"-"`
    Active            *int32 `json:"active,omitempty"`
    Running           *int32 `json:"running,omitempty"`
    Completed         *int32 `json:"completed,omitempty"`
    Succeeded         *int32 `json:"succeeded,omitempty"`
    Failed            *int32 `json:"failed,omitempty"`
}

Proposed
// TaskCounts ...
type TaskCounts struct {
    autorest.Response `json:"-"`
    Active            *int32 `json:"active,omitempty"`
    ActiveTotal       *int32 `json:"active_total,omitempty"`
    Running           *int32 `json:"running,omitempty"`
    RunningTotal      *int32 `json:"running_total,omitempty"`
    CompletedTotal    *int32 `json:"completed_total,omitempty"`
    SucceededTotal    *int32 `json:"succeeded_total,omitempty"`
    FailedTotal       *int32 `json:"failed_total,omitempty"`
}

Additional Context
I asked this because after writing prometheus-azure-exporter (which was initially written only to expose Azure Batch metrics to prometheus) we couldn't represent accurately active & running tasks because gauges do not show what happens between two metrics retrievals.

cc @devigned @kiwidev

@sylr I'm not a committer on this project, but sounds like a useful feature. 👍

@devigned do you know who are ?

I'm not sure, but I think @matthchr probably does.

Thanks for the ping @devigned
@sylr - I've forwarded this along internally to the owners of the counting features.

@matthchr Thanks!
Any chance to have feedbacks from these guys here ?

Hi @sylr - just making sure we understand this correctly.
Currently, Active, Completed, etc are snapshots of the current number of tasks in the given state at the time you call the metrics API. It already includes all tasks (so, Active + Completed + Running = total of all tasks).
What's the proposed difference between that behavior, and your Total proposal?
Is the primary desire you have to track tasks which have been deleted?
So for example if at t0 you have:
20 active
10 running
10 completed

and then you delete the 20 active tasks, you'd like to see:
0 active
10 running
10 completed
20 TotalActive

Is that right?

The goal here is to track volumes of active and running tasks at any given time (before they complete or fail) by computing deltas.
Gauge don't allow to do that.
Also It would be nice to separate Failed and Canceled tasks because at the moment they all end up in the Failed counter. So this would be quite nice :
// TaskCounts ...
type TaskCounts struct {
    autorest.Response `json:"-"`
    // Current number of active tasks
    Active            *int32 `json:"active,omitempty"`
    // Total number of tasks ever created
    ActiveTotal       *int32 `json:"active_total,omitempty"`
    // Current number of running tasks
    Running           *int32 `json:"running,omitempty"`
    // Total number of tasks ever gone to running state
    RunningTotal      *int32 `json:"running_total,omitempty"`
    // Total number of tasks ever completed (SucceededTotal + FailedTotal + CanceledTotal)
    CompletedTotal    *int32 `json:"completed_total,omitempty"`
    // Total number of tasks ever succeeded
    SucceededTotal    *int32 `json:"succeeded_total,omitempty"`
    // Total number of tasks ever failed
    FailedTotal       *int32 `json:"failed_total,omitempty"`
    // Total number of tasks ever canceled
    CanceledTotal       *int32 `json:"failed_total,omitempty"`
}

The goal here is to track volumes of active and running tasks at any given time (before they complete or fail) by computing deltas.

Isn't this exactly what the current Active/Running/Completed already tell you? They're exactly the volume of tasks in a particular state at a particular time - why do you want/need to compute those numbers via deltas when they're already provided in the API?
If you want to compute deltas between time intervals, isn't subtracting t0 from t1 sufficient to see what has changed (unless you've deleted tasks - which is where my "are you deleting tasks" question came from)?
Sorry if I'm being dense - a specific example might help me understand the value of what you're asking for. I suspect my confusion is that I am not aware of how prometheus is doing things so it's not obvious why the current solution isn't sufficient.

  t       t+60     t+120    t+180    t+240
  o--------o--------o--------o--------o
  0        2        1        3        0   active gauge
  o--------o--------o--------o--------o
 200      202      205      208      208  active total
  o--------o--------o--------o--------o
          +2       +3       +3       +0   delta(active total)

Here between t+60 and t+120 +3 new tasks but also 4 went to running

Okay, so in the scenario you described, do you agree that the Batch API today would return the below (note that you didn't mention when completions happened so I just made some up)
  t       t+60     t+120    t+180    t+240
  o--------o--------o--------o--------o
  0        2        1        3        0   active (as returned by the Batch API today)
  o--------o--------o--------o--------o
  0        0        4        1        0   running (as returned by the Batch API today)
  o--------o--------o--------o--------o
 200      200      200      204      208  completed (as returned by the Batch API today)
  o--------o--------o--------o--------o
 200      202      205      208      208  total tasks in the job (as computed by adding Active, Running, and Completed returned by the Batch API today)
  o--------o--------o--------o--------o
          +2       +3       +3       +0   delta (new tasks)

i.e. is your active total (which really is just == to the number of tasks added to the job) computable by summing active, running, and completed?

I believe you are correct, didn't see it that way.

Note that, if your job deletes tasks, the above is a bit of a fib because delete tasks are omitted from counts, so deleting tasks does throw everything off (which is why I was asking about that scenario above).
If you aren't deleting tasks until the job is "done" then I think the above should work for you?

@alfpark - I think we can close this issue unless @sylr objects.

Huh yeah, still be nice to extract canceled jobs out of Failed counter and have its own Canceled counter.

When you say Canceled, do you mean tasks which were terminated by the user via for example a TerminateTask API?

Yes.


Revisit BC Fossil Sample part of model

Need to review and refine the BC Fossil Sample part of the Resource Model. Specifically we need to examine:

[x] The relationship between Taxonomy and Sample
[x] The location of Geological Assessment in the model (where it belongs)
[ ] The location of Temporal Assessment in the model (where it belongs)

Temporal Assessment was re-named Geological Age and is now showing up in the model


pwsh-beta: Add arm64

Also uses the checksum file for hash extraction

Relates to https://github.com/ScoopInstaller/Main/pull/4837

[x] I have read the Contributing Guide.

/verify


New version: Mozilla.Thunderbird version 115.5.2

Pull request has been created with WinGet Automation :rocket:
Microsoft Reviewers: Open in CodeFlow

Merge conflicts - reset PR.