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

Set up the releaser workflow #34

Closed
4 tasks done
brichet opened this issue May 16, 2024 · 21 comments
Closed
4 tasks done

Set up the releaser workflow #34

brichet opened this issue May 16, 2024 · 21 comments
Labels
enhancement New feature or request maintenance Packaging, tests

Comments

@brichet
Copy link
Collaborator

brichet commented May 16, 2024

Task list to set up the releaser workflow:

  • Add the jupyterlab releaser bot Github App (done by default)
  • Create a "release" environment
  • Add APP_ID variable, NPM_TOKEN and APP_PRIVATE_KEY secrets to that environment (coming from the Github app)
  • Configure the ruleset on branch and tag to allow the Github app to bypass it

cc @jtpio

@brichet brichet added the enhancement New feature or request label May 16, 2024
@jtpio
Copy link
Member

jtpio commented May 16, 2024

Add APP_ID variable, NPM_TOKEN and APP_PRIVATE_KEY secrets to that environment (coming from the Github app)

These should now be set ✔️

@brichet
Copy link
Collaborator Author

brichet commented May 16, 2024

thanks @jtpio
I can't see the NPM_TOKEN in the secrets. Is it not required too?

@jtpio
Copy link
Member

jtpio commented May 16, 2024

It's in the Actions secrets:

image

@brichet
Copy link
Collaborator Author

brichet commented May 16, 2024

OK thanks, in nbgrader it is set in the environment secrets, don't know if it make a difference.

image

@jtpio
Copy link
Member

jtpio commented May 16, 2024

Ah, it's probably equivalent. For reference I looked at the jupyter-collaboration repo since it was recently set up to use the GitHub for releasing. Both APP_PRIVATE_KEY and NPM_TOKEN are accessed via secrets.:

https://github.com/jupyterlab/jupyter-collaboration/blob/adb51b0efd22e63c0110c08dacfc61aebb8ef559/.github/workflows/publish-release.yml#L28

https://github.com/jupyterlab/jupyter-collaboration/blob/adb51b0efd22e63c0110c08dacfc61aebb8ef559/.github/workflows/publish-release.yml#L42

@jtpio
Copy link
Member

jtpio commented May 16, 2024

Also it looks like we still to update the releaser workflows to use the GitHub app, as there is still a mention of ADMIN_GITHUB_TOKEN:

token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

@brichet
Copy link
Collaborator Author

brichet commented May 16, 2024

Yes, I saw that too, I'll open a PR with an update

@brichet
Copy link
Collaborator Author

brichet commented May 16, 2024

The releaser workflow failed to publish assets https://github.com/jupyterlab/jupyter-chat/actions/runs/9118046663/job/25070279419#step:5:157.
It seems to be related to a PyPI token.

@jtpio
Copy link
Member

jtpio commented May 17, 2024

Could it be because there is a pyproject.toml file, but no Python package to publish? https://github.com/jupyterlab/jupyter-chat/blob/main/pyproject.toml

Do we need this file, or could the releaser config be moved to the package.json and this file be deleted?

@brichet
Copy link
Collaborator Author

brichet commented May 17, 2024

There are python packages :

python_packages = [
"packages/jupyterlab-collaborative-chat",
"packages/jupyterlab-ws-chat"
]

The project is a monorepo containing one javascript package and 2 jupyterlab extension, including python packages.

@jtpio
Copy link
Member

jtpio commented May 17, 2024

Ah ok, then yes we need to set up the project on PyPI.

The easiest would probably to publish a placeholder package (with version 0.0.0a0), and set up the trusted publisher via the settings page of the project on PyPI.

@jtpio
Copy link
Member

jtpio commented May 17, 2024

Also since this repo is under the jupyterlab org (jupyterlab/frontends-team-compass#247) we could move the package to the Jupyter organization on PyPI, and put it under the JupyterLab team, once a first version is published.

@brichet
Copy link
Collaborator Author

brichet commented May 17, 2024

The easiest would probably to publish a placeholder package (with version 0.0.0a0), and set up the trusted publisher via the settings page of the project on PyPI.

Thanks, it should work now.

I guess this is the same issue with npmjs: https://github.com/jupyterlab/jupyter-chat/actions/runs/9124554676/job/25088955159#step:5:254

I can probably create placeholder for jupyterlab-collaborative-chat and jupyterlab-ws-chat, but I don't have rights to create @jupyter/chat package.

@jtpio
Copy link
Member

jtpio commented May 17, 2024

That's strange, the jupyterlab-release-bot npm account should normally be able to publish the npm package directly without a placeholder.

@jtpio
Copy link
Member

jtpio commented May 17, 2024

Oh, maybe it's because that package is under the @jupyter scope and not the @jupyterlab scope.

If so, we can update the NPM_TOKEN to be the one for jupyter-release-bot (and not jupyterlab-release-bot), and check if it helps.

@jtpio
Copy link
Member

jtpio commented May 17, 2024

OK I have updated the NPM_TOKEN:

image

Let's try again and see if that fixes it?

@brichet
Copy link
Collaborator Author

brichet commented May 17, 2024

OK I have updated the NPM_TOKEN:

image

Let's try again and see if that fixes it?

Good catch, thanks for the update

@jtpio
Copy link
Member

jtpio commented May 17, 2024

That might actually not work, because it looks like the jupyter-release-bot npm account is not part of the jupyterlab organization on npm:

image

Is there any reason for naming the package @jupyter/chat, or could @jupyterlab/chat also work?

@brichet
Copy link
Collaborator Author

brichet commented May 17, 2024

Looks like it worked: 🎉 https://github.com/jupyterlab/jupyter-chat/releases

Is there any reason for naming the package @jupyter/chat, or could @jupyterlab/chat also work?

At first, it was named @jupyterlab/chat. Then we change it because it can be used with other jupyter-frontends applications.

For the extensions, since they were using the jupyterlab extension system, I choose to prefix them with jupyterlab_ (even if they should work with Notebook as well).

I don't have a strong opinion on it. Are you aware of any open discussion of org subprojects since the switch to jupyter-frontends?

@brichet brichet added the maintenance Packaging, tests label May 17, 2024
@jtpio
Copy link
Member

jtpio commented May 17, 2024

OK thanks for the extra context 👍

I think it's fine to keep the jupyterlab_ prefix, as most of the ecosystem uses it. And even if other frontends such as Notebook 7 are different applications, they are still based on JupyterLab components.

@brichet
Copy link
Collaborator Author

brichet commented May 17, 2024

Thanks @jtpio for helping with the release workflow

@brichet brichet closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintenance Packaging, tests
Projects
None yet
Development

No branches or pull requests

2 participants