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

Jenkins: branchName splitting prevents detection of greenkeeper #145

Open
kaylee42 opened this issue Apr 23, 2018 · 2 comments
Open

Jenkins: branchName splitting prevents detection of greenkeeper #145

kaylee42 opened this issue Apr 23, 2018 · 2 comments

Comments

@kaylee42
Copy link
Contributor

In the jenkins ci-services file, branchName is set by performing some manipulation magic on the GIT_BRANCH env variable. However, the result of this manipulation is the prevention of recognizing a branch as a greenkeeper branch.

For instance: my GIT_BRANCH variable is greenkeeper/initial. Because of the drop in the above referenced line, branchName gets set to initial rather than the correct greenkeeper/initial, so it's falls into this conditional and I get an 'initial' is not a Greenkeeper branch error.

This was fixed in the (apparently now defunct ?? ) #73 by removing the branchName manipulation code. I'm happy to submit a new PR which removes this manipulation, but wasn't sure if it would be better for me to pick up #73 and complete the code review comments (though I'm not sure about the purpose of some of the other changes). Please advise and I'll get a PR in :)

@espy
Copy link
Contributor

espy commented Apr 27, 2018

Hi Kaylee,
thanks for the PR offer! If you do want to tackle this, here’s why the mangling happens: some customers use a git plugin for Jenkins that also prepends something to the branch name, the removal of which makes sense for them, but breaks everything for users like you, who use the other git plugin (apparently there’s two), which doesn’t prepend anything.

Currently, the branch prefix used by by Greenkeeper is always greenkeeper/ or greenkeeper-, so it’s safe to drop the first part of branchName if it doesn’t match greenkeeper, or drop everything before greenkeeper, both should work.

So it would make sense to pick up #73 again, but only do the drop with the condition described above. If you don’t have time, we'll fit it in next week.

Have a good weekend 👋

@kaylee42
Copy link
Contributor Author

@espy thanks! Just put in a PR for this #148 (I pulled down changes from #73 but couldn't push to that branch)

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