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

"Only running on first push of a new branch" error on new greenkeeper branch #50

Closed
patkub opened this issue Aug 11, 2017 · 7 comments
Closed

Comments

@patkub
Copy link
Contributor

patkub commented Aug 11, 2017

I am getting this error for new branches created by greenkeeper. I run greenkeeper-lockfile in CircleCI.
Branch: https://github.com/patkub/rmc1891-site/tree/greenkeeper/bs4-polymer-0.1.12
CircleCI: https://circleci.com/gh/patkub/rmc1891-site/736

Looks like issue #26 still occurs.

@ethanrubio
Copy link
Collaborator

It looks like this won't work CircleCI's new feature of workflows since the current check is to detect if CIRCLE_PREVIOUS_BUILD_NUM exists. Until a better solution is found, I'd recommend placing the greenkeeper updater in the first workflow since subsequent workflows will add CIRCLE_PREVIOUS_BUILD_NUM.

@patkub
Copy link
Contributor Author

patkub commented Aug 12, 2017

Still getting the same error after moving the greenkeeper updater to the first job in the workflow.
https://github.com/patkub/rmc1891-site/blob/master/.circleci/config.yml#L232

@janl
Copy link
Contributor

janl commented Oct 18, 2017

@patkub is this still the case and can you point to a current build that shows the behaviour? Thanks!

@patkub
Copy link
Contributor Author

patkub commented Oct 18, 2017

@janl yes this is still the case. I just updated my bs4-polymer package to version 0.2.2 which triggered:

The lockfile job says "Only running on first push of a new branch" for both the greenkeeper-lockfile-update and greenkeeper-lockfile-upload commands.

CircleCI config: https://github.com/patkub/rmc1891-site/blob/master/.circleci/config.yml

@ethanrubio
Copy link
Collaborator

@patkub It looks like when you have a workflow that runs the builds in parallel, you run into a race condition issue where whatever build starts first gets CIRCLE_PREVIOUS_BUILD_NUM="" (as you can see with this branch the first build #1290) while the other builds are given a number. Unfortunately, with the way that the current CirleCI check works, it does not handle this parallel case.

@patkub
Copy link
Contributor Author

patkub commented Oct 18, 2017

@ethanrubio Thank you for explaining the race condition issue. I got this to work by making lockfile the first job run and having every other job require lockfile to complete before running. This forces the lockfile job to run first in the workflow and get CIRCLE_PREVIOUS_BUILD_NUM="". Now the workflow looks like this: https://circleci.com/workflow-run/bf6ef80e-1a64-4371-9c99-69f997f7e303

Edit: fixed link

@janl
Copy link
Contributor

janl commented Oct 19, 2017

Thanks @ethanrubio & @patkub, we merged the README addition already.

@janl janl closed this as completed Oct 19, 2017
mattyclarkson added a commit to ef-carbon/tspm that referenced this issue Feb 14, 2018
The upload will fail with a `Only running on first push of new branch`
error if `CIRCLE_PREVIOUS_BUILD_NUM` is defined. That variable is
defined for every subsequent job. We need to run the lockfile update
in the first job. Luckily we have a job that runs at the start and
everything depends on it.

See greenkeeperio/greenkeeper-lockfile#50
mattyclarkson added a commit to ef-carbon/tspm that referenced this issue Feb 14, 2018
The upload will fail with a `Only running on first push of new branch`
error if `CIRCLE_PREVIOUS_BUILD_NUM` is defined. That variable is
defined for every subsequent job. We need to run the lockfile update
in the first job. Luckily we have a job that runs at the start and
everything depends on it.

See greenkeeperio/greenkeeper-lockfile#50
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
chore: try fixing greenkeepler lockfile script

chore: use github:jasonLaster/greenkeeper-lockfile

refs: greenkeeperio/greenkeeper-lockfile#58

chore(circleci): fix npm install command

chore(circleci): avoid installing tool globally

fix(greenkeeper): greenekeeper lockfile workaround

refs: greenkeeperio/greenkeeper-lockfile#50
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
chore: try fixing greenkeepler lockfile script

chore: use github:jasonLaster/greenkeeper-lockfile

refs: greenkeeperio/greenkeeper-lockfile#58

chore(circleci): fix npm install command

chore(circleci): avoid installing tool globally

fix(greenkeeper): greenekeeper lockfile workaround

refs: greenkeeperio/greenkeeper-lockfile#50
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
chore: try fixing greenkeepler lockfile script

chore: use github:jasonLaster/greenkeeper-lockfile

refs: greenkeeperio/greenkeeper-lockfile#58

chore(circleci): fix npm install command

chore(circleci): avoid installing tool globally

fix(greenkeeper): greenekeeper lockfile workaround

refs: greenkeeperio/greenkeeper-lockfile#50
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
chore: try fixing greenkeepler lockfile script

chore: use github:jasonLaster/greenkeeper-lockfile

refs: greenkeeperio/greenkeeper-lockfile#58

chore(circleci): fix npm install command

chore(circleci): avoid installing tool globally

fix(greenkeeper): greenekeeper lockfile workaround

refs: greenkeeperio/greenkeeper-lockfile#50
kt3k pushed a commit to recruit-tech/redux-pluto that referenced this issue Aug 1, 2018
chore: try fixing greenkeepler lockfile script

chore: use github:jasonLaster/greenkeeper-lockfile

refs: greenkeeperio/greenkeeper-lockfile#58

chore(circleci): fix npm install command

chore(circleci): avoid installing tool globally

fix(greenkeeper): greenekeeper lockfile workaround

refs: greenkeeperio/greenkeeper-lockfile#50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants