notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Workflow to update JupyterLab dependencies automatically

Open itsmevichu opened this issue 1 year ago • 16 comments

Issue- #7271

Description: This workflow can be used to update all the jupyterlab dependecies to the latest release. This can also be manually triggered, which takes the JupyterLab version as an input.

Things to re-visit:

  • Github secrets, user, email - to create branch and raise PR.
  • Executing "yarn install" post dependency updates results in a substantial amount of modifications, with over 15,000 additions and 15,000 deletions. - Done
  • Scheduling time for cron job.

The created PR looks like - Sample pull-request

Feel free to adapt the workflow based on your requirements.

itsmevichu avatar Feb 27 '24 08:02 itsmevichu

Binder :point_left: Launch a Binder on branch itsmevichu/notebook/workflow-update-jupyterlab-dependencies

github-actions[bot] avatar Feb 27 '24 08:02 github-actions[bot]

Thanks @itsmevichu for looking into this!

jtpio avatar Feb 27 '24 08:02 jtpio

Executing "yarn install" post dependency updates results in a substantial amount of modifications, with over 15,000 additions and 15,000 deletions.

Maybe it's because it's using the default yarn (version 1), while the repo here uses yarn 3 via jlpm. So we would probably need to install jupyterlab and use jlpm.

jtpio avatar Feb 27 '24 08:02 jtpio

Thanks @itsmevichu.

Looks like this needs a lint pass.

jtpio avatar Mar 08 '24 09:03 jtpio

@jtpio The lint check is failing because of the coverage for the scripts. Is it possible for us to exclude the "scripts" folder from coverage checks?

itsmevichu avatar Mar 08 '24 13:03 itsmevichu

@jtpio I am fetching the latest versions of the lab dependencies from the below URL - https://raw.githubusercontent.com/jupyterlab/jupyterlab/v4.1.4/jupyterlab/staging/package.json.

The package "@jupyterlab/testutils" is not present in the above package.json. As a result, only that specific package won't get updated by this workflow.

itsmevichu avatar Mar 08 '24 13:03 itsmevichu

@jtpio The lint check is failing because of the coverage for the scripts. Is it possible for us to exclude the "scripts" folder from coverage checks?

Yes I think so. An alternative could be to write the scripts in TypeScript and put them alongside other scripts here: https://github.com/jupyter/notebook/tree/main/buildutils/src

The package "@jupyterlab/testutils" is not present in the above package.json. As a result, only that specific package won't get updated by this workflow.

Right it's fine, we only need to update the packages used here in the notebook repo.

jtpio avatar Mar 11 '24 12:03 jtpio

@jtpio I have converted the scripts to typescript and included them in the buildutils.

Pending tasks:

  1. To refer the appropriate secrets. https://github.com/jupyter/notebook/blob/2154f0f039e9a5f3b8c42f94934dc8f6023b7ecd/.github/workflows/upgrade-juypterlab-dependencies.yml#L67-L68
  2. Cron job timings. https://github.com/jupyter/notebook/blob/2154f0f039e9a5f3b8c42f94934dc8f6023b7ecd/.github/workflows/upgrade-juypterlab-dependencies.yml#L5

itsmevichu avatar Mar 31 '24 11:03 itsmevichu

@jtpio Are any changes needed in this PR? If not, we could simply utilize this workflow, as it would minimize the effort required to upgrade dependencies with each JupyterLab release.

itsmevichu avatar Jun 01 '24 11:06 itsmevichu

It would be really handy to have this in!

krassowski avatar Aug 26 '24 19:08 krassowski

It looks like it missed one package, "@jupyterlab/testutils": ~4.2.0

krassowski avatar Aug 26 '24 19:08 krassowski

@jtpio I am fetching the latest versions of the lab dependencies from the below URL - https://raw.githubusercontent.com/jupyterlab/jupyterlab/v4.1.4/jupyterlab/staging/package.json.

The package "@jupyterlab/testutils" is not present in the above package.json. As a result, only that specific package won't get updated by this workflow.

I noticed the same, but it seems that the @jupyterlab/testutils information is not present in our source package.json.

itsmevichu avatar Aug 27 '24 05:08 itsmevichu

I noticed the same, but it seems that the @jupyterlab/testutils information is not present in our source package.json.

I think it is under devDependencies.

krassowski avatar Aug 27 '24 11:08 krassowski

I noticed the same, but it seems that the @jupyterlab/testutils information is not present in our source package.json.

I think it is under devDependencies.

I've looked through, it appears to be missing from devDependencies. Can I proceed adding it in the respective jupyterlab's package.json?

itsmevichu avatar Aug 27 '24 12:08 itsmevichu

See this commit: https://github.com/jupyter/notebook/pull/7447/commits/f7f2ead7eb1575b42b0f438acdbb467949b642db

krassowski avatar Aug 27 '24 12:08 krassowski

See this commit: f7f2ead

It seems there was a misunderstanding. The source from which we get the latest release version https://raw.githubusercontent.com/jupyterlab/jupyterlab/v4.2.0/jupyterlab/staging/package.json doesn't include the @jupyterlab/testutils package, which is why the script isn't updating it here. I think we need to add this as a devDependency in the source jupyterlab/jupyterlab/staging/package.json first.

itsmevichu avatar Aug 27 '24 12:08 itsmevichu