GA4GH service registry has incorrect TRS information

Describe the bug
The GA4GH service registry returns the wrong url for the Dockstore TRS API.
To Reproduce
Steps to reproduce the behavior:
curl -s https://registry.ga4gh.org/v1/services/org.dockstore.dockstoreapi | jq '.'
{
  "id": "org.dockstore.dockstoreapi",
  "name": "Dockstore",
  "type": {
    "group": "org.ga4gh",
    "artifact": "trs",
    "version": "2.0.0"
  },
  "organization": {
    "id": "org.dockstore",
    "name": "Dockstore",
    "url": "https://dockstore.org"
  },
  "version": "1.8.1",
  "url": "https://dockstore.org/api/api/ga4gh/v2/",
  "description": "Dockstore TRS implementation",
  "documentationUrl": "https://dockstore.org/api/static/swagger-ui/index.html"

Note the url value https://dockstore.org/api/api/ga4gh/v2/  should be https://dockstore.org/api/ga4gh/trs/v2/.
Also, the version value looks wrong, assuming that's the Dockstore version.
Expected behavior
The url should be https://dockstore.org/api/ga4gh/trs/v2/
Additional context
I probably should log this in a GA4GH repo, but I don't know which one.
┆Issue is synchronized with this Jira Story
┆Issue Number: DOCK-2510
┆Sprint: Backlog
┆Issue Type: Story

Just noticed that two versions are wrong:

type.version should be 2.0.1 instead of 2.0.0.
version should be 1.15 or 1.15.0 instead of 1.8.1.

Not a ton of info, but this is fixed now.
FYI @kathy-t if it came up during that TRS notebook example


Node in stack can't be dragged out and are stuck

Hey!
Your repo was a huge help to get me started on implementing a StackNode. Thanks for that.
While testing I found a bug.
https://github.com/alelievr/NodeGraphProcessor/blob/bc71d48ba9dfc7e7062779d6d12b9ef269e521b1/Assets/com.alelievr.NodeGraphProcessor/Editor/Views/BaseStackNodeView.cs#L106
is never called. So the nodes are never removed from the stack view list.
I debugged the thing and it turns out that only OnStartDragging is called. Must be new? I don't know.
But that's also the fix. To move the remove event to OnStartDragging.
Cheers!

Some more info on this because it's not straight forward to reproduce.
The node that is moved out of the stack has to be the last node.
DragLeave is only called when a placeholder was created in the stack and then the dragged node is moved out of the stack.
Being the last node, the stack shrinks immediately and no  placeholder is created.


socket.error: [Errno 61] Connection refused

Hi All,
I tried to connect to my SAP HANA AWS,  host is my Public DNS, port 30015, user and password as ones I connect the server from eclipse,  but get following error:
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
  File "/Library/Python/2.7/site-packages/pyhdb/__init__.py", line 30, in connect
    conn.connect()
  File "/Library/Python/2.7/site-packages/pyhdb/connection.py", line 137, in connect
    self._open_socket_and_init_protocoll()
  File "/Library/Python/2.7/site-packages/pyhdb/connection.py", line 66, in _open_socket_and_init_protocoll
    self._socket = socket.create_connection((self.host, self.port), self._timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 575, in create_connection
    raise err
socket.error: [Errno 61] Connection refused

Any help is appreciated!
Thanks!

Hi lulucs,
this is probably not related to pyhdb but rather a basic
  connectivity problem with your HANA instance - it seems like it is
  not reachable from whereever you try it.

I have a trial HANA cloud platform (HPC) instance, and for being
  able to connect to it I have to use a proxy/tunnel tool (see
  https://tools.hana.ondemand.com), maybe your AWS installation
  requires something similar. But this is just a guess ...
Ralph

On 26.04.16 19:37, lulucs wrote:

  Hi All,
    I tried to connect to my SAP HANA AWS, host is my Public DNS,
    port 30015, user and password as ones I connect the server from
    eclipse, but get following error:
  Traceback (most recent call last):

File "", line 5, in
File "/Library/Python/2.7/site-packages/pyhdb/init.py", line 30, in connect
conn.connect()
File "/Library/Python/2.7/site-packages/pyhdb/connection.py", line 137, in connect
self._open_socket_and_init_protocoll()
File "/Library/Python/2.7/site-packages/pyhdb/connection.py", line 66, in _open_socket_and_init_protocoll
self._socket = socket.create_connection((self.host, self.port), self._timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 575, in create_connection
raise err
socket.error: [Errno 61] Connection refused
  Any help is appreciated!
  Thanks!
  —
    You are receiving this because you are subscribed to this
    thread.
    Reply to this email directly or view it on
      GitHub

@ralhei Hi Ralph, thanks for the suggestion! I'll try this out and let you know how this goes.

The guide might be helpful http://scn.sap.com/community/developer-center/hana/blog/2015/04/24/try-hanatrial-using-python-or-nodejs

Please reopen if the problem still exist and is related to PyHDB.


LeaderLine on stackblitz

Hello Anseki,
This is not a bug. I dont know where to put this information, is there a general discussion board.
I would like to thank you for creating this package and draggable..both excellent stuff.. now to the main issue.
I was trying to work out a simple leader line example on stackblitz environment.
After some struggle it went through.
The project is @krishsub2011/leaderline-working for reference.
Link is https://stackblitz.com/edit/leaderline-working?file=index.js
If you do get the time please check the index.js file, its basically a copy of leader-line-min.js with some additions
a) adds the first 13 lines and  line 17-21
b) defines a function "makeLine" which gets called in the index.html on the button click.
Can you comment on whether this is the best way to do it ?
All others failed for me, but I am a newbie to JS.
regards,
Krishnan

Hi @krishsub2011, thank you for the comment.
I can't decide  whether that is the best way or not because I don't know your goal.
If that is a result expected by you, the way is your expected  solution.

Hi Anseki,
The final goal was to include your library in an pure angular (ts) based
program.
a) This was after I had learnt how to use leader-line and draggable in a
pure JS environment locally on my machine in an apache-tomcat environment
(this worked well for me).
b) Because I was using stackblitz for angular program development I tried
using leader-line&draggable on an angular project
on stackblitz. This didnt work.
c) Then I tried to get leader-line working with a pure JS program on
stackblitz which also was not too straightforward and hence
the solution I posted.
Also I didnt expect you to respond to questions else I would have posted
them earlier -:).
So the question I have for you is,
a) can leader-line & draggable work on pure angular program ? If so how ?
Examples would be useful.
b) Also can this solution be made to work on stackblitz because that
seems to be good environment for quick&dirty
prototyping & testing.
regards,
Krishnan
On Thu, Dec 24, 2020 at 7:09 AM anseki<EMAIL_ADDRESS>wrote:

Hi @krishsub2011 https://github.com/krishsub2011, thank you for the
comment.
I can't decide whether that is the best way or not because I don't know
your goal.
If that is a result expected by you, the way is your expected solution.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/anseki/leader-line/issues/184#issuecomment-750698362,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AI6I3HARQL65OM5AIUJVLXLSWKLVFANCNFSM4VG7OJXQ
.

can leader-line & draggable work on pure angular program ? If so how ? Examples would be useful.

These may help you:
https://github.com/anseki/leader-line/issues/68
https://github.com/anseki/leader-line/issues/136

No reply came, then this abandoned issue is closed.

No reply came, then this abandoned issue is closed.


Deployment: Optimize React script bundle

Closing this.
Will reopen if I get around to using pico8-mobile-template for a game.


videa.hu is broken

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

[X] I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

[X] I'm reporting that yt-dlp is broken on a supported site
[X] I've verified that I'm running yt-dlp version 2023.06.22 (update instructions) or later (specify commit)
[X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
[X] I've checked that all URLs and arguments with special characters are properly quoted or escaped
[X] I've searched known issues and the bugtracker for similar issues including closed ones. DO NOT post duplicates
[X] I've read the guidelines for opening an issue
[ ] I've read about sharing account credentials and I'm willing to share it if required

Region
No response
Provide a description that is worded well enough to be understood
Gives out element error
Provide verbose output that clearly demonstrates the problem

[X] Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
[X] If using API, add 'verbose': True to YoutubeDL params instead
[X] Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output
yt-dlp -vU https://videa.hu/videok/nool/emberek-vlogok/immar-tizenkettedik-alkalommal-rendeztek-meg-NfwjOpsodVL6NJ9H
[debug] Command-line config: ['-vU', 'https://videa.hu/videok/nool/emberek-vlogok/immar-tizenkettedik-alkalommal-rendeztek-meg-NfwjOpsodVL6NJ9H']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version<EMAIL_ADDRESS>[812cdfa06] (pip)
[debug] Python 3.11.2 (CPython x86_64 64bit) - macOS-10.11.6-x86_64-i386-64bit (OpenSSL 1.1.1s  1 Nov 2022)
[debug] exe versions: ffmpeg 4.4.2 (setts), ffprobe 4.4.2
[debug] Optional libraries: Cryptodome-3.17, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1851 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version<EMAIL_ADDRESS>Current version<EMAIL_ADDRESS>yt-dlp is up to date<EMAIL_ADDRESS>[Videa] Extracting URL: https://videa.hu/videok/nool/emberek-vlogok/immar-tizenkettedik-alkalommal-rendeztek-meg-NfwjOpsodVL6NJ9H
[Videa] NfwjOpsodVL6NJ9H: Downloading webpage
[Videa] NfwjOpsodVL6NJ9H: Downloading webpage
[Videa] NfwjOpsodVL6NJ9H: Downloading webpage
ERROR: [Videa] NfwjOpsodVL6NJ9H: <Element 'error' at 0x1053b05e0>
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/yt_dlp/extractor/common.py", line 708, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/yt_dlp/extractor/videa.py", line 137, in _real_extract
    raise ExtractorError(xpath_element(

The same error for youtube-dl. I tried with a lot of GNU/Linux systems, in no one works the download now:
ERROR: [Videa] iCgK7uTgVIBLCypm: <Element 'error' at 0xf63746e0>
This is very annoying because Videa is the most popular Hungarian video sharing site, some videos you can find only there. Nobody from yt-dlp developers is interested to fix this issue???

Digging into the code shows that the returned XML contains Paraméter hiba! (302) as string, meaning "parameter error" in English.
Probably the query params has changed on their side.
https://github.com/yt-dlp/yt-dlp/blob/7cccab79e7d00ed965b48b8cefce1da8a0513409/yt_dlp/extractor/videa.py#L127
I have no more resources to continue with this, I was just passing by.


readme.md not found

Hi,
this tool sounds really useful, but unfortunately I can't install it via pip.
I get:
Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\FLORIA~1\AppData\Local\Temp\pip-install-ttr95c0m\sifreader\setup.py", line 13, in <module> long_description = open('readme.md').read(), FileNotFoundError: [Errno 2] No such file or directory: 'readme.md' Command "python setup.py egg_info" failed with error code 1 in C:\Users\FLORIA~1\AppData\Local\Temp\pip-install-ttr95c0m\sifreader\
on Python 3.6.5
Seems similar to https://github.com/lightingghost/sifreader/issues/3
Upgrading setup tools didn't help.
Any idea?
Thanks for your effort,
Flo

Can you please try install from git?
git clone https://github.com/lightingghost/sifreader
cd sifreader
python setup.py install

There seems to be an issue with the current version of setuptools I am using.


multi youtube search

If a user prompts the bot multiple times with !yt in a row without explicitly selecting a result each time the bot will happily continue to spit out YouTube searches. Expected functionality is that each user should only be able to execute one search per channel per guild.

simple possible fix is to make get_selection()
return something more sensible if an int is not passed as the arg

i exceeded my quota testing today
main issue appears to be add_search() is executing the list.append() multiple times once a search has started.Same issue across guilds as well as channels within the same guild.
ex serv1: $yt some search -> correctly added to guild's search array
serv2: $yt another search -> added TWICE to the array
same behavior within same server, and using two channels, the second search is duplicated into the array


fix: adds support for all yarn version by removing the minimun versio…

…n check.
PR #172 adds supports for yarn V1 but fails to actually enable it when building via the API's

[ ] All tests passed. If this feature is not already covered by the tests, I added new tests.
[ ] All static analysis checks passed.
[ ] This pull request is on the dev branch.
[ ] I used gofmt for formatting the code before submitting the pull request.

Thank you @grinish21.
Supporting in Yarn V1 is on our track, but it will take some time to fully support all the functionalities we have for Yarn V2.
Our recent additions added support for 'jf audit' command and for creating fixes using Frogbot
The block you requested to remove is there for a reason, since we are not supporting buildInfo with Yarn 1 currently.
We keep adding more and more support for Yarn V1, as long with support to other package managers so stay tuned for further improvements

Thank you @grinish21.
Supporting in Yarn V1 is on our track, but it will take some time to fully support all the functionalities we have for Yarn V2.
Our recent additions added support in Jfrog CLI command and for creating fixes using Frogbot
The block you requested to remove is there for a reason, since we are not supporting buildInfo with Yarn 1 currently.
We keep adding more and more support for Yarn V1, as long with support to other package managers so stay tuned for further improvements

Thank you @grinish21 for your contribution for our code! Supporting in Yarn V1 is on our track, but it will take some time to fully support all the functionalities we have for Yarn V2. Our recent additions added support in Jfrog CLI command and for creating fixes using Frogbot The block you requested to remove is there for a reason, since we are not supporting buildInfo with Yarn 1 currently. We keep adding more and more support for Yarn V1, as long with support to other package managers so stay tuned for further improvements

Thank you @eranturgeman . been waiting for the Yarn V1 support for a while So was excited to see the PR and use the latest version and i realized that check on min version is stopping it. But either ways I will be keeping an eye for yarn V1 support is there an issue or feature we can monitor for completion.


Build pods and the use of the z2jh user-scheduler

Without using the user-scheduler to schedule the build pods, they will spread out on the available nodes with the default scheduler. After #853 they will be able to and therefor prefer and to schedule on empty user nodes, and therefore block scale down of these unless there are 0 build pods for more than 10 minutes.
In the case of mybinder.orgs typical usage, i think this actually becomes an issue.
We should make them schedule like the user pods are scheduled now that this toleration is in place i think.
/cc: @jhamman @betatim
/ erik from mobile

For mybinder.org spreading the build pods around the cluster as much as possible is a feature. A build pod (can) uses a lot of CPU, much more than a typical notebook pod. It is more like a batch job workload (executing code as fast as possible and lots of it) than the interactive workload (human types, thinks, pauses, reads, rarely executes code).
Build pods last (typically) much less long than the timescale of wanting to scale down. Most builds are done in a few minutes. The longer ones take a few hours. The "period" of scale up and down for the cluster as a whole is more quarter of a day or so. Waiting an extra hour to scale down isn't a problem.
We had a situation a while back where build pods (for unknown reasons) preferred to schedule on the same node. This is the PR I made to add antiaffinity between them https://github.com/jupyterhub/binderhub/pull/834

I think user-scheduler + anti-affinity is fine, but not using the user scheduler for these pods will add a lot of costs due to a failure of downscaling nodes i think.
Related: #855 to discuss the image locality of user pods.
There is probably some tuning that needs to be done. Is there a good metric on the benefit of spreading the build pods? Perhaps the average build time?

not using the user scheduler for these pods will add a lot of costs due to a failure of downscaling nodes i think.

I disagree. The main reason for this is that there doesn't seem to be a problem with this right now. If we can show that downscaling is actually prevented by assigning build pods with the default scheduler, then we can think about how to fix it.
The chances that a downscale is prevented (for an overly long time) by a build pod are small and in practice doesn't seem to happen. There is also a bit of a "conspiracy" happening that we tend to have about as many build pods running as we have nodes in the cluster. A running build pod uses all its allowed resources, where as a user pod uses nearly none of its resources. This is the main reason you want to spread the builds around instead of clumping them together (which tends to be the effect of the current user-scheduler).
If we want to tune the assignment of user pods to nodes based on image locality it also makes sense to me to assign builds to random nodes to prevent all the newer images being on one node, which then preferentially gets all the newly launched pods. Any time we introduce a pattern things get tricky, random assignment/sampling is a surprisingly good and unbiased method for doing stuff.
When we start a build we have a clean slate. I can't think of a reason why a build would complete faster on any of the nodes we have that is not related to CPU utilisation. Launching a user pod is different. There is a reason to prefer nodes over others: the fact that the image is already on the node. For me this means we want to randomly select a node to build on or even better: select the one which has the lowest actual CPU utilisation (not based on limits and guarantees).

Useful background:

Each new scheduler config requires one additional scheduler deployment setup
The typical cluster autoscaler configuration, that a gke cluster for example cant manage, will scale down nodes that have been empty for 10 consecutive minutes
Using the defualt scheduler without any extra affinities will make the the build pods use the least used node, in other words the empty nodes.
I dont think the kube-scheduler binary can be configured to account for current CPU load, but a custom written scheduler binary could. Note that z2jh uses the k8s provided kube-scheduler with a custom configuration.

About the "as many build pods as the nodes in the cluster". Sounds like a daemonset, or like a hard anti pod affinity makes it so.

Im not understanding the setup good enough, but:
If:

build pods are scheduled to use the least utilized node, as the default scheduler does (current situation).
build pods isnt evictable (they are not daemonset pods right, but rather spawned by binderhub as standalone pods? then they will block scale down)
build pods pop up every 10+X minutes, running for X minutes
we have scaled up earlier, but a lot of users have left and we one node is free of users now
Then:
The empty node will always have a build pod running on it or had one running in the latest 10 minutes, and that would block scale down.

So if we observe no issues with downscaling, I figure either my assumptions are a bad approximation of reality, or my logic is flawed. If there are no issues at all, then id be greatly surprised, unless we evict build pods for users from time to time on downscaling nodes and crash their builds, or we simply dont schedule build pods on the user nodes.

About the "as many build pods as the nodes in the cluster". Sounds like a daemonset, or like a hard anti pod affinity makes it so.

I think it is just a coincidence that the number of requested builds (at any one time) happens to be roughly equal to (or lower) the number of nodes in the cluster. It could change tomorrow that suddenly a lot more builds are requested or run for a lot longer (or we switched to much bigger instances and hence reduced the number of nodes).
I think the reason we don't see an effect from this is that there just aren't that many build pods running at any given moment in time and that they typically don't run for very long: https://grafana.mybinder.org/d/nDQPwi7mk/node-activity?refresh=1m&panelId=44&fullscreen&orgId=1&from=now-2d&to=now

Closed in favor of #946.


Can't connect to dedicated server

I tried the package with the free relay server, it worked fine, it's a great package, Then I decided to deploy our own relay server for our game. (we had 400ms ping because we connected from eu).
I can't connect to the dedicated server. I am always getting socket exception. I checked if the port was open, and it is.
What could be the solution?  The server looks fine, and the client works too (Its tested with the free server).
Here is the picture if the vps running the proxy.

Or where could I search for the mistake I made?
UPDATE: I just found it in the logs, it could be helpful.
[Trace]   DarkRiftServer        System Details:
OS: Microsoft Windows NT 6.2.9200.0
CLS Version: 4.0.30319.42000
DarkRift: <IP_ADDRESS> - Free
[Trace]   PluginFactory         Created plugin 'RelayPlugin'.
[Info]    PluginManager         Loaded plugin RelayPlugin version 2.5
[Trace]   PluginFactory         Created plugin 'BichannelListener'.
[Trace]   HttpHealthCheck       HTTP health check started at 'http://localhost:10666/health'
[Trace]   DarkRiftServer        Binding listeners to ClientManager as server is externally visible.
[Trace]   DefaultNetworkListener Starting bichannel listener.
[Info]    DefaultNetworkListener Server mounted, listening on port 4296.
[Trace]   DefaultNetworkListener Accepted TCP connection from <IP_ADDRESS>:51850.
[Trace]   DefaultNetworkListener Connection attempt from <IP_ADDRESS>:51850 timed out.
[Trace]   DefaultNetworkListener Accepted TCP connection from <IP_ADDRESS>:51946.
[Trace]   DefaultNetworkListener Connection attempt from <IP_ADDRESS>:51946 timed out.
[Trace]   DefaultNetworkListener Accepted TCP connection from <IP_ADDRESS>:52211.
[Trace]   DefaultNetworkListener Connection attempt from <IP_ADDRESS>:52211 timed out.
[Trace]   DefaultNetworkListener Accepted TCP connection from <IP_ADDRESS>:52232.
[Trace]   DefaultNetworkListener Connection attempt from <IP_ADDRESS>:52232 timed out.
[Trace]   DefaultNetworkListener Accepted TCP connection from <IP_ADDRESS>:52238.
[Trace]   DefaultNetworkListener Connection attempt from <IP_ADDRESS>:52238 timed out.

I tried connecting to your relay as well without success. It answers on telnet just like my relay but I cannot connect from Unity. Could it be some issue with the EC2-firewall blocking half of the TCP-traffic?

Solved, I have set it up locally and connected to my host using my 4g net on a laptop. Now it seems to be working.
It looks like amazon blocks udp packets for some reason.
The EC2 firewall is open for both tcp and udp traffic.
I close the issue because it is not the plugins error.
But the it can be useful for future users.


OAuth1 with signature

Is there a way to create an hmac sh1 signature to add to a get request url header in Alamofire?
Thanks

Questions like this are best suited to StackOverflow. If you create a question and tag it alamofire, the whole community can take a look for you. Generally, though, you can add headers by using the request(_:headers:) function. See our documentation.


gtmOnFailure should be called in the onFailure handler.

https://github.com/anujtenani/gtm-goaffpro-template/blob/0e5aec6eb372dbd88f29d43e6cb43bd765b77ff6/template.tpl#L104
Scripts should call either gtmOnSuccess or gtmOnFailure exactly once, any time the script is run.
Not calling this will lead to issues with tag sequencing.

Thanks.
Fixed in commit


How to add a loadbalancer as port 443 already used by nginx proxy to api

FEATURE REQUEST
Quick question:
I am adding a lb (traefik) on a node in order to access my service from outside.
On each minion, the port 443 is already taken by nginx proxy to forward local api request to masters.
What is the easiest way to make services available like: https://grafana2.satoshi.tech without the need to specify another port for https.
Anyway in kargo to free up these 443 ports on all nodes?
The setup is here.
https://github.com/gregbkr/kubernetes-kargo-logging-monitoring/blob/master/README.md#5-loadbalancers
Thank you.
Greg.

Greg, you can change the nginx_kube_apiserver_port to something else, such as 8443. This was added quite recently here: https://github.com/kubernetes-incubator/kargo/commit/6905edbeb6251d0a046c09777d70bdaf05fc580e

thanks @mattymo. I used this var and redeploy on top. Traefik now proxies my request on 443. Works great thx a lot!


Update README.md to change 'header' to 'headers'

the README.md gets auto generated from https://github.com/Availity/availity-ekko/tree/master/docs/readme/partials.  Please update the source as well else your fixes will be overridden.


Configurable Path to .jdkw

If you execute <path>/jdk-wrapper.sh then it looks for the .jdkw file in $CWD and never looks  in <path>. We should add <path> look-up as a location for .jdkw in priority between $HOME and ./. The value of <path> can be determined by something like:
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Obviously, the documentation will need to be updated to reflect this change and should likely be applied to both the wrapper-wrapper and the jdk wrapper.

This is available in 0.11.0 being released today.


Improvements to the physics engine.

Note: some clipping into blocks still happens when colliding at high velocities.


fix(gatsby-theme-docz): fix playground react-resize-detector usage

Fixed usage of react-resize-detector onResize callback
Description
Fixes: https://github.com/doczjs/docz/issues/1349
Review

[ ] Check the copy

Pre-merge checklist
Screenshots
No visual changes

Hey @rafarovina
Awesome ! Thanks for catching and fixing this 👍


Delete rackhd.py

rackHd.py moved to https://github.com/ansible/ansible/blob/devel/contrib/inventory/rackhd.py

@zyoung51 @jlongever @benbp

:+1:

@tannoa2 @uppalk1

:+1:

:+1:

:+1:


Adding Links for GSSpc'22, hacktober fest 2021 and finally  the Demo video link for this repo

Issue Type:

[ ] Bug Report
[x] Feature Request
[ ] Documentaion

Describe the bug

A clear and concise description of what the bug is.

Possible solution

Describe the solution you thought of.

Screenshots

If applicable, add screenshots to help explain your problem.

Please assign this issue to me @arpit456jain

@arpit456jain

**Can you assign this to me please @arpit456jain @VidhiBhatt01 **

Please can anyone assign this issue to me and I will solve it asap @DEEPALI-SUK @DEEPIKA-SUK @astha2412 @VidhiBhatt01 @arpit456jain
Thanks in advanced

i would like to work on this issue


Use proper tags on sdk dashboard

Both java and go SDKs use capitalized camel case tags.
This change brings dashboard in compliance with that.

Discarded in favor of making all metric tags lowercase.


User, Superuser, Staff Permissions Question

Hello All,
I'm unsure what the different user types are intended to be able to access and how DefectDojo is intended to be setup with multiple users having access to the same products. In my instance of DefectDojo, normal active users and superusers seem to have the same access. They each only have access to view the products on which they are authorized. They are not able to view or create engagements or to create new products. So far, the only way I have been able to change the access available to a user has been to mark the user as Staff, which then seems to give them access to all Products, engagements, users, etc. Is this the way DefectDojo is intended to work?
I originally assumed that I could create a Product as Staff and then have multiple authorized users for that product that could view, add and modify all engagements, tests, findings, etc. for that product only. Is this the way access is intended?
I apologize if this information was already available in the documentation or if I am submitting this question in the wrong place. I appreciate any help you are able to provide. Thank you.

Hi @StephenNickle! Thanks for your question. Staff users are typically engineers / testers. They have access to and can edit all products, engagements, and findings. Authorized users are typically people external to the security team that want to view the details for a specific product. Authorized users can also see the general metrics. Super users can see the metrics on all engineers. If this doesn't answer you question, please feel free to re-open the issue.

@devGregA Thank you for your quick response. Having engineers/testers as staff makes sense. My only concern is I would prefer not to give all our staff users access to the Users tab where they can make changes to our other user's accounts. Is there a way to allow a user to have all the staff access for engagements, tests, etc. without giving them access to the users tab? Thanks again for your help!

Hi @StephenNickle, ah gotcha. So the user tab is a little misleading. While staff have access to it and can set the fields, the users do not receive passwords until a super user goes to /admin. That user tab is for adding place holders for contact info. However, if a super user added a password for a user, a staff user could elevate the privileges of a user. I'll add a fix to my backlog, but it could be a couple weeks before I can allocate the time to address it.

Elevating to a bug for tracking.

@devGregA That helps clear it up for me. Thank you for your help.

Hi @StephenNickle , I have a fix for this, I am also working on #174. I will submit the fix for this issue with the PR for #174 .

Hi @StephenNickle, ah gotcha. So the user tab is a little misleading. While staff have access to it and can set the fields, the users do not receive passwords until a super user goes to /admin. That user tab is for adding place holders for contact info. However, if a super user added a password for a user, a staff user could elevate the privileges of a user. I'll add a fix to my backlog, but it could be a couple weeks before I can allocate the time to address it.

Hi @StephenNickle! Thanks for your question. Staff users are typically engineers / testers. They have access to and can edit all products, engagements, and findings. Authorized users are typically people external to the security team that want to view the details for a specific product. Authorized users can also see the general metrics. Super users can see the metrics on all engineers. If this doesn't answer you question, please feel free to re-open the issue.

Hi @devGregA  ,I have created a user and have just marked him as active. When he tries to close or change status of a finding he is prompted with enter credentials pop up. May I know why

This is a current limitation of the role model being used.
Please refer to #1048 for up-to-date info, and related links. Thanks.


cannot import name 'util' from 'telebot'

2023-02-12 07-07-24: Traceback (most recent call last):
2023-02-12 07-07-24:   File "/root/my_app/Openaibot/Openaibot/main.py", line 52, in
2023-02-12 07-07-24:     start()
2023-02-12 07-07-24:   File "/root/my_app/Openaibot/Openaibot/main.py", line 43, in start
2023-02-12 07-07-24:     module = importlib.import_module('App.' + starter)
2023-02-12 07-07-24:   File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module
2023-02-12 07-07-24:     return _bootstrap._gcd_import(name[level:], package, level)
2023-02-12 07-07-24:   File "", line 1030, in _gcd_import
2023-02-12 07-07-24:   File "", line 1007, in _find_and_load
2023-02-12 07-07-24:   File "", line 986, in _find_and_load_unlocked
2023-02-12 07-07-24:   File "", line 680, in _load_unlocked
2023-02-12 07-07-24:   File "", line 850, in exec_module
2023-02-12 07-07-24:   File "", line 228, in _call_with_frames_removed
2023-02-12 07-07-24:   File "/root/my_app/Openaibot/Openaibot/App/Telegram.py", line 17, in
2023-02-12 07-07-24:     from telebot import util, types
2023-02-12 07-07-24: ImportError: cannot import name 'util' from 'telebot' (/root/my_app/.venv/lib/python3.9/site-packages/telebot/init.py)
2023-02-12 07-07-24: 2023-02-12 07:07:24.648 | INFO     | main::25 - NEWS Channel:https://t.me/Openaibot_channel
报错如上，python菜鸡一只，虚心请教一下。
另外 error: can't find Rust compiler
手动安装或是下载安装都一样报错

pip uninstall telebot


add 'truncate-overwrite' mode

some file systems have a different behavior for overwrite and truncate

just saw this, sorry about that.   I'll take a look, may have questions.  Thanks for the PR.

@bengland2 Yeh, make sense. I will update the PR.

@kofemann  thx!


dynatrace_network_zone resource produces an update on every plan

Describe the bug
A plan is genereted for dynatrace_network_zone on every plan, because the connected activegate and oneagent fields are set to null.
Since these values are dynamic and fluctuate over time, the provider should ignore them when planning to update resources.
Here is ane example of a plan:
~ resource "dynatrace_network_zone" "my_nz" {
    id                                = "my.nz.id"
    name                              = "my.nz.name"
  - num_of_configured_activegates     = 1 -> null
  - num_of_configured_oneagents       = 17 -> null
  - num_of_oneagents_from_other_zones = 48 -> null
  - num_of_oneagents_using            = 62 -> null
    # (2 unchanged attributes hidden)
}

To Reproduce
Steps to reproduce the behavior:

Configure a NZ with Terraform
Connect AGs and Oneagents to the NZ
Run Terraform Plan
See error

Expected behavior
Changes in these value should not generate an update in the plan. So far as I understand it, these values are informational.
Additional context
Tested with provider v1.59.1

Hi @mattBaumBeneva,
Thank you for the feedback! The fix will be included in the next release.

Thanks, @kishikawa12 !


[Issue]: Unable to Access AutoGenStudio（running in docker sharing the host  network） on Port 8081 from Host Despite --network host Option

Describe the issue
I'm encountering an issue with accessing AutoGenStudio running inside a Docker container from the host machine. The container is started with the --network host option, which should allow for direct access to the service on the host's network interface, but it seems that the service is only listening on <IP_ADDRESS>:8081 instead of <IP_ADDRESS>:8081.
Steps to reproduce
Created a Dockerfile with the following content:
FROM python:3.11-slim
RUN pip install autogenstudio
EXPOSE 8081
CMD ["autogenstudio", "ui", "--port", "8081"]

Built the Docker image with the command:
docker build -t autogenstudio .

Ran the container using:
docker run -d --name autogenstudio --network host autogenstudio

Attempted to access the UI via http://localhost:8081 from the host machine without success.
Screenshots and logs

Additional Information
version are up to date
I suspect that the service needs to be configured to listen on <IP_ADDRESS> instead of <IP_ADDRESS>, but I haven't found a way to make this adjustment for AutoGenStudio. Any guidance or suggestions on how to properly configure the service to listen on all interfaces would be greatly appreciated.
Thank you for your assistance!

Try with:
CMD ["autogenstudio", "ui", "--host", "<IP_ADDRESS>", "--port", "8081"]

OR access using url: http://<IP_ADDRESS>:8081/


2 year+ badges are not visible

Checklist

[X] I'm reporting a problem with Chatterino
[X] I've verified that I'm running the most recent nightly build or stable release
[X] I've looked for my problem on the wiki
[X] I've searched the issues and pull requests for similar looking reports

Describe your issue
If you equip a 7TV badge 2 years or above it will not show up in Chatterino7
Screenshots
No response
OS and Chatterino Version
Chatterino 7.4.4

On which OS are you on?

On which OS are you on?

Windows 11, doesn't show for others on same Chatterino with Windows 10

Chatterino 7.4.4

Just noticed you're on an old version. Both https://github.com/SevenTV/chatterino7/releases/tag/v7.4.6 and https://github.com/SevenTV/chatterino7/releases/tag/v7.4.5 should show the badges.

Chatterino 7.4.4

Just noticed you're on an old version. Both https://github.com/SevenTV/chatterino7/releases/tag/v7.4.6 and https://github.com/SevenTV/chatterino7/releases/tag/v7.4.5 should show the badges.

Apologies, never saw a new version was out. Thank you!


Error after update to 9.0+

After update I get error "The configuration for the "manager" component must contain a "class" element." It works fine on 0.8.2

Check out this link to the issue I had which sounds similar to what you have here.
https://github.com/dektrium/yii2-user/issues/210
See if you made the same misunderstanding as I did.
If not, place a screenshot of the config file which you are updating based on author guidelines.

 'modules' => [
'user' => [
            'class' => 'dektrium\user\Module',
            'enableUnconfirmedLogin' => true,
            'confirmWithin' => 21600,
            'cost' => 12,
            'admins' => ['render'],
            'rememberFor' => 60 * 60 * 24 * 30 * 12,
            'components' => [
                'manager' => [
                    'userClass' => 'app\models\Users',
                    'loginFormClass' => 'app\models\LoginForm',
                ],
            ],
        ],
]

You have used outdated documentation. New guide is located here. You can also check out UPGRADE.md to see what has been changed in 0.9.0.

Hi. Can you please say exactly what changes you did to get it to work?
I have the same problem after updating and I don't understand what has changed.
I'm pretty sure I need to add 'class' => 'something' to:
'user' => [
'components' => [
'manager' => [
But what?

user' => [
'class' => 'dektrium\user\Module',
'modelMap' => [
'User' => 'app\models\User',
],
],

I still cant get it to work.
Exactly same error as before.
The configuration for the "manager" component must contain a "class" element.
'modules' => [
    'v1' => [
        'class' => 'app\api\v1\Module',
    ],
    'user' => [
        'class' => 'dektrium\user\Module',
        'modelMap' => [// NOTE! This is the new I added from your comment
            'User' => 'app\models\User',// NOTE! This is the new I added from your comment
        ],// NOTE! This is the new I added from your comment
        'enableRegistration' => false,
        'enableGeneratingPassword' => false,
        'enablePasswordRecovery' => true,
        'enableConfirmation' => true,
        'enableUnconfirmedLogin' => false,
        'emailChangeStrategy' => dektrium\user\Module::STRATEGY_SECURE,
        'confirmWithin' => 3600 * 6,
        'rememberFor' => 3600 * 0.5,
        'cost' => 10, // used by Blowfish hash algoritm
        'urlPrefix' => 'user',
        'urlRules' => [],
        'controllerMap' => [
            'admin' => 'app\controllers\user\AdminController',
            'profile' => 'app\controllers\user\ProfileController',
            'registration' => 'app\controllers\user\RegistrationController',
            'settings' => 'app\controllers\user\SettingsController',
            'site' => 'app\controllers\SiteController',
        ],
        'mailer' => [
            'sender' => $params['email']['noReply'],
        ],
        'components' => [
            'manager' => [
                'userClass' => 'app\models\User',
                'tokenClass' => 'app\models\Token',
                'profileClass' => 'app\models\Profile',
                'accountClass' => 'dektrium\user\models\Account',
                // Model that is used on user search on admin pages
                'userSearchClass' => 'dektrium\user\models\UserSearch',
                // Model that is used on registration
                'registrationFormClass' => 'app\models\RegistrationForm',
                // Model that is used on settings
                'settingsFormClass' => 'app\models\SettingsForm',
                // Model that is used on resending confirmation messages
                'resendFormClass' => 'dektrium\user\models\ResendForm',
                // Model that is used on logging in
                'loginFormClass' => 'app\models\LoginForm',
                // Model that is used on password recovery
                'recoveryRequestFormClass' => 'dektrium\user\models\RecoveryForm',
                // Model that is used on requesting password recovery
                'recoveryRequestFormClass' => 'dektrium\user\models\RecoveryRequestForm',
            ],
        ],
        'admins' => [
            '',
        ],
    ],

You need to move everything from  'components' => [
'manager' => [
to
'modelMap' => [
syntax has changed

@stepanorda is correct. But, @anders-akero, have you checked out upgrade instructions before asking this questions? It is clearly described there how you should adjust your config after upgrade from 0.8.*.

I would like to defend @anders-akero. The upgrade instruction focus on custom classes. If you did not change anything and just upgrade, it won't work. Even after the instructions above I do not have an idea what I should do to get this software working. Oke, my fault. But I do not understand eveything. I just want it to work.
It would be nice to have a complete working version as example in the docs.

Hi.
I read the changelog and the documentation for example of the configuration. I could not find any example of the configuration and that is why I started searching for others with same issue and found this thread. I did not see the file UPGRADE.md for some reason, my mistake there.
I would recommend you to write the last answer from Stepanorda in the upgrade instructions. It was very clear and helpful to me and will be for many others as well I am sure of. In general a very good extension with a great potential. I would however give the advice for the future to write in what users should change in the upgrade instructions and not just write the new syntax.
I failed because I never understood that we had to move from components, I thought it was something new I just had to add.
Finally I would like to say that I am totally aware of that this extension is not in a stable release yet and that upgrading may break things.
In order to help others who may end up here and having the same issue I will show you my configuration after modification to work with version 0.9.2
    'user' => [
        'class' => 'dektrium\user\Module',
        'enableRegistration' => false,
        'enableGeneratingPassword' => false,
        'enablePasswordRecovery' => true,
        'enableConfirmation' => true,
        'enableUnconfirmedLogin' => false,
        'emailChangeStrategy' => dektrium\user\Module::STRATEGY_SECURE,
        'confirmWithin' => 3600 * 6,
        'rememberFor' => 3600 * 0.5,
        'cost' => 10, // used by Blowfish hash algoritm
        'urlPrefix' => 'user',
        'urlRules' => [],
        'controllerMap' => [
            'admin' => 'app\controllers\user\AdminController',
            'profile' => 'app\controllers\user\ProfileController',
            'registration' => 'app\controllers\user\RegistrationController',
            'settings' => 'app\controllers\user\SettingsController',
            'site' => 'app\controllers\SiteController',
        ],
        'modelMap' => [
            'User' => 'app\models\User',
            // Active record classes
            'userClass' => 'app\models\User',
            'tokenClass' => 'app\models\Token',
            'profileClass' => 'app\models\Profile',
            'accountClass' => 'dektrium\user\models\Account',
            // Model that is used on user search on admin pages
            'userSearchClass' => 'dektrium\user\models\UserSearch',
            // Model that is used on registration
            'registrationFormClass' => 'app\models\RegistrationForm',
            // Model that is used on settings
            'settingsFormClass' => 'app\models\SettingsForm',
            // Model that is used on resending confirmation messages
            'resendFormClass' => 'dektrium\user\models\ResendForm',
            // Model that is used on logging in
            'loginFormClass' => 'app\models\LoginForm',
            // Model that is used on password recovery
            'recoveryRequestFormClass' => 'dektrium\user\models\RecoveryForm',
            // Model that is used on requesting password recovery
            'recoveryRequestFormClass' => 'dektrium\user\models\RecoveryRequestForm',
        ],
        'mailer' => [
            'sender' => $params['email']['noReply'],
        ],
        'admins' => [
        ],
    ],

@anders-akero @arjenmeijer I'm agree with you, upgrade instructions may be a little bit confusing. I'll update them as soon as possible.

actually im using this in common config area:
user' => [
'class' => 'dektrium\user\Module',
'modelMap' => [
'User' => 'app\models\User',
],
],
but, afterthat all the capcha image is broken only when i try to ovrride User Model.


PS Move Config Tool not detecting controllers via USB

I have recently purchased two PS Move controllers to use for VR. But the PSMove Config Tool is detecting any of my controllers when connected by USB. Please help me with my issue.

Some questions for you

Are you using the MotionInJoy drivers?

If so you'll need to uninstall those first.

What version of Windows are you running?

There have been issues with HIDAPI (the library we use to communicate with the controller) and different versions of windows.
Win10 is officially supported (the other versions of windows are not)

Can you paste the output of the psmoveservice log window into this issue?

@notsimply As you haven't replied to the questions asked that would enable us to help you with your problem, I'm closing the issue. Please comment here (with the replies to the above questions) if your problem is not solved.


Failed to load a language-systemverilog package grammar

[Enter steps to reproduce:]

...
...

Atom: 1.50.0 x64
Electron: 5.0.13
OS: Mac OS X 10.15.6
Thrown From: language-systemverilog package 1.0.0
Stack Trace
Failed to load a language-systemverilog package grammar
At Cannot find module './build/Release/tree_sitter_verilog_binding'
Require stack:
- /Users/techpeng/.atom/packages/language-systemverilog/node_modules/tree-sitter-verilog/index.js
- /Applications/Atom.app/Contents/Resources/app.asar/static/index.html in /Users/techpeng/.atom/packages/language-systemverilog/grammars/tree-sitter-systemverilog.cson

Error: Cannot find module './build/Release/tree_sitter_verilog_binding'
Require stack:
- /Users/techpeng/.atom/packages/language-systemverilog/node_modules/tree-sitter-verilog/index.js
- /Applications/Atom.app/Contents/Resources/app.asar/static/index.html
    at Module._resolveFilename (internal/modules/cjs/loader.js:683:15)
    at Module._resolveFilename (/Applications/Atom.app/Contents/Resources/electron.asar/common/reset-search-paths.js:43:12)
    at Function.get_Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:155481)
    at Module.require (/app.asar/static/index.js:61:43)
    at require (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:146814)
    at /packages/language-systemverilog/node_modules/tree-sitter-verilog/index.js:2:20)
    at /packages/language-systemverilog/node_modules/tree-sitter-verilog/index.js:15:3)
    at Module.get_Module._compile (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:147498)
    at Object.value [as .js] (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:151046)
    at Module.load (internal/modules/cjs/loader.js:701:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:633:12)
    at Function.Module._load (internal/modules/cjs/loader.js:625:3)
    at Module.require (/app.asar/static/index.js:72:46)
    at require (internal/modules/cjs/helpers.js:14:16)
    at customRequire (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:1:695414)
    at new TreeSitterGrammar (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:3105868)
    at GrammarRegistry.createGrammar (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:360435)
    at /Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:360276
    at /Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:582207
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:54:3)
  at /packages/language-systemverilog/grammars/tree-sitter-systemverilog.cson:1:1

Commands

Non-Core Packages
counter 0.3.5
highlight-selected 0.17.0
language-systemverilog 1.0.0
split-diff 1.6.1
Sublime-Style-Column-Selection 1.7.5

My bad - I thought we had worked out all the bugs. I just unpublished the most recent release and put the improved (but still buggy version on a branch). If you apm remove language-systemverilog && apm install language-systemverilog it'll be working like it was before.

It looks like Mac-specific issue. I run only on Linux and it is fine.

Do you remember if you had to do anything out of the ordinary when you got it working on MacOS? https://github.com/pistoletpierre/language-systemverilog/issues/4#issuecomment-537648579

I don't own a Mac, and I have borrowed Mac for these experiments.
I think that language-systemverilog will install tree-sitter-verilog as npm dependency.
tree-sitter-verilog Installation requires Node GYP and C++ compiler configured. May that be a problem?

Ah ok. I put your tree-sitter code on a separate branch and reverted master for the time being. @TechPeng do you mind doing a few experiments with us since my Mac seems to not be having any issues with it anymore? (I was seeing a similar error before (https://github.com/pistoletpierre/language-systemverilog/issues/4#issuecomment-515642493), but it has since disappeared & I don't know off the top of my head how to get my computer back in to a state where the error would reappear)
@drom I would hope that if Node GYP and/or a C++ compiler were not configured then apm would complain and not silently fail while reporting a successful installation but you never know...
Could this be a potential fix? https://github.com/tree-sitter/tree-sitter-verilog/pull/44

Could this be a potential fix? tree-sitter/tree-sitter-verilog#44

I don't think so. npm package already include C and H files.

@drom I would hope that if Node GYP, a C++ compiler, or anything else necessary to install prerequisites were not configured properly then apm would complain and not silently dismiss such an issue while reporting a successful package installation but you never know...

What is the standard C++ compiler on Mac? XCode? I any quick way to check if it is installed?

@drom I would hope that if Node GYP, a C++ compiler, or anything else necessary to install prerequisites were not configured properly then apm would complain and not silently dismiss such an issue while reporting a successful package installation but you never know...

What is the standard C++ compiler on Mac? XCode? I any quick way to check if it is installed?

On MacOS, gcc/g++ are "secretly" clang. According to https://stackoverflow.com/questions/62366112/does-macos-come-built-in-with-the-clang-compiler-or-is-built-in-with-the-xcode-i, it's not included in a fresh MacOS installation but comes with XCode.

@TechPeng do you mind doing which gcc and then $(which gcc) --help ?

Catalina isssue?
https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md
I doubt it, but not willing to rule it out entirely. I'm currently running Catalina and have no had problems installing other npm packages. Also, it was released on Oct 7 2019 and I was having similar issue to @TechPeng when running the previous MacOS version (July 2019 -  https://github.com/pistoletpierre/language-systemverilog/issues/4)

xcode-select --install ?
This wouldn't have been my issue when we first saw it last summer. I've had the XCode command-line developer tools installed & kept up-to-date for ages


Add tests

Configure and add unit/integration tests for the application.

Pull Request #68 merged.


[Epic] New Contract Dependency Manager

Overview
Following the declarative design principles of Flow CLI we want to build a simple dependency manager that enables developers to:

Import a known contract from supported locations such as Flow networks (mainnet, testnet, …), GitHub repositories, or the NFT Catalog into the current project.
Deliver code with dependencies without re-shipping copies of dependencies.
Checkout missing dependencies based on flow.json

Design
Each contract is identified in flow.json by a unique identifier. It can be imported into another contract, transaction, or script like this:
import "MyContract"

The pre-processor will replace the imports with valid Cadence syntax and addresses based on flow.json:
"contracts": {
	"MyContract": "./contracts/MyContract.cdc", // local file location
	"TopShot": "mainnet/0x0123123123/TopShot", // live network address
	"NonFungibleToken": "github.com/onflow/flow-nft/NonFungibleToken.cdc", // github
	"CoolNFT": "nft-catalog/mainnet/CoolNFT"
}

The simple syntax can be evolved in the future to support specific commit hashes or versions for GitHub, or block heights for addresses.
Flow CLI will support checking for missing dependencies and checking them out into a local imports folder. The folder can be added to .gitignoreso other developers always pull the dependencies from the original source-of-truth.
flow contracts install
Flow CLI can check all dependencies and fetch missing ones into imports with this command:
flow contracts install

flow contracts add

From live Flow networks:

flow contracts add mainnet/0x0123123123/TopShot

A copy of the contract is fetched into the imports folder. For each import, a subfolder is created and the same operation is executed recursively. An alias entry is also created in flow.json to prevent re-deployments. Check out
cadence-import to see this in action.

From NFT Catalog:

flow contracts add nft-catalog/mainnet/CoolNFT

The contract address is resolved via NFT Catalog. The same steps as importing from networks are applied.

From GitHub:

flow contracts add github.com/onflow/flow-nft/NonFungibleToken.cdc

A copy of the contract is fetched into the imports folder from the latest commit. The name of the contract will be resolved from the contents. If the contract has imports, the repository’s root flow.json is checked to resolve them.
### Issues
- [ ] #910
- [ ] #331
- [ ] #944
- [ ] #957
- [ ] #958

References

https://github.com/jrkhan/cadence-import

Note that some contracts are very unfriendly to deploy and install on emulator, if they have very many arguments to the initializer. FiatToken i am looking at you.
We have solved this now by simple providing a shim for it that is a lot simpler. I would very much like the system to support  shims for emulators that behave as the deployed version but it a lot easier to work with.

For GitHub import, can we introduce the concept of exporting contracts?
There will be no ambiguity when importing.
Firstly, add an 'export' field in flow.json.
{
  "contracts": {
    "MyContract": "./contracts/PathToFolder/MyContract.cdc", // local file location,
  },
  "exports": [
    "MyContract"
  ]
}

Then when using it, do as follows:
{
  "contracts": {
    "MyContract": "github.com/username/reponame/MyContract", // GitHub, can only import contracts from exports, no worry about the path
  },
}

I think we need to use more advanced format, something like:
{
    "contracts": {
        "MyContract": {
            "type" : "local",
            "localPath": "./contracts/MyContract.cdc"
        },
        "TopShot":{
            "type": "flow",
            "localPath": "./contracts/utility/TopShot.cdc",
            "remotePath":{
                "mainnet": "0x0123123123/TopShot",
                "testnet": "0x0424242424/TopShot"
            }
        },
        "NonFungibleToken":{
            "type": "github",
            "localPath": "./contracts/utility/NonFungibleToken.cdc",
            "remotePath":{
                "mainnet": "github.com/onflow/flow-nft/NonFungibleToken.cdc",
                "testnet": "github.com/onflow/flow-nft/NonFungibleToken.cdc"
            },
            "aliases":{
                "mainnet": "0x0123123123",
                "testnet": "0x0424242424"
            }
        },
        "CoolNFT":{
            "type": "nftcatalog",
            "localPath": "./contracts/CoolNFT.cdc",
            "remotePath":{
                "mainnet": "mainnet/CoolNFT",
                "testnet": "testnet/CoolNFT"
            },
            "aliases":{
                "mainnet": "0x0123123123",
                "testnet": "0x0424242424"
            }
        },
    }
}

Note that some contracts are very unfriendly to deploy and install on emulator, if they have very many arguments to the initializer. FiatToken i am looking at you.
We have solved this now by simple providing a shim for it that is a lot simpler. I would very much like the system to support shims for emulators that behave as the deployed version but it a lot easier to work with.

@bjartek You're right. I created another issue for this, since it seems like there is no support for contract init params: https://github.com/onflow/flow-cli/issues/964
Feel free to comment if you have any suggestions on how to change flow.json for this.

Thanks @nvdtf this would be quite helpful for local development, and might also help improve contract deployment pipelines. Would also like to suggest -n should be a valid alternative for specifying network in the live flow Network flavor as it would align with usage for other commands:
flow contracts add 0x0123123123/TopShot -n mainnet

@jrkhan I re-used the simple syntax from flow.json for simplicity. We can also check if -n is present and support dropping the network name from the contract path. This can work with NFT catalog entries too. Thanks for the suggestion!

For GitHub import, can we introduce the concept of exporting contracts? There will be no ambiguity when importing.
Firstly, add an 'export' field in flow.json.
{
  "contracts": {
    "MyContract": "./contracts/PathToFolder/MyContract.cdc", // local file location,
  },
  "exports": [
    "MyContract"
  ]
}

Then when using it, do as follows:
{
  "contracts": {
    "MyContract": "github.com/username/reponame/MyContract", // GitHub, can only import contracts from exports, no worry about the path
  },
}

@btspoony The problem with supporting exports is that the original developer must be mindful of future reusability. I think we need to have exports, but with higher-level constructs like JS packages or FLIX interactions. I don't see a problem with being able to import any given contract from anywhere.

I think we need to use more advanced format, something like:
{
    "contracts": {
        "MyContract": {
            "type" : "local",
            "localPath": "./contracts/MyContract.cdc"
        },
        "TopShot":{
            "type": "flow",
            "localPath": "./contracts/utility/TopShot.cdc",
            "remotePath":{
                "mainnet": "0123123123.TopShot",
                "testnet":  "042424242.TopShot"
            }
        },
        "NonFungibleToken":{
            "type": "github",
            "localPath": "./contracts/utility/NonFungibleToken.cdc",
            "remotePath":{
                "mainnet": "github.com/onflow/flow-nft/NonFungibleToken.cdc",
                "testnet": "github.com/onflow/flow-nft/NonFungibleToken.cdc"
            },
            "aliases":{
                "mainnet": "0x0123123123",
                "testnet": "0x0424242424"
            }
        },
        "CoolNFT":{
            "type": "nftcatalog",
            "localPath": "./contracts/CoolNFT.cdc",
            "remotePath":{
                "mainnet": "mainnet/CoolNFT",
                "testnet": "testnet/CoolNFT"
            },
            "aliases":{
                "mainnet": "0x0123123123",
                "testnet": "0x0424242424"
            }
        },
    }
}

also deploy shim idea is also great ( or some init args in flow.json )

@bluesign Definitely looking to expand the simple syntax into advanced with more config options. I was also thinking of branch commit hash, content hash, ...
I'll open another issue in the future to expand the syntax.

New thoughts:
https://discord.com/channels/613813861610684416/1123314820763111465/1164943141699342527

The initial proposal is clean, but I think there is a big gap from going from something like that to the extended format (which seems required to actually have enough information across networks to work). Also, in a more extended format I think we can lean in more to the existing terminology and structure a developer already knows as to not overwhelm in difficulty and confusion. We could do something like this:
{
  "contracts": {
    // local contracts
  },
  "dependencies": {
    "TopShot": {
      "path": "./imports/TopShot",
      "remotePath": "testnet/0x0123123123.TopShot",
      "aliases": {
        "testnet": "0x0123123123",
        "mainnet": "0x0123123124"
      }
    }
  },
  "networks": {
    "emulator": "<IP_ADDRESS>:3569",
    "mainnet": "access.mainnet.nodes.onflow.org:9000",
    "testnet": "access.devnet.nodes.onflow.org:9000"
  },
  "accounts": {
    // account configurations
  }
}

In this the dependencies from the contract manager that you are not developing locally are broken out into a separate dependencies section so it's clear there is a difference and that different key/values may be possible. Then since there is an issue with different networks having different contract versions we should let the developer define the single source of truth they want to use to pull and develop with locally, which is the removePath. Aliases are then also still defined for running against testnet, mainnet, or any other network. The nice part is that this is already the pattern they are familiar with from the contracts section.
A developer should not set path, so the initial adding of a contract would look just like this:
"dependencies": {
    "TopShot": {
      "remotePath": "testnet/0x0123123123.TopShot",
    }
  },

Then someone could run flow contracts install and the path would be created. Curious to hear feedback.

@chasefleming  We can remove path in dependencies since the local path will be dictated automatically (like dependencies/mainnet/0x1/A.cdc). We also don't expect the developer to set a custom path.
For simplicity, we can also always check out the mainnet version of a dependency locally when it's defined on both networks.

Yeah I agree path seems unnecessary and we don't want developer manually editing them by mistake. Let's remove that. Based on the feedback, it would be this:
"dependencies": {
		"TopShot": {
			"remoteSource": "testnet/0x0123123123.TopShot",
			"aliases": {
				"testnet": "0x0123123123",
				"mainnet": "0x0123123124"
			}
		}
	}

@bjartek I also agree a mapping would be nice, but I'm not sure we can rely on every contract having it so we'd need to have this working without that first and if there was a way to group down the road that could speed things up for a developer.

If you cant trust the author of a contract you should not use it. You have to trust somebody. And since this just populates local files and flow.json you can always validate right?

If you cant trust the author of a contract you should not use it. You have to trust somebody. And since this just populates local files and flow.json you can always validate right?

Another option besides pragma is a resource you can store in your accoung. We talked about this in the flix wg yesterday, but not sure how well it would scale. @JeffreyDoyle

I was thinking we only define dependencies so:

Their addresses are aliases and translated correctly on each network since we won't be deploying them again alongside our own contracts.
We can run them in the emulator locally.

On the first point, if a given contract's mainnet/testnet code differs, we aren't impacted since we rely only on translated import addresses. The checked-out code is only useful for the second point, local deployment. This means that we're grabbing contracts from a source of truth (mainnet/testnet) and will run it in the emulator. We can argue at this point if we have a contract that has a different code on mainnet/testnet it won't probably work in emulator anyway since it's relying on network addresses in its code. Based on this point, we can have a rule like "always get the mainnet code" and simplify. Let me know what you think.

Some projects that you might want to implement might not be on mainnet yet. We need to cover that case to.
What to do with Fiat token for instance? Personally i think USDC should bust be on emulator like FlowToken.

We need to support contract init args before we think about FiatToken 🥲
I agree it should be emulator. I support adding lots of more base contracts to the emulator in favor of better DX.

Personally i think flow init should have a flag to populate flow.json with all the aliases that are deployed when you start emulator. That makes bootstrapping way easier.

But we are not now only talking about a dependenxcy manager for contracts. What about flix/tx/scripts to initialize an «addon».

As I began coding and reached the step for deploying dependencies, I realized that instead of trying to integrate dependencies into commands like flow project deploy, it's more seamless to build upon the existing flow.json patterns. In these patterns, you list dependencies that ultimately get added to contracts. This approach ensures that everything continues to work smoothly with the Flow CLI. I've modified the code I'm working on to operate as follows:
Initially, you would list dependencies in this format, which is easier to add (I will incorporate the :// suggestion from @bjartek mentioned during office hours):
{
	"contracts": {
		"HelloWorld": "cadence/contracts/HelloWorld.cdc"
	},
	"dependencies": {
		"TopShot": "testnet://877931736ee77cff.TopShot"
	},
	"networks": {
		"emulator": "<IP_ADDRESS>:3569",
		"mainnet": "access.mainnet.nodes.onflow.org:9000",
		"testnet": "access.devnet.nodes.onflow.org:9000"
	},
	"accounts": {
		"emulator-account": {
			"address": "f8d6e0586b0a20c7",
			"key": "1a42a3e48bd7f09ae61e9d39e2cf7045f5499424468dcf8d7e39f62426e238d0"
		}
	}
}

After running install, the result will be as follows, where all dependencies are listed, and the contracts section is populated with your dependencies:
{
	"contracts": {
		"FungibleToken": {
			"source": "imports/9a0766d93b6608b7/FungibleToken",
			"aliases": {
				"testnet": "9a0766d93b6608b7"
			}
		},
		"HelloWorld": "cadence/contracts/HelloWorld.cdc",
		"MetadataViews": {
			"source": "imports/631e88ae7f1d7c20/MetadataViews",
			"aliases": {
				"testnet": "631e88ae7f1d7c20"
			}
		},
		"NonFungibleToken": {
			"source": "imports/631e88ae7f1d7c20/NonFungibleToken",
			"aliases": {
				"testnet": "631e88ae7f1d7c20"
			}
		},
		"TopShot": {
			"source": "imports/877931736ee77cff/TopShot",
			"aliases": {
				"testnet": "877931736ee77cff"
			}
		},
		"TopShotLocking": {
			"source": "imports/877931736ee77cff/TopShotLocking",
			"aliases": {
				"testnet": "877931736ee77cff"
			}
		}
	},
	"dependencies": {
		"FungibleToken": "testnet//:9a0766d93b6608b7.FungibleToken",
		"MetadataViews": "testnet//:631e88ae7f1d7c20.MetadataViews",
		"NonFungibleToken": "testnet//:631e88ae7f1d7c20.NonFungibleToken",
		"TopShot": "testnet//:877931736ee77cff.TopShot",
		"TopShotLocking": "testnet//:877931736ee77cff.TopShotLocking"
	},
	"networks": {
		"emulator": "<IP_ADDRESS>:3569",
		"mainnet": "access.mainnet.nodes.onflow.org:9000",
		"testnet": "access.devnet.nodes.onflow.org:9000"
	},
	"accounts": {
		"emulator-account": {
			"address": "f8d6e0586b0a20c7",
			"key": "1a42a3e48bd7f09ae61e9d39e2cf7045f5499424468dcf8d7e39f62426e238d0"
		}
	}
}

Now, you can run flow project deploy without encountering any issues.

This makes sense to me, have you considered using either identifiers for imports or replace the . With /? So either
testnet://A.9a0766d93b6608b7.FungibleToken
Or
testnet://0x9a0766d93b6608b7/FungibleToken


Clean-up entities version

Coverage remained the same at 51.81% when pulling 7baf9f671be8003afdabcfcbc8593d1abfa251a8 on alex-slynko-wonga:master into d73e0984acd092365c6224fc2a045276e5b350cb on vasyl-purchel:master.

Coverage remained the same at 51.81% when pulling 7baf9f671be8003afdabcfcbc8593d1abfa251a8 on alex-slynko-wonga:master into d73e0984acd092365c6224fc2a045276e5b350cb on vasyl-purchel:master.

Coverage remained the same at 51.81% when pulling 7baf9f671be8003afdabcfcbc8593d1abfa251a8 on alex-slynko-wonga:master into d73e0984acd092365c6224fc2a045276e5b350cb on vasyl-purchel:master.

Coverage remained the same at 51.81% when pulling a791f61a582ccaf9b59276943de58c0a22d9b231 on alex-slynko-wonga:master into d73e0984acd092365c6224fc2a045276e5b350cb on vasyl-purchel:master.

Coverage remained the same at 51.81% when pulling a791f61a582ccaf9b59276943de58c0a22d9b231 on alex-slynko-wonga:master into d73e0984acd092365c6224fc2a045276e5b350cb on vasyl-purchel:master.

Coverage remained the same at 51.81% when pulling a791f61a582ccaf9b59276943de58c0a22d9b231 on alex-slynko-wonga:master into d73e0984acd092365c6224fc2a045276e5b350cb on vasyl-purchel:master.


App crashes with empty list

When you start an adapter with an empty list like:
ArrayList<GroupObject> groupObjectList = new ArrayList<GroupObject>
MyAdaper adapter = new MyAdapter(groupObjectList)

it crashes, so for example if you are downloading objects and get an empty list you have to do some workarounds to use the adapter. I think this is because the numberOfVisibleItemsInGroup in ExpandableListClass always returns 1 or more, so it´s getting a java.lang.ArrayIndexOutOfBoundsException: length=0; index=0

Hello, I encounter the same problem, it is exactly same as yours. Can you show your solution here? Really thanks

Same problem here, don't know how to fix.

+1

@Almaral-Engineering  Some solution for this issue?

+1

Create copies of ExpandableList & ExpandableRecyclerViewAdapter in your project.
Modify ExpandableList function :
private int numberOfVisibleItemsInGroup2(int group) {
if(expandedGroupIndexes!=null && expandedGroupIndexes.length>0) {
if (expandedGroupIndexes[group]) {
return groups.get(group).getItemCount() + 1;
} else {
return 1;
}
}
return 0;
}
Use the modified list in your copied  ExpandableRecyclerViewAdapter.
Use the pair of these 2 modified classes.

https://github.com/thoughtbot/expandable-recycler-view/issues/61#issuecomment-493419380
As i understood, the solution provided above is incorrect. Dont use it. Follow the solution, provided by link below instead, without any modifying of library source code:
https://github.com/thoughtbot/expandable-recycler-view/issues/27#issuecomment-448226409

#61 (comment)
As i understood, the solution provided above is incorrect. Dont use it. Follow the solution, provided by link below instead, without any modifying of library source code:
#27 (comment)

The mentioned solution is worked for me, even the edited version of comment is a working solution. Done some edits to make it more clear.


BUG: pip install panel version doesn't import

I'm running through the Scipy 2018 PyViz tutorial and command 16 on the 01_Workflow_Introduction notebook uses panel.
When I use a pip install version of panel, I get:
import panel
[Out]:ModuleNotFoundError: No module named 'panel'

The pip install version is panel-0.0.1 and I confirmed that it was installed in my environment with conda list and pip freeze.

However, when I install with conda using conda install panel -c pyviz, the import works with no issues.

Thanks for the report, we haven't yet released an official version of panel and uploaded a package to PyPI solely to register the name. We are getting very close to a first release though, so I'll keep you updated.

To get the current dev releases:
conda install -c pyviz/label/dev param panel

That worked.


Expanded text and added link to the Mailing List

Thanks for the PR!
Could you please fix up the extra  at
adsabs-dev-api ?


windows: 'sbt -jvm-debug 5005' not working with 1.3.3 launcher bat file

steps
sbt version: insert sbt version
D:\test>sbt -version
sbt version in this project: 1.3.3
sbt script version: 1.3.3
problem
When upgrading the sbt installation from 1.2.8 to 1.3.3 (using the msi), the '-jvm-debug' command line setting stopped working.
D:\test>sbt --jvm-debug
[info] Loading global plugins from C:\Users\user\.sbt\1.0\plugins
[info] Loading project definition from D:\test\project
[info] Loading settings for project test from build.sbt ...
[info] Set current project to test (in build file:/D:/test/)
[error] Expected ';'
[error] --jvm-debug
[error]

D:\test>

Same results with variations of the cmd:
sbt --jvm-debug 5005
sbt -jvm-debug
sbt -jvm-debug 5005

expectation
I would expect the jvm-debug command to be recognized and set up the jvm for remote debugging correctly.
notes
Other cmds like --mem 2048 work ok.
using sbt script 1.3.3 with a project version of 1.2.8 exhibits the same problem.

@noisypants Thanks for the report!

@eed3si9n feel free to mention me in these windows launcher script when you triage them.

This is working for me (at least in 1.3.5)
PS C:\Users\Eric Peters\IdeaProjects\ta-solr-healthcheck-plugin> sbt --script-version
1.3.5
PS C:\Users\Eric Peters\IdeaProjects\ta-solr-healthcheck-plugin> sbt -v -jvm-debug runMain
...
# Executing command line:
"C:\Program Files\AdoptOpenJDK\jdk-<IP_ADDRESS>-hotspot\\bin\java.exe"
-Dfile.encoding=UTF-8
-Dscala.ext.dirs="C:\Users\Eric Peters\.sbt\0.13\java9-rt-ext-adoptopenjdk_11_0_3"
-agentlib:jdwp
transport
dt_socket
server
y
suspend
n
address
5005
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-cp
"C:\Program Files (x86)\sbt\\bin\sbt-launch.jar"
xsbt.boot.Boot
runMain

Listening for transport dt_socket at address: 5005

Confirmed.  I tried on 1.3.5 and it works again.  thanks.

Apparently i got a ahead of myself.  this issue still seems to exist with 1.3.5.
`D:\dev\testapp>sbt --script-version
1.3.5
D:\dev\testapp>sbt -v -jvm-debug 5005
Executing command line:
"java"
-Dfile.encoding=UTF-8
-agentlib:jdwp
transport
dt_socket
server
y
suspend
n
address
5005
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-cp
"C:\Program Files (x86)\sbt\bin\sbt-launch.jar"
xsbt.boot.Boot
-jvm-debug
5005
Listening for transport dt_socket at address: 5005
[info] Loading project definition from D:\dev\testapp\project
[info] Loading settings for project testapp from build.sbt ...
[info] Set current project to testapp (in build file:/D:/dev/testapp/)
[error] Expected ';'
[error] -jvm-debug
[error]           ^
D:\dev\testapp>`

-jvm-debug doens't work anymore on sbt 1.4 .
Was it dropped or is it a bug @eed3si9n?

@lolgab As far as I know, it's not dropped. Could you open a new issue with the output of
sbt --script-version
sbt -v -jvm-debug 5005


Add files via upload

Let's add a contribution file, so we can work better, together!

Let's add a contribution file, so we can work better, together!

Let's add a contribution file, so we can work better, together!


 in the flagging conditions page duplicate when pressing back

Go to a flagging conditions page

Go to another page like "status" on the top
Press the browser back button

Expected:
I expect the old page to load
Actual:
We now have 2 site instances of the <select> box

(repeat the steps to get even more duplicated selection inputs)

This actually affects multiple pages which have a similar type of selection input, not just "Sites".


Should sending emails break on missing attachments?

I noticed that sending emails breaks if attachments are set (e.g. using the Email Template Manager) but missing (unreadable/unexisting path or similar).
This is intended.
But this makes sending emails using the Email Newsletter Manager and the Email Template Manager less flexible. The definition of attachments requires the attachments to actually exist — in other words:  you can't provide email logic with optional attachments to your authors.
I myself already hacked the EmailGateway class in order to not break on missing attachments (and also set email headers and boundaries accordingly).
Is this a change that is interesting for the core?

How would you patch it ? With an optional parameter that says skip non existing attachment ? Would you log that ?
Why not just validate the file yourself ? You want to avoid doing the check twice ?

You want to avoid doing the check twice ?

Exactly. And even if a first check would succeed, the actual loading might fail (because the file has gone away). So checking in advance would not prevent all problems.

How would you patch it ?

I just implemented a "silent fail", as described above. The email will still be sent if an attachment can not be read. I don't need a parameter to configure this behaviour, and I don't need any logging in this case. If that is interesting for the core, I can send a PR. If this is not considered a good solution, well, never mind. :-)

To be more clear:
I prefer to not let an email fail because of a missing attachment. I myself use this as the default behaviour. So I changed EmailGateway::getSectionAttachments (where an attachment actually gets loaded).
I also thought about logging such incidents (instead of throwing an exception, which stops the process and prevents the email from being sent). But in my case that doesn't make sense. I send emails to thousands of recipients, and if the attachment is deliberately optional (but still defined in the ETM using an XPath expression), the log would get polluted with thousands of messages.
There are good arguments for either behaviour, and I wouldn't say that the behaviour I implemented is right… But it's the best for me.
Doing this really right (make fail behaviour configurable, make logging configurable, thus breaking the API, probably more than that…) would increase complexity way too much, IMHO. We shouldn't do that without need.

@nitriques: Please feel free to close this issue if you prefer the current default behaviour.

Let's just add a private property on the class (with a getter and setter) to ignore attachments errors. No change to the API nor behavior. Would this suffice ?

I will take a look. It might get a bit complicated in EmailGateway::prepareMessageBody, however.
Do we really need a getter method as well? Actually we don't have getters for most of the email properties. (The email gateway has a "magic function" __get($name) instead.)
To which branch should PRs be submitted? 2.7.x?

Do we really need a getter method as well?

No we don't, you're right.

2.7.x

Yup. But I can now change the base of any PR, which is pretty awesome.

I can now change the base of any PR

I didn't know that. Thanks for this info!

:)


Feature Request: Loading Static Resources in Jest Tests

Any chance lwc-jest could add support for actually loading static resources during a jest test rather than just mocking script loading functions?
I assume we'd want a library like lodash to actually be loaded during the test so that our lwc components would continue to function as expected. We may be looking at this the wrong way, but either way, any help would be much appreciated.
In the meantime, we've settled on the solution below.
jest.mock(
    'lightning/platformResourceLoader',
    () => {
        return {
            loadScript() {
                return new Promise((resolve, reject) => {
                    global.elementResizeDetectorMaker = require('../../../staticresources/elementResizeDetector');
                    resolve();
                });
            }
        };
    },
    { virtual: true }
);

Cross-referencing https://github.com/trailheadapps/lwc-recipes/issues/78
FYI @trevor-bliss

@cnaccio For now we've made the decision to keep the static resource imports as mocks by default. We've decided to do this for a couple reasons:

Similar to importing a component from another namespace, like lightning, it's crossing a boundary and blurs the line between a unit and higher order test. People have differing (and strong!) opinions on where exactly we should draw this boundary crossing line so I understand if you believe we should automatically import 3rd party libraries, but we've discussed internally and made the decision to default these to mocks for now.

We want to keep things relatively simple for what you get out of the box in lwc-jest and then allow more advanced users to override configuration and mocks as they please. Rather than replicating the platformResourceLoader logic to create a <script> tag with a URL that matches where your static resources are, it feels much more reliable to simply mock out the call and let users load their static resource lib themselves if they want.

FWIW I think the code sample you shared is a good approach to loading the real library. If you want a mock that is used across your entire workspace instead of per-file, you can try using using the moduleNameMapper config. We do that for a couple libraries in lwc-recipes here.

Hey @trevor-bliss, after spending more time thinking about this and working on our tests, I'm inclined to agree with you that static resources are just like any other out scope resource for a unit test.
Plus, while at first the lack of salesforce proprietary magic bothered us, we're starting to really appreciate how vanilla the lwc dev experience is. Once we realized that lwc-jest was nothing more than  jest + some specific configuration, we were able to leverage the standard Jest documentation for troubleshooting. This is priceless!
Thanks for the response, and confirmation that our approach for static resources is solid; it's working nicely.
I'll close this issue now. Thanks again!

Going to bump this - I feel like there is an important oversight in regards to static resources in managed packages. At present there is no method of accessing these static resources from a jest test concept, as they cannot be manually loaded through a mock without org access.
This is a deal-breaking limitation for a lot of our use-cases, as several of our packages have dependencies on JS libraries within managed packages.
Perhaps this limitation could revive the consideration of a managed static resource tool?

@AdamSquiresXAC Is this a managed package you also own, or one that you are only a consumer of?
Would it be possible to see a specific example of a static resource you are consuming and how it's being used in the component? I want to make sure I fully understand the use case and how it's different from what we already discussed earlier in this thread. Feel free to simplify the example or rename things if you need to. Thank you.

Hi Trevor, thanks for the response. Yes it's a managed package of ours. There's several re-useable JS libraries that we keep inside managed packages.
The example would be as simple as loading a JS library from a static resource within a managed package, and calling a method from the JS library. I'll try make an example today if time permits.
Thanks!

Hi @AdamSquiresXAC, just wanted to follow up here. To be sure I understand your use case, you own the code inside the managed package, but the source is not available unless you are inside the live org? In other words, the source is not available directly from your Salesforce DX workspace and thus you cannot import it like the example in the original post here.
If that is the case, it sounds like you need to mock out this resource since it requires org access which is out of scope for these unit tests. Or since you own the managed package, maybe there's a way to keep an in sync copy of the package contents inside your workspace that the test can import.
Let me know your thoughts and if you're unsatisfied with those answers please provide a sample project or extensive example code we can work through.

Hi Trevor,
Thanks for getting back to me and apologies for not having the time to setup an example. Yes exactly, you've hit the nail on the head! I can see the argument to be made to keep this functionality out of scope. At the same time, it's hard to argue with the logic of:
Re-useable code should be re-used where possible. The best model of doing this across multiple products is to store functionality in a generic package.
If the method is called only once then sure, a mock makes sense. However, when these methods are called multiple times with different arguments and expected return values, it becomes messy to do this without using the actual functionality,
I had the same thought re- keeping a local in-sync version of the external resource. The issue is that we have multiple developers working on the same projects. They could be checked out under various directory names / structures depending on what each developer is currently working on, so the unit tests would need changing depending on each developers current project directory structure.
To me this seems like a game-breaking limitation on scaleability. I think we should still have to mock these external resources, but a library to connect to an org for manually mocking external resources would solve these issues. Alternatively, a tool to temporarily download external resources from installed packages to a local directory could be an easier solution?
Perhaps a workaround would be to store the local managed package path in the project.json, and reference this url from the unit tests (if possible?). At least each developer would only need to update this URL once per directory structure, although this could become messy if developers do not keep local versions up to date (which they may not be working on for months at a time). It would also be better if project.json files could be kept insync.
Many thanks for the response and thoughts,
Adam

Couple of thoughts:
IMHO that's something that can be solved by an organizational level, means: defining how local directory structure should be set up by the developers. That's at least what I directed my engineers to in previous roles.
For example:
|
|-project1
|-project2
|-project3
|-shared1
|-shared2
For unit tests you can then setup a relative directory import from projectX to sharedY, similar to what we've done with the recipes here.
Latest when you look in to incorporating unit tests into CI you'll need a similar setup, where for example a script pulls down the source of your shared code into the code that gets tested.

@AdamSquiresXAC Can you use an existing sfdx command like sfdx force:source:pull to pull down the package from the org and then import it in the unit test?

@trevor-bliss no, that command will not pull down static resources from a managed package.

Is the source for your managed package hosted anywhere like github or npm? You could have a dependency in your project on the package directly and use it in your tests that way rather than pulling it down from the org.
To be honest I still don't think I 100% understand your use case. I understand there are nuances to managed packages but if you own the source code in the managed package it seems like there should be a way for you to have that same source available in your project during unit tests.

Hi Trevor,
Sorry let me try and better explain. You are right in the sense that we could check out the managed package code elsewhere on our local machines, and then manually direct to these resources in jest.
The issue is that although this is a trivial thing to do for a solo developer, it is not scaleable when working in a team. Different people will have different directory structures and therefore filepaths, which would make syncing tests and config files a mess.
Does this make more sense?

Ok that makes sense. So going back to the question of if the managed package code is hosted anywhere like github or npm. If it's in the npm registry (or a private one only available to internal devs) then you can add a dependency on it in the package.json and it will be installed into the node_modules directory when devs run npm install, similar to how lwc-jest is loaded.
Or if you don't want to host it in the npm registry you can reference it by a github or direct URL.

Thanks for this. We don't have anything currently hosted in npm, and if I understand correctly this would download the entire workspace of our generic package, when we are only wanting access to our static resources folder (within that directory).
But are you saying that I can also directly access a web-hosted file within jest context? If so this makes the most sense to us! Do you have any examples of this? I've had a quick look and there's a few muddled discussion threads but it appears as though they are referring to the inclusion of local files.


Enable CORS on data.covidactnow.org

Test page to demonstrate it fails: https://mike-stuff.web.app/test-data.html
Result (in JS Console):

Access to fetch at 'https://data.covidactnow.org/states.csv' from origin 'https://mike-stuff.web.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

We need to get CORS working, which probably means adding a Access-Control-Allow-Origin: * header.
Note that in a past lifetime I recall * had limitations and it ended up being better to instead set the header to whatever the incoming requests Origin was set to.  If we do that, we also probably need to set Vary: Origin to avoid unwanted caching by proxies, etc.  We should probably start with just setting it to *.

@mikelehen  - i think this works!
https://mike-stuff.web.app/test-data.html

Yes!  Thank you!

For some reason, this has regressed.  So this will block moving the website over to snapshots. 😦

works again