Skip to content

Add warning notification when connectivity errors occur in when opening the plugin manager#6931

Merged
jni merged 2 commits intonapari:mainfrom
goanpeca:enh/add-warning-plugin-manager-connectivity
May 27, 2024
Merged

Add warning notification when connectivity errors occur in when opening the plugin manager#6931
jni merged 2 commits intonapari:mainfrom
goanpeca:enh/add-warning-plugin-manager-connectivity

Conversation

@goanpeca
Copy link
Copy Markdown
Contributor

@goanpeca goanpeca commented May 24, 2024

Fixes napari/napari-plugin-manager#26

Description

Catches connectivity errors when fetching for plugin information when opening the plugin manager.

Although the issue lives in the plugin manager repo, the code that fetches the code still lives in napari, hence with the PR seem to be better resolved on this side.

Result

Before this PR

napari-before

With this PR

napari

The warning reads:

There seems to be an issue with network connectivity. Remote plugins cannot be installed, only local ones.

@goanpeca goanpeca self-assigned this May 24, 2024
@goanpeca
Copy link
Copy Markdown
Contributor Author

Hi @psobolewskiPhD, added you as reviewer since you opened the original issue :)

@jni
Copy link
Copy Markdown
Member

jni commented May 24, 2024

Thanks @goanpeca!

the code that fetches the code still lives in napari

Is this something that should be revisited? (ie how hard would it be to pull this out too?)

@goanpeca
Copy link
Copy Markdown
Contributor Author

Hi @jni

Is this something that should be revisited? (ie how hard would it be to pull this out too?)

Something to consider indeed, I think the only "user" of the file being modified in this PR is the napari-plugin-manager, so we could perhaps pull it out.

@goanpeca goanpeca changed the title Add warning notification when connectivity errors occur in plugins manager Add warning notification when connectivity errors occur in when opening the plugin manager May 24, 2024
@jni
Copy link
Copy Markdown
Member

jni commented May 24, 2024

I think the only "user" of the file being modified in this PR is the napari-plugin-manager

And can we imagine any other users? To me it is indeed very weird that napari would contact conda-forge — to use the analogy motivating the original pull-out, it would be as if matplotlib was contacting conda-forge. That would be surprising!

@goanpeca
Copy link
Copy Markdown
Contributor Author

goanpeca commented May 24, 2024

To me it is indeed very weird that napari would contact conda-forge — to use the analogy motivating the original pull-out, it would be as if matplotlib was contacting conda-forge. That would be surprising!

Well technically we are pinging https://npe2api.vercel.app a napari maintained webservice, not conda-forge directly 🙃 .

And can we imagine any other users?

I cant think of any at the moment, but perhaps I need others to chime in here 🤔

@jni
Copy link
Copy Markdown
Member

jni commented May 24, 2024

Well technically we are pinging https://npe2api.vercel.app/ a napari maintained webservice, not conda-forge directly 🙃 .

Ah! Right! That's indeed a little different. I'm not sure but my instinct still says transplant it.

@psobolewskiPhD
Copy link
Copy Markdown
Member

Without the plugin manager, can base napari do anything with the info it gathers from npe2api?
If not, then yeah it probably belongs in npe2 or in the manager.

@codecov
Copy link
Copy Markdown

codecov bot commented May 24, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 92.42%. Comparing base (2300b0e) to head (ab3dcc0).
Report is 3 commits behind head on main.

Files Patch % Lines
napari/plugins/npe2api.py 16.66% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6931      +/-   ##
==========================================
- Coverage   92.48%   92.42%   -0.06%     
==========================================
  Files         612      612              
  Lines       55165    55171       +6     
==========================================
- Hits        51018    50991      -27     
- Misses       4147     4180      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@goanpeca
Copy link
Copy Markdown
Contributor Author

goanpeca commented May 24, 2024

Did a quick search for usage of npe2api module, and indeed it does not seem to be used anywhere inside napari.

Without the plugin manager, can base napari do anything with the info it gathers from npe2api?

nope at the moment :)

Now in the spirit of making less PRs, any chance we could get this merged here 🙈 so I can then proceed to transplant it?

@psobolewskiPhD
Copy link
Copy Markdown
Member

Now in the spirit of making less PRs, any chance we could get this merged here 🙈 so I can then proceed to transplant it?

Seems reasonable to me. Fix it, then port it over.

@goanpeca
Copy link
Copy Markdown
Contributor Author

Any suggestions on the current text I used are welcome:

There seems to be an issue with network connectivity. Remote plugins cannot be installed, only local ones.

I took it loosely from what @psobolewskiPhD wrote on the original issue, but perhaps it could be made more clear/concise :)

@goanpeca
Copy link
Copy Markdown
Contributor Author

Created this napari/napari-plugin-manager#33 to track "transplants"

@jni jni added the bug Something isn't working as expected label May 24, 2024
@jni jni added this to the 0.5.0 milestone May 24, 2024
@jni jni added ready to merge Last chance for comments! Will be merged in ~24h bugfix PR with bugfix and removed bug Something isn't working as expected labels May 24, 2024
@jni jni merged commit 89c515a into napari:main May 27, 2024
@github-actions github-actions bot removed the ready to merge Last chance for comments! Will be merged in ~24h label May 27, 2024
@goanpeca goanpeca deleted the enh/add-warning-plugin-manager-connectivity branch May 27, 2024 22:44
@goanpeca
Copy link
Copy Markdown
Contributor Author

Thanks @jni!

Working on the transplant now :)

andy-sweet pushed a commit to andy-sweet/napari that referenced this pull request May 28, 2024
…ng the plugin manager (napari#6931)

Fixes napari/napari-plugin-manager#26

# Description

Catches connectivity errors when fetching for plugin information when
opening the plugin manager.

Although the issue lives in the plugin manager repo, the code that
fetches the code still lives in napari, hence with the PR seem to be
better resolved on this side.

# Result

## Before this PR


![napari-before](https://github.com/napari/napari/assets/3627835/6e704463-2dd3-4701-9aa5-93f2501e48fd)


## With this PR


![napari](https://github.com/napari/napari/assets/3627835/ffa3ad0a-da18-4e76-a4aa-8a007f90ce36)

The warning reads: 

>There seems to be an issue with network connectivity. Remote plugins
cannot be installed, only local ones.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR with bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plugin manager gives traceback if no internet connection

3 participants