Does Jenkis need the workspace in order to compare previous commits for Git repository

22 views
Skip to first unread message

Łukasz Zachulski

unread,
Jun 7, 2017, 5:48:26 PM6/7/17
to Jenkins Users
I've found Jenkins article Triggering a build using hooks in Bitbucket server and it states that

You need to ensure that your workspace is not deleted after every build. The Git plugin needs the workspace in order to compare previous commits to check if there were changes in the repository or not.

What will happen if the workspace will be deleted or when build will be simply executed on different node? Will Jenkins not be able to correctly depict changes between previous and current builds?

How does this rule apply to Pipeline, especially Multibranch and Bitbucket Team jobs and the fact that mult-ibranch jobs do it own branch indexing?


With Regards,
Lukasz.

Stephen Connolly

unread,
Jun 7, 2017, 7:46:28 PM6/7/17
to jenkins...@googlegroups.com
Multibranch keeps its own track. You can ignore that rule for multibranch 


With Regards,
Lukasz.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2060c2f6-78a9-4421-a15d-aabafb3877d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone

Mark Waite

unread,
Jun 7, 2017, 11:29:09 PM6/7/17
to jenkins...@googlegroups.com
On Wed, Jun 7, 2017 at 5:46 PM Stephen Connolly <stephen.al...@gmail.com> wrote:
On Wed 7 Jun 2017 at 22:48, Łukasz Zachulski <lzach...@gmail.com> wrote:
I've found Jenkins article Triggering a build using hooks in Bitbucket server and it states that

You need to ensure that your workspace is not deleted after every build. The Git plugin needs the workspace in order to compare previous commits to check if there were changes in the repository or not.


As far as I understand it, that statement is incorrect.  The git plugin does not need the workspace to check if there were changes in the repository or not.  The plugin remembers the SHA1 associated with a build.  If a SHA1 is detected which has not been previously built, then it is assumed a new build is needed.

Remote polling (the default) does not require a workspace, unless you're using certain special cases, like ignoring commits based on the commit author or commit message.

Mark Waite
 
What will happen if the workspace will be deleted or when build will be simply executed on different node? Will Jenkins not be able to correctly depict changes between previous and current builds?


Changes from build to build are calculated using the git repository that was used for the build.  That repository is assumed to have enough history in it to compute the differences between the build and its predecessor.  

Yes, it is possible to violate that assumption using a shallow clone value that is less than the number of intervening commits between the build and its predecessor.

No, I haven't tested the behavior when that assumption is violated.

Mark Waite
 
How does this rule apply to Pipeline, especially Multibranch and Bitbucket Team jobs and the fact that mult-ibranch jobs do it own branch indexing?

Multibranch keeps its own track. You can ignore that rule for multibranch 


With Regards,
Lukasz.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2060c2f6-78a9-4421-a15d-aabafb3877d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from my phone

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

Kevin Burnett

unread,
Jun 8, 2017, 9:41:46 AM6/8/17
to Jenkins Users
I got super-confused here for a minute, so I thought it might be worth pointing out that people who are using multibranch pipelines can completely ignore the article presented in this thread (it says it's for "non-multibranch jobs") and get this bitbucket server add-on instead: https://marketplace.atlassian.com/plugins/nl.topicus.bitbucket.bitbucket-webhooks/server/overview. stephen has recently submitted pull requests for this "topicus" add-on, so i'm pretty sure it's still a thing. :) it works in concert with the Bitbucket Branch Source jenkins plugin.

Łukasz Zachulski

unread,
Jun 10, 2017, 6:19:51 PM6/10/17
to Jenkins Users
Thanks for the feedback.
Reply all
Reply to author
Forward
0 new messages