[JENKINS-26587]#296
[JENKINS-26587]#296toyPoodle wants to merge 7 commits intojenkinsci:masterfrom toyPoodle:JENKINS-26587
Conversation
|
Thank you for a pull request! Please check this document for how the Jenkins project handles pull requests |
|
Wrote short description in first commit description line |
|
👎 injected RPA in ghprb-plugin is a ghprb-plugin regression and this not a git-plugin issue. |
|
Sorry for delay in my answer, KostyaSha. Multiple scms plugin fails on the line https://github.com/jenkinsci/multiple-scms-plugin/blob/master/src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCM.java#L118. I also created a test to show it in this PR. Multiple scms plugin looks SCM agnostic at line 118 and I am not sure if introducing a dependency to git specific CommitHookCause would be a good idea. Additionally I found no way of removing RPA from build actions if I don't want to propagate it to the underlying GitSCM. Could you point me in the right direction? |
|
RPA is a design and it internal object, don't inject it to build, btw ghprb-plugin finally removed it one release before. |
|
rebased the branch on top of jenkinsci master (2be13e1) |
|
I think that there is a misunderstanding. I have found a problem when using Multiple SCMs Plugin. When searching for solutions, I found that users of ghprb-plugin had same issue. My changes are inspired only by Multiple SCMs Plugin. |
|
Do you mean that all SCMs are trying to checkout the same revision? Was RPA injected by CommitHook? |
|
How i can reproduce this error? |
|
RPA is injected at https://github.com/toyPoodle/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitStatus.java#L255. Multiple SCMs Plugin loops over all SCMs at https://github.com/jenkinsci/multiple-scms-plugin/blob/master/src/main/java/org/jenkinsci/plugins/multiplescms/MultiSCM.java#L116 and tries to check out few lines later. Since GitSCM checks for RPA at https://github.com/toyPoodle/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitSCM.java#L900 and I found no solution to suppress this, rev-parse fails on unknown commit and fails the build. You can reproduce the issue if you checkout the branch JENKINS-26587 in this repo, comment out code added by me at https://github.com/toyPoodle/git-plugin/blob/JENKINS-26587/src/main/java/hudson/plugins/git/GitSCM.java#L904 906, 907, 908 and run GitStatusMultipleSCMTest |
|
Yes, all SCMs try to check out same revision |
|
|
@KostyaSha : do you have time / are you interested in looking further at this PR? Or should I ask other devs to look at it? |
|
Ghprb expects hardcoded refspec, so such GItSCM configuration can be used only for building PRs. Injected RPA was already removed from ghprb. Not sure why GIT scm should be patched because of multiple SCMs. |
There was a problem hiding this comment.
Why it has "Cause" class if you are getting GitStatus.CommitHookCause.class ?
There was a problem hiding this comment.
Agree, makes no sense
|
Current logic is obvious: if RevisionParameterAction exists, then use it as candidate for build. Adding hacks with Cause looks a bad idea for me, because there are other plugins that may use Causes and it may affect somehow.
It maybe possible to add a |
|
As I already said above, my only issue is multiple-scms-plugin and not ghprb. If I knew that it would cause so many misunderstandings, I would've never mentioned it. Just forget I ever said it. I will look at the approach with RPA you mentioned. |
There are following cases now:
There are two points where I am unsure:
|
|
Is this fix merged into master release? |
|
@markya0616, this pull request is still in review. Git plugin version is 2.3.6-SNAPSHOT at the moment. I am periodically rebasing it on top of latest master commit from jenkinsci repo. |
|
@KostyaSha the pull request is ready to review again |
|
I am having this problem mentioned as well. It seems to occur on polling but not on manual builds. |
|
Would also love to see this fix included in a next release. |
|
I've checked out this PR and verified that it works well with multiple scms. It's reporting merge conflicts, but there were none when fetched. Thanks for the fix. |
|
I will try to rebase the branch this week to get rid of conflict warning. Hope the guys merge it then or give me feedback on how to improve it. |
|
Any progress on this issue? |
|
@athornz: updated. |
|
Any progress on this merge? |
|
I hope to evaluate this proposal in the next week. |
|
Will recheck commit messages. Dropping latest commit is not a problem. |
- extend CommitHookCause to contain repo URL to be able to check it on checkout in GitSCM - add test for the bug and CommitHookCause - extend TestGitRepo to return commit SHA1 for the committed file Conflicts: src/main/java/hudson/plugins/git/GitStatus.java
- commit notification log message no longer contains "null" when no repository URL is supplied
- remote URL is now stored in RPA instead of CommitHookCause - add some tests - fix comment in GitSCM to point to a Jenkins issue Conflicts: src/main/java/hudson/plugins/git/GitStatus.java
- remove unused parameter - remove unused import - fix compile error due to added parameter
- reduce inconsitency in indentation by converting spaces to tabs
- restore tab indents removed by previous commits
|
Changed commit messages to have an empty line after summary, also added a short description after issue key in every commit. Most entries are written now in imperative. |
There was a problem hiding this comment.
@MarkEWaite: your comment seems to be gone after rebase. Yes the change is to reduce the scope of envVars. It was used only in constructor.
|
I would rather not have the CommitCauseHook changes inserted in one commit, then removed in a subsequent commit. Would you be willing to consider my changes which switched it from 5 commits to a single commit? |
|
Sure. What is the procedure? Should I take over the commit you created or would you create a pull request for your changes? |
|
I'll handle the merge machinery after I've finished some further tests. I'll probably create a pull request, merge it, and close this pull request. |
|
Rebased and merged with 4979ace |
…on (and duplicated jenkinsci#187) See https://issues.jenkins-ci.org/browse/JENKINS-26587 and jenkinsci/git-plugin#296 for more information
…on (and duplicated jenkinsci#187) See https://issues.jenkins-ci.org/browse/JENKINS-26587 and jenkinsci/git-plugin#296 for more information
…on (and duplicated jenkinsci#187) See https://issues.jenkins-ci.org/browse/JENKINS-26587 and jenkinsci/git-plugin#296 for more information
https://issues.jenkins-ci.org/browse/JENKINS-26587