Skip to content
Merged
Show file tree
Hide file tree
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
15 changes: 0 additions & 15 deletions .github/actions/build-dist/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,14 @@ runs:
run: |
hatch build

- name: Build npm distributions
shell: bash
run: |
mkdir pkgs
hatch run npm_pack
cp packages/*/*.tgz pkgs

- name: Build checksum file
shell: bash
run: |
cd dist
sha256sum * | tee SHA256SUMS
cd ../pkgs
sha256sum * | tee SHA256SUMS

- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: notebook-dist-${{ github.run_number }}
path: ./dist

- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: notebook-pkgs-${{ github.run_number }}
path: ./pkgs
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ jobs:
hatch run lint:build
pipx run interrogate -v .
pipx run doc8 --max-line-length=200 docs/source *.md
npm install -g yarn
yarn
yarn eslint:check
yarn prettier:check
yarn build:utils
yarn integrity
python -m pip install -U "jupyterlab>=4.6.0a0,<4.7"
jlpm
jlpm eslint:check
jlpm prettier:check
jlpm build:utils
jlpm integrity

tests_check: # This job does nothing and is only used for the branch protection
if: always()
Expand Down
88 changes: 70 additions & 18 deletions .github/workflows/buildutils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,84 @@ jobs:
git config --global user.email "you@example.com"
git config --global user.name "Your Name"

- name: Reset version
- name: Check Notebook versioning flow
run: |
set -eux

assert_release_state() {
local py_expected="$1"
local js_expected="$2"

test "$(hatch version)" = "${py_expected}"
grep -nF "__version__ = \"${py_expected}\"" notebook/_version.py
grep -nF "\"version\": \"${js_expected}\"" \
buildutils/package.json \
packages/application/package.json \
packages/lab-extension/package.json
grep -nF "\"@jupyter-notebook/application\": \"^${js_expected}\"" \
packages/application-extension/package.json \
packages/lab-extension/package.json
grep -nF "\"@jupyter-notebook/application\": \"~${js_expected}\"" \
app/package.json
grep -nF '"version": "0.1.0"' package.json ui-tests/package.json
}

hatch version 9.8.7
jlpm run lerna version 9.8.7 --no-push --force-publish --no-git-tag-version --yes
jlpm run set:workspace-version 9.8.7
git commit -am "Release 9.8.7"
assert_release_state 9.8.7 9.8.7

- name: Patch Release
run: |
jlpm release:patch --force
jlpm release:bump next --skip-commit
assert_release_state 9.8.8 9.8.8
git restore .

- name: Minor Release
run: |
jlpm release:bump minor --force
jlpm release:patch
assert_release_state 9.8.8 9.8.8

jlpm release:bump minor
assert_release_state 9.9.0a0 9.9.0-alpha.0

jlpm release:bump next --skip-commit
assert_release_state 9.9.0a1 9.9.0-alpha.1
git restore .

jlpm release:bump release
assert_release_state 9.9.0b0 9.9.0-beta.0

jlpm release:bump release
assert_release_state 9.9.0rc0 9.9.0-rc.0

jlpm release:bump release
assert_release_state 9.9.0 9.9.0

- name: Release Cycle
jlpm release:bump major
assert_release_state 10.0.0a0 10.0.0-alpha.0

- name: Check dependency update helper
run: |
# beta
jlpm release:bump release --force
# rc
jlpm release:bump release --force
# final
jlpm release:bump release --force

- name: Major Release
set -eux

UPDATE_LOG="$(
jlpm update:dependency @jupyterlab/application '~4.5.0-rc.1' --dry-run 2>&1
)"
printf '%s\n' "${UPDATE_LOG}"

grep -F 'packages/application/package.json' <<< "${UPDATE_LOG}"
grep -F 'packages/lab-extension/package.json' <<< "${UPDATE_LOG}"
git diff --exit-code

- name: Check JupyterLab version update helpers
run: |
jlpm release:bump major --force
set -eux

EXACT_VERSION=$(node ./buildutils/lib/get-latest-lab-version.js --set-version v4.5.0rc1)
test "${EXACT_VERSION}" = "4.5.0rc1"

node ./buildutils/lib/upgrade-lab-dependencies.js --set-version 4.5.0rc1

grep -nF 'jupyterlab>=4.5.0rc1,<4.6' pyproject.toml .pre-commit-config.yaml
grep -nF '"@jupyterlab/application": "~4.5.0-rc.1"' app/package.json packages/lab-extension/package.json
git diff --name-only -- ui-tests/package.json | grep -Fx 'ui-tests/package.json'

npm:
runs-on: ubuntu-latest
Expand Down
74 changes: 46 additions & 28 deletions .github/workflows/upgrade-jupyterlab-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,40 @@ jobs:

echo "latest=${LATEST}" >> $GITHUB_ENV
jlpm upgrade:lab:dependencies --set-version ${LATEST}
if [[ ! -z "$(git status --porcelain package.json)" ]]; then
jlpm
jlpm deduplicate

cd ui-tests
jlpm
jlpm deduplicate
- name: Detect tracked changes
id: detect-changes
shell: bash
run: |
if [[ -n "$(git status --porcelain --untracked-files=no)" ]]; then
echo "has_changes=true" >> "$GITHUB_OUTPUT"
else
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi

- name: Refresh JavaScript lockfiles
if: steps.detect-changes.outputs.has_changes == 'true'
run: |
jlpm
jlpm deduplicate

cd ui-tests
jlpm
jlpm deduplicate

- uses: prefix-dev/setup-pixi@v0.9.4
if: steps.detect-changes.outputs.has_changes == 'true'
with:
pixi-version: v0.41.4
manifest-path: pyproject.toml
locked: false

- name: Update pixi.lock
if: steps.detect-changes.outputs.has_changes == 'true'
run: pixi install

- name: Create a PR
if: steps.detect-changes.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -97,32 +113,34 @@ jobs:
export LATEST=${{ env.latest }}
export BRANCH_NAME=update-to-v${LATEST}

# if resulted in any change:
if [[ ! -z "$(git status --porcelain package.json)" ]]; then
# if branch already exists.
if git ls-remote --heads origin | grep "refs/heads/${BRANCH_NAME}$" > /dev/null; then
echo "Branch '${BRANCH_NAME}' exists."
else
# new branch is created
git checkout -b "${BRANCH_NAME}"
git config user.name "github-actions[bot]"
git config user.email 'github-actions[bot]@users.noreply.github.com'
if [[ -z "$(git status --porcelain --untracked-files=no)" ]]; then
echo "No tracked changes to commit."
exit 0
fi

git commit . -m "Update to JupyterLab v${LATEST}"
# if branch already exists.
if git ls-remote --heads origin | grep "refs/heads/${BRANCH_NAME}$" > /dev/null; then
echo "Branch '${BRANCH_NAME}' exists."
else
# new branch is created
git checkout -b "${BRANCH_NAME}"
git config user.name "github-actions[bot]"
git config user.email 'github-actions[bot]@users.noreply.github.com'

git push --set-upstream origin "${BRANCH_NAME}"
git commit . -m "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."
)
git push --set-upstream origin "${BRANCH_NAME}"

# Add --repo flag only if target_repo is specified
if [[ -n "${{ inputs.target_repo }}" ]]; then
PR_ARGS+=(--repo "${{ inputs.target_repo }}")
fi
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."
)

gh pr create "${PR_ARGS[@]}"
# 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
21 changes: 0 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,6 @@ Running the end to end tests in headful mode will trigger something like the fol

![playwright-headed-demo](https://user-images.githubusercontent.com/591645/141274633-ca9f9c2f-eef6-430e-9228-a35827f8133d.gif)

## Tasks caching

The repository is configured to use the Lerna caching system (via `nx`) for some of the development scripts.

This helps speed up rebuilds when running `jlpm run build` multiple times to avoid rebuilding packages that have not changed on disk.

You can generate a graph to have a better idea of the dependencies between all the packages using the following command:

```
npx nx graph
```

Running the command will open a browser tab by default with a graph that looks like the following:

![a screenshot showing the nx task graph](https://github.com/jupyter/notebook/assets/591645/34eb46f0-b0e5-44b6-9430-ae5fbd673a4b)

To learn more about Lerna caching:

- https://lerna.js.org/docs/features/cache-tasks
- https://nx.dev/docs/features/cache-task-results

### Updating reference snapshots

Often a PR might make changes to the user interface, which can cause the visual regression tests to fail.
Expand Down
1 change: 0 additions & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@
},
"devDependencies": {
"@jupyterlab/builder": "~4.6.0-alpha.4",
"@jupyterlab/buildutils": "~4.6.0-alpha.4",
"@rspack/cli": "^1.7.1",
"@rspack/core": "^1.7.1",
"@types/rimraf": "^3.0.2",
Expand Down
Loading
Loading