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

[.gitpod.yml generator] Use 'pnpm' package manager when there is a pnpm-lock.yaml file or the package.json specifies it #10731

Merged
merged 2 commits into from
Jul 25, 2022

Conversation

jankeromnes
Copy link
Contributor

@jankeromnes jankeromnes commented Jun 17, 2022

Description

When auto-generating a .gitpod.yml, look for a pnpm-lock.yaml file in the root of the repository, or a packageManager entry in package.json that starts with "pnpm". If it's a match, the wanted package manager is likely pnpm (instead of npm or yarn).

Related Issue(s)

Fixes #10374

How to test

  1. Open a repository using pnpm (which does not yet have a committed .gitpod.yml) in the preview environment
  2. The auto-generated .gitpod.yml should use pnpm (instead of npm or yarn)

Release Notes

[.gitpod.yml generator] Use 'pnpm' package manager when there is a pnpm-lock.yaml file or the package.json specifies it

Documentation

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jun 20, 2022

Hint: Reviewing without whitespace changes is easier: https://github.com/gitpod-io/gitpod/pull/10731/files?w=1

@jankeromnes jankeromnes marked this pull request as ready for review June 21, 2022 06:56
@jankeromnes jankeromnes requested a review from a team June 21, 2022 06:56
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Jun 21, 2022
Copy link
Contributor

@andrew-farries andrew-farries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a test for this to config-inferrer.spec.ts too.

@gengjiawen
Copy link
Contributor

We should add a test for this to config-inferrer.spec.ts too.

Is there easy way mock ctx for now ?

@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jun 29, 2022

Is there easy way mock ctx for now ?

@gengjiawen Yes, something like this is already set up here: https://github.com/gitpod-io/gitpod/blob/main/components/server/src/config/config-inferrer.spec.ts

FYI, given that I'll be on holidays for a few weeks -- please feel free to re-appropriate my PR and add a test to the spec file 👍 (or, you can also feel free to leave this hanging, and I'll update this PR when I'm back from holidays 🌴)

@gengjiawen
Copy link
Contributor

@jankeromnes friendly ping

…k.yaml file or the package.json specifies it

Co-authored-by: Jiawen Geng <[email protected]>
@jankeromnes
Copy link
Contributor Author

jankeromnes commented Jul 25, 2022

New tests run and pass:

[components/server:app]   config inferrer
[components/server:app]     ✓ [node] yarn
[components/server:app]     ✓ [node] npm
[components/server:app]     ✓ [node] pnpm

@jankeromnes jankeromnes marked this pull request as ready for review July 25, 2022 14:30
@roboquat roboquat merged commit c704b81 into main Jul 25, 2022
@roboquat roboquat deleted the jx/pnpm branch July 25, 2022 14:31
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note size/L team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

better .gitpod.yml generation
4 participants