Fallback to plugin for Git data if no data found in builds#401
Fallback to plugin for Git data if no data found in builds#401benjie332 wants to merge 2 commits intojenkinsci:masterfrom ixaris:git-commit-update
Conversation
…to using the plugin's data regarding Git commits/branches if no Git data is stored with the build. This can occur if the job does not use a Git SCM (such as a multi-job that triggers other jobs).
|
I think it would be even better to remove the whole "magical" code that relies on the data of the git-plugin. The CauseData should contain all relevant information for retrieving MR builds. |
|
Fair enough. I tried that first, but found a few breaking tests so I decided to play it safe. Question though, the build utils differentiates between merges..is that a workaround for Jenkins and the fact that you can try a merge before a build? If we go for CauseData that won't matter anymore |
…e now made based on this plugin's own data Refactored tests to trigger builds via plugin (as Jenkins based builds will no longer have the necessary data)
|
I dropped all Jenkins related logic from the BuildUtil class. I had to rework a few tests as Jenkins-triggered builds will no longer be considered by the plugin. Not sure if this is a bit of a regression? It fits our use-case perfectly, but other configurations might suffer if we don't use the fallback approach. |
|
@benjie332 are you still interested in working on this PR? |
|
Yes, time is a little limited though! At the moment the pull request should
have all the refactoring done, but probably needs syncing.
Do you have any thoughts on the possible breakages in user configurations?
…On 13 Dec 2016 22:39, "Owen Mehegan" ***@***.***> wrote:
@benjie332 <https://github.com/benjie332> are you still interested in
working on this PR?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#401 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADAnAUjQxTaA6-Ukf0NyVlPBdDzzWDmgks5rHxCcgaJpZM4JuI4g>
.
|
|
@benjie332 @omehegan |
|
Ok I fully caught up now - as @HeikoBoettger mentioned, pull request #431 is essentially this pull request + some rebasing and conflict resolution. I have no problems with #431 being merged instead of this as they are essentially the same thing |
Updated the BuildUtil (and all processes that query builds) to fallback to using the plugin's data regarding Git commits/branches if no Git data is stored with the build. This can occur if the job does not use a Git SCM (such as a multi-job that triggers other jobs).
Otherwise, merge request updates with no change in commit, such as a title change, would be registered as unbuilt by the plugin and trigger a (useless) new build.
Added tests for merge request handler for the case in question, and also manually tested this for Jenkins version 2.7.2 and GitLab version 8.9.1.
Feedback (especially for new tests) is more than welcome! No test failures were introduced with the change.