It's all about the answers!

Ask a question

buildOnlyIfChanges check not working in build definition for jenkins job


Rodrigo Jimenez (115) | asked Jul 24 '19, 7:24 a.m.
edited Jul 24 '19, 7:26 a.m.

 Having a Jenkins build definition scheduled for every 2 hours that has enabled the checks 

  • Accept latest changes before loading
  • Build only if there are changes accepted
this build definition triggers a jenkins pipeline job, changes are not accepted in the workspace configure in build definition, it remains in the same state after every build.

Job is always trigger independently of the workspace status

Load directory is specified and is loaded in the jenkins master node where the buildengine daemon is running.
i tested situations where 
  • the workspace was not loaded and directory not present.
  • Workspace has been loaded previously therefore workspace content is downloaded upfront build triggering.
Workspace owner is the same as the one used to run the daemon.

RTC buildsystem toolkit and RTC Server version is 6.0.3

is this feature working i saw this issue :
where is stated that this functionality was not working but reworked in 5.0.2 


Comments
Sridevi Sangaiah commented Jul 25 '19, 1:22 a.m.
JAZZ DEVELOPER
Few possibilities:
  1. A private component could have been added to the stream that the build workspace flows with - Build Definition triggers scheduled build even without changes for private components in the RTC (470380)
  2. Does the build definition mention a list of components to be excluded during load? - If so then you might be facing the same issue as Provide more control over whether a build proceeds when changes accepted into excluded component (205217)


Rodrigo Jimenez commented Jul 25 '19, 5:28 a.m.
Hello, 

About situation 1, components in flow stream and workspace are the same.

About situation 2, there is no exclusion, all components to be accepted.

There is a way to find/generate any logs about this proccess of build triggering ?

5 answers



permanent link
Rodrigo Jimenez (115) | answered Aug 07 '19, 8:25 a.m.
edited Aug 07 '19, 8:26 a.m.

 Nobody can help ??

I notice that for command build definitions its working, however not for jenkins build defs. 


Comments
Sridevi Sangaiah commented Aug 07 '19, 9:43 a.m.
JAZZ DEVELOPER
Are you executing the command line build definition with JBE? If so then are the credentials used in JBE and Jenkins are same? For Jenkins scheduled builds is the schedule configured in the RTC build definition or is it through polling in Jenkins?


permanent link
Rodrigo Jimenez (115) | answered Aug 07 '19, 11:07 a.m.

 Command line build def works fine, the one that does not work is with jenkins build definition.


 As far as i know is not possible to configure polling with RTC in jenkins declarative pipeline jobs, without starting the job itself.

this configuration does not work for us as always trigger the build 

checkout([$class: 'RTCScm', 
                avoidUsingToolkit: false, 
                buildTool: 'RTC-BuildSystem-Toolkit-Linux-6.0.3', 
                buildType: [buildDefinition: 'Jenkins - Sygma CI 13.0 Pipeline',customizedSnapshotName: '', value: 'buildDefinition'],
                credentialsId: 'b7a43c43-d7ca-4a6c-a6f1-7bee640e4627', 
                overrideGlobal: false, 
                poll: true,
                serverURI: 'https://s-cc-rwp01.net1.cec.eu.int:9443/jazz', 
                timeout: 480]) 


Comments
Sridevi Sangaiah commented Aug 08 '19, 7:36 a.m.
JAZZ DEVELOPER

Did you try to deliver some changes to the stream that the build workspace flows with, request a build manually, and verify if the changes are accepted?


permanent link
Rodrigo Jimenez (115) | answered Aug 08 '19, 8:10 a.m.

 Yes i tried that, the workspace remains unchanged, is like when the build definition is of jenkins-hudson type is not verifying this, cos as i said when the definition is as build engine command line works as expected so as workaround im using curl to trigger the builds, and i can see in the logs.

However this approach is not reflecting the real status of the build as it always success as long as the curl request works. also the RTC build ends right after the curl command, obviously does not wait until jenkins build ends. 


RTC output log of build (when defined as command line ), however when the build was of jenkins type only the jenkins console is shown in the log:

2019-08-08 08:55:47 [Jazz build engine] 
2019-08-08 08:55:47 [Jazz build engine] Substituted the following configuration element property variables:
2019-08-08 08:55:47 [Jazz build engine] com.ibm.team.build.cmdline : com.ibm.team.build.cmdline.arguments = -I -u a002khlf:11673da4b075d97aa6070c513c1b86245b  http://mons.cc.cec.eu.int:8080/job/Sygma13.1-CI-Pipeline/buildWithParameters?token=Sygma&buildResultUUID=${buildResultUUID}   -->   com.ibm.team.build.cmdline.arguments = -I -u a002khlf:11673da4b075d97aa6070c513c1b86245b  http://mons.cc.cec.eu.int:8080/job/Sygma13.1-CI-Pipeline/buildWithParameters?token=Sygma&buildResultUUID=_f8xVYbmpEem8p-yLo1Lm7A
2019-08-08 08:55:47 [Jazz build engine] 
2019-08-08 08:55:47 [Jazz build engine] running on host: tournai.cc.cec.eu.int
2019-08-08 08:55:47 [Jazz build engine] Should build occur?
2019-08-08 08:55:47 [Jazz build engine] Checking for changes incoming to workspace "Sygma13.1-CI-Pipeline" ...
2019-08-08 08:55:49 [Jazz build engine]  found changes (3)
2019-08-08 08:55:49 [Jazz build engine] Yes: Pre-build participant "com.ibm.team.build.jazzscm" would like to build.
2019-08-08 08:55:49 [Jazz build engine] Invoking pre-build participant "com.ibm.team.build.jazzscm"
2019-08-08 08:55:49 [Jazz build engine] Accepting changes into workspace "Sygma13.1-CI-Pipeline" ...
2019-08-08 08:55:55 [Jazz build engine] Fetching files to fetch destination "/ec/local/data/jenkins-data/workspace/Sygma13.1-CI-Pipeline/Sygma13.1-CI-Pipeline" ...
2019-08-08 08:57:11 [Jazz build engine] Invoking build participant "com.ibm.team.build.cmdline"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
HTTP/1.1 201 Created
Date: Thu, 08 Aug 2019 06:57:11 GMT
X-Content-Type-Options: nosniff
Content-Length: 0
Server: Jetty(9.4.z-SNAPSH


Comments
Sridevi Sangaiah commented Aug 08 '19, 9:56 a.m.
JAZZ DEVELOPER

Can you also provide the log output from your jenkins-hudson type build?


permanent link
Rodrigo Jimenez (115) | answered Aug 09 '19, 7:00 a.m.

 the RTC log ?, I actually can not find any link to the log in the build overview.


Comments
Sridevi Sangaiah commented Aug 09 '19, 7:39 a.m.
JAZZ DEVELOPER

You can provide the console output from the Jenkins build. You can find the link to the Jenkins build in the external links tab of the RTC build result.


Ralph Schoon commented Aug 09 '19, 8:12 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

https://jazz.net/library/article/92827 shows the Jenkins Console log and how to get more details into it as well. 


permanent link
Rodrigo Jimenez (115) | answered Aug 09 '19, 10:37 a.m.

 Here is the beginning of the jenkins console log, but here there is no logging related to the checkout and accept of the workspace configured in the build definition, the checkout that appears in the log is for the pipeline script ( which is part of Jenkins pipeline configuration)



Started by user RDG Dev Build User
Lightweight checkout support not available, falling back to full checkout.
Checking out teamconcert-https://s-cc-rwp01.net1.cec.eu.int:9443/jazz-RTC-BuildSystem-Toolkit-Linux-6.0.3 into /ec/local/data/jenkins-data/jobs/Sygma14.0-CI-Pipeline/workspace@script to read Jenkins/sygma_ci.pipeline
RTC : checkout...
Using stream configuration.
Fetching files from repository workspace "HJP_1565280532466".
RTC Checkout : Fetching files to fetch destination "/ec/local/data/jenkins-data/pipelines" ...
RTC Checkout : Fetching Completed
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on tournai in /ec/local/data/jenkins-data/workspace/Sygma14.0-CI-Pipeline
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
RTC : checkout...
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withCredentials
Masking supported pattern matches of $RTC or $RTC_USR or $RTC_PSW or $DOCKER or $DOCKER_USR or $DOCKER_PSW
    

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.