|
||
|
All, I'm having some trouble with getting PR jobs to run correctly. I've tried making a simple PR to illustrate my problem. First, here's the output of our build server:
The reason it fails is because the merge creates an add/add conflict, even though no conflict exists. Distilling the steps above, you can test the results with these commands:
To figure out what was going on, I went and looked at the output of some PR jobs on the ROS build server. Here's the relevant output for
The only difference between the two is this line:
While both have So, armed with this information, I tested it:
Sure enough, this works just fine. So the question is why the PR job is using the It's not clear if this is the source of the issue I'm seeing. The relevant build templates are here: ros-infrastructure/ros_buildfarm/blob/master/ros_buildfarm/templates/devel/devel_job.xml.em#L60
ros-infrastructure/ros_buildfarm/blob/master/ros_buildfarm/templates/snippet/scm_git.xml.em
This file has been truncated. show original
So my question is this: why am I seeing that flag? Is Jenkins parsing the configuration differently? |
||
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.
|
||
|
I looked into the configure page of the referenced job (Ipr__gazebo_ros_pkgs__ubuntu_trusty_amd64). It only shows the "Shallow clone" option which is enabled. But it doesn't show the "Shallow clone depth" option from your screenshot. The snippet where that configuration is being specified is here (a bit below the snippet you posed): https://github.com/ros-infrastructure/ros_buildfarm/blob/ff92d25f063314acc6d0d1aaf5953ce5cfdad0d5/ros_buildfarm/templates/snippet/scm_git.xml.em#L27-L31 That indicates that you are using different versions of the Jenkins plugins. build.ros.org currently uses version 2.4.1 of the Git plugin (see the version nummber in the snippet). The shallow clone depth option was added in version 2.4.3 (https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin#GitPlugin-Version2.4.3%28Mar19%2C2016%29). Usually the plugins and their config is forward compatible. Maybe something needs to be changed to work with the newer version? |
||
|
||
|
Perhaps. The code that manages the generation of the depth switch is here. Interestingly, if I manually set the depth to 2: | ||
|
...everything works just fine. I'm not familiar with how the templates map to the Java code, though there appears to be a direct correspondence between the XML tags and the class structure, so perhaps if we add
to the snippet? Not sure if 2 will always be enough, but then if not, it seems like we'd have to choose an arbitrary depth, in which case we start to lose the benefit of shallow clones/fetches. |
|
||
After you have manually configured the job you can go back to the configure form and change the url ending in |
||
Visit Topic or reply to this email to respond.
|
||
| Perhaps. The code that manages the generation of the depth switch is here. Interestingly, if I manually set the depth to 2: git init robot_localization cd robot_localization git config remote.origin.url https://github.com/locusrobotics/robot_localization.git git -c core.askpass=true fetch --tags … | ||
|
||
I believe that the plugin is attempting to merge by default before running the build. If the pull-request branch is based off of an older commit than the shallow clone, presumably it cannot do the merge without the appropriate history available. Is the branch that you're trying to test fast forwardable? |
||
Visit Topic or reply to this email to respond.
|
||
| After you have manually configured the job you can go back to the configure form and change the url ending in /configure into /config.xml. That will show the raw job configuration. Please post the relevant block of the xml here. | ||
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.
|
||
So to create the PR, I just made a branch of indigo-devel on GH, added a single trivial line in a constructor, committed/pushed, and submitted a PR. I can merge it using |
||
|
||
| I believe that the plugin is attempting to merge by default before running the build. If the pull-request branch is based off of an older commit than the shallow clone, presumably it cannot do the merge without the appropriate history available. Is the branch that you're trying to test fast forward… | ||
|
||
|
||
|
| After you have manually configured the job you can go back to the configure form and change the url ending in /configure into /config.xml. That will show the raw job configuration. Please post the relevant block of the xml here. |
|
||
|
I guess it comes down to choose between "merge before build" and "shallow clone":
|
||
Visit Topic or reply to this email to respond.
|
||
| <hudson.plugins.git.extensions.impl.CloneOption> <shallow>true</shallow> <noTags>false</noTags> <reference/> <depth>2</depth> <honorRefspec>false</honorRefspec> </hudson.plugins.git.extensions.impl.CloneOption> | ||
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.
|
||
Sounds like a good approach. |
||
|
||
| I guess it comes down to choose between "merge before build" and "shallow clone": If we use a shallow clone a merge will potentially fail - simply because there is no way to choose the "right" depth which always works. So if we want to keep merging before build (which I think is very valuable, th… | ||
|
||
|
I created a pull request to change the behavior of the PR jobs as discussed: don't use shallow cloning when using merge-before-build
1 commits
changed 2 files
with 3 additions
and 3 deletions.
|
||
|
||
| Sounds like a good approach. :+1: | ||
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.
|
||
|
Hi! I can't find anything similar if I look on the Jenkins log page. |
||
|
||
If you refer to the messages about the git commands those are part of the console output of each job (at the very beginning). |
||
Visit Topic or reply to this email to respond.
|
||
|
Hi, Thank you for answering! Yes, I mean logs like this one: | ||
|
When I look into the log from my Jenkins job, I can't find this much detail(and I am using git for PR). The only thing in the logs was I'm using the Jenkins Git plugin and the Jenkins Bitbucket plugin. Did you look into some other logs or that you enabled some option to have more verbose logging? |
|
||
|
For example this job has the following output:
You can find the template for the job configuration here: https://github.com/ros-infrastructure/ros_buildfarm/blob/master/ros_buildfarm/templates/snippet/scm_git.xml.em Maybe that helps you finding the difference. |
||
|
||
|
@octaviantuchila14 It sounds like you're debugging a different system. Please ask a question on http://answers.ros.org with enough information to reproduce your problem. This thread is not the appropriate place to debug, it's a discussion which resolved itself through an enhancement 6 months ago. For guidelines for asking questions please see http://wiki.ros.org/Support The logs we're talking about are in the console logs for the job without any extra options. For example: http://build.ros.org:8080/view/Kpr/job/Kpr__angles__ubuntu_xenial_amd64/4/consoleFull
|
||
Visit Topic or reply to this email to respond.
|
||
| Hi, Thank you for answering! Yes, I mean logs like this one: 09:45:05 GitHub pull request #17 of commit e22a0f7053c41cc2b791ff63b7ccd11c356b34f6, no merge conflicts. 09:45:05 Setting status of e22a0f7053c41cc2b791ff63b7ccd11c356b34f6 to PENDING with url <redacted>/job/Ipr__robot_localization__… | ||