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

Trigger build on new push to pull requests #38

Closed
mikesir87 opened this issue Dec 6, 2013 · 32 comments
Closed

Trigger build on new push to pull requests #38

mikesir87 opened this issue Dec 6, 2013 · 32 comments

Comments

@mikesir87
Copy link
Contributor

(copying comments from blog)

-- Comment from 12/4 11:10

We tried to use your plugin with Stash Pull Requests, but encountered a problem, I know that it is on Stash side, but want to ask if you have some workaround in mind:

What we want to accomplish is:

  1. Open Pull Request in Stash for specific
  2. After Pull Request is openned trigger "Pull Request Build Job" in Jenkins
    (we are using Git Plugin in Jenkins and specifying refspec
    parameters: "+refs/pull-requests/:refs/remotes/origin/pull-requests/"
    and building the "origin/pull-requests/*/from" branch)
    Jenkins WebHook plugin is setup to trigger job by commit to Stash Repo
  3. Initiate Review process with changes discussion
  4. Do commit changes and update pull-request with new commits due to discussion
    (Here we get trouble, cause your plugin is sending trigger after commit, but poll scm from Jenkins can't find nothing, cause stash updates the reference - "refs/pull-requests/*/from" only if it was Approved in Pull Request)
  5. We want to Trigger Jenkins build for new commits in the "Pull Request Build Job"
  6. Review again, approve, merge

But to update reference and have additional commits in the same Pull we need to Approve and Unapprove each time after commit, which is makes no sense

Do you have any workaround or any ideas how to adopt this to Pull Requests process?

------ Comment on 12/4 11:57

I got a fast reply from Atlassian Developer according to this.
Michael could be interesting for you as a feature, since he also submitted some code snippet how to solve this - https://answers.atlassian.com/questions/239988/change-pull-request-refs-after-commit-instead-of-after-approval-or-workaround

@ashnazg
Copy link

ashnazg commented Dec 6, 2013

I'm confused, because our Jenkins jobs configured to watch pull requests already do pick up new commits to PRs and do builds for them.

Now, there is an odd behavior in Stash itself that I've not yet figured out, though I have found a workaround for it...

Occasionally, for a new commit added to an existing PR, if you click the link to view the commit, Stash returns a 404. I've even seen this happen repeatedly for several commit links on the same PR. Further, as long as these pages 404, I've seen that Jenkins is NOT getting notified about the commits, and thus no new builds.

The workaround here is to view the Diff tab on the PR. It's as though Stash having to handle the Diff view is what actually creates the individual Commit pages, and once these Commit pages are available and not 404ing, then the Jenkins notifications happen and new builds happen.

My app versions are: Stash v2.6.2; Jenkins v1.535.

@mikesir87
Copy link
Contributor Author

Hmm... nice to know. I haven't done too much with adding to pull requests yet, but plan on doing so this weekend to figure out what I may be able/need to do. Thanks for the info!

@mikesir87
Copy link
Contributor Author

So, it looks like I have the code working in its tests, but wanted to check in a real setup. However, I'm having trouble getting Jenkins to see the current pull requests. I tried following the instructions posted in the original issue, but got

Invalid refspec '+refs/pull-requests/:refs/remotes/origin/pull-requests/'

Was there any other setup you needed to perform to fetch those refs? I found a related Atlassian Answers post (https://answers.atlassian.com/questions/188883/building-pull-requests-from-stash-on-bamboo), but am interested in how you have your systems setup.

@melvyndekort
Copy link

Hi Michael,

Nice work!
I've used the following refspec:
+refs/pull-requests//merge:refs/remotes/origin/pr/
This builds only the merge commit.
The merge commit is the attempted merge of the pull request by Stash.

Let me know if you have any further problems with the setup!

Kind regards,

Melvyn de Kort

On Tue, Dec 17, 2013 at 4:47 AM, Michael Irwin notifications@github.comwrote:

So, it looks like I have the code working in its tests, but wanted to
check in a real setup. However, I'm having trouble getting Jenkins to see
the current pull requests. I tried following the instructions posted in the
original issue, but got

Invalid refspec '+refs/pull-requests/:refs/remotes/origin/pull-requests/'

Was there any other setup you needed to perform to fetch those refs? I
found a related Atlassian Answers post (
https://answers.atlassian.com/questions/188883/building-pull-requests-from-stash-on-bamboo),
but am interested in how you have your systems setup.


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-30724225
.

@ashnazg
Copy link

ashnazg commented Dec 17, 2013

Are you intentionally using /merge rather than /merge-clean? As best I can tell, watching /merge will mean triggering builds even though Stash already knows a merge will fail. If you instead only watch /merge-clean, then you'll only trigger a build if a PR can successfully merge to its target.

On our build system, I'd originally set up separate builds jobs to watch the various PR-related branches separately:

  • /from - run a build against the PR's source in its original state, without regard to the PR target
  • /merge-clean - run a build against the PR's target only if a merge was clean
  • /merge - run a build against the PR's target, even if the merge resulted in conflicts

I eventually realized that a /merge build for a good merge is just a duplicate of /merge-clean. Further, any /merge build without a duplicated /merge-clean build means I ran a build against corrupt code (because it contained conflicts), and thus the build actually meant nothing useful. The PR itself should be indicating the merge failure condition itself, without requiring a failed build alongside it.

@melvyndekort
Copy link

Hi Chuck,

Yes, this is intentional, since the merge-clean or merge-fail don't always
exist.
The new version of the Jenkins trigger will only inform Jenkins to build
when there are no conflicts, which means it actually is a clean merge.

Kind regards,

Melvyn de Kort

On Tue, Dec 17, 2013 at 6:55 PM, Chuck Burgess notifications@github.comwrote:

Are you intentionally using /merge rather than /merge-clean? As best I can
tell, watching /merge will mean triggering builds even though Stash already
knows a merge will fail. If you instead only watch /merge-clean, then
you'll only trigger a build if a PR can successfully merge to its target.

On our build system, I'd originally set up separate builds jobs to watch
the various PR-related branches separately:

  • /from - run a build against the PR's source in its original state,
    without regard to the PR target
  • /merge-clean - run a build against the PR's target only if a merge
    was clean
  • /merge - run a build against the PR's target, even if the merge
    resulted in conflicts

I eventually realized that a /merge build for a good merge is just a
duplicate of /merge-clean. Further, any /merge build without a duplicated
/merge-clean build means I ran a build against corrupt code (because it
contained conflicts), and thus the build actually meant nothing useful. The
PR itself should be indicating the merge failure condition itself, without
requiring a failed build alongside it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-30774029
.

@melvyndekort
Copy link

By the way Chuck, you should read the response of Bryan Turner (Atlassian
Stash Dev) in this thread:
https://answers.atlassian.com/questions/239988/change-pull-request-refs-after-commit-instead-of-after-approval-or-workaround

He says here that since Stash 2.9 the /merge commit doesn't exist at all
when there are conflicts, it seems that the /merge-clean is replaced by the
/merge.
In my local Stash (Atlassian SDK) installation, which is 2.9, I don't see
any /merge-clean entries under refs/pull-requests/*/.
This is why the /merge should be used in Jenkins and not /merge-clean.

The soon to be updated stash-jenkins-postreceive-webhook plugin will only
trigger Jenkins when there are NO conflicts.
And only when there are no conflicts the /merge will exist, this way only
valid builds will be executed.

Kind regards,

Melvyn de Kort

On Wed, Dec 18, 2013 at 10:10 AM, Melvyn de Kort melvyn@mdekort.nl wrote:

Hi Chuck,

Yes, this is intentional, since the merge-clean or merge-fail don't always
exist.
The new version of the Jenkins trigger will only inform Jenkins to build
when there are no conflicts, which means it actually is a clean merge.

Kind regards,

Melvyn de Kort

On Tue, Dec 17, 2013 at 6:55 PM, Chuck Burgess notifications@github.comwrote:

Are you intentionally using /merge rather than /merge-clean? As best I
can tell, watching /merge will mean triggering builds even though Stash
already knows a merge will fail. If you instead only watch /merge-clean,
then you'll only trigger a build if a PR can successfully merge to its
target.

On our build system, I'd originally set up separate builds jobs to watch
the various PR-related branches separately:

  • /from - run a build against the PR's source in its original state,
    without regard to the PR target
  • /merge-clean - run a build against the PR's target only if a merge
    was clean
  • /merge - run a build against the PR's target, even if the merge
    resulted in conflicts

I eventually realized that a /merge build for a good merge is just a
duplicate of /merge-clean. Further, any /merge build without a duplicated
/merge-clean build means I ran a build against corrupt code (because it
contained conflicts), and thus the build actually meant nothing useful. The
PR itself should be indicating the merge failure condition itself, without
requiring a failed build alongside it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-30774029
.

@ashnazg
Copy link

ashnazg commented Dec 18, 2013

That's good info. I've always been a bit worried about hitting those internal refs like that, as anything non-API is subject to change like that. I'll have to keep these things in mind when we migrate into the newer Stash versions.

@mikesir87
Copy link
Contributor Author

Ok. Just pushed up the new code. Want to take a look and see how it works out for ya? I'll take another stab at getting my own instance working.

@melvyndekort
Copy link

I'll take a look at it in the morning, it's 10:22 pm here in the Netherlands ;-)

@mikesir87
Copy link
Contributor Author

Sounds good! Have a good night! :)
On Jan 2, 2014 4:23 PM, "Melvyn de Kort" notifications@github.com wrote:

I'll take a look at it in the morning, it's 10:22 pm here in the
Netherlands ;-)


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-31485785
.

@melvyndekort
Copy link

Doesn't work yet, the IsMergeableEligibilityFilter still assumes all incoming events are of type PullRequestRescopedEvent.
In my pull-request I've modified the IsMergeableEligibilityFilter to cope with all 3 types of PullRequestEvents, maybe you can use that one?

@mikesir87
Copy link
Contributor Author

Wow... totally missed that for some reason. Thanks for letting me know. I'll get it patched up using your code.

@mikesir87
Copy link
Contributor Author

Ok. Just pushed up another code set (forgot to tag the issue in it). Should work for ya now. :)

@melvyndekort
Copy link

Yep, that did it, successfuly tested open, decline -> reopen and rescope.
I'd say issue closed ;-)
Will you also build a new release for the Stash plugin manager?

@mikesir87
Copy link
Contributor Author

Sounds great! I'll go ahead and prepare it for release and get it updated in the Atlassian Marketplace. I'm not sure how quickly it'll propagate through their system, so may take a little while before it shows up.

Thanks for all of your help!

@melvyndekort
Copy link

No problem, we needed it, so I'm happy to help.
By the way, I might already have the next project for you.... a button which allows a manual Jenkins trigger, not automated. ;-)
Shall I create a new issue for it? I can explain in the issue why we'd like it.

@mikesir87
Copy link
Contributor Author

Sure thing. May not be what you have in mind, but for the mean time, you can always trigger by testing the settings from the webhook settings panel. Hitting the test button does send a trigger to Jenkins. But, I'd be happy to hear what you've got in mind. :)

@melvyndekort
Copy link

That would indeed temporarily help us.
I've created the issue (#45) with my explanation.

@ashnazg
Copy link

ashnazg commented Jan 8, 2014

Hey Mike, I can report working behavior from a pull request we processed through yesterday, via Stash 2.10 :-). However, once the PR was merged, our separate job that watches the DEVELOP branch in order to do post-merge builds was never triggered. We saw this error in the Stash log:

'com.atlassian.stash.event.pull.PullRequestMergedEvent[source=com.atlassian.stash.internal.pull.PullRequestServiceImpl@27fe07f9]' for the invoker 'SingleParameterMethodListenerInvoker{method=public void com.nerdwin15.stash.webhook.RepositoryChangeListener.onRefsChangedEvent(com.atlassian.stash.event.RepositoryRefsChangedEvent), listener=com.nerdwin15.stash.webhook.RepositoryChangeListener@724633e6}'.
java.lang.RuntimeException: This pull request has already been merged.

Is perhaps one of those PR-related filters mentioned earlier unintentionally blocking non-PR event posts now?

@mikesir87
Copy link
Contributor Author

@ashnazg - I'm looking into it now, but feel free to follow the new issue for updates, as this one's closed now.

@tombarber
Copy link

Hi All, sorry if this is not the right place to ask this - but I have the above working correctly building pull requests however I am unable to figure out how it is possible to display the results of the pr build within stash on the PR tab. Is this possible? Many thanks

@kuhnroyal
Copy link
Contributor

With this Jenkisn Plugin:
https://wiki.jenkins-ci.org/display/JENKINS/StashNotifier+Plugin

2014-06-23 16:31 GMT+02:00 Tom Barber notifications@github.com:

Hi All, sorry if this is not the right place to ask this - but I have the
above working correctly building pull requests however I am unable to
figure out how it is possible to display the results of the pr build within
stash on the PR tab. Is this possible? Many thanks


Reply to this email directly or view it on GitHub
#38 (comment)
.

@tombarber
Copy link

Thanks, i've actually configured that plugin already but isnt working as i expect for PRs. I should have posted my question on a forum for that plugin. Many thanks

@joaofernandes
Copy link

Hi, I'm currently trying to setup stash (3.4.0) with jenkins with a similar setup. We are currently using gitflow setup and developers have no access to commit to develop or master branches so only pull requests will work.
I want to build a merged version from pull requests made to develop (and master) but the job never triggers.

I've defined the ref specs as +refs/pull-requests/:refs/remotes/origin/pull-requests/
I've tried to define branch specifier as
origin/pull-requests//from
origin/pull-requests/
/merge
origin/develop
but nothing triggers the job
If I define as
origin/feature/** I can see the job being launched everytime I commit to the remote branch. but never on pull requests made to develop.

@ashnazg
Copy link

ashnazg commented Nov 4, 2014

@joaofernandes my refspecs include a wildcard:
+refs/pull-requests/*:refs/remotes/origin/pull-requests/*

though I'm not convinced they're entirely necessary. However, I do think the "branches to build" setting does need them:
origin/pull-requests/*/from
origin/pull-requests/*/merge

That third level of the branch paths has your PR# in it. I think that's why your jobs are failing to trigger.

@ANierbeck
Copy link

Hi Guys,

unfortunately this doesn't seem to work for me.
I got following setup, Stash (v. 3.4.0) and latest Jenkins.
If I configure to use

+refs/pr/*:refs/remotes/origin/pr/*
or
+refs/pull-requests/*:refs/remotes/origin/pull-request/*

and the corresponding branch:

origin/pr/*/merge
or
origin/pull-requests/*/merge

every time I trigger the build only my "feature"-Branch build is triggerd but not the merge branch one.
Any Idea what I'm missing?

@tombarber
Copy link

Try this:
refspec:
+refs/pull-requests//merge:refs/remotes/origin/pr/

branch:
**

It was some time ago that i was playing around with this and I believe the above worked correctly, though am unable to check at the moment.

@joaofernandes
Copy link

Still not working.
I've used
+refs/pull-requests//merge:refs/remotes/origin/pull-requests/ so only merged get fetched.
I've set branch to **
In the webook plugin for this repository I've disabled send SHA1 hash.

When I update a pull request nothing gets triggered in jenkins but if I press trigger build inside the pull request page, It starts building the project.

@ashnazg
Copy link

ashnazg commented Nov 7, 2014

On the build job itself, do you have polling enabled? A "schedule" is not necessary, so that can be left blank, but "polling" does need to be toggled "ON".

If you check your Jenkins log (Manage Jenkins -> Systems Logs -> All Jenkins Logs), you should see a record of the Stash notification coming from the pull request update, and any jobs that are configured to poll against the notified refspec/branch will report a record of their poll request back to Stash to find new commits. If your jobs are not configured to poll, you'll only see the Stash notification record. If you don't even see the Stash notification record, then I'm very confused, because that would indicate a Stash-side config problem, one that should also prevent the Trigger Build button on the PR from functioning.

@joaofernandes
Copy link

Polling is enabled since first configuration and ignore post commit hook is "off".
In Stash project "ignore SHA1 hash" is enabled.

Sometimes the build really starts once a commit is done to an existing pull request but most of the times it doesn't. It's like if the references aren't updated so when the webhook plugin notifies jenkins and jenkins activates pooling it won't detect what was changed in the pull request.

Here is the log after committing to an existing pull request

Running: C:\Program Files (x86)\Git\bin\git.exe config --local --remove-section credential
Nov 07, 2014 3:25:00 PM INFO hudson.plugins.git.GitStatus$JenkinsAbstractProjectListener onNotifyCommit
Triggering the polling of GIT_BUILD_PULL_REQUEST
Nov 07, 2014 3:25:00 PM FINE hudson.triggers.SCMTrigger
Scheduling a polling for hudson.model.FreeStyleProject@127e4e3[GIT_BUILD_PULL_REQUEST]
Nov 07, 2014 3:25:00 PM FINE hudson.triggers.SCMTrigger
scheduling the trigger to (asynchronously) run
Nov 07, 2014 3:25:00 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
Nov 07, 2014 3:25:00 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url http://servernt2:7990/scm/fx/fx-test.git
Nov 07, 2014 3:25:00 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe --version
Nov 07, 2014 3:25:00 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local credential.helper store --file=\"C:\Users\AGENDA~1\AppData\Local\Temp\git4243510306350065328.credentials\"
Nov 07, 2014 3:25:00 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress http://servernt2:7990/scm/fx/fx-test.git +refs/pull-requests/*:refs/remotes/origin/pull-requests/*
Nov 07, 2014 3:25:01 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local --remove-section credential
Nov 07, 2014 3:25:01 PM FINE hudson.plugins.git.util.GitUtils
Computing merge base of 5  branches
Nov 07, 2014 3:25:01 PM FINE hudson.plugins.git.util.GitUtils
Computed merge bases in 442 commit steps and 6 ms
Nov 07, 2014 3:25:31 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe --version
Nov 07, 2014 3:25:31 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe init C:\Users\AGENDA~1\AppData\Local\Temp\hudson640078271237419969tmp
Nov 07, 2014 3:25:31 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local credential.helper store --file=\"C:\Users\AGENDA~1\AppData\Local\Temp\git7255487168510403669.credentials\"
Nov 07, 2014 3:25:31 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe ls-remote -h http://servernt2:7990/scm/fx/fx-test.git HEAD
Nov 07, 2014 3:25:31 PM FINE hudson.Proc

This is after manual triggering build manually:

Running: C:\Program Files (x86)\Git\bin\git.exe config --local --remove-section credential
Nov 07, 2014 3:26:48 PM INFO hudson.plugins.git.GitStatus$JenkinsAbstractProjectListener onNotifyCommit
Triggering the polling of GIT_BUILD_PULL_REQUEST
Nov 07, 2014 3:26:48 PM FINE hudson.triggers.SCMTrigger
Scheduling a polling for hudson.model.FreeStyleProject@127e4e3[GIT_BUILD_PULL_REQUEST]
Nov 07, 2014 3:26:48 PM FINE hudson.triggers.SCMTrigger
scheduling the trigger to (asynchronously) run
Nov 07, 2014 3:26:48 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
Nov 07, 2014 3:26:48 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url http://servernt2:7990/scm/fx/fx-test.git
Nov 07, 2014 3:26:48 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe --version
Nov 07, 2014 3:26:48 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local credential.helper store --file=\"C:\Users\AGENDA~1\AppData\Local\Temp\git4633522487704120266.credentials\"
Nov 07, 2014 3:26:48 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress http://servernt2:7990/scm/fx/fx-test.git +refs/pull-requests/*:refs/remotes/origin/pull-requests/*
Nov 07, 2014 3:26:49 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local --remove-section credential
Nov 07, 2014 3:26:49 PM FINE hudson.plugins.git.util.GitUtils
Computing merge base of 5  branches
Nov 07, 2014 3:26:49 PM FINE hudson.plugins.git.util.GitUtils
Computed merge bases in 444 commit steps and 13 ms
Nov 07, 2014 3:26:49 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe log --full-history --no-abbrev --format=raw -M -m --raw ec51dbe136839afc32fecc0605bbedcc220261f7..4a9f84aee0c7fd325b8874843d181fc45d0b9bc5
Nov 07, 2014 3:26:49 PM INFO hudson.triggers.SCMTrigger$Runner run
SCM changes detected in GIT_BUILD_PULL_REQUEST. Triggering  #51
Nov 07, 2014 3:26:56 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
Nov 07, 2014 3:26:56 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url http://servernt2:7990/scm/fx/fx-test.git
Nov 07, 2014 3:26:56 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe --version
Nov 07, 2014 3:26:56 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local credential.helper store --file=\"C:\Users\AGENDA~1\AppData\Local\Temp\git8757714161045584701.credentials\"
Nov 07, 2014 3:26:56 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress http://servernt2:7990/scm/fx/fx-test.git +refs/pull-requests/*:refs/remotes/origin/pull-requests/*
Nov 07, 2014 3:26:57 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local --remove-section credential
Nov 07, 2014 3:26:57 PM FINE hudson.plugins.git.util.GitUtils
Computing merge base of 5  branches
Nov 07, 2014 3:26:57 PM FINE hudson.plugins.git.util.GitUtils
Computed merge bases in 444 commit steps and 15 ms
Nov 07, 2014 3:26:57 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config core.sparsecheckout
Nov 07, 2014 3:26:57 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe checkout -f 4a9f84aee0c7fd325b8874843d181fc45d0b9bc5
Nov 07, 2014 3:26:58 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe rev-list ec51dbe136839afc32fecc0605bbedcc220261f7
Nov 07, 2014 3:26:58 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe whatchanged --no-abbrev -M --pretty=raw -n 1024 4a9f84aee0c7fd325b8874843d181fc45d0b9bc5 "^ec51dbe136839afc32fecc0605bbedcc220261f7"
Nov 07, 2014 3:26:58 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
Nov 07, 2014 3:26:58 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url http://servernt2:7990/scm/fx/fx-test.git
Nov 07, 2014 3:26:58 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe --version
Nov 07, 2014 3:26:58 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local credential.helper store --file=\"C:\Users\AGENDA~1\AppData\Local\Temp\git3495985842597099609.credentials\"
Nov 07, 2014 3:26:58 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe fetch --tags --progress http://servernt2:7990/scm/fx/fx-test.git +refs/pull-requests/*:refs/remotes/origin/pull-requests/*
Nov 07, 2014 3:26:59 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config --local --remove-section credential
Nov 07, 2014 3:26:59 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe config core.sparsecheckout
Nov 07, 2014 3:26:59 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe checkout -f 4a9f84aee0c7fd325b8874843d181fc45d0b9bc5
Nov 07, 2014 3:27:00 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe rev-list ec51dbe136839afc32fecc0605bbedcc220261f7
Nov 07, 2014 3:27:00 PM FINE hudson.Proc
Running: C:\Program Files (x86)\Git\bin\git.exe whatchanged --no-abbrev -M --pretty=raw -n 1024 4a9f84aee0c7fd325b8874843d181fc45d0b9bc5 "^ec51dbe136839afc32fecc0605bbedcc220261f7"
Nov 07, 2014 3:27:00 PM FINE hudson.Proc
Running: cmd /c call C:\Users\AGENDA~1\AppData\Local\Temp\hudson4225777872491008894.bat

As you can see there is a different behavior going on.

@prosenjit87
Copy link

prosenjit87 commented Aug 19, 2020

Ok so in GitLab if you would like to trigger auto build using Poll SCM for only merge requests you can use the below syntax under Refspec and Branch Specifier (blank for 'any') respectively .... it will work perfectly

+refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*
**

image

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

8 participants