Allow to customise directory and notebook icon
References
for issue 15741 https://github.com/jupyterlab/jupyterlab/issues/15741
Code changes
as I proposed previously
currently for notebook and directory, Jupyter would ignore user-specification.
In my change, I would force lookup file type with respect to suffix/pattern, and check if the content type coincides with notebook/directory
as discussed with @krassowski and @JasonWeill , this shall be part of 4.2
User-facing changes
I believe no impact to current user (if no bug)
after implemented, user can customise icon via writing lab extensions
Backwards-incompatible changes
I guess no backwards incompatibility breaking since it is small change
Thanks for making a pull request to jupyterlab!
To try out this branch on binder, follow this link:
Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:
@krassowski do you know how can I check the detail of those UI integration test failure? those regression failure looks irrelevant and I can see similar issue happens frequently in other PR
Yes, they look unrelated, I restarted them.
Yes, they look unrelated, I restarted them.
Thanks @krassowski for restarting it, may I know are those UI regression failure regular as I can see a few other pull requests with similar failures.
Also, (sorry that I am new to the development of Jupyter itself) honestly I don't know how to have a quick test, is there any approach to build Jupyter and link the JS target to asset like what we did in lab extension development
well, if I understand correctly, follow https://jupyterlab.readthedocs.io/en/latest/developer/contributing.html#installing-jupyterlab shall be good enough... please ignore
looks like one test passed after retry and the other still failing, can someone help re-trigger the failed one
Feel sorry that it is a bit difficult to build Jupyter from source code in local development environment, can anyone help make a quick test? (such as grant node_modules folder a JuliaIcon)
Hello @krassowski, @JasonWeill. Sorry that I was AFK for a few personal issue.
Looks like my change works
My sample change:
import {juliaIcon} from '@jupyterlab/ui-components';
app.docRegistry.addFileType({
name: 'node_module',
contentType: 'directory',
icon: juliaIcon,
pattern: '^node_modules$'
})
As you can see below, looks like icon of node_modules is changed to JuliaIcon
Since looks like it does not break any specific ut, let's try to fix the pipeline and merge it. or shall we include any additional unit test to handle this logic?
test keeps failing with words like pluggy._manager.PluginValidationError: Plugin 'check-links' for hook 'pytest_collect_file' hookimpl definition: pytest_collect_file(path: 'Any', parent: 'pytest.Collector') -> 'CheckLinks | None' Argument(s) {'path'} are declared in the hookimpl but can not be found in the hookspec
Is there something broken by my change?
@linlol this appears a recent change in a dependency which started showing up on CI today. We are investigating in https://github.com/jupyterlab/jupyterlab/issues/15908
@linlol this appears a recent change in a dependency which started showing up on CI today. We are investigating in #15908
Thanks @krassowski! would merge main after issue resolved
somehow I got this error after merged master
is this something like version auto-bump? @krassowski
Made integrity changes!
Please commit the changes by running:
git commit -a -m "Package integrity updates"
4.1.3
4.1.3
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.8/x64/bin/jupyter-releaser", line 8, in git push --delete origin {tag_name}
Traceback (most recent call last):
File "
@linlol just an unlucky timing - the CI got confused as it started before 4.1.3 got released before it was done it was already released; I restarted the test it should pass now.
@linlol just an unlucky timing - the CI got confused as it started before 4.1.3 got released before it was done it was already released; I restarted the test it should pass now.
@krassowski lol it happens.
btw, is it correct that if UI integration failed, just retry it? I can see sometimes it failed and sometimes it works
Ok, I see what is happening, we need to bump main to 4.2.0alpha0. I am working on it right now
hi @krassowski can you retrigger it again? looks like during check-link, github raises a series of 429 too many request, I guess it is due to many similar check-link checks running at the same moment? Is it correct that we can fix it via retry
Also we can notice UI regression failure, I guess it is expected, please correct me if I am wrong
regards
@krassowski similar 429 for github request for check link failure,
and do you know what does this mean
how can I check which test failed here?
That job timed out (it has a timeout of 30 minutes, it is not clear why it got stalled but could be a runner issue) - I restarted it.
@krassowski thanks a lot! btw any suggestion for check-link failure? Looks like it failed 3 or 4 times in a row with a series of github 429 resp, shall we make any change or just retry
@krassowski thanks a lot! btw any suggestion for check-link failure? Looks like it failed 3 or 4 times in a row with a series of github 429 resp, shall we make any change or just retry
nws, let's wait for check-links got fixed first
@krassowski Hi, it finally passed all checks, could you help check if it is ok to merge it?
Thanks! I think we still should add a test to ensure that this does not regress in the future when someone will be optimizing this function. The test should go in:
https://github.com/jupyterlab/jupyterlab/blob/b6253d94454818b3feefbbe7a095b0da3286cfe9/packages/docregistry/test/registry.spec.ts#L682-L736
Thanks! I think we still should add a test to ensure that this does not regress in the future when someone will be optimizing this function. The test should go in:
https://github.com/jupyterlab/jupyterlab/blob/b6253d94454818b3feefbbe7a095b0da3286cfe9/packages/docregistry/test/registry.spec.ts#L682-L736
@krassowski sure, I would handle the ut this weekend. Btw, is it correct that no UI regression requested
hello @krassowski, added unit test for notebook/directory's customised FileType support and all Linux JS Tests passed.
Since the only 2 failing test (UI regression) are quite common and those test passed previously, can we merge without all success?
Anyway let me merge main to re-trigger. (This time UI test passed but checklink failed again lol)
hello @krassowski, thanks for pointing out the typo, those typos shall be resolved.
Feel free to merge it anytime
Cheers @krassowski for the heads up. Will look into it!!
thanks everyone
btw @krassowski , sorry that just curious, do we know the root cause of UI regression failure? Looks like it failed 3 times in a row
It is a problem with the tests running in parallel and the kernels not being mocked but pooled from the same server which is used to run multiple tests. #15845 might alleviate it a bit.
Congrats on your first merged pull request in this project! :tada:
Thank you for contributing, we are very proud of you! :heart:
Thanks @krassowski for your help. As a seven-year jupyter user, it's my great honour to contribute it