Graph Multiple Transitions to Same State

This might be an issue with my understanding of state machines but I am seeing unexpected results when creating a graph.
I have a machine that when it is "hot" it turns "off".  If it detects "hot" while it is off it stays off.  If it detects "warm" while it is off it stays off.   I expect in the graph generated that it would have two self-referential arrows.   Instead I am seeing just one for the last transition that I defined.
Example code:
class DemoIssue(object):
    states = ["Off",
              "Green Light On"]

    def __init__(self):
        self.machine = Machine(model=self, states=DemoIssue.states, initial='Off', auto_transitions=False)

        self.machine.add_transition(trigger='hot', source="Off", dest="Off")

        self.machine.add_transition(trigger='warm', source="Off", dest="Off")
        self.machine.add_transition(trigger='warm', source="Green Light On", dest="Off")

        self.machine.add_transition(trigger='cold', source="Off", dest="Green Light On")
        self.machine.add_transition(trigger='cold', source="Green Light On", dest="Green Light On")

Example Graph:

Hi @Cabalist It looks like you are just running an older version of the code. Here's what I'm getting:

Excellent!  I just did a pip install. I'll pull from the repo. Thanks!


How to change OpenJDK version,so high

Steps to reproduce
Android Studio Ladybug | 2024.2.1 Patch 2
How to change OpenJDK version,so high
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
Expected results
How to change OpenJDK version,so high
• Java version OpenJDK Runtime Environment (build 11.0.25)
Actual results
How to change OpenJDK version,so high
• Java version OpenJDK Runtime Environment (build 11.0.25)
Code sample
1
Screenshots or Video
1
Logs
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-apply
FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring root project 'android'.

Could not open cp_proj generic class cache for build file '/android/build.gradle' (.gradle/caches/7.5/scripts/39iwfsj445e8nxuf5115pfdu0).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 65

Try:

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

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

BUILD FAILED in 2s
┌─ Flutter Fix ───────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project's Gradle version is incompatible with the Java version that Flutter is using   │
│ for Gradle.                                                                                │
│                                                                                │
│ If you recently upgraded Android Studio, consult the migration guide at                         │
│ https://flutter.dev/to/java-gradle-incompatibility.                                             │
│                                                                                │
│ Otherwise, to fix this issue, first, check the Java version used by Flutter by running flutter │ │ doctor --verbose.                                                                              │
│                                                                                │
│ Then, update the Gradle version specified in                                                    │
│ /android/gradle/wrapper/gradle-wrapper.properties to be │
│ compatible with that Java version. See the link below for more information on compatible        │
│ Java/Gradle versions:                                                                           │
│ https://docs.gradle.org/current/userguide/compatibility.html#java                               │
│                                                                                │
│                                                                                │
└─────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
Flutter Doctor output
flutter doctor -v
[✓] Flutter (Channel stable, 3.27.0, on macOS 15.1.1 24B91 darwin-arm64, locale
zh-Hans-SG)
• Flutter version 3.27.0 on channel stable at /development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 8495dee1fd (3 days ago), 2024-12-10 14:23:39 -0800
• Engine revision 83bacfc525
• Dart version 3.6.0
• DevTools version 2.40.2
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at Library/Android/sdk
• Platform android-35, build-tools 34.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16B40
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

For windows
flutter config --jdk-dir "C:\Program Files\Java\jdk-11"

Above is correct option to configure jdk per your path and it should resolve your question. Closing.


Update bug report URL in LibYAML

Previously we pointed at BitBucket, but we're using GitHub now, so we
should update that.

Applied, pushed, thanks!


fix(ci): fix windows vim test

https://github.com/catppuccin/nvim/actions/runs/5367690476

It's just a fluke, I reran the previous action and it passed: https://github.com/catppuccin/nvim/actions/runs/5367690476/jobs/9738158889
Also note that only gvim supports termguicolors on github actions for some reason

It's just a fluke, I reran the previous action and it passed: https://github.com/catppuccin/nvim/actions/runs/5367690476/jobs/9738158889
Also note that only gvim supports termguicolors on github actions for some reason

I thought the same, thanks!


Thumbnail generation stops working when ->pick() is added to image upload field.

I've added the pick() method to my image upload field, but then the thumbnail generation is not called. No errors/exceptions, it is just omitted. When I remove the pick() method, the thumbnail generation is working again. I've tried all different methods for generating thumbnails, but they all have the same problem. It happens with single and multiple image uploads.
$form->multipleImage('images', __('admin.images'))->thumbnailFunction('fullhd', function ($image) {
    return $image->resize(1980, 1080, function ($constraint) {
        $constraint->upsize();
        $constraint->aspectRatio();
    });
})->thumbnailFunction('small', function ($image) {
    return $image->resize(800, 450, function ($constraint) {
        $constraint->upsize();
        $constraint->aspectRatio();
    });
})->pick(); // This will disable the thumbnail generation.

@bytebrain i see what you mean and what happens.
Need a little bit of thinking on this on. Since the image is coming from the library, i`m wondering if direct modification of the image should be available. That's the reason this is disabled in the first place. For example preventing a crop on already existing image.
But i see the structure you setup coming in handy. Likely there need to be some extra checks. Any Ideas on how to make this work properly?


Azure CLI not found on path error

Hello,
I have an issue with making kubelogin work properly.
Here is the fragment of my kubeconfig file:
user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - get-token
      - --login
      - azurecli
      - --server-id
      - <UUID cut out>
      command: kubelogin
      env: null
      provideClusterInfo: false

When I try to run any kubectl operation I'm getting "Azure CLI not found on path" error despite the fact that I do have az in path. Attaching screenshot with a session which shows that I can run the actual command which kubelogin is running (az account get-access-token). However when run via kubelogin it appears like if the env variable ($PATH) wouldn't be passed to child process.

did you use snap to install kubelogin? if so, it's pretty broken at this moment since it's running in a sandbox env that doesn't have access to az context.

Yes, I did.
Thanks for help! It now works after installing it with brew.


Workaround for posting single comments in split diff view

Workaround for #4745.

This doesn't fix the root cause, which is that the .add-code-comment div is somehow obscuring the Post single comment button and hijacking the click events
Changing the button's z-index doesn't seem to have an effect
It's not clear why the other buttons on the same form aren't affected :man_shrugging:

Not sure why the CI is failing

It's unrelated, restarted.

Codecov Report

Merging #7052 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #7052      +/-   ##
==========================================
+ Coverage   41.44%   41.45%   +0.01%
==========================================
  Files         442      442
  Lines       59604    59608       +4
==========================================
+ Hits        24702    24713      +11
+ Misses      31672    31664       -8
- Partials     3230     3231       +1

Impacted Files
Coverage Δ

models/models.go
57.5% <0%> (+0.72%)
:arrow_up:

routers/repo/view.go
43.03% <0%> (+1.01%)
:arrow_up:

modules/log/colors_router.go
87.5% <0%> (+4.16%)
:arrow_up:

models/unit.go
67.56% <0%> (+5.4%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 063fa99...4da487b. Read the comment docs.

Make lg-tm work


Fluxctl 1.3.0 crash on OSX

fluxctl_darwin_amd64 v1.3.0 fatal crash
panic: runtime error: index out of range

goroutine 1 [running]:
main.userGitconfigMap(0xc4200b8580, 0xc57, 0xc57)
	/go/src/github.com/weaveworks/flux/cmd/fluxctl/args.go:60 +0x232
main.getUserGitconfig(0x3d)
	/go/src/github.com/weaveworks/flux/cmd/fluxctl/args.go:48 +0x175
main.AddCauseFlags(0xc42032a480, 0xc4200ea758)
	/go/src/github.com/weaveworks/flux/cmd/fluxctl/args.go:15 +0x26
main.(*controllerReleaseOpts).Command(0xc4200ea6e0, 0xc4200ea6e0)
	/go/src/github.com/weaveworks/flux/cmd/fluxctl/release_cmd.go:46 +0x1a5
main.(*rootOpts).Command(0xc4203193e0, 0xc4203193e0)
	/go/src/github.com/weaveworks/flux/cmd/fluxctl/root_cmd.go:62 +0x53b
main.run(0xc420094090, 0x1, 0x1, 0xc4200001a0)
	/go/src/github.com/weaveworks/flux/cmd/fluxctl/main.go:12 +0x4d
main.main()
	/go/src/github.com/weaveworks/flux/cmd/fluxctl/main.go:29 +0x64

Fixed it by removing a multiline alias in my git config.

Likely the same problem that prompted https://github.com/weaveworks/flux/pull/1073 -- I should do another release, to get that and other fixes into GA.

(1.3.1 included this fix -- closing)


Traceback (most recent call last):
File "main.py", line 594, in
if opt.learned_embeds_path is not None and os.path.exists(opt.learned_embeds_path):  # add textual inversion tokens to model
File "/data1/Magic123/nerf/utils.py", line 1049, in train
self.train_one_epoch(train_loader, max_epochs)
File "/data1/Magic123/nerf/utils.py", line 1263, in train_one_epoch
self.model.update_extra_state()
File "/home/groot/apps/miniconda/envs/e3/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/data1/Magic123/nerf/renderer.py", line 1493, in update_extra_state
xx, yy, zz = custom_meshgrid(xs, ys, zs)
RuntimeError: CUDA error: device-side assert triggered
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

please tell me how to fix it，thank you.

 Since you machine could not find gpu 0


Skype for Business Admin Center no longer exists

Although this doc was updated 4 days ago (21 Sep 2018), the Skype for Business Admin Center was rolled into Teams & Skype back in March. Please update this doc

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

ID: ac16b3b5-de8f-af59-9127-6edeb9f89a36
Version Independent ID: df452aa6-873b-5a6b-b642-0eff6d3db919
Content: Getting phone numbers for your users
Content Source: Skype/SfbOnline/what-are-calling-plans-in-office-365/getting-phone-numbers-for-your-users.md
Service: skype-for-business-online
GitHub Login: @tonysmit
Microsoft Alias: tonysmit

@hazymat Thank you for this feedback
I'll make sure this article gets updated again.
I was able to get this into the backlog for the Teams/Skype for Business team. The team will get this prioritized into a sprint plan. Thank you for reporting and making the docs better. Much appreciated.
I made a note to request the team to update this when the work is complete.

So...this still hasn't been updated........

You can still get to the Skype for Business Admin center through the Teams admin center (https://admin.teams.microsoft.com/dashboard).

@CarolynRowe  I would love to get your opinion on what would be the best way to go about updating this page and to what degree.  Thanks!

Please follow up with @tonysmit .  He's the expert on the Teams and SfB Admin centers.

@tonysmit Yes, I would love your thoughts on this.

The SFBO admin center wasn't 'rolled' into the Teams Admin Center. However, currently they need to use the Legacy portal link in the Teams Admin Center to get and port phone numbers. This will be changing in the future.


EndPoint routing and MapRazorPages and Map()

Describe the bug
When EndPoint routing and Razor Pages are used within a mapped pipeline i.e app.Map("/t1
MapRazorPages() generates Endpoints for each of the Razor pages, but those generated routes do not take into account the mapped path i.e "/t1" and therefore do not match - for example if you have a page in Pages\Home.cshtml then the route will match "Home" but browsing the site on /t1/Home results in a 404. Browsing the site on /Home also results in a 404 because this means the mapped pipeline containing razor pages doesn't execute.
Here is a sample showing the issue: https://github.com/dazinator/DemoRazorPagesMapped
To Reproduce
Steps to reproduce the behavior:
Run this sample: https://github.com/dazinator/DemoRazorPagesMapped
Expected behavior
Should be able to run RazorPages and EndpointRouting in a Map()'d pipeline.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Include the output of dotnet --info
Stems from debugging an issue here: https://github.com/aspnet/AspNetCore/issues/10469

Thanks for contacting us, @dazinator.
What are you trying to achieve? What is your goal? There is probably a better way to do what you want.

My goal is for:

Razor pages to operate completely independently from one tenant to another. For example tenant T1 might have its razor pages /foo.cshtml in /T1 subfolder. Tenant T2 has its razor pages /bar.cshtml in its /T2 subfolder. When tenant T1 access the site through its URL www mysite.com/t1 then T2 razor pages should not be routable and vice versa.

I've kind of achieved this goal by giving each tenant their own IServiceProvider and middleware pipeline. This means services are registered for each tenant rather than at application level and so can be configured for the specific tenant. With AddRazorPages that's great because you can specify the location on disk that contains that tenants pages. However when EndPoint routing middleware is executing in a mapped pipeline such as "/t1" and razor routes are generated, the generated routes don't take into account the current mapped path they are being generated on it seems instead that go from the sites root path "/". I don't foresee this being a problem when using different domain names to identify tenants for example www.t1.com and www.t2.com it just appears to be a problem when having to use Map().

@rynowak is the solution @dazinator achieved good for his scenario, or would we recommend something different?

I've kind of achieved this goal by giving each tenant their own IServiceProvider and middleware pipeline. This means services are registered for each tenant rather than at application level and so can be configured

You will have to do this. MVC doesn't provide features oriented around doing things per-tenant. I'd strongly suggest looking at Orchard.Core and least copying the design/code where appropriate. It's not to build multi-tenant systems.
The other approach you could do would be to write an IEndpointSelectorPolicy that looks at the base-path. I'm not confident that this will meet all of your needs though.
Are you still stuck here? It sounds like you fount a solution.

Thanks, yep I found a solution, I have a working multitenancy razor pages sample. I am pretty certain razor pages adds incorrect routes to endpoint routing though if you are using endpoint routing within a mapped path.. but luckily in my scenario as each tenant has it's own domain I dont need to use a mapped path to seperate tenants so if there is indeed a problem it's now a non issue.

I am pretty certain razor pages adds incorrect routes to endpoint routing though if you are using endpoint routing within a mapped path.. but luckily in my scenario as each tenant has it's own domain I dont need to use a mapped path to seperate tenants so if there is indeed a problem it's now a non issue

Map and routing don't interact at all. It's something that happens before routing runs - and removes the mapped segment from consideration:
Ex:
**Before Map**
Path: /map1/Foo/Bar
PathBase: /

**After Map (map1)**
Path: /Foo/Bar
PathBase: /map1

Routing looks at the Path and ignores PathBase


Fix Smokey being able to self-delete messages (poof/delete-force, automated self-deletion, etc.)

When reconnecting using a modified cookie-login method introduced in #6733 , as we're not calling one of the Chat Exchange "client" object's login methods, the Chat Exchange _worker thread doesn't get restarted, and as a result, message deletion is queued up but not performed. This PR explicitly starts that thread back up.
Had a chat with Makyen about this here, and for future reference, he mentions we should probably implement an abbreviated login function into our fork of Chat Exchange that doesn't rely upon Main/Meta sites being up, but that's more of a "Would be nice"/"Implement if you have time" thing.
This resolves issue #6776 and a sub-issue mentioned there by Ryan M.

!!/approve
Great! Thanks for the PR!


Azure REST API documents for adding lock on resource is wrong | need to remove parentResourcePath to run API

Hello Team,
for adding Lock on azure resources via API, Azure provides two links officially
https://learn.microsoft.com/en-us/rest/api/resources/management-locks/create-or-update-by-scope?tabs=HTTP#code-try-0
and
https://learn.microsoft.com/en-us/rest/api/resources/management-locks/create-or-update-at-resource-level?tabs=HTTP#code-try-0
however, if we run API via official documents directly with Parameters "parentResourcePath", API cannot be run and will pop error:
{'error':{'code':'InvalidResourceType','message':'The resource type could not be found in the namespace 'Microsoft.Storage' for api version '2016-09-01'.'}}
After investigation, we can run REST API without this parameter in other tool, like postman
example:
PUT https://management.azure.com/subscriptions/xxxxxsubidxxxx/resourcegroups/xxxxresourcegroupnamexxxx/providers/Microsoft.Storage/storageAccounts/xxxxstorageaccountnamexxx/providers/Microsoft.Authorization/locks/testlockname?api-version=2016-09-01
Body:
{
"properties": {
"level": "ReadOnly"
}
}
Please help correct two rest api links as it will confuse people who would like to add lock via API

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

ID: 4e7af209-7240-dd2a-7130-e7fb3143986a
Version Independent ID: a653b0d1-877d-09f7-17fa-11bf06c37cc9
Content: Protect your Azure resources with a lock - Azure Resource Manager
Content Source: articles/azure-resource-manager/management/lock-resources.md
Service: azure-resource-manager
Sub-service: management
GitHub Login: @tfitzmac
Microsoft Alias: tomfitz

@jjjjeee
Thanks for your feedback! We will investigate and update as appropriate.

@jjjjeee AFAIK the REST API articles are auto-generated based on REST API specifications, etc.
Tagging @tfitzmac @mumian for visibility, review and to help provide insights and do the needful if appropriate.

If the resource type doesn't have a parent type, then that segment is omitted.
#please-close


feat(fs12): execution summary table

I like this and the changes you made after our conversation. Having a cleaner table will help make the errors stand out when they happen.
I was trying to think of a way to have the plugin name and platform auto-discovered so you wouldn't have to add it to every plugin. But things like Function.prototype.name are not appropriate in production code.

It's not based off the function name i.e. every function name is a named export execute so that is can be autrun bound by interface by cli. The filename is not appropriate because the code is bundled i.e. everything is bundled into a single index.js file.

Yeah there's just no clever way to have the log be auto aware. So going forward we will need to make sure developers follow the same naming conventions when using with Summary.


[Bug] [Python]  change python doc link in readme.md

Search before asking

[X] I had searched in the issues and found no similar issues.

What happened
ci failed
What you expected to happen
ci pass
How to reproduce
run github action
Anything else
No response
Version
dev
Are you willing to submit PR?

[X] Yes I am willing to submit a PR!

Code of Conduct

[X] I agree to follow this project's Code of Conduct

I will close this issue because it had fixed.


My sampler update

I introduced a breaking change with 6.4.0 release and that version should have been v7.0.0.  I will delete v6.4.0 release and make a new v7.0.0 release.

Closing  this without merge and trying again after private rebase.


feat(container): update altinity/clickhouse-backup (2.5.29 → 2.6.3)

Update Request | Renovate Bot
This PR contains the following updates:

Package
Update
Change

altinity/clickhouse-backup
minor
2.5.29 -> 2.6.3

Release Notes

Altinity/clickhouse-backup (altinity/clickhouse-backup)
v2.6.3
Compare Source
IMPROVEMENTS

implement new format for *.state2 files boltdb key value (please, check memory RSS usage)
clean resumable state if backup parameters changed, fix 840
switch to golang 1.23
add clickhouse_backup_local_data_size metric as alias for TotalBytesOfMergeTreeTablesm from system.asychnrous_metrics, fix 573
API refactoring, query options with snake case, also allow with dash case.
add --resume parameter to create and restore command to avoid unnecessary copy object disk data fix 828

BUG FIXES

after drop table, before create table, will check if replica path already exists, and will try to, helpfull for restoring Replicated tables which not contains macros in replication parameters fix 849
fix TestLongListRemote for properly time measurement
fix log_pointer handle from system.replicas during restore, fix 967
fix use_embedded_backup_restore: true behavior for azblob, fix 1031
fix Nullable(Enum()) types corner case for check_parts_columns: true, fix 1033
fix deletions for versioned s3 buckets, multiple object versions created during internal retry

v2.6.2
Compare Source
BUG FIXES

fix rare corner case, for system.disks query behavior fix 1007
fix --partitions and --restore-database-mapping, --restore-table-mapping works together, fix 1018
fix wrong slices initialization for shardFuncByName (rare used function for backup different tables from different shards), fix 1019, thanks @cuishuang

v2.6.1
Compare Source
BUG FIXES

fix unnecessary warnings in allow_object_disk_streaming: true behavior during restore
fix stuck with gcs.clientPool.BorrowObject error: Timeout waiting for idle object cause OBJECT_DISK_SERVER_SIDE_COPY_CONCURRENCY has default value 32, but it much more than calculated default pool

v2.6.0
Compare Source
IMPROVEMENTS

add rbac-only and configs-only parameters to POST /backup/create and POST /backup/restore API calls
add allow_object_disk_streaming config option which will make object disk backup when CopyObject failed or when Object Storage have incompatible types, fix 979
add operation_id to callback, fix 995 thanks @manasmulay

Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.

[ ] If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

⚠ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

any of the package files in this branch needs updating, or
the branch becomes conflicted, or
you click the rebase/retry checkbox if found above, or
you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:
File name: undefined
Command failed: ./hack/bump-chart-version.sh 'clickhouse' '' 'true' ''
sed: 1: "charts/clickhouse/Chart ...": command c expects \ followed by text


es.split generate a empty line for trailing newline

es.split is mostly used for processing line by line, however we usually get an empty line at the end of the file. Please remove trailing newline.

use es.split({trailing: false})
see here for documentation: https://www.npmjs.com/package/split
On Tue, Nov 24, 2015 at 7:52 PM, yinrong<EMAIL_ADDRESS>wrote:

es.split is mostly used for processing line by line, however we usually
get an empty line at the end of the file. Please remove trailing newline.
—
Reply to this email directly or view it on GitHub
https://github.com/dominictarr/event-stream/issues/90.

I think event-stream's doc  should have a link to split's doc.

<EMAIL_ADDRESS>the latest version on npm, depends on<EMAIL_ADDRESS>which doesn't implement the trailing option. split itself is at version 1.0.1. Why is this, and how can we fix it?

split upgraded to 1.0.1


Add a custom rendering server

Type

New feature

Related JIRA Issue(s)
https://www.ebi.ac.uk/panda/jira/browse/ENSWBSITES-1069
Description
This PR adds the infrastructure for server-side rendering to the Ensembl website, and contains the refactorings necessary to support it.
Noteworthy parts of this PR are:

a Node-based rendering server
refactored build process (added dedicated script files for development and production build)
refactored routing, so that it can be reused both on the client and on the server side
Page-type components in every app; currently they are the only components that run on the server and add the dynamic meta tags to the page
updated redux code that it doesn't try to access browser-specific apis during the startup

Immediate to-do list

[x] fix tests
[x] fix loading of data from browser storage into redux
[x] fix api routing for requests that can be sent both client-side and server-side
[x] clean up the code

Subsequent to-dos (in separate PRs)

[ ] rethink the storage services — they should not try to get initialized upon an import
[ ] review the api service; specifically its use of the "apiHost" parameter from the config (this parameter probably doesn't make sense anymore)
[ ] move all our api calls to use the base urls passed from the server to the config
[ ] remove Connected React Router — we don't seem to be using it anyway (see this section in React Router docs for how to use React Router's hooks for submitting analytics)
[ ] dynamically detect free ports in the start script
[ ] we don't really need to run hasMounted in every page component; in fact, it's clearly undesirable because it leads to a flash of white. hasMounted should probably be calculated once per app and then passed down through global context
[ ] use a proper logger (winston?) on the Node side, rather than console.log
[ ] fix the script for performing bundle analysis on the build

Miscellaneous notes

After I added the isServer and isClient functions to the environment.ts helper file, and added a bit of client/server-dependent logic to the config.ts, I had to move the code for reading the environment variable from the config.ts file to the environment.ts file. Otherwise, a circular dependency between the config.ts and the environment.ts file occurred.

Deployment URL
It's complicated. Kamal has manually deployed the branch to http://ssr.review.ensembl.org; but gitlab-ci.yaml will have to be updated by the time we are ready to merge this PR in.
Views affected
All
Possible complications
🙈

I am getting a bunch of warnings like below when running storybook:
The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding
	["@babel/plugin-proposal-private-property-in-object", { "loose": true }]```

I am not sure if this is something to look into in this PR.
When we try to display "Sorry, something seems to have gone wrong", if the issue is related to do with communicating with the node server itself, the error page will probably look like this without the images:

I am getting a bunch of warnings like below when running storybook

@imransl thanks for checking the Storybook. As is frequently the case with Storybook, Storybook is tiring. It has its own default webpack config, in which it inlines babel-loader's options, and among those options, it lists the plugins that we recently removed: plugin-proposal-class-properties, plugin-proposal-private-methods, and plugin-proposal-object-rest-spread:

You will notice that these settings explicitly contain the "loose": true option. When babel-loader compares these inline settings with our babel config which doesn't even mention these plugins, it complains. I added a custom babelrc in the storybook directory that lists these two plugins. Hopefully, some time in the future, Storybook will remove these plugins form its own webpack config, and we will be able to delete the babelrc from the storybook folder.

I am not sure if this is something to look into in this PR.
When we try to display "Sorry, something seems to have gone wrong", if the issue is something to do with communicating with the node server itself, the error page will probably look like this without the images:

Not sure what you mean, @msmanoj. In a production build, all our static files are saved into the dist/static folder, which will be served by Nginx. The images on the error page can be found among dist/static/images/general-error-....jpg.

I haven't look at the code changes, just try the branch on my laptop. I did an npm ci and npm start and click through the site and everything seems to be working as expected (also tried the new 404). There were some errors about the static files (favicons and manifest.json) which we are aware of already and will need fixing.

Just when i already approved the PR that i spotted something thats broken. It seems like displaying youtube video isn't working:
http://ssr.review.ensembl.org/help/videos/how-to-find-and-add-species (works fine on internal) and i think there are some issues with static content on help pages, http://ssr.review.ensembl.org/help/articles/what-is-the-genome-browser:
GET http://ssr.review.ensembl.org/api/docs/images/id-genome-browser.svg 404 (Not Found)

It seems like displaying youtube video isn't working

Should be fixed now.
Notice that the deployment url has now changed to http://custom-ssr.review.ensembl.org

It seems like displaying youtube video isn't working

Should be fixed now.
Notice that the deployment url has now changed to http://custom-ssr.review.ensembl.org

Just checked and this is working for me now

Added an ensemblRoot alias for the root directory of the project (for the rare occasions not covered by the available aliases). Replaced the ../../../ in the imports of a file from a webpack directory. Seems to work fine.

The youtube video now works fine. Everything else is ok.


Added CPU instruction for README

Since the change itself is quite straight-forward, I'll just describe the context. Tried using automatic installer on my laptop, kept erroring out on line 140-something of installer.py, "ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv."
Got tired of of fighting with pip so moved on to command line install. Worked immediately, but at the time lacked instruction for CPU, so instead of opening any helpful hyperlinks in the readme, took a few minutes to grab the link from installer.py - thus this pr.

Thanks for the contribution!


IntelliJ IDEA is giving an error, ValueError: Model 'GPT-3.5' not found in /Users/xxx/.chat/config.yml

After setting the Key, the conversation throws an error, ValueError: Model 'GPT-3.5' not found in /Users/xxx/.chat/config.yml

Fixed in v0.1.0 version


Allow generating Rust 2018 code

This PR is a small subset of https://github.com/danburkert/prost/pull/147 we can land earlier than its more ambitious counterpart, tag a new release and unblock Rust 2018 projects depending on Prost.

r? @danburkert


No database specified, how it works doesn't explained

It is said, that example will work with in-memory database, but where it set it was not said.

That's a Spring Boot feature: Embedded Database Support. H2 is bootstrapped as in-memory database by just having H2 on the class path.


[PROD] DP homepage sometimes loads pretty slowly (up to 5 seconds)

Appetite: 2
What:
DP homepage sometimes takes up to 5 seconds to load all dataset. I haven't been able to reproduce the issue reliably, but at least both Bruce and I experience it a few times
Ask:

Set up an acceptance criterion for loading homepage under 1 second
Figure out the bottleneck and resolve the issue please 🙏

I suspect this might be due to the API fetching project details per project. In the future this landing page will go away so is it worthwhile spending the time to optimize it now. Or some basic caching would do the trick?

Yeah the interesting thing is that it comes and goes, so I haven't been able to tell what the bottleneck is
Bruce was also saying we can possibly add Datadog to monitor the endpoints if that helps detect the slow down?

Bruce's potential idea for API perf goal for /project and /project/{id}: Mean < 500ms, 90% < 1 second

@tihuan - why is a performance/tuning issue a bug?

Oh I was just thinking that the perf issue is an anomaly instead of an expected behavior, so I lumped that into the bug category. But we could treat that as a tech debt or just a regular feature ticket?

Looks like /project is not the problem (155ms), but /project/{id}! (At least for dev env API)

I saw Marcus mentioned something about keeping the lambda warm, but just wanted to provide more information in case it's helpful :D
Thank you!

@Bento007 and @MDunitz will pair on refining this ticket and help us explore a solution to keep the API calls under 1 second, and ensure the ticket has enough details for estimation 😄
Thanks both!

Trent and I located the api gateway latency metrices. The latency was extremely spiky indicating an issue with cold starts. Using locust we tested the dev api (see stats below[0]). We then turned on the api cache and retested[1] and found a 10x improvement. We recommend add caching through api gateway (this may be challenging due to how chalice and terraform interact). In terms of regression testing we recommend setting up cloudfront monitoring/alerting.
[0] no cache stats
--------------------------------------------------------------------------------------------------------------------------------------------
GET /dp/v1/project                                               608     0(0.00%)  |     199      97    4469     130  |    8.05    0.00
GET /dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481          127     0(0.00%)  |     345     220    5067     270  |    1.68    0.00
GET /dp/v1/project/673637cf-dcb7-45e1-bb88-72a27c50c8ca          126     0(0.00%)  |     389     220    5070     260  |    1.67    0.00
GET /dp/v1/project/8ad74eb4-c68f-4a4a-a17e-354f17605da6          129     0(0.00%)  |     798     413    5463     500  |    1.71    0.00
GET /dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174          104     0(0.00%)  |     374     193    4534     230  |    1.38    0.00
GET /dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379          116     0(0.00%)  |     480     243    4985     280  |    1.53    0.00
--------------------------------------------------------------------------------------------------------------------------------------------
Aggregated                                                      1210     0(0.00%)  |     340      97    5463     220  |   16.01    0.00
Response time percentiles (approximated)
Type     Name                                                              50%    66%    75%    80%    90%    95%    98%    99%  99.9% 99.99%   100% # reqs
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
GET      /dp/v1/project                                                    130    140    140    150    200    320    590   4300   4500   4500   4500    608
GET      /dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481               270    280    290    300    510    660    840    850   5100   5100   5100    127
GET      /dp/v1/project/673637cf-dcb7-45e1-bb88-72a27c50c8ca               260    270    280    290    370    610   4500   4600   5100   5100   5100    126
GET      /dp/v1/project/8ad74eb4-c68f-4a4a-a17e-354f17605da6               500    520    530    540    720   4800   5200   5300   5500   5500   5500    129
GET      /dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174               230    240    250    250    320    660   4300   4500   4500   4500   4500    104
GET      /dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379               290    300    330    360    550    750   4800   4900   5000   5000   5000    116
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
None     Aggregated                                                        220    260    290    320    500    600   4300   4800   5300   5500   5500   1210

[1] With cache stats
--------------------------------------------------------------------------------------------------------------------------------------------
 GET /dp/v1/project                                               568     0(0.00%)  |      63      36    1071      50  |   10.37    0.00
 GET /dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481           98     0(0.00%)  |      66      43     558      52  |    1.79    0.00
 GET /dp/v1/project/673637cf-dcb7-45e1-bb88-72a27c50c8ca           93     0(0.00%)  |      73      42     849      54  |    1.70    0.00
 GET /dp/v1/project/8ad74eb4-c68f-4a4a-a17e-354f17605da6           91     0(0.00%)  |      68      43     570      53  |    1.66    0.00
 GET /dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174           87     0(0.00%)  |      56      40     179      53  |    1.59    0.00
 GET /dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379           93     0(0.00%)  |      70      45    1068      52  |    1.70    0.00
--------------------------------------------------------------------------------------------------------------------------------------------
 Aggregated                                                      1030     0(0.00%)  |      65      36    1071      51  |   18.81    0.00
Response time percentiles (approximated)
 Type     Name                                                              50%    66%    75%    80%    90%    95%    98%    99%  99.9% 99.99%   100% # reqs
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
 GET      /dp/v1/project                                                     50     53     56     58     67     83    200    400   1100   1100   1100    568
 GET      /dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481                52     55     59     60     71    150    430    560    560    560    560     98
 GET      /dp/v1/project/673637cf-dcb7-45e1-bb88-72a27c50c8ca                54     57     60     62     73    150    540    850    850    850    850     93
 GET      /dp/v1/project/8ad74eb4-c68f-4a4a-a17e-354f17605da6                53     58     61     63     72    180    200    570    570    570    570     91
 GET      /dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174                53     56     59     60     65     75    130    180    180    180    180     87
 GET      /dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379                52     55     59     59     71    130    210   1100   1100   1100   1100     93
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
 None     Aggregated                                                         51     54     58     60     69    110    200    430   1100   1100   1100   1030```

Love the comprehensive table and description!! 🔥 👍

Update 9/14
Filed case with AWS support

Without caching all of the endpoints return the correct data. When UI turn on caching it appears that the endpoints returns whatever data I request first.
For example if I turn on caching and then go to `https://api.dev.corpora.cziscience.com/dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481` I get the correct data set.
But if I try to go to https://api.dev.corpora.cziscience.com/dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174` it will return the `18e6337b-8c36-4977-9ac8-ca8aa5494481` dataset```

Notes from pairing with Trent
Turned on Provisioned Concurrency with 5 lambdas
Locust with xray, 30 users, 10 users spawn per second.
Name                                                          # reqs      # fails  |     Avg     Min     Max  Median  |   req/s failures/s
GET /dp/v1/project                                               433     0(0.00%)  |     273     120    4869     190  |    7.60    0.00
GET /dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481           96     0(0.00%)  |     491     274    4583     400  |    1.69    0.00
GET /dp/v1/project/673637cf-dcb7-45e1-bb88-72a27c50c8ca           80     0(0.00%)  |     739     295    5730     390  |    1.40    0.00
GET /dp/v1/project/8ad74eb4-c68f-4a4a-a17e-354f17605da6           93     0(0.00%)  |     873     510    2528     780  |    1.63    0.00
GET /dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174           92     0(0.00%)  |     457     244    4943     330  |    1.62    0.00
GET /dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379           78     0(0.00%)  |     491     274    1940     430  |    1.37    0.00
Aggregated                                                       872     0(0.00%)  |     442     120    5730     320  |   15.31    0.00
Response time percentiles (approximated)
Type     Name                                                              50%    66%    75%    80%    90%    95%    98%    99%  99.9% 99.99%   100% # reqs
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
GET      /dp/v1/project                                                    190    210    230    250    420    600    770   1200   4900   4900   4900    433
GET      /dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481               400    450    480    500    710    790   1000   4600   4600   4600   4600     96
GET      /dp/v1/project/673637cf-dcb7-45e1-bb88-72a27c50c8ca               390    480    540    620    810   4900   5300   5700   5700   5700   5700     80
GET      /dp/v1/project/8ad74eb4-c68f-4a4a-a17e-354f17605da6               780    850    960   1000   1200   1400   2300   2500   2500   2500   2500     93
GET      /dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174               330    370    400    450    720    900   1300   4900   4900   4900   4900     92
GET      /dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379               430    470    510    550    750    830   1100   1900   1900   1900   1900     78
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
None     Aggregated                                                        320    400    490    570    770    940   1300   4500   5700   5700   5700    872

Thanks so much for the constant updates for lurkers like me to follow along 😆
The table above seems to show similar performance as https://github.com/chanzuckerberg/corpora-data-portal/issues/565#issuecomment-690734828 No cache stats[0]? Or maybe I'm not reading it correctly lol

Warmed cloudfront cache, no provisioned lambdas (through the cloudfront api https://api.cellxgene.dev.single-cell.czi.technology/dp/v1/project/{uuid}
 Name                                                          # reqs      # fails  |     Avg     Min     Max  Median  |   req/s failures/s
--------------------------------------------------------------------------------------------------------------------------------------------
 GET /dp/v1/project                                               204     0(0.00%)  |     178     119     527     160  |    8.18    0.00
 GET /dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481           36     0(0.00%)  |     329     268     420     310  |    1.44    0.00
 GET /dp/v1/project/673637cf-dcb7-45e1-bb88-72a27c50c8ca           43     0(0.00%)  |     342     244     759     330  |    1.72    0.00
 GET /dp/v1/project/8ad74eb4-c68f-4a4a-a17e-354f17605da6           40     0(0.00%)  |     694     555     977     650  |    1.60    0.00
 GET /dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174           41     0(0.00%)  |     349     238    1359     280  |    1.64    0.00
 GET /dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379           41     0(0.00%)  |     383     290     565     350  |    1.64    0.00
--------------------------------------------------------------------------------------------------------------------------------------------
 Aggregated                                                       405     0(0.00%)  |     298     119    1359     270  |   16.24    0.00
Response time percentiles (approximated)
 Type     Name                                                              50%    66%    75%    80%    90%    95%    98%    99%  99.9% 99.99%   100% # reqs
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
 GET      /dp/v1/project                                                    160    180    180    190    260    310    360    400    530    530    530    204
 GET      /dp/v1/project/18e6337b-8c36-4977-9ac8-ca8aa5494481               320    360    370    380    390    420    420    420    420    420    420     36
 GET      /dp/v1/project/673637cf-dcb7-45e1-bb88-72a27c50c8ca               330    350    360    370    390    390    760    760    760    760    760     43
 GET      /dp/v1/project/8ad74eb4-c68f-4a4a-a17e-354f17605da6               700    750    750    760    820    900    980    980    980    980    980     40
 GET      /dp/v1/project/a55cac37-629f-4d28-9b3f-4ece7a7ac174               280    290    300    310    470    610   1400   1400   1400   1400   1400     41
 GET      /dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379               350    420    430    440    520    540    570    570    570    570    570     41
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
 None     Aggregated                                                        270    310    350    380    570    730    770    870   1400   1400   1400    405

@Bento007 and I determined that using the new merged domain with cloudfront caching achieves the latency goals.

Thank you @MDunitz for updating the ticket.
Solutions
Stand up cloudfront in front of api-gateway and the lambda
Pros

This results in api call under 200ms.
We are already doing it

Cons

must clear the cloudfront cache whenever a database entry is add or modified. This can be a slow process.
need to verify that this will work as intended once authentication is in place.

Enable Caching at on api-gateway
Pros

results in api call under 500ms
Able to control the cache time to live for each endpoint

Cons

Will take more work to setup using chalice.
The cached response could get stale when making databases.

Reserve lambdas
Pro

result in api calls under 500ms
The database response is always up to date

Cons

As load increases we will eventually run into the slow startup time of 5 seconds as more lambdas spin up.

Optimize the spin-up time of Lambdas
Pro

We could reduce the API spin up time to under 1 second.

Cons

could require rebuilding of the backend server.

Future Work
We must verify certain things still work as intended. Verify that cache control headers work as expected. Verify that Authentication works as expected.
Conclusion
Any combination of the proposed solution will improve the load time of the frontend. Using cloudfront is the best solution for the time being. With that said we will need to verify cache control headers work, and authentication work moving forward.

Added latency tests (<500ms) to the cloudfront api for

https://api.cellxgene.dev.single-cell.czi.technology/dp/v1/project
https://api.cellxgene.dev.single-cell.czi.technology/dp/v1/project/e7c47289-22fe-440e-ba24-a4434ac3f379

TODO

add tests to staging/prod env when those changes are merged

Reopening this design ticket for next sprint to further our investigation 😄 Thank you!

@Bento007 has several options to fix, which would have different estimates.
Another option (which could be used in combination with some of the others), is to implement a new API that gets all the projects.  So instead of num projects + 1 API calls, we would just have 1.

From the Refinement, I believe the next step is to do a spike to figure out what combination of the solutions we want to try, and then create a ticket for that so we can estimate it. Is that what everyone understands too?
As for priority, judging from what @brianraymor and @ambrosejcarr said, it sounds like a P2?
Thank you!

When considering performance, please be aware that the portal will transition from a simple list of datasets to a list of collections with related metadata extracted from the datasets in the collection as outlined in Consumers want to explore published collections.

Per conversation with @maniarathi - We are migrating off of Lambda in mid-March which should solve the problem.
We'll create a new issue if that's not the case since this is related to the earlier dataset view.


add nth-prime exercise

Summary of changes:

Add nth-prime exercise and tests
Update config.json to list the nth-prime exercise

Merged in 8b70c656ab02e20bf353f8d48079210ba4e2a97c

Thank you :heart:


SafeERC20 - Does not revert on non-true value

@nventuro We have considered migrating our own implementation of SafeERC20 with the OpenZeppelin one and found that Tokens that return numbers in approve/transferFrom operations do not revert. In the code itself, it says that the return value must be true.
See here for a mock token you can test against:
https://github.com/SetProtocol/set-protocol-contracts/blob/master/contracts/mocks/tokens/InvalidReturnTokenMock.sol

I am not sure what do you mean?  return numbers in approve/transferFrom operations do not revert?

Hi @felix2feng. When an operation has a a return value, SafeERC20 interprets it exactly as Solidity would, for backwards compatibility. If a contract returns a non-zero number in place of a bool, Solidity will interpret it as true, and so SafeERC20 considers it a success and does not revert.
You're right that the comment is not accurate. We should change it to reflect the actual semantics.
https://github.com/OpenZeppelin/openzeppelin-solidity/blob/cf7375d6b873afc9f705e329db39e2ef389af9d2/contracts/token/ERC20/SafeERC20.sol#L48
I'm not sure what Set are doing but IMO a return value of 4 should not be considered a failure.


[homepage] "Start coding" on Save the Forest links to HoC homepage

Describe the bug

"Start coding" could link directly to the skillmap, with an additional "Learn more" link for the HoC landing page

Great suggestion, added and waiting on approval


Enable filtering in all the screens

Currently you can't filter agents, sayings, domains or keywords because the filter is not implemented in the API

I am going to create a separate issue for search in the API and leave this one as implementing that search in the UI.

Just a note, this feature was fully working with the old api. So it is just matter of having the endpoints to do so.

Especially on the saying page, given that we've lumped them all together we need something more than just basic filtering.

On the API side:
This requires the attributes that we need to use for the search be marked as indexed in the redis model
Also if we are going to use more than one then we need to modify server/plugins/redis/lib/base-model.searchByField() to accommodate more than one field at a time.
Look at "Finding by Index" documentation for how to do this.

@malave I am giving this one to you. Hoping that the API work you did will make it easy for you to modify things as necessary. Also hoping the UI work is minimal.
The goal is that on the sayings page the user should be able to type in search tags, that are Slack like in how they functions. Like:

category:Small Talk, action: Greet and the list will be filtered to the small talk category, Greet action.
action:Greet hi would filter to the greet action with text containing hi

Here is what it looks like in Slack:


⚠ Bofrost.lu has degraded performance

In 957d694, Bofrost.lu (https://www.bofrost.lu) experienced degraded performance:

HTTP code: 200
Response time: 1409 ms

Resolved: Bofrost.lu performance has improved in 7621bce after 6 minutes.


Token Action HUD Compatibility and additional Tidy Sheet tab

Title. Cuz right now the only option to use active stuff is through the sheet. Also, maybe, an additional sheet tab just for Magic Items thing?

https://github.com/Larkinabout/fvtt-token-action-hud-dnd5e/issues/85
For adding Magic Items spells to Token Action HUD consult this post.
I won't be making another tab for Spells from items.


extent_t is ptrdiff_t, which ruins SFINAE for people expecting std::size_t

I wrote a template
template <typename T, std::size_t Extent>
void process(span<T, Extent> ...) {

}

This didn't work properly, because extent_t in span-lite is ptrdiff_t. Can I change this to std::size_t and make a PR, or is there a specific reason span-lite made this choice?

Related to Review span in face of p1024 and p1089 (Continued from #14).
It's so due to span's history (see e.g. p0122r1).
Currently, cppreference says:
inline constexpr std::size_t dynamic_extent = std::numeric_limits<std::size_t>::max(); (since C++20)
and:
Since std::size_t is an unsigned type, an equivalent definition is:
inline constexpr std::size_t dynamic_extent = -1;
So it seems like a good idea to change extent_t to be std::size_t.
I'll try and update span lite in this respect.

I updated it for you. Let me know if anything is wrong. :D

Thanks @ThePhD,
In the end the changes you offered in PR #46 were handled in 54ae6bac45e7c6afe2996e9877ff7ead214a8c61, 9becd6980fa74c3f39e95d2dee472d4573b91d56 (extent) and in 0c95c2994823a2ee43c2b476af2ac5e74ab4fff1 (index_type -> size_type) and 17abefb0ad0c9c02df3e243fecca62462c941a7b (change default type to std::size_t).

Yaaay! 🎉
Thanks for doing this so quickly. It certainly covers all of my use cases. I appreciate it! ❤

Hi, thank you for this project!
I would be grateful if we could see this change in a new release.

Released v0.7.0.


golang.org/x/net CVEs

Hi, the old release v.0.3.0 has vulnerability issue with golang.org/x/net v0.0.0-20221004154528-8021a29435af
https://security-tracker.debian.org/tracker/CVE-2022-41723
https://security-tracker.debian.org/tracker/CVE-2022-41721
Are we planning on a new release?
Thank you

Hi @ntang86 - the module requires Go 1.19, which marked this CVE as fixed. Are you seeing something different?

Okay I just cut https://github.com/GoogleCloudPlatform/cloud-run-proxy/releases/tag/v0.4.0


add a definition file for typescript

Hi,
For some project, I use TypeScript in react. The react-lottie package is not compatible with TypeScript because TypeScript requires a variable definition file to work properly (FlowType also uses it for variable definitions).
I propose a draft definition file (I'm not sure it's 100% compatible with your code)
declare module 'react-lottie' {
  /**
   * @param loop if the animation must be continue after the animation has fully executed
   * @param autoplay if the animation needs to be started when the react component requests rendering
   * @param animationData require here the animation data in format JSON
   * @param rendererSettings
   */
  interface LottieBodymovinOptionProps {
    loop?: boolean,
    autoplay?: boolean,
    animationData: any,
    rendererSettings?: {
      preserveAspectRatio?: any
      context?: any, // the canvas context
      scaleMode?: 'noScale' | any,
      clearCanvas?: boolean,
      progressiveLoad?: boolean, // Boolean, only svg renderer, loads dom elements when needed. Might speed up initialization for large number of elements.
      hideOnTransparent?: boolean, //Boolean, only svg renderer, hides elements when opacity reaches 0 (defaults to true)
      className?: string,
    }
  }

  /**
   * @param eventName the event sent by bodymovin
   * @param callback a callback execute when this eventName is received.
   */
  interface BodymovinEvent {
    eventName: 'complete' | 'loopComplete' | 'enterFrame' | 'segmentStart' | 'config_ready' | 'data_ready' | 'loaded_images' |
    'DOMLoaded' | 'destroy',
    callback: () => void,
  }

  /**
   * Props of Lottie component
   * @param options the object representing the animation settings that will be instantiated by bodymovin.
   * @param height height size of the animation in pixel, default value is 100%
   * @param width width size of the animation in pixel, default value is 100%
   * @param isStopped must be stocked in a state, boolean that describe if the animation must be in stopped mode
   * @param isPaused must be stocked in a state, boolean that describe if the animation must be in paused mode
   * @param eventListeners optional [default: []], This is an array of objects containing a eventName and callback function that will be registered as eventlisteners on the animation object. refer to bodymovin#events where the mention using addEventListener, for a list of available custom events.
   */
  interface LottiePropsType {
    options: LottieBodymovinOptionProps,
    height?: number | string,
    width?: number | string,
    isStopped: boolean,
    isPaused: boolean,
    eventListeners?: Array<BodymovinEvent>
    segments?: Array<number>
    speed?: number | 1,
    direction?: number,
    ariaRole?: string | 'button',
    ariaLabel?: string | 'animation',
    isClickToPauseDisabled?: boolean,
    title?: string,
  }
  /**
   * @component Lottie is a component that allow you to use animation from JSON file that created by
   * Bodymovin on Adobe After Effect
   */
  class Lottie extends React.Component<LottiePropsType, any> {}
  export default Lottie;
}

Note : this code must be in a file whose name ends in .d.ts. More documentation here
Note : you must probably add a new css rule to remove the blue outline when the mac user clicks on the animation exemple
  .myAnimationDiv {
    outline: 0;
  }

@Kana00 mind starting a PR for this?

PR yes please

Please PR this kana 👍

@Kana00 Why not go and try https://github.com/DefinitelyTyped ? chenqingspring does not seem to be active lately...

@Kana00 I fixed your code and made a PR #60
Hope that's cool with you :)

As @chenqingspring doesn't seem to be merging looking through PRs lately I also made a PR for the DefininetlyTyped repo, as recommended by @TanelVari, which got merged and published today: https://www.npmjs.com/package/@types/react-lottie

@Ricki-BumbleDev Thank you. Sorry I didn't answer sooner.


narrow: Resolve the dependency between narrow and stream_list.

narrow.js and stream_list.js forms 2-way cyclic import. To break the cycle, I made stream_list.initialize() register  callback functions handle_narrow_activated and handle_narrow_deactivated that narrow.js will use.
On the top of narrow.js, a register function is created for receiving the callback function. A gobal variable named similarly to the callback function is created as well. The global variable
stream_list_handle_narrow_activated stores the callback and removes the dependency on calling handle_narrow_activated in stream_list.js. Same for stream_list_handle_narrow_deactivated and
handle_narrow_deactivated.
This technique is inspired by the dependency breaking method used in #24628.
Current limitation
The CI fails at the test case narrow_activate.test.js because the mocked stream_list and their mocked functions (such as ``) does not call initialized(). Therefore, the callback function in narrow.js is not registered and thus the test case fails. I tried to zrequire('stream_list') and remove mock_esm("../src/stream_list") but then the test case shows
Error:
        Please use mock_template if your test needs to render subscribe_to_more_streams.hbs

        We use mock_template in our unit tests to verify that the
        JS code is calling the template with the proper data. And
        then we use the results of mock_template to supply the JS
        code with either the actual HTML from the template or some
        kind of zjquery stub.

Since I'm not sure whether following the error message to  mock templates of stream_list in narrow_activate.test.js is a best practice, so I pause here and would like to pick up later when I get inspired.

Self-review checklist

[ ] Self-reviewed the changes for clarity and maintainability
(variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

[ ] Explains differences from previous plans (e.g., issue description).
[ ] Highlights technical choices and bugs encountered.
[ ] Calls out remaining decisions and concerns.
[ ] Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

[ ] Each commit is a coherent idea.
[ ] Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

[ ] Visual appearance of the changes.
[ ] Responsiveness and internationalization.
[ ] Strings and tooltips.
[ ] End-to-end functionality of buttons, interactions and flows.
[ ] Corner cases, error conditions, and easily imagined bugs.

Regarding failing test you could maybe manually register the callback before calling narrow.activate in test like so:-
    narrow.register_stream_list_callback(stream_list.handle_narrow_activated);
    narrow.activate(terms, {
        then_select_id: selected_id,
    });

That will fix the test.

Regarding failing test you could maybe manually register the callback before calling narrow.activate in test like so:-
    narrow.register_stream_list_callback(stream_list.handle_narrow_activated);
    narrow.activate(terms, {
        then_select_id: selected_id,
    });

That will fix the test.

Seems to be a workaround. Currently included in my commits.

I have updated the PR using an "ugly" approach from the discussion. Let me know if it is in the right redirection! Converted this to draft because there are still test cases to be updated.
https://chat.zulip.org/#narrow/stream/6-frontend/topic/simple.20import.20cycles/near/1548672

Closing, as I don't think this is the API we want for breaking the import cycle; and probably some of the refactoring in #23812 is a better next step towards this goal.


Misses public ips used by NAT Gateways.

It misses NAT gateways (which have largely replaced NAT instances now).  NAT gateways do not appear as EC2 instances.  They can be scanned by specifically looking for NAT gateways via DescribeNatGateways.  However, I'd suggest using the DescribeAddresses API to query all Elastic IP Addresses:
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeAddresses.html
You can filter out EC2 instances by skipping any Elastic IP that has an Instance ID provided.  I'd suggest keeping the existing EC2 scanning code because it let's you show ips associated with the instance using them with the verbose option.  For elastic ips I'd suggest showing them associated with the network interface they are attached to.  Sadly this is more abstracted from what people are using them for but it's the best you can do without writing a ton of code for each use that isn't an EC2 instance.
You can filter out unused elastic ips by looking for empty network interface or association ids.  It may be worth having an option that let's you see the out of use ips too.
I haven't specifically tested this but I suspect that by not scanning DescribeAddresses you actually miss Fargate containers with public ips attached because they don't show up as EC2 instances despite your documentation mentioning that you'd find Fargate via EC2.  Which is part of the reason I suggest this path.

I recently added support to CloudMapper for ECS and I used aws ec2 describe-network-interfaces to find their IPs.  See https://github.com/duo-labs/cloudmapper/blob/6922f8284e95941f9c97dc0700be8baf680cf08a/shared/nodes.py#L572

Seems that excluding NAT Gateways may have been on purpose, see:
https://github.com/arkadiyt/aws_public_ips/blob/master/lib/aws_public_ips/checks/ec2.rb#L15-L16

I recently added support to CloudMapper for ECS and I used aws ec2 describe-network-interfaces to find their IPs. See https://github.com/duo-labs/cloudmapper/blob/6922f8284e95941f9c97dc0700be8baf680cf08a/shared/nodes.py#L572

Yeah scanning for network interfaces works as well, that would also exclude unused ips.

Seems that excluding NAT Gateways may have been on purpose, see:
https://github.com/arkadiyt/aws_public_ips/blob/master/lib/aws_public_ips/checks/ec2.rb#L15-L16

That's correct - the idea of this tool is to find exposed IPs that might have vulnerabilities / lead to unintentional access / etc, and since the NAT Gateways are managed by AWS and don't allow ingress traffic I excluded them. Could you let me know what your use case for seeing those is?

That's a reasonable reason to exclude these.  My use cases matches what you describe I don't need this.


Code Cleanup

The Haskell code should be improved by following suggestions by HLint.

All suggestions by HLint have been implemented to correct the Haskell source code.


Improve WebhookConstraintMatchers for namespaces

/area ops-productivity
/kind enhancement
Currently a webhook for namespaces that properly ignores the kube-system namespace is still considered as problematic webhook:
  failurePolicy: Fail
  matchPolicy: Exact
  name: check-ignore-label.gatekeeper.sh
  namespaceSelector: {}
  objectSelector:
    matchExpressions:
    - key: gardener.cloud/purpose
      operator: NotIn
      values:
      - kube-system
  rules:
  - apiGroups:
    - ""
    apiVersions:
    - '*'
    operations:
    - CREATE
    - UPDATE
    resources:
    - namespaces

This PR adapts the constraints to do not consider any webhook for namespace as problematic but only webhooks for namespace selecting the kube-system namespace.
Fixes #5956
Release note:

NONE

Thanks for letting me know! I was not aware of this handling. I now added a new commit which should cover this case as well.

Nice!
/approve

/lgtm


apostrophe in df's object/string column breaks groupby

pd.DataFrame({
    'locs': ["some apostrophe' place", 'no apostrophe'],
    'x': [1, 2], 'y': [5, 6]}
).hvplot.scatter(groupby='locs')

I was unable to reproduce this in hvplot 0.6.0 using firefox

@ahuang11 thanks for the issue, I wasn't able to reproduce.
Could you confirm that this is a problem in the most recent version of hvplot?

Suspect this was an issue with the old HoloViews widgets, which was resolved by upgrading to Panel based widgets.

It works now, thanks!


replace multiple spaces and tabs with a single space

Should reduce log space usage

🤔
On Tue, Oct 25, 2016 at 12:04 AM asood123<EMAIL_ADDRESS>wrote:

@asood123 commented on this pull request.
In server/lib/queries.js
https://github.com/OpenCollective/opencollective-api/pull/649:

@@ -36,7 +36,7 @@ const getTotalDonations = () => {
SELECT SUM(${generateFXConversionSQL()}) AS "totalDonationsInUSD"
FROM "Transactions"
WHERE amount > 0 AND "PaymentMethodId" IS NOT NULL

`.replace(/\n/g, ' '), // this is to remove the new lines and save log space.

`.replace(/\s\s+/g, ' '), // this is to remove the new lines and save log space.

Are you sure? I tested it and it always replaces multiple spaces with a
single space.
[image: screenshot 2016-10-24 18 03 21]
https://cloud.githubusercontent.com/assets/6106941/19665694/3ed4a812-9a14-11e6-9dbc-0ab883fb6381.png
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/OpenCollective/opencollective-api/pull/649, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEidr5a0QVtiocxWgpWPW1qCrmau8xMks5q3StbgaJpZM4KfBzR
.


Remove version.yml GH workflow

Signed-off-by: prudhvigodithi<EMAIL_ADDRESS>Description
Remove version.yml GH workflow.
The version increment will be now part of workflow triggered from opensearch-build repo.
Sample version increment PR https://github.com/opensearch-project/job-scheduler/pull/230, triggered from central workflow which is part of the build repo.
Issues Resolved
[List any issues this PR will resolve]
Check List

[ ] New functionality includes testing.

[ ] All tests pass

[ ] New functionality has been documented.

[ ] New functionality has javadoc added

[x] Commits are signed per the DCO using --signoff

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

Looks like the tests are failing:
Suite: Test class org.opensearch.jobscheduler.sampleextension.bwc.JobSchedulerBackwardsCompatibilityIT
  2> Set 05, 2022 8:34:08 QN org.opensearch.client.RestClient logResponse
  2> WARNING: request [PUT http://[::1]:40019/.scheduler_sample_extension/_doc/WCmQjoJGMj?refresh] returned 1 warnings: [299 OpenSearch-2.3.0-SNAPSHOT-5985955bd01cf4777c1fcc8ddb35beca0a79dcdf "index name [.scheduler_sample_extension] starts with a dot '.', in the next major version, index names starting with a dot are reserved for hidden indices and system indices"]
  2> REPRODUCE WITH: ./gradlew ':opensearch-job-scheduler-sample-extension:jobSchedulerBwcCluster#fullRestartClusterTask' --tests "org.opensearch.jobscheduler.sampleextension.bwc.JobSchedulerBackwardsCompatibilityIT.testBackwardsCompatibility" -Dtests.seed=20C2C0FB709ED9AD -Dtests.security.manager=true -Dtests.locale=mt -Dtests.timezone=Etc/GMT+8 -Druntime.java=17

Probably not relevant for this PR. But @prudhvigodithi @joshpalis could you guys create an issue and take a look. Probably main is broken.

Codecov Report

Merging #233 (637b9f1) into main (df154b8) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main     #233   +/-   ##
=========================================
  Coverage     53.19%   53.19%
  Complexity       65       65
=========================================
  Files             8        8
  Lines           438      438
  Branches         50       50
=========================================
  Hits            233      233
  Misses          186      186
  Partials         19       19

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


Fixed 8862

Issue Reference
#8862
How To Test This?

Go to 'Shop'
Add a product to the cart and proceed to checkout.
Fill in all the required fields and select the preferred shipping/payment method.
Click on the "Place Order" button.
Access the 'Admin Panel.'
Open the order and generate a invoice.
Refund it now.
Check the mailbox of the customer and the admin.

Documentation

[ ] My pull request requires an update on the documentation repository.

@sunarcrajneesh It is working fine. Here

Could you please let us know when we can expect these changes to be merged?

@sunarcrajneesh, Can you please update the branch? As commits are too much behind.

@Amitk-webkul,
Sure, updated now.


UI add layout configuration for spring-boot-maven-plugin

adding layout config allows to use loader.path in order to add external dependencies

I added some notes to the PR
I'm presuming this changes the artifact from a jar to a zip - this may have other impacts we need to look at / fix up.
See PR for notes so far -- but this should indeed probably be discussed in this issue (which I saw after)

Jar is a zip format with jar extension.
The configuration itself is not change the format but allows using loader.path the same way as server-chassis (where we have the same configuration already), which allows loading external dependencies (jars and or files).
Primary purpose is to be able to externalize css files so to be able to customize the look and feel without changing the build.
Long term is to be able to plug in and out additional views in the UI.
There are no other artifacts affected.
It is not impact current functionality at all.

Sounds good. I misinterpreted as a format change with external impact, but if still jar and follows the pattern of the server chassis that sounds very appropriate - and agree with the reasoning behind the requirement


Inline Role-based access control

Describe the feature you'd like
I'm looking for a feature that allows for role-based content visibility within a single page. Specifically, I want to have sections of content on the same page that are conditionally displayed based on the logged-in user's role. For instance, a "support" role user should be able to see both "guest" and "support" sections, while a "mod" role user should see "guest", "support", and "mod" sections, all on the same page. This is not about restricting access to entire pages based on roles, but rather displaying or hiding specific sections of content within a page. Does your platform offer such functionality natively, or is there a way to achieve this using custom code?
Describe the benefits this would bring to existing BookStack users
Ability to make one page content without being redundant on multiple pages. For example if there is a documentation that has different level of access, only supports will be able what they can access, while mods can see theirs and supports only.
Can the goal of this request already be achieved via other means?
I dont think so
Have you searched for an existing open/closed issue?

[X] I have searched for existing issues and none cover my fundamental request

How long have you been using BookStack?
Not using yet, just scoping
Additional context
No response

Hi @GHAFRI,
It would be worth reading through #978 since that is a very similar request, where I also share a potential system using existing in-platform features.
Otherwise, I probably wouldn't look to bring specific permission control/functionality down to this level of detail due to the complexity it introduces, for relatively little demand.


Add FreeBSD support

Added FreeBSD support; by way of copying Linuxes operations.

I'm confused, I don't see a FreeBSD build in the Electron GitHub releases.

electron-builder produces appimage for Linux and it works on FreeBSD. So, not clear for me too.

@jbenden thank you for the pull request, however, the Electron project does not support FreeBSD-specific builds. Electron Packager only supports target platforms and architectures that upstream Electron supports. You should be able to use Linux builds using FreeBSD's Linux binary compatibility feature. If you would like to have native FreeBSD builds of Electron, please file an issue at the Electron issue tracker.

Not so fast, please. I am in progress of getting everything (all NPMs and related) building and functioning on FreeBSD. As part of this process, I really need the change accepted - please.
Thank you.

I will be happy to reopen when upstream Electron provides official support for prebuilt FreeBSD binaries. Until then, I can't accept this change as these changes will lack test coverage, and more importantly, Packager will incorrectly advertise that it supports creating native FreeBSD bundles.

Ok, I appreciate your kind explanation. I also accept that explanation! ;)
Thank you for your time and patience...

When this PR is ready again, it would be much appreciated if you could fill out the pull request template and insert it into the PR summary.


[Bug]: possibile memory leak leads to node process exit in express.js web app

🔎 Search Terms
winston memory leak
The problem
After replacing console.log with winston 3.8.2 we are experiencing a sudden exit of the node process with this error:
66|happyde | api: (node:25295) UnhandledPromiseRejectionWarning: RangeError: Invalid string length
66|happyde | api:     at stringifyFnReplacer (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/safe-stable-stringify/index.js:316:68)
66|happyde | api:     at stringifyFnReplacer (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/safe-stable-stringify/index.js:273:23)
66|happyde | api:     at stringifyFnReplacer (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/safe-stable-stringify/index.js:314:23)
66|happyde | api:     at stringify (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/safe-stable-stringify/index.js:659:18)
66|happyde | api:     at Format.transform (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/logform/json.js:28:19)
66|happyde | api:     at DerivedLogger._transform (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/winston/lib/winston/logger.js:313:29)
66|happyde | api:     at DerivedLogger.Transform._read (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:177:10)
66|happyde | api:     at DerivedLogger.Transform._write (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/winston/node_modules/readable-stream/lib/_stream_transform.js:164:83)
66|happyde | api:     at doWrite (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:409:139)
66|happyde | api:     at writeOrBuffer (/home/admin/ci-cd/dev.int.goomood.tech/node_modules/winston/node_modules/readable-stream/lib/_stream_writable.js:398:5)
66|happyde | api: (node:25295) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

This is the JS stacktrace:
66|happyde | api: <--- Last few GCs --->
66|happyde | api: 7)[25295:0x4631f10]   728896 ms: Mark-sweep (reduce) 1935.8 (1943.6) -> 1935.4 (1943.2) MB, 3471.9 / 0.1 ms  (+ 0.0 ms in 1 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 3472 ms) (average mu = 0.076, current mu = 0.000) [25295:0x4631f10]   733185 ms: Mark-sweep (reduce) 1936.8 (1940.6) -> 1936.8 (1942.6) MB, 4286.2 / 0.0 ms  (+ 0.0 ms in 16 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 4289 ms) (average mu = 0.035, current mu = 0.001)
66|happyde | api: <--- JS stacktrace --->
66|happyde | api: FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
66|happyde | api:  1: 0xa3ac10 node::Abort() [/usr/bin/node]
66|happyde | api:  2: 0x970199 node::FatalError(char const*, char const*) [/usr/bin/node]
66|happyde | api:  3: 0xbba58e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
66|happyde | api:  4: 0xbba907 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
66|happyde | api:  5: 0xd76b25  [/usr/bin/node]
66|happyde | api:  6: 0xda74be v8::internal::EvacuateNewSpaceVisitor::Visit(v8::internal::HeapObject, int) [/usr/bin/node]
66|happyde | api:  7: 0xdb34f6 v8::internal::FullEvacuator::RawEvacuatePage(v8::internal::MemoryChunk*, long*) [/usr/bin/node]
66|happyde | api:  8: 0xd9f68f v8::internal::Evacuator::EvacuatePage(v8::internal::MemoryChunk*) [/usr/bin/node]
66|happyde | api:  9: 0xd9f908 v8::internal::PageEvacuationTask::RunInParallel(v8::internal::ItemParallelJob::Task::Runner) [/usr/bin/node]
66|happyde | api: 10: 0xd921e9 v8::internal::ItemParallelJob::Run() [/usr/bin/node]
66|happyde | api: 11: 0xdb5450 void v8::internal::MarkCompactCollectorBase::CreateAndExecuteEvacuationTasks<v8::internal::FullEvacuator, v8::internal::MarkCompactCollector>(v8::internal::MarkCompactCollector*, v8::internal::ItemParallelJob*, v8::internal::MigrationObserver*, long) [/usr/bin/node]
66|happyde | api: 12: 0xdb5cec v8::internal::MarkCompactCollector::EvacuatePagesInParallel() [/usr/bin/node]
66|happyde | api: 13: 0xdb5eb5 v8::internal::MarkCompactCollector::Evacuate() [/usr/bin/node]
66|happyde | api: 14: 0xdc7eb1 v8::internal::MarkCompactCollector::CollectGarbage() [/usr/bin/node]
66|happyde | api: 15: 0xd84178 v8::internal::Heap::MarkCompact() [/usr/bin/node]
66|happyde | api: 16: 0xd85c68 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]
66|happyde | api: 17: 0xd87ba5 v8::internal::Heap::HandleGCRequest() [/usr/bin/node]
66|happyde | api: 18: 0xd2e0b7 v8::internal::StackGuard::HandleInterrupts() [/usr/bin/node]
66|happyde | api: 19: 0x109f7a3 v8::internal::Runtime_StackGuard(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/node]
66|happyde | api: 20: 0x1448f59  [/usr/bin/node]
66|happyde | api: Aborted
66|happyde | api: error Command failed with exit code 134.
66|happyde | lerna ERR! yarn run start:prod exited 134 in 'api'
66|happyde | lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
66|happyde | error Command failed with exit code 134.

This is the winston configuration:
const winston = require('winston');
require('winston-daily-rotate-file');

// Define different colors for each level.
const colors = {
    error: 'white redBG',
    warn: 'yellow',
    info: 'green',
    http: 'magenta',
    verbose: 'cyan',
    debug: 'white cyanBG',
    sylly: 'white'
}

winston.addColors(colors);

// This method set the current severity based on the current NODE_ENV
const level = () => {
    const logLevel = process.env.LOG_LEVEL || 'info';
    return logLevel;
}

// Chose the aspect of your log customizing the log format.
const format = winston.format.combine(
    // Add the message timestamp with the preferred format
    winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss:ms' }),
    // Define the format of the message showing the timestamp, the level and the message
    winston.format.printf(
        (info) => `${info.timestamp} ${info.level}: ${info.message}`
    )
)

// Create the logger instance that has to be exported
// and used to log messages.
const logger = winston.createLogger({
    level: level(),
    transports: [
        new winston.transports.DailyRotateFile({
            filename: 'logs/server-%DATE%.log',
            datePattern: 'YYYY-MM-DD',
            zippedArchive: true,
            maxSize: '20m',
            maxFiles: '30d',
            createSymlink: true,
            format: winston.format.combine(
                winston.format.uncolorize(),
                format
            )
        }),
        new winston.transports.Console({
            format: winston.format.combine(
                winston.format.colorize(),
                format
            )
        })
    ]
});

module.exports = logger

What version of Winston presents the issue?
v3.8.2
What version of Node are you using?
v14.20.1
If this worked in a previous version of Winston, which was it?
No response
Minimum Working Example
This is the app.ts
import express from "express";
import cors from "cors";
import fileUpload from "express-fileupload";
import request from "./macros/request";
import response from "./macros/response";
import logger from "./config/logger";
import morgan from "morgan";

const app = express();

logger.info('Initiliazing middlewares ...');
logger.debug('process.env: ' + JSON.stringify(process.env, null, 2));
logger.info(`NODE_ENV = '${process.env.NODE_ENV}', Logger.level = '${logger.level}'`);

const stream = {
    // Use the http severity log level for morgan
    write: (message) => logger.http(message),
};
app.use(morgan('combined', { stream }));

app.use(cors());

app.use(
    fileUpload({
        parseNested: true,
        debug: process.env.NODE_ENV == "development"
    })
);

app.use(
    express.json({
        verify: (request: any, response, buffer) => {
            // stripe webhook signature validation works with raw body
            if (request.url.includes("webhook")) {
                request.rawBody = buffer;
            }
        }
    })
);

app.use(request);
app.use(response);

export default app;

Additional information
No response

As additional information, the problem was a big stopper for us so we moved to another logging library (pino) and the memory problem disappeared.

I'm sadly experiencing same issue. For me it exits the node process if I try to log an instance of AxiosError.

I'm sadly experiencing same issue. For me it exits the node process if I try to log an instance of AxiosError.

Facing same issue too. I move to pino and problem is solved.

Same issue, memory is leaking.

In my case memory was leaking due to improper creation of logger instances.
I created a shared logger options object and used it to instantiate multiple loggers in my code:
export const defaultLoggerOptions: winston.LoggerOptions = {
  ...
  transports: [new winston.transports.Console()],
};

...

const logger = winston.createLogger(defaultLoggerOptions);

Specifically, it seems like winston.transports.Console() is not intended to be re-used between the logger instances. So, changing the code as follows fixed the issue for me.
export function getDefaultLoggerOptions(): winston.LoggerOptions {
  return {
    ...
    transports: [new winston.transports.Console()],
  };
}

...

const logger = winston.createLogger(getDefaultLoggerOptions());

memory leak originates from one of the dependency package safe-stable-stringify in the method stringifyFnReplacer

Possibly related: https://github.com/BridgeAR/safe-stable-stringify/issues/41 (which also cites a solution of using a maximumDepth option to safe-stable-stringify).
Can someone add a failing test case so it's clear what's being logged when the error occurs? A clearly reproducible example would help determine if any proposed fix actually fixes the issue; looking at OP above it seems to depend on the details of an incoming request.

Hello everyone!
I am finding an error while using NestJs with the Winston library to format my logs. This is how I have set it up:
    this.logger = WinstonModule.createLogger({
      format: winston.format.uncolorize(),
      transports: [
        new winston.transports.Console({
          format: winston.format.combine(
            winston.format.timestamp(),
            winston.format.ms(),
            utilities.format.nestLike()
          ),
        }),
      ],
      level: "debug",
    });

Running it locally everything is working fine and my memory heap is fine:

Local env:

Node: v18.19.0
Mac: Macos Monterey 12.3; M1, 2020; 8GB;

When I push it I use a docker image and this is what I have

It consumes all my heap memory. My container is using node:18.13-alpine.
In order to get this weird behaviour quickly I wrote this code inside my bootstrap function:
  setInterval(() => {
    console.error('test'.repeat(1000));
  }, 10);

  setInterval(() => {
    const MB_DIV = 1024 * 1024;
    const usage = process.memoryUsage();

    fs.appendFile(
      'message.txt',
      `${new Date().toISOString()} heap used/total: ${
        usage.heapUsed / MB_DIV
      }/${usage.heapTotal / MB_DIV} MB\r\n`,
      function (err) {
        if (err) throw err;
        console.log('Saved!');
      },
    );
  }, 1000);

Is there anything I'm missing missing that can cause this issue?


SABnzbd - Feature Request

Currently completed downloads have to be removed individually. Can you add a function to allow mass purge?

Clicking the trash on the th will bring up a modal where you can remove all or just the ones that has failed


Add publish GitHub Action workflow

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (987a516) 55.74% compared to head (f02400c) 55.15%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #87      +/-   ##
==========================================
- Coverage   55.74%   55.15%   -0.59%
==========================================
  Files           9        9
  Lines        1202     1202
==========================================
- Hits          670      663       -7
- Misses        532      539       +7

Flag
Coverage Δ

unittests
55.15% <ø> (-0.59%)
:arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Is this project still maintained?

 And pull requests aren't being merged nor reviewed. Just want to know about a real idea on what is going on if it's no longer maintained?

I've written xetys an email, maybe he will transfer the ownership to someone.

hey folks,
Indeed, I had time issues all around this year.
I'll try to find a way of bringing activity back to this project. Sorry for the delays!

Thank you!

for now, I'd say: yes, it's still maintained :)


Exclude .pyc files from sdist

When doing distro packaging, comparisons of the old and new sdist tarballs is a safety measure to ensure nothing suspect has slipped in.  The .pyc files in the sdists create a lot of noise in that process.

See e.g. https://build.opensuse.org/package/rdiff/home:jayvdb:py-dephell-roundtrip/python-dephell?opackage=python-dephell&oproject=devel%3Alanguages%3Apython&rev=6

Thank you for your report! Duplicate of #103. I also really want to see it fixed :)


Add Instructions for Optional AaC Command Arguments

Add instructions for optional arguments that are presented to the user when they execute AaC commands via the VSCode Extension.
AC:

[x] Optional arguments are clearly labeled as optional arguments when presented to the user.
[ ] Update VSCode Extension documentation incorporating the new label for optional
[x] Update unit tests as appropriate for the optional arguments

[ ] Include justification if unable to implement a unit test

The first AC may conflict with what is already displayed by VSCode itself from what I've seen:

The first AC may conflict with what is already displayed by VSCode itself from what I've seen:

Good point. I was thinking of including the text "(Escape to skip)" next to the name of the variable. So, for the image it would look like "--output_directory (Optional Argument. Press escape to skip)". Is it redundant? Yes, it is, but I am that terrible user that ignores instructions that are underneath the input field. Since I'm not alone in being such a terrible user, I think it would certainly add clarity for users like me. 🙃

Nothing is changing about code execution for the extension, this is purely a visual display update, so no modifications to the unit tests at this time.

Final confirmation of the "looks" of improvement is blocked by #625.


[Feature Request] Option to move the npc list on different sides of the screen

Great module!
When you minimize a conversation, the list of npcs appears on the right side of the screen. Would there be a way to choose in the configs to dock it on others sides of the screen? Like horizontally at the bottom or top, or vertically on the left side? I think that could make for a great addition.
Also would be great if there were options to choose the size of the minimized portraits of both inactive and active speakers (to make it possible, for example, to make the inactive ones smaller and the active one bigger, to give more prominence to the active speaker)

Hey and thanks for the kind words!
Regarding the positioning of the NPCs when minimized, I have tried placing the list in other places but the results were less than favorable. The only location where it looked somewhat decent was on the right, but that still posed some issues so I decided to scrap the entire alternate placement idea. While it would definitely be nice, the effort required to make it work is not worth it (the main issue being to ensure that the module looks good and works on all supported resolutions).
The different sized portraits however can be done and I will look into it. This feature won't be coming in the upcoming release, but I will start working on it after that so stay tuned for that!

Hey, and sorry for the long delay in updates. I have looked into the differently sized portraits, however, due to the way that the module has been implemented, those different sizes caused issues especially for the DM (since there are control buttons linked to each participant and making the sizes smaller would have caused issues.)
That said, I might try something in the future as I will be rewriting the module so as to simplify many aspects as well as to make the module more flexible. When I will do so, I will definitely try to incorporate some of the features you have mentioned (which should be much easier to implement with a fresh codebase and now that I am familiar with how Foundry works). This unfortunately might take a while :(