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

Released JupyterLab uses different dependencies than the master yarn.lock specifies #11429

Closed
jasongrout opened this issue Nov 10, 2021 · 6 comments · Fixed by #11433
Closed
Labels
bug status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.

Comments

@jasongrout
Copy link
Contributor

Recently there was a bug in @lumino/commands version 1.18.0 which prevented arrow shortcut keys from working (see jupyterlab/lumino#255, jupyterlab/lumino#151, and jupyterlab/lumino#258; jlab issue at #11412).

It turns out that @lumino/commands 1.15.0 is what yarn.lock is locked to (this is the root yarn.lock file at the 3.2.2 release commit):

jupyterlab/yarn.lock

Lines 2352 to 2353 in 4852e50

"@lumino/commands@^1.12.0", "@lumino/commands@^1.15.0":
version "1.15.0"

However, something in the release process actually released JLab 3.2.2 using @lumino/commands 1.18.0 (this is the yarn.lock file in our 3.2.2 release staging directory at the same commit):

"@lumino/commands@^1.12.0", "@lumino/commands@^1.18.0":
version "1.18.0"

The end result is that we are releasing something that we are not seeing or testing in our dev branches. That concerns me, in that we can pick up regressions in dependencies that we won't catch in our normal dev workflow, like we did for 3.2.2.

@jasongrout jasongrout added the bug label Nov 10, 2021
@jtpio
Copy link
Member

jtpio commented Nov 10, 2021

Thanks Jason for catching this 👍

It looks like @lumino/commands was updated in this commit for 3.2.2: 4852e50. But many of the previous release commits also seem to be updating staging/yarn.lock so maybe that's been the case for a while already?

So probably something to do with the logic in update-core-mode.ts?

// Create a new yarn.lock file to ensure it is correct.
utils.run('jlpm', { cwd: staging });

@jasongrout
Copy link
Contributor Author

Here is where we create a new yarn.lock in the release process:

// Create a new yarn.lock file to ensure it is correct.
utils.run('jlpm', { cwd: staging });
try {
utils.run('jlpm yarn-deduplicate -s fewer --fail', { cwd: staging });
} catch {
// re-run install if we deduped packages!
utils.run('jlpm', { cwd: staging });
}

@jasongrout
Copy link
Contributor Author

Here is the commit where we started creating a fresh new yarn.lock file in the release process: 90693b8

This was during the 0.30 days years ago. @blink1073 - do you remember what problem we were trying to solve by creating a new yarn.lock rather than using something like the current yarn.lock? I remember discussing it, but I don't remember exactly the problem we were running up against.

@blink1073
Copy link
Contributor

Best I can remember is that the dependencies are different between the two top level packages, but I'm not sure if we considered allowing yarn to prune the unnecessary packages.

@jasongrout
Copy link
Contributor Author

do you remember what problem we were trying to solve by creating a new yarn.lock

Actually, looking at that commit where it was introduced (90693b8), we see that it was taking care of a duplication in the yarn.lock. It may be that we were simply trying to deal with yarn having a conservative update policy that easily introduces duplicates. These days, we also run the yarn-deduplicate script just after creating a new yarn.lock, so that original concern might be resolved anyway.

Best I can remember is that the dependencies are different between the two top level packages, but I'm not sure if we considered allowing yarn to prune the unnecessary packages.

Good point about the master yarn.lock containing a superset of the packages we need. I just tried copying the root yarn.lock to the staging directory and running jlpm, and it did indeed prune a lot of packages.

jasongrout added a commit to jasongrout/jupyterlab that referenced this issue Nov 10, 2021
Fixes jupyterlab#11429

Essentially, since we were creating a new yarn.lock when making a release, we were possibly upgrading dependencies in a release that we were not using in our dev branches. This meant we could introduce changes or regressions right when making a release that we would not see in our dev workflow. This change locks the release to the versions of packages we had been using in the dev process.
fcollonval pushed a commit that referenced this issue Nov 11, 2021
Fixes #11429

Essentially, since we were creating a new yarn.lock when making a release, we were possibly upgrading dependencies in a release that we were not using in our dev branches. This meant we could introduce changes or regressions right when making a release that we would not see in our dev workflow. This change locks the release to the versions of packages we had been using in the dev process.
@krassowski
Copy link
Member

I will just note that this caused another regression (in sanitizer! this could have gone very wrong) and made it difficult to debug because it was actually a dependency of sanitize-html that got updated and broke it (see #11473 (comment)) - and it was impossible to reproduce in dev mode/on binder because of this issue. Depending on how long we plan to support 3.2 (and on whether there is going to be 33.3), backporting the fix to 3.x might be useful for our sanity.

@github-actions github-actions bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label May 20, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants