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

Does not seem to work with yarn workspaces #224

Open
aaronjensen opened this issue Feb 6, 2019 · 1 comment
Open

Does not seem to work with yarn workspaces #224

aaronjensen opened this issue Feb 6, 2019 · 1 comment

Comments

@aaronjensen
Copy link

I use yarn workspaces and greenkeeper-lockfile@2. A dependency was updated on one of the packages in the repo (the main package.json was not changed).

When running update, I see this:

Switched to branch 'greenkeeper/default/serverless-1.37.0'
package.json: No dependency changed
functions/package.json: Without either an "npm-shrinkwrap.json", "package-lock.json" or "yarn.lock" file present there is no need to run this script

The functions package.json changed, but its yarn.lock is in the root because that's how yarn workspaces work.

Then, when running upload, I saw this:

Only uploading on one build job

Which doesn't actually mean anything to me. Is that a bad thing? Did it upload my lockfile or not? I'm not seeing it in the branch, but I don't know if that's because my build failed (due to an intermittently failing test).

Does greenkeeper-lockfile actually work with workspaces and just have misleading output and not work when the build fails, or is it actually broken in this scenario?

Thanks!

@jbinto
Copy link

jbinto commented Mar 1, 2019

Same problem here.

Only uploading on one build [...] Is that a bad thing? Did it upload my lockfile or not?

I interpret Only uploading on one build job when running greenkeeper-lockfile-upload as trying to make sure it doesn't commit/push multiple times, in the case the job is re-run on CI or if there are new commits. The intention appears to be prevent double pushes, but this message is misleading when zero pushes have happened.

For CircleCI it comes down to this line:

uploadBuild: env.CIRCLE_NODE_INDEX === `${env.BUILD_LEADER_ID || 0}` && isLockfileUpdate()

  uploadBuild: env.CIRCLE_NODE_INDEX === `${env.BUILD_LEADER_ID || 0}` && isLockfileUpdate()

For "re-builds" this fails on the first expression. For actual first-pass Greenkeeper PRs, it fails on the second expression. That just tests that the last commit was chore\(package\): update lockfiles.

This is because greenkeeper-lockfile-upload did not commit anything. It did not commit anything, as @aaronjensen points out, because it bailed when it saw no yarn.lock in the subpackages.

package.json: No dependency changed
packages/example-client/package.json: Without either an "npm-shrinkwrap.json", "package-lock.json" or "yarn.lock" file present there is no need to run this script
packages/example-server/package.json: Without either an "npm-shrinkwrap.json", "package-lock.json" or "yarn.lock" file present there is no need to run this script

resir014 added a commit to commonlabs-id/pinjollist that referenced this issue May 4, 2019
Turns out Greenkeeper doesn't work well with Yarn Workspaces, so we're
turning it off.

Reference: greenkeeperio/greenkeeper-lockfile#224
resir014 added a commit to commonlabs-id/pinjollist that referenced this issue May 4, 2019
* chore(yarn): disable yarn workspaces

Turns out Greenkeeper doesn't work well with Yarn Workspaces, so we're
turning it off.

Reference: greenkeeperio/greenkeeper-lockfile#224

* fix: fixed weird styled-components issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants