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

chore(logs): allow anonymous calls to jenkins to get builds and projects #912

Merged
merged 1 commit into from
Dec 14, 2020

Conversation

dbyron0
Copy link
Contributor

@dbyron0 dbyron0 commented Dec 14, 2020

to clean up warnings like:

2020-12-14 19:20:54.704  WARN 1 --- [   scheduling-1] c.n.s.okhttp.OkHttp3MetricsInterceptor   : Request GET:https://jenkins.<mydomain>/job/<somejob>/job/master/api/xml?exclude=/*/build/action[not(totalCount)]&tree=builds[number,url,duration,timestamp,result,building,url,fullDisplayName,actions[failCount,skipCount,totalCount]] is missing [X-SPINNAKER-USER, X-SPINNAKER-ACCOUNTS] authentication headers and will be treated as anonymous.
Request from: com.netflix.spinnaker.okhttp.MetricsInterceptor.doIntercept(MetricsInterceptor.java:95)
	at com.netflix.spinnaker.okhttp.OkHttp3MetricsInterceptor.intercept(OkHttp3MetricsInterceptor.java:33)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService.lambda$getBuilds$4(JenkinsService.java:163)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService.getBuilds(JenkinsService.java:163)
	at com.netflix.spinnaker.igor.service.BuildOperations$getBuilds.call(Unknown Source)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.getBuilds(JenkinsBuildMonitor.groovy:174)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.processBuildsOfProject(JenkinsBuildMonitor.groovy:138)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2$_closure10.doCall(JenkinsBuildMonitor.groovy:113)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2.doCall(JenkinsBuildMonitor.groovy:113)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2.doCall(JenkinsBuildMonitor.groovy)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.generateDelta(JenkinsBuildMonitor.groovy:110)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.generateDelta(JenkinsBuildMonitor.groovy)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.internalPollSingle(CommonPollingMonitor.java:169)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$pollSingle$2(CommonPollingMonitor.java:141)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.doAcquire(RedisLockManager.java:230)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.acquire(RedisLockManager.java:268)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.acquireLock(RedisLockManager.java:138)
	at com.netflix.spinnaker.igor.polling.LockService.acquire(LockService.java:48)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.pollSingle(CommonPollingMonitor.java:141)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_poll_closure1.doCall(JenkinsBuildMonitor.groovy:96)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.poll(JenkinsBuildMonitor.groovy:95)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$onApplicationEvent$0(CommonPollingMonitor.java:94)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$onApplicationEvent$1(CommonPollingMonitor.java:91)

and

2020-12-14 19:21:37.543  WARN 1 --- [   scheduling-1] c.n.s.okhttp.OkHttp3MetricsInterceptor   : Request GET:https://jenkins.<mydomain>/api/xml?tree=jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url]]]]]]]]]]]&exclude=/*/*/*/action[not(totalCount)] is missing [X-SPINNAKER-USER, X-SPINNAKER-ACCOUNTS] authentication headers and will be treated as anonymous.
Request from: com.netflix.spinnaker.okhttp.MetricsInterceptor.doIntercept(MetricsInterceptor.java:95)
	at com.netflix.spinnaker.okhttp.OkHttp3MetricsInterceptor.intercept(OkHttp3MetricsInterceptor.java:33)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService.lambda$getProjects$1(JenkinsService.java:115)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService.getProjects(JenkinsService.java:113)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService$getProjects.call(Unknown Source)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2.doCall(JenkinsBuildMonitor.groovy:112)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2.doCall(JenkinsBuildMonitor.groovy)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.generateDelta(JenkinsBuildMonitor.groovy:110)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.generateDelta(JenkinsBuildMonitor.groovy)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.internalPollSingle(CommonPollingMonitor.java:169)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$pollSingle$2(CommonPollingMonitor.java:141)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.doAcquire(RedisLockManager.java:230)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.acquire(RedisLockManager.java:268)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.acquireLock(RedisLockManager.java:138)
	at com.netflix.spinnaker.igor.polling.LockService.acquire(LockService.java:48)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.pollSingle(CommonPollingMonitor.java:141)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_poll_closure1.doCall(JenkinsBuildMonitor.groovy:96)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.poll(JenkinsBuildMonitor.groovy:95)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$onApplicationEvent$0(CommonPollingMonitor.java:94)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$onApplicationEvent$1(CommonPollingMonitor.java:91)

there are other jenkins calls in this file that could likely benefit from the same treatment, but since I haven't experienced the struggle myself, I'm leaving those alone.

to clean up warnings like:

2020-12-14 19:20:54.704  WARN 1 --- [   scheduling-1] c.n.s.okhttp.OkHttp3MetricsInterceptor   : Request GET:https://jenkins.<mydomain>/job/<somejob>/job/master/api/xml?exclude=/*/build/action[not(totalCount)]&tree=builds[number,url,duration,timestamp,result,building,url,fullDisplayName,actions[failCount,skipCount,totalCount]] is missing [X-SPINNAKER-USER, X-SPINNAKER-ACCOUNTS] authentication headers and will be treated as anonymous.
Request from: com.netflix.spinnaker.okhttp.MetricsInterceptor.doIntercept(MetricsInterceptor.java:95)
	at com.netflix.spinnaker.okhttp.OkHttp3MetricsInterceptor.intercept(OkHttp3MetricsInterceptor.java:33)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService.lambda$getBuilds$4(JenkinsService.java:163)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService.getBuilds(JenkinsService.java:163)
	at com.netflix.spinnaker.igor.service.BuildOperations$getBuilds.call(Unknown Source)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.getBuilds(JenkinsBuildMonitor.groovy:174)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.processBuildsOfProject(JenkinsBuildMonitor.groovy:138)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2$_closure10.doCall(JenkinsBuildMonitor.groovy:113)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2.doCall(JenkinsBuildMonitor.groovy:113)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2.doCall(JenkinsBuildMonitor.groovy)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.generateDelta(JenkinsBuildMonitor.groovy:110)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.generateDelta(JenkinsBuildMonitor.groovy)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.internalPollSingle(CommonPollingMonitor.java:169)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$pollSingle$2(CommonPollingMonitor.java:141)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.doAcquire(RedisLockManager.java:230)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.acquire(RedisLockManager.java:268)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.acquireLock(RedisLockManager.java:138)
	at com.netflix.spinnaker.igor.polling.LockService.acquire(LockService.java:48)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.pollSingle(CommonPollingMonitor.java:141)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_poll_closure1.doCall(JenkinsBuildMonitor.groovy:96)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.poll(JenkinsBuildMonitor.groovy:95)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$onApplicationEvent$0(CommonPollingMonitor.java:94)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$onApplicationEvent$1(CommonPollingMonitor.java:91)

and

2020-12-14 19:21:37.543  WARN 1 --- [   scheduling-1] c.n.s.okhttp.OkHttp3MetricsInterceptor   : Request GET:https://jenkins.<mydomain>/api/xml?tree=jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url],jobs[name,lastBuild[actions[failCount,skipCount,totalCount,urlName],duration,number,timestamp,result,building,url]]]]]]]]]]]&exclude=/*/*/*/action[not(totalCount)] is missing [X-SPINNAKER-USER, X-SPINNAKER-ACCOUNTS] authentication headers and will be treated as anonymous.
Request from: com.netflix.spinnaker.okhttp.MetricsInterceptor.doIntercept(MetricsInterceptor.java:95)
	at com.netflix.spinnaker.okhttp.OkHttp3MetricsInterceptor.intercept(OkHttp3MetricsInterceptor.java:33)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService.lambda$getProjects$1(JenkinsService.java:115)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService.getProjects(JenkinsService.java:113)
	at com.netflix.spinnaker.igor.jenkins.service.JenkinsService$getProjects.call(Unknown Source)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2.doCall(JenkinsBuildMonitor.groovy:112)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_generateDelta_closure2.doCall(JenkinsBuildMonitor.groovy)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.generateDelta(JenkinsBuildMonitor.groovy:110)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.generateDelta(JenkinsBuildMonitor.groovy)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.internalPollSingle(CommonPollingMonitor.java:169)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$pollSingle$2(CommonPollingMonitor.java:141)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.doAcquire(RedisLockManager.java:230)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.acquire(RedisLockManager.java:268)
	at com.netflix.spinnaker.kork.jedis.lock.RedisLockManager.acquireLock(RedisLockManager.java:138)
	at com.netflix.spinnaker.igor.polling.LockService.acquire(LockService.java:48)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.pollSingle(CommonPollingMonitor.java:141)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor$_poll_closure1.doCall(JenkinsBuildMonitor.groovy:96)
	at com.netflix.spinnaker.igor.jenkins.JenkinsBuildMonitor.poll(JenkinsBuildMonitor.groovy:95)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$onApplicationEvent$0(CommonPollingMonitor.java:94)
	at com.netflix.spinnaker.igor.polling.CommonPollingMonitor.lambda$onApplicationEvent$1(CommonPollingMonitor.java:91)

there are other jenkins calls in this file that could likely benefit from the same treatment, but since I haven't experienced the struggle myself, I'm leaving those alone.
Copy link
Contributor

@gal-yardeni gal-yardeni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gal-yardeni gal-yardeni added the ready to merge Approved and ready for merge label Dec 14, 2020
@mergify mergify bot merged commit b133a66 into spinnaker:master Dec 14, 2020
@mergify mergify bot added the auto merged label Dec 14, 2020
@dbyron0 dbyron0 deleted the allow_anonymous_jenkins branch December 14, 2020 22:36
@dbyron0
Copy link
Contributor Author

dbyron0 commented Dec 14, 2020

@spinnakerbot add-label backport-candidate

@dbyron0
Copy link
Contributor Author

dbyron0 commented Dec 14, 2020

Note: testing spinnakerbot...not actually a backport candidate, much as I'd love it to be.

@spinnakerbot spinnakerbot added the backport-candidate Add to PRs to designate release branch patch candidates. label Dec 14, 2020
@dbyron0
Copy link
Contributor Author

dbyron0 commented Dec 15, 2020

@spinnakerbot remove-label backport-candidate

@spinnakerbot spinnakerbot removed the backport-candidate Add to PRs to designate release branch patch candidates. label Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants