Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bgd 4393 merge upstream jupyter_server 2.12.4 #14

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
b23b086
Create CODEOWNERS
Lironavr1 May 15, 2023
a20fe64
ContentsHandler return 404 rather than raise exc (#1357)
bloomsa Nov 15, 2023
9f8ff28
Add more typings (#1356)
blink1073 Nov 15, 2023
fcd5740
Publish 2.10.1
blink1073 Nov 15, 2023
60798e3
Bump to 2.11.0.dev0
blink1073 Nov 15, 2023
8ed8b33
typo: ServerApp (#1361)
IITII Nov 16, 2023
ea6ceee
Support get file(notebook) md5 (#1363)
Wh1isper Nov 19, 2023
0983b71
Update ruff and typings (#1365)
blink1073 Nov 19, 2023
e7c0f33
Update api docs with md5 param (#1364)
Wh1isper Nov 19, 2023
cc74bb6
Publish 2.11.0
blink1073 Nov 21, 2023
8e5d766
Bump to 2.12.0.dev0
blink1073 Nov 21, 2023
ecd5b1f
Change md5 to hash and hash_algorithm, fix incompatibility (#1367)
Wh1isper Nov 24, 2023
40a95e5
avoid unhandled error on some invalid paths (#1369)
minrk Nov 25, 2023
3755794
Publish 2.11.1
blink1073 Nov 27, 2023
88eca99
Bump to 2.12.0.dev0
blink1073 Nov 27, 2023
0056c3a
Merge pull request from GHSA-h56g-gq9v-vc8r
minrk Dec 4, 2023
9bd9657
Publish 2.11.2
blink1073 Dec 4, 2023
1dd6d13
Bump to 2.12.0.dev0
blink1073 Dec 4, 2023
290fcf6
chore: update pre-commit hooks (#1370)
pre-commit-ci[bot] Dec 4, 2023
3e08300
Update for tornado 6.4 (#1372)
blink1073 Dec 5, 2023
3bd347b
Support async Authorizers (#1373)
Zsailer Dec 5, 2023
ae6857a
Publish 2.12.0
Zsailer Dec 5, 2023
7f2b4f6
Bump to 2.13.0.dev0
Zsailer Dec 5, 2023
b462387
log extension import time at debug level unless it's actually slow (#…
minrk Dec 6, 2023
a59beb9
Add support for async Authorizers (part 2) (#1374)
Zsailer Dec 6, 2023
cd2a4e0
Publish 2.12.1
Zsailer Dec 6, 2023
b0bbedf
Bump to 2.13.0.dev0
Zsailer Dec 6, 2023
bf8aab2
Use ruff docstring-code-format (#1377)
blink1073 Dec 16, 2023
69d3c58
Enable htmlzip and epub on readthedocs (#1379)
bollwyvl Dec 21, 2023
ac15039
Update pre-commit deps (#1380)
blink1073 Dec 23, 2023
c5493d0
Fix a typo in error message (#1381)
krassowski Jan 2, 2024
4991568
Force legacy ws subprotocol when using gateway (#1311)
epignot Jan 4, 2024
a42c08b
Publish 2.12.2
Zsailer Jan 4, 2024
b711b10
Bump to 2.13.0.dev0
Zsailer Jan 4, 2024
250b924
Fix test param for pytest-xdist (#1382)
tornaria Jan 5, 2024
d3aaaa9
Simplify the jupytext downstream test (#1383)
mwouts Jan 7, 2024
99b9126
Import User unconditionally (#1384)
yuvipanda Jan 9, 2024
6bcaf45
Publish 2.12.3
blink1073 Jan 9, 2024
359148b
Bump to 2.13.0.dev0
blink1073 Jan 9, 2024
7bb21b4
Fix log arguments for gateway client error (#1385)
minrk Jan 11, 2024
f9c6924
Publish 2.12.4
blink1073 Jan 11, 2024
c0c54b8
Merge branch 'main' of https://github.com/spotinst/jupyter_server int…
sigmarkarl Jan 14, 2024
7d322c9
merge 2.12.4 from upstream
sigmarkarl Jan 14, 2024
e8a2b14
merge 2.12.4 from upstream
sigmarkarl Jan 14, 2024
93a9a1c
merge 2.12.4 from upstream
sigmarkarl Jan 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ updates:
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
# Python
- package-ecosystem: "pip"
directory: "/"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/downstream-test@v1
with:
package_name: jupytext
test_command: pip install pytest-jupyter[server] gitpython pre-commit && python -m ipykernel install --name jupytext-dev --user && pytest -vv -raXxs -W default --durations 10 --color=yes --ignore=tests/test_doc_files_are_notebooks.py --ignore=tests/test_changelog.py
test_command: pip install pytest-jupyter[server] gitpython pre-commit && python -m ipykernel install --name jupytext-dev --user && pytest -vv -raXxs -W default --durations 10 --color=yes

downstream_check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down
16 changes: 5 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.2
rev: 0.27.3
hooks:
- id: check-github-workflows

Expand All @@ -33,17 +33,11 @@ repos:
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [yaml, html, json]

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
hooks:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
hooks:
Expand All @@ -58,7 +52,7 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.7.1"
rev: "v1.8.0"
hooks:
- id: mypy
files: jupyter_server
Expand All @@ -67,7 +61,7 @@ repos:
["traitlets>=5.13", "jupyter_core>=5.5", "jupyter_client>=8.5"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.1.9
hooks:
- id: ruff
types_or: [python, jupyter]
Expand All @@ -76,7 +70,7 @@ repos:
types_or: [python, jupyter]

- repo: https://github.com/scientific-python/cookie
rev: "2023.11.17"
rev: "2023.12.21"
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ python:
path: .
extra_requirements:
- docs
formats:
- epub
- htmlzip
# TODO: evaluate, see https://github.com/jupyter-server/jupyter_server/issues/1378
# - pdf
61 changes: 59 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,65 @@ All notable changes to this project will be documented in this file.

<!-- <START NEW CHANGELOG ENTRY> -->

## 2.12.4

([Full Changelog](https://github.com/jupyter-server/jupyter_server/compare/v2.12.3...7bb21b45392c889b5c87eb0d1b48662a497ba15a))

### Bugs fixed

- Fix log arguments for gateway client error [#1385](https://github.com/jupyter-server/jupyter_server/pull/1385) ([@minrk](https://github.com/minrk))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_server/graphs/contributors?from=2024-01-09&to=2024-01-11&type=c))

[@minrk](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Aminrk+updated%3A2024-01-09..2024-01-11&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 2.12.3

([Full Changelog](https://github.com/jupyter-server/jupyter_server/compare/v2.12.2...99b9126853b69aafb700b4c92b50b83b7ca00e32))

### Bugs fixed

- Import User unconditionally [#1384](https://github.com/jupyter-server/jupyter_server/pull/1384) ([@yuvipanda](https://github.com/yuvipanda))

### Maintenance and upkeep improvements

- Simplify the jupytext downstream test [#1383](https://github.com/jupyter-server/jupyter_server/pull/1383) ([@mwouts](https://github.com/mwouts))
- Fix test param for pytest-xdist [#1382](https://github.com/jupyter-server/jupyter_server/pull/1382) ([@tornaria](https://github.com/tornaria))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_server/graphs/contributors?from=2024-01-04&to=2024-01-09&type=c))

[@mwouts](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Amwouts+updated%3A2024-01-04..2024-01-09&type=Issues) | [@tornaria](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Atornaria+updated%3A2024-01-04..2024-01-09&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Awelcome+updated%3A2024-01-04..2024-01-09&type=Issues) | [@yuvipanda](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Ayuvipanda+updated%3A2024-01-04..2024-01-09&type=Issues)

## 2.12.2

([Full Changelog](https://github.com/jupyter-server/jupyter_server/compare/v2.12.1...49915685531ce90baae9d2a4d6baa9c533beffcc))

### Bugs fixed

- Fix a typo in error message [#1381](https://github.com/jupyter-server/jupyter_server/pull/1381) ([@krassowski](https://github.com/krassowski))
- Force legacy ws subprotocol when using gateway [#1311](https://github.com/jupyter-server/jupyter_server/pull/1311) ([@epignot](https://github.com/epignot))

### Maintenance and upkeep improvements

- Update pre-commit deps [#1380](https://github.com/jupyter-server/jupyter_server/pull/1380) ([@blink1073](https://github.com/blink1073))
- Use ruff docstring-code-format [#1377](https://github.com/jupyter-server/jupyter_server/pull/1377) ([@blink1073](https://github.com/blink1073))

### Documentation improvements

- Enable htmlzip and epub on readthedocs [#1379](https://github.com/jupyter-server/jupyter_server/pull/1379) ([@bollwyvl](https://github.com/bollwyvl))

### Contributors to this release

([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_server/graphs/contributors?from=2023-12-06&to=2024-01-04&type=c))

[@blink1073](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Ablink1073+updated%3A2023-12-06..2024-01-04&type=Issues) | [@bollwyvl](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Abollwyvl+updated%3A2023-12-06..2024-01-04&type=Issues) | [@epignot](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Aepignot+updated%3A2023-12-06..2024-01-04&type=Issues) | [@krassowski](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Akrassowski+updated%3A2023-12-06..2024-01-04&type=Issues)

## 2.12.1

([Full Changelog](https://github.com/jupyter-server/jupyter_server/compare/v2.12.0...a59beb9b7bf3decc00af782821561435f47bbb16))
Expand All @@ -19,8 +78,6 @@ All notable changes to this project will be documented in this file.

[@minrk](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3Aminrk+updated%3A2023-12-05..2023-12-06&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server+involves%3AZsailer+updated%3A2023-12-05..2023-12-06&type=Issues)

<!-- <END NEW CHANGELOG ENTRY> -->

## 2.12.0

([Full Changelog](https://github.com/jupyter-server/jupyter_server/compare/v2.11.2...3bd347b6f2ead5897a18c6171db1174eaaf6176d))
Expand Down
8 changes: 8 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# “team-big-data” team members will be requested for
# review when someone opens a pull request.
*
@Spotinst/team-big-data
3 changes: 3 additions & 0 deletions examples/simple/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ source = "nodejs"
[tool.hatch.build.targets.wheel.shared-data]
"etc/jupyter/jupyter_server_config.d" = "etc/jupyter/jupyter_server_config.d"

[tool.hatch.build.targets.wheel]
packages = ["simple_ext1", "simple_ext2", "simple_ext11"]

[tool.hatch.build.hooks.jupyter-builder]
dependencies = [
"hatch-jupyter-builder>=0.8.2",
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import List

# Version string must appear intact for automatic versioning
__version__ = "2.12.1"
__version__ = "2.12.4"

# Build up version_info tuple for backwards compatibility
pattern = r"(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)"
Expand Down
11 changes: 5 additions & 6 deletions jupyter_server/auth/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def passwd(passphrase=None, algorithm="argon2"):

Examples
--------
>>> passwd('mypassword') # doctest: +ELLIPSIS
>>> passwd("mypassword") # doctest: +ELLIPSIS
'argon2:...'

"""
Expand Down Expand Up @@ -93,15 +93,14 @@ def passwd_check(hashed_passphrase, passphrase):

Examples
--------
>>> myhash = passwd('mypassword')
>>> passwd_check(myhash, 'mypassword')
>>> myhash = passwd("mypassword")
>>> passwd_check(myhash, "mypassword")
True

>>> passwd_check(myhash, 'otherpassword')
>>> passwd_check(myhash, "otherpassword")
False

>>> passwd_check('sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a',
... 'mypassword')
>>> passwd_check("sha1:0e112c3ddfce:a68df677475c2b47b6e86d0467eec97ac5f4b85a", "mypassword")
True
"""
if hashed_passphrase.startswith("argon2:"):
Expand Down
3 changes: 2 additions & 1 deletion jupyter_server/base/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from jupyter_server._sysinfo import get_sys_info
from jupyter_server._tz import utcnow
from jupyter_server.auth.decorator import authorized
from jupyter_server.auth.identity import User
from jupyter_server.i18n import combine_translations
from jupyter_server.services.security import csp_report_uri
from jupyter_server.utils import (
Expand All @@ -50,7 +51,7 @@
from tornado.concurrent import Future

from jupyter_server.auth.authorizer import Authorizer
from jupyter_server.auth.identity import IdentityProvider, User
from jupyter_server.auth.identity import IdentityProvider
from jupyter_server.serverapp import ServerApp
from jupyter_server.services.config.manager import ConfigManager
from jupyter_server.services.contents.manager import ContentsManager
Expand Down
7 changes: 6 additions & 1 deletion jupyter_server/gateway/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from tornado.escape import json_decode, url_escape, utf8
from tornado.httpclient import HTTPRequest
from tornado.ioloop import IOLoop
from traitlets import Bool, Instance, Int
from traitlets import Bool, Instance, Int, Unicode

from ..services.kernels.connection.base import BaseKernelWebsocketConnection
from ..utils import url_path_join
Expand All @@ -31,6 +31,11 @@ class GatewayWebSocketConnection(BaseKernelWebsocketConnection):

retry = Int(0)

# When opening ws connection to gateway, server already negotiated subprotocol with notebook client.
# Same protocol must be used for client and gateway, so legacy ws subprotocol for client is enforced here.

kernel_ws_protocol = Unicode("", allow_none=True, config=True)

async def connect(self):
"""Connect to the socket."""
# websocket is initialized before connection
Expand Down
28 changes: 16 additions & 12 deletions jupyter_server/gateway/gateway_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,22 +757,25 @@ async def _is_retryable(self, method: str, exception: Exception) -> bool:

async def gateway_request(endpoint: str, **kwargs: ty.Any) -> HTTPResponse:
"""Make an async request to kernel gateway endpoint, returns a response"""
kwargs = GatewayClient.instance().load_connection_args(**kwargs)
gateway_client = GatewayClient.instance()
kwargs = gateway_client.load_connection_args(**kwargs)
rhc = RetryableHTTPClient()
try:
response = await rhc.fetch(endpoint, **kwargs)
GatewayClient.instance().emit(
gateway_client.emit(
data={STATUS_KEY: SUCCESS_STATUS, STATUS_CODE_KEY: 200, MESSAGE_KEY: "success"}
)
# Trap a set of common exceptions so that we can inform the user that their Gateway url is incorrect
# or the server is not running.
# NOTE: We do this here since this handler is called during the server's startup and subsequent refreshes
# of the tree view.
except HTTPClientError as e:
GatewayClient.instance().emit(
gateway_client.emit(
data={STATUS_KEY: ERROR_STATUS, STATUS_CODE_KEY: e.code, MESSAGE_KEY: str(e.message)}
)
error_reason = f"Exception while attempting to connect to Gateway server url '{GatewayClient.instance().url}'"
error_reason = (
f"Exception while attempting to connect to Gateway server url '{gateway_client.url}'"
)
error_message = e.message
if e.response:
try:
Expand All @@ -788,38 +791,39 @@ async def gateway_request(endpoint: str, **kwargs: ty.Any) -> HTTPResponse:
"Ensure gateway url is valid and the Gateway instance is running.",
) from e
except ConnectionError as e:
GatewayClient.instance().emit(
gateway_client.emit(
data={STATUS_KEY: ERROR_STATUS, STATUS_CODE_KEY: 503, MESSAGE_KEY: str(e)}
)
raise web.HTTPError(
503,
f"ConnectionError was received from Gateway server url '{GatewayClient.instance().url}'. "
f"ConnectionError was received from Gateway server url '{gateway_client.url}'. "
"Check to be sure the Gateway instance is running.",
) from e
except gaierror as e:
GatewayClient.instance().emit(
gateway_client.emit(
data={STATUS_KEY: ERROR_STATUS, STATUS_CODE_KEY: 404, MESSAGE_KEY: str(e)}
)
raise web.HTTPError(
404,
f"The Gateway server specified in the gateway_url '{GatewayClient.instance().url}' doesn't "
f"The Gateway server specified in the gateway_url '{gateway_client.url}' doesn't "
f"appear to be valid. Ensure gateway url is valid and the Gateway instance is running.",
) from e
except Exception as e:
GatewayClient.instance().emit(
gateway_client.emit(
data={STATUS_KEY: ERROR_STATUS, STATUS_CODE_KEY: 505, MESSAGE_KEY: str(e)}
)
logging.getLogger("ServerApp").error(
f"Exception while trying to launch kernel via Gateway URL {GatewayClient.instance().url} , {e}",
"Exception while trying to launch kernel via Gateway URL %s: %s",
gateway_client.url,
e,
)
raise e

if GatewayClient.instance().accept_cookies:
if gateway_client.accept_cookies:
# Update cookies on GatewayClient from server if configured.
cookie_values = response.headers.get("Set-Cookie")
if cookie_values:
cookie: SimpleCookie = SimpleCookie()
cookie.load(cookie_values)
GatewayClient.instance().update_cookies(cookie)
gateway_client.update_cookies(cookie)
return response
Loading
Loading