jupyterlab / extension-template

A `copier` template for JupyterLab extensions
Creative Commons Zero v1.0 Universal
54 stars 17 forks source link

Check release & publish release workflow errors #42

Closed Rmarieta closed 1 year ago

Rmarieta commented 1 year ago

Description

Could not find any related issues despite getting this error with the most simple extension and after the first commit. My issue is that some of the workflows are failing with errors that seem a bit strange to me. The error that interrupts both the Populate Release step of the Step 2: Publish Release workflow and the Check Release of the Check Release workflow is the following :

...
npm notice === Tarball Details ===
npm notice name:          releasetest
npm notice version:       0.1.1
npm notice filename:      releasetest-0.1.1.tgz
npm notice package size:  4.3 kB
npm notice unpacked size: 11.7 kB
npm notice shasum:        a0e9f2b30fd7526837dd7e3ad359125de3316641
npm notice integrity:     sha512-GKXIuibxBSRAr[...]O+H2SEBPnV85g==
npm notice total files:   8
npm notice
releasetest-0.1.1.tgz
stderr:
 npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/runner/work/jupyterlab-test-release/jupyterlab-test-release/.jupyter_releaser_checkout/dist/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/runner/work/jupyterlab-test-release/jupyterlab-test-release/.jupyter_releaser_checkout/dist/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
...

To explore whether that could be caused by my extension in itself, I created a new empty extension with the last version of JupyterLab, and created a new public GitHub repository to host that extension, and ended up with the same error. The Check Release and Step 2: Publish Release workflows are both still failing with the same error.

Reproduce

  1. Create new public GitHub repository

  2. Create new extension and seed the project with the template :

    conda create -n release-test --override-channels --strict-channel-priority -c conda-forge -c nodefaults jupyterlab=4 nodejs=18 git copier jinja2-time
    conda activate release-test
    mkdir release-test
    cd release-test
    copier copy --UNSAFE https://github.com/jupyterlab/extension-template .
    pip install -ve .
    jupyter labextension develop . --overwrite
  3. Push code to GitHub repository :

    git init
    git add .
    git commit -m "First commit"
    git branch -M main
    git remote add origin https://github.com/<path-to-repo>.git
    git push -u origin main
  4. Then this triggers the Check Release workflow. Set up job, Checkout and Base Setup pass but Check Release does not. Full log can be seen at : GitHub Actions job link.

  5. If I now also try to manually trigger both Step 1: Prep Release and Step 2: Publish Release by providing my ADMIN_GITHUB_TOKEN, NPM_TOKEN and PYPI_TOKEN in my secrets, I also get the same error during the Step 2: Publish Release workflow.

Expected behavior

I would expect the template extension Check Release and Step 2: Publish Release workflows to pass without errors if I haven't modified the source code of my extension yet.

Context

Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.

welcome[bot] commented 1 year ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

jtpio commented 1 year ago

Thanks @Rmarieta for reporting :+1:

Looks like this will be fixed by https://github.com/jupyter-server/jupyter_releaser/pull/522.

jtpio commented 1 year ago

Actually the issue might be related to the workspaces entry in package.json:

https://github.com/jupyterlab/extension-template/blob/e7e4c2bd3467aa3c5a8864e438e897c5f0439098/template/package.json.jinja#L31-L33

@Rmarieta would you be able to try without the workspaces field in package.json to see if it fixes the check release?

Rmarieta commented 1 year ago

I just tried removing the workspaces field and the check release still does not complete, but this time with a different error (see the full log here on my repository) :

...
➤ YN0000: ┌ Resolution step
Resolution step
  ➤ YN0002: │ @jupyterlab/services@npm:7.0.5 doesn't provide react (p4d970), requested by @jupyterlab/settingregistry
  ➤ YN0002: │ @jupyterlab/testutils@npm:4.0.5 doesn't provide typescript (pd72c2), requested by @jupyterlab/testing
  ➤ YN0002: │ releasetest@workspace:. doesn't provide webpack (p371b1), requested by css-loader
  ➤ YN0002: │ releasetest@workspace:. doesn't provide webpack (p47c78), requested by source-map-loader
  ➤ YN0002: │ releasetest@workspace:. doesn't provide webpack (p14490), requested by style-loader
  ➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 402ms
➤ YN0000: ┌ Post-resolution validation
Post-resolution validation
  ➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.
➤ YN0000: └ Completed
➤ YN0000: Failed with errors in 0s 515ms
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.4/x64/bin/jupyter-releaser", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/cli.py", line 119, in invoke
    util.run(hook)
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/util.py", line 94, in run
    raise e
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/util.py", line 86, in run
    process = tee(cmd, **kwargs)
              ^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/tee.py", line 159, in run
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command 'jlpm' returned non-zero exit status 1.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/actions/populate_release.py", line 38, in <module>
    run_action("jupyter-releaser build-npm")
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/actions/common.py", line 25, in run_action
    _run(target, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/util.py", line 94, in run
    raise e
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/util.py", line 86, in run
    process = tee(cmd, **kwargs)
              ^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.4/x64/lib/python3.11/site-packages/jupyter_releaser/tee.py", line 159, in run
    raise subprocess.CalledProcessError(
subprocess.CalledProcessError: Command 'jupyter-releaser build-npm' returned non-zero exit status 1.
jtpio commented 1 year ago

➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.

This time it looks like the yarn.lock file changes on CI.

You can try to run jlpm locally and it will likely modify that yarn.lock file. Then commit and push the changes.

krassowski commented 1 year ago

If there are no changes locally, you may also want to ensure that you use the JupyterLab and Node.js version as on the CI. I am not sure if a different operating system could also have an impact.

Rmarieta commented 1 year ago

➤ YN0028: │ The lockfile would have been modified by this install, which is explicitly forbidden.

This time it looks like the yarn.lock file changes on CI.

You can try to run jlpm locally and it will likely modify that yarn.lock file. Then commit and push the changes.

It worked, thank you for your help !