Open emmenko opened 7 years ago
Short update here: in the last greenkeeper branch, it did work out at the end. By looking at the circleci env variables, it seems that at the time the build started, the PR was not created yet, thus the lockfile update
worked as expected.
I'm wondering then if it's more of a race condition problem. By the time the build starts, if the PR is already created the lockfile update will be skipped, if the PR has not been created yet the lockfile update will run.
I have a quick-fix branch here, that others can use. I'm not sure why we would want to ignore some branches from updating:
yarn global add greenkeeper-lockfile@github:jasonLaster/greenkeeper-lockfile
it seems that updating is cheap...
Unsure about cheap, these are commits on the branch, we don’t want to be lackluster about them.
Yarn would randomly fail to install this patch so I got this to work instead: yarn global add https://github.com/jasonLaster/greenkeeper-lockfile.git
In CircleCI it's difficult to detect whether or not a build is running on a pull request or a branch. This is from the Danger.js docs:
For setting up Circle CI, we recommend turning on "Only Build pull requests." in "Advanced Setting." Without this enabled, it is really tricky for Danger to know whether you are in a pull request or not, as the environment metadata isn't reliable. This may be different with Circle v2.
I wonder… would unsetting CI_PULL_REQUEST
in the invocation of greenkeeper-lockfile-update
have the same effect as @jasonLaster's quick-fix? This issue creates a bunch of extra work in Shields and I'd be happy for a workaround, especially if a correct solution is not possible. We squash-merge PR, so extra commits on the PR branch are not an issue.
Hey guys,
we've noticed that on CircleCI
greenkeeper-lockfile
always skips to update.This already happens when greenkeeper creates the branch (first commit).
By looking at the code it seems that the problem comes from
correctBuild
beingfalse
.https://github.com/greenkeeperio/greenkeeper-lockfile/blob/e4ba1a322fab59b602c60d3f5427096a1775fe23/update.js#L33-L35
which is determined by
https://github.com/greenkeeperio/greenkeeper-lockfile/blob/e4ba1a322fab59b602c60d3f5427096a1775fe23/ci-services/circleci.js#L9
Now, if I look at the CI variables the
CI_PULL_REQUEST
is setSo it seems that for CircleCI it will always skip to update.
What is the reason for using
_.isEmpty(env.CI_PULL_REQUEST)
? Is this supposed to work differently?Thanks for the help!