Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

buildOnlyIfChanges check not working in build definition for jenkins job

 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 

0 votes

Comments
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)

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

 Nobody can help ??

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

0 votes

Comments
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

 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]) 

0 votes

Comments

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

 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

0 votes

Comments

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


Permanent link

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

0 votes

Comments

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.

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


Permanent link

 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
    

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,121

Question asked: Jul 24 '19, 7:24 a.m.

Question was seen: 2,331 times

Last updated: Aug 09 '19, 10:37 a.m.

Confirmation Cancel Confirm