Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into jupyterlabgh-13746-…
Browse files Browse the repository at this point in the history
…refactor-ajv8
  • Loading branch information
bollwyvl committed Feb 9, 2023
2 parents 986d19a + bd3c281 commit e76bc7f
Show file tree
Hide file tree
Showing 66 changed files with 1,509 additions and 512 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Execute benchmark tests
if: github.event_name == 'schedule' || (github.event_name == 'pull_request_review' && (github.event.review.state == 'approved' || contains(github.event.review.body, 'please run benchmark')))

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

env:
BENCHMARK_NUMBER_SAMPLES: 100
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
name: Execute memory-leak tests
if: github.event_name == 'schedule' || (github.event_name == 'pull_request_review' && (github.event.review.state == 'approved' || contains(github.event.review.body, 'please run benchmark')))

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 30

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ permissions:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/galata-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Update Galata References
if: ${{ github.event.issue.pull_request && (contains(github.event.comment.body, 'please update galata snapshots') || contains(github.event.comment.body, 'please update snapshots')) }}
timeout-minutes: 80
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand Down Expand Up @@ -54,15 +54,15 @@ jobs:
name: Update Documentation Snapshots
if: ${{ github.event.issue.pull_request && (contains(github.event.comment.body, 'please update documentation snapshots') || contains(github.event.comment.body, 'please update snapshots')) }}
timeout-minutes: 80
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# Python version is frozen through strategy.matrix.python-version
# Python dependencies are frozen in the installation step
# Note: IPython is among the frozen package
strategy:
matrix:
# Freeze Python version because it appears in console header
python-version: ['3.9.9']
python-version: ['3.10.6']

steps:
- name: Checkout JupyterLab
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/galata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,29 @@ on:
- master
pull_request:

env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

jobs:
test:
name: Visual Regression Tests
if: ${{ (github.event_name != 'issue_comment') || (github.event.issue.pull_request && (contains(github.event.comment.body, 'Galata snapshots updated.'))) }}
timeout-minutes: 80
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Set up browser cache
uses: actions/cache@v2
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install dependencies
run: |
bash ./scripts/ci_install.sh
Expand Down Expand Up @@ -48,7 +58,7 @@ jobs:
- name: Test
run: |
cd galata
jlpm run test
jlpm run test --project galata jupyterlab
mv galata/test-results galata/test-jupyterlab-results || true
# Run once benchmark tests to ensure they have no regression
BENCHMARK_NUMBER_SAMPLES=1 jlpm run test:benchmark
Expand Down Expand Up @@ -82,11 +92,11 @@ jobs:
# Python dependencies are frozen in the installation step
# Note: IPython is among the frozen package
timeout-minutes: 80
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
# Freeze Python version because it appears in console header
python-version: ['3.9.9']
python-version: ['3.10.6']
steps:
- name: Checkout JupyterLab
uses: actions/checkout@v3
Expand All @@ -108,6 +118,13 @@ jobs:
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Set up browser cache
uses: actions/cache@v2
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install dependencies
run: |
set -ex
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license-header.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
header-license-fix:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linuxjs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
js-vega5-extension,
]
fail-fast: false
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 40
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linuxtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
python-version: "3.8"
fail-fast: false
timeout-minutes: 45
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
lock:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ examples/federated/labextensions

junit.xml

jupyterlab/galata/@jupyterlab
jupyterlab/geckodriver
jupyterlab/static
jupyterlab/schemas
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ examples/federated/core_package/index.template.js
examples/federated/core_package/index.js
examples/federated/labextensions
galata/playwright-report
jupyterlab/galata
jupyterlab/schemas
jupyterlab/themes
jupyterlab/geckodriver
Expand Down
1 change: 0 additions & 1 deletion builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
],
"scripts": {
"build": "tsc",
"build:all": "npm run build",
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
"watch": "tsc -w --listEmittedFiles"
},
Expand Down
1 change: 0 additions & 1 deletion buildutils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
],
"scripts": {
"build": "tsc && cd template && npm run build",
"build:all": "npm run build",
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
"watch": "tsc -w --listEmittedFiles"
},
Expand Down
7 changes: 3 additions & 4 deletions buildutils/src/ensure-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,12 @@ export async function ensurePackage(
delete data.scripts.prepublishOnly;
}

// If the package is not in `packages` or does not use `tsc` in its
// If the package does not use `tsc` in its
// build script, add a `build:all` target
const buildScript = data.scripts?.build || '';
if (
buildScript &&
((pkgPath.indexOf('packages') == -1 && pkgPath.indexOf('template') == -1) ||
buildScript.indexOf('tsc') == -1) &&
path.basename(pkgPath) != 'galata' &&
buildScript?.indexOf('tsc') === -1 &&
!isPrivate
) {
data.scripts['build:all'] = 'npm run build';
Expand Down
16 changes: 14 additions & 2 deletions buildutils/src/ensure-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const MISSING: Dict<string[]> = {
'@jupyterlab/coreutils': ['path'],
'@jupyterlab/buildutils': ['path', 'webpack'],
'@jupyterlab/builder': ['path'],
'@jupyterlab/galata': ['fs', 'path'],
'@jupyterlab/galata': ['fs', 'path', '@jupyterlab/galata'],
'@jupyterlab/testing': ['fs', 'path'],
'@jupyterlab/vega5-extension': ['vega-embed']
};
Expand Down Expand Up @@ -98,7 +98,6 @@ const UNUSED: Dict<string[]> = {
],
'@jupyterlab/coreutils': ['path-browserify'],
'@jupyterlab/fileeditor': ['regexp-match-indices'],
'@jupyterlab/galata': ['http-server'],
'@jupyterlab/services': ['ws'],
'@jupyterlab/rendermime': ['@jupyterlab/mathjax2'],
'@jupyterlab/testing': [
Expand Down Expand Up @@ -156,6 +155,19 @@ const SKIP_CSS: Dict<string[]> = {
],
'@jupyterlab/filebrowser': ['@jupyterlab/statusbar'],
'@jupyterlab/fileeditor': ['@jupyterlab/statusbar'],
'@jupyterlab/galata': [
'@jupyterlab/application',
'@jupyterlab/apputils',
'@jupyterlab/docmanager',
'@jupyterlab/notebook'
],
'@jupyterlab/galata-extension': [
'@jupyterlab/application',
'@jupyterlab/apputils',
'@jupyterlab/cells',
'@jupyterlab/docmanager',
'@jupyterlab/notebook'
],
'@jupyterlab/help-extension': ['@jupyterlab/application'],
'@jupyterlab/lsp': ['codemirror'],
'@jupyterlab/metapackage': [
Expand Down
33 changes: 27 additions & 6 deletions docs/source/extension/extension_migration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ bumped their major version (following semver convention). We want to point out p
- ``@jupyterlab/filebrowser-extension`` from 3.x to 4.x
Remove command ``filebrowser:create-main-launcher``. You can replace by ``launcher:create`` (same behavior)
All launcher creation actions are moved to ``@jupyterlab/launcher-extension``.
- ``@jupyterlab/galata`` from 4.x to 5.x
* ``ContentsHelper`` and ``galata.newContentsHelper`` have new constructor arguments to use Playwright API request object:
``new ContentsHelper(baseURL, page?, request?)`` -> ``new ContentsHelper(request?, page?)``
``galata.newContentsHelper(baseURL, page?, request?)`` -> ``galata.newContentsHelper(request?, page?)``
you need to provide ``request`` or ``page``; they both are fixtures provided by Playwright.
* ``galata.Mock.clearRunners(baseURL, runners, type)`` -> ``galata.Mock.clearRunners(request, runners, type)``
- ``@jupyterlab/docregistry`` from 3.x to 4.x
* Removed the property ``docProviderFactory`` from the interface ``Context.IOptions``.
* The constructor of the class ``DocumentModel`` receives a parameter ``DocumentModel.IOptions``.
Expand Down Expand Up @@ -229,6 +223,33 @@ helpers from various core packages. The exported helpers are the same as before
- ``NBTestUtils.DEFAULT_CONTENT``: Removed - you could imported from ``@jupyterlab/notebook/lib/testutils`` but we strongly advice not to and to use your own test data.
- ``NBTestUtils.DEFAULT_CONTENT_45``: Removed

Testing with Galata
^^^^^^^^^^^^^^^^^^^

The in-page helpers are now in an JupyterLab extension to live in the common Webpack shared scoped. That new extension
is contained in the JupyterLab python package at ``jupyterlab.galata``. It requires to update your Jupyter server
configuration by adding the following line:

.. code-block:: python
import jupyterlab
c.LabApp.extra_labextensions_path = str(Path(jupyterlab.__file__).parent / "galata")
.. note::

To ease configuration, we have introduce a new helper function ``jupyterlab.galata.configure_jupyter_server``. So you can
simplify the server configuration to be ``jupyterlab.galata.configure_jupyter_server(c)``.

Here are the changes in the Javascript package ``@jupyterlab/galata`` from 4.x to 5.x:
* ``ContentsHelper`` and ``galata.newContentsHelper`` have new constructor arguments to use Playwright API request object:
``new ContentsHelper(baseURL, page?, request?)`` -> ``new ContentsHelper(request?, page?)``
``galata.newContentsHelper(baseURL, page?, request?)`` -> ``galata.newContentsHelper(request?, page?)``
you need to provide ``request`` or ``page``; they both are fixtures provided by Playwright.
* ``galata.Mock.clearRunners(baseURL, runners, type)`` -> ``galata.Mock.clearRunners(request, runners, type)``
* In-pages helpers are now in an extension define in ``jupyterlab/galata/extension`` and
store in ``@jupyterlab/galata/lib/extension``. And the global object has been renamed ``window.galata`` instead
of ``window.galataip`` (it still exists but it is deprecated).

Extension Development Changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion examples/notebook/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const SetupCommands = (
nbWidget.activate();
}
// find next and previous are now disabled
commands.notifyCommandChanged();
commands.notifyCommandChanged(cmdIds.startSearch);
});

/**
Expand Down

0 comments on commit e76bc7f

Please sign in to comment.