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

Update workflow improvements #7552

Merged
merged 3 commits into from
Dec 21, 2024
Merged
Changes from all commits
Commits
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
28 changes: 23 additions & 5 deletions .github/workflows/upgrade-jupyterlab-dependencies.yml
Original file line number Diff line number Diff line change
@@ -15,6 +15,11 @@ on:
default: main
required: false
type: string
target_repo:
description: 'Target repository'
required: false
default: jupyter/notebook
type: string

env:
version_tag: 'latest'
@@ -68,13 +73,17 @@ jobs:
echo "latest=${LATEST}" >> $GITHUB_ENV
jlpm upgrade:lab:dependencies --set-version ${LATEST}
if [[ ! -z "$(git status --porcelain package.json)" ]]; then
jlpm install
jlpm
jlpm deduplicate

cd ui-tests
jlpm
jlpm deduplicate
fi

- name: Create a PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
run: |
set -eux

@@ -95,9 +104,18 @@ jobs:
git commit . -m "Update to JupyterLab v${LATEST}"

git push --set-upstream origin "${BRANCH_NAME}"
gh pr create \
--base ${{ inputs.branch || 'main' }} \
--title "Update to JupyterLab v${LATEST}" \

PR_ARGS=(
--base "${{ inputs.branch || 'main' }}"
--title "Update to JupyterLab v${LATEST}"
--body "New JupyterLab release [v${LATEST}](https://github.com/jupyterlab/jupyterlab/releases/tag/v${LATEST}) is available. Please review the lock file carefully."
)

# Add --repo flag only if target_repo is specified
if [[ -n "${{ inputs.target_repo }}" ]]; then
PR_ARGS+=(--repo "${{ inputs.target_repo }}")
fi

gh pr create "${PR_ARGS[@]}"
fi
fi
11 changes: 11 additions & 0 deletions buildutils/src/upgrade-lab-dependencies.ts
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@ const PACKAGE_JSON_PATHS: string[] = [
'packages/tree-extension/package.json',
'packages/tree/package.json',
'packages/ui-components/package.json',
'ui-tests/package.json',
];

const DEPENDENCY_GROUP = '@jupyterlab';
@@ -78,7 +79,16 @@ async function updatePackageJson(newVersion: string): Promise<void> {
throw new Error(errorMessage);
}

// fetch the new galata version
const galataUrl = `https://raw.githubusercontent.com/jupyterlab/jupyterlab/v${newVersion}/galata/package.json`;
const galataResponse = await fetch(galataUrl);
if (!galataResponse.ok) {
const errorMessage = `Failed to fetch galata/package.json from ${galataUrl}. HTTP status code: ${galataResponse.status}`;
throw new Error(errorMessage);
}

const newPackageJson = await response.json();
const galataPackageJson = await galataResponse.json();

for (const packageJsonPath of PACKAGE_JSON_PATHS) {
const filePath: string = path.resolve(packageJsonPath);
@@ -87,6 +97,7 @@ async function updatePackageJson(newVersion: string): Promise<void> {
const newDependencies = {
...newPackageJson.devDependencies,
...newPackageJson.resolutions,
[galataPackageJson.name]: galataPackageJson.version,
};

updateDependencyVersion(existingPackageJson, newDependencies);
2 changes: 1 addition & 1 deletion ui-tests/package.json
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
"license": "BSD-3-Clause",
"description": "Jupyter Notebook UI Tests",
"scripts": {
"deduplicate": "jlpm dlx yarn-berry-deduplicate -s fewerHighest && jlpm install",
"rimraf": "rimraf",
"start": "jupyter notebook --config test/jupyter_server_config.py",
"start:detached": "yarn run start&",
"test": "playwright test",
"test:debug": "PWDEBUG=1 playwright test",
"test:report": "http-server ./playwright-report -a localhost -o",

Unchanged files with check annotations Beta

// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import { IJupyterLabPage, expect, galata } from '@jupyterlab/galata';

Check warning on line 4 in ui-tests/test/mobile.spec.ts

GitHub Actions / Test Lint

'IJupyterLabPage' is defined but never used
import { test } from './fixtures';
const toolbar = page.getByRole('toolbar');
['Rename', 'Delete', 'Open', 'Download', 'Delete'].forEach(async (text) => {
expect(toolbar.getByText(text)).toBeVisible();

Check failure on line 41 in ui-tests/test/filebrowser.spec.ts

GitHub Actions / ui-tests (firefox)

[firefox] › test/filebrowser.spec.ts:32:7 › File Browser › Select one file

1) [firefox] › test/filebrowser.spec.ts:32:7 › File Browser › Select one file ──────────────────── Error: expect(locator).toBeVisible() Locator: getByRole('toolbar').getByText('Delete') Expected: visible Received: hidden Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByRole('toolbar').getByText('Delete') 39 | 40 | ['Rename', 'Delete', 'Open', 'Download', 'Delete'].forEach(async (text) => { > 41 | expect(toolbar.getByText(text)).toBeVisible(); | ^ 42 | }); 43 | }); 44 | at forEach (/home/runner/work/notebook/notebook/ui-tests/test/filebrowser.spec.ts:41:39) at /home/runner/work/notebook/notebook/ui-tests/test/filebrowser.spec.ts:40:56
});
});
expect(toolbar.getByText('Rename')).toBeHidden();
expect(toolbar.getByText('Open')).toBeHidden();
expect(toolbar.getByText('Delete')).toBeVisible();

Check failure on line 57 in ui-tests/test/filebrowser.spec.ts

GitHub Actions / ui-tests (firefox)

[firefox] › test/filebrowser.spec.ts:45:7 › File Browser › Select files and folders

2) [firefox] › test/filebrowser.spec.ts:45:7 › File Browser › Select files and folders ─────────── Error: expect(locator).toBeVisible() Locator: getByRole('toolbar').getByText('Delete') Expected: visible Received: hidden Call log: - expect.toBeVisible with timeout 5000ms - waiting for getByRole('toolbar').getByText('Delete') 55 | expect(toolbar.getByText('Rename')).toBeHidden(); 56 | expect(toolbar.getByText('Open')).toBeHidden(); > 57 | expect(toolbar.getByText('Delete')).toBeVisible(); | ^ 58 | }); 59 | 60 | test('Select files and open', async ({ page, tmpPath }) => { at /home/runner/work/notebook/notebook/ui-tests/test/filebrowser.spec.ts:57:41
});
test('Select files and open', async ({ page, tmpPath }) => {

Check failure on line 1 in ui-tests/test/links.spec.ts

GitHub Actions / ui-tests (firefox)

[firefox] › test/links.spec.ts:37:7 › Local Links › Open a folder

3) [firefox] › test/links.spec.ts:37:7 › Local Links › Open a folder ───────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 44 in ui-tests/test/links.spec.ts

GitHub Actions / ui-tests (firefox)

[firefox] › test/links.spec.ts:37:7 › Local Links › Open a folder

3) [firefox] › test/links.spec.ts:37:7 › Local Links › Open a folder ───────────────────────────── Error: proxy.waitForEvent: Test timeout of 60000ms exceeded. =========================== logs =========================== waiting for event "popup" ============================================================ 42 | 43 | const [folder] = await Promise.all([ > 44 | page.waitForEvent('popup'), | ^ 45 | page.getByText('Open Test Folder').last().click(), 46 | ]); 47 | at /home/runner/work/notebook/notebook/ui-tests/test/links.spec.ts:44:12
// Copyright (c) Jupyter Development Team.

Check failure on line 1 in ui-tests/test/notebook.spec.ts

GitHub Actions / ui-tests (chromium)

[chromium] › test/notebook.spec.ts:24:7 › Notebook › Title should be rendered

1) [chromium] › test/notebook.spec.ts:24:7 › Notebook › Title should be rendered ───────────────── Error: "apiRequestContext.fetch: Target page, context or browser has been closed Call log: - → POST http://localhost:8888/api/sessions?1734805291577 - user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/130.0.6723.31 Safari/537.36 - accept: */* - accept-encoding: gzip,deflate,br - accept-language: en-US - content-type: text/plain;charset=UTF-8 - cookie: username-localhost-8888="2|1:0|10:1734805289|23:username-localhost-8888|196:eyJ1c2VybmFtZSI6ICIwZDFhZjY3ODIzZWM0NzRhODIyMWQ1MThmM2E3ODVhZiIsICJuYW1lIjogIkFub255bW91cyBFdXJvcGEiLCAiZGlzcGxheV9uYW1lIjogIkFub255bW91cyBFdXJvcGEiLCAiaW5pdGlhbHMiOiAiQUUiLCAiY29sb3IiOiBudWxsfQ==|4908535ef63410ecfaa1e66f9c2ae24c8bafbf3c96d12a97cc37294093d079d2"; _xsrf=2|52664bfe|64440765e9523949bdf4af5a77bf2423|1734805289 - origin: http://localhost:8888 - referer: http://localhost:8888/notebooks/test-notebook-Notebook-Title-should-be-rendered-chromium/example.ipynb - x-xsrftoken: 2|52664bfe|64440765e9523949bdf4af5a77bf2423|1734805289 - sec-ch-ua: "Chromium";v="130", "HeadlessChrome";v="130", "Not?A_Brand";v="99" - sec-ch-ua-mobile: ?0 - sec-ch-ua-platform: "Linux" - content-length: 173 - ← 201 Created - server: TornadoServer/6.4.2 - content-type: application/json - date: Sat, 21 Dec 2024 18:21:31 GMT - x-content-type-options: nosniff - content-security-policy: frame-ancestors 'self'; report-uri /api/security/csp-report; default-src 'none' - location: /api/sessions/66b37ae2-4d87-44eb-acf4-7946794ee549 - content-length: 514 " while running route callback. Consider awaiting `await page.unrouteAll({ behavior: 'ignoreErrors' })` before the end of the test to ignore remaining routes in flight. at /home/runner/work/notebook/notebook/ui-tests/node_modules/@jupyterlab/galata/src/galata.ts:961:49
// Distributed under the terms of the Modified BSD License.
import path from 'path';