pharo-launcher icon indicating copy to clipboard operation
pharo-launcher copied to clipboard

Jenkins template can do too many request

Open jecisc opened this issue 4 years ago • 3 comments

While getting an image from my server I get too many requests when I select my image.

I logged them and here is the result of every request made.

When I select my Jenkins it does:

https://USER:TOKEN@URL/job/JOB//api/json?tree=builds%5Bnumber,url%5D

When I select the project it does

https://USER:TOKEN@URL/job/JOB//lastSuccessfulBuild/api/json?tree=artifacts%5BrelativePath%5D

When I select LatestSuccessful it does

https://USER:TOKEN@URL/job/JOB//lastSuccessfulBuild/api/json?tree=runs%5Bnumber,url%5D

When I select the right subbuild

https://USER:TOKEN@URL/job/JOB/ARCHITECTURE=64,PHARO=80/lastSuccessfulBuild//api/json?tree=artifacts%5BrelativePath%5D

Then when I select the artefact to DL it does

https://USER:TOKEN@URL/job/JOB//api/json?tree=builds%5Bnumber,url%5D
https://USER:TOKEN@URL/job/JOB//lastSuccessfulBuild/api/json?tree=artifacts%5BrelativePath%5D
https://USER:TOKEN@URL/job/JOB//lastSuccessfulBuild/api/json?tree=runs%5Bnumber,url%5D
https://USER:TOKEN@URL/job/JOB/ARCHITECTURE=64,PHARO=80/lastSuccessfulBuild//api/json?tree=artifacts%5BrelativePath%5D
https://USER:TOKEN@URL/job/JOB//api/json?tree=builds%5Bnumber,url%5D
https://USER:TOKEN@URL/job/JOB//lastSuccessfulBuild/api/json?tree=artifacts%5BrelativePath%5D
https://USER:TOKEN@URL/job/JOB//lastSuccessfulBuild/api/json?tree=runs%5Bnumber,url%5D
https://USER:TOKEN@URL/job/JOB/ARCHITECTURE=64,PHARO=80/lastSuccessfulBuild//api/json?tree=artifacts%5BrelativePath%5D

I guess the UI is refreshing and it computes once again all open children?  In the case of requests to the Jenkins, it takes a lot of time and makes it hard to use it.

jecisc avatar Mar 17 '20 13:03 jecisc

Also, I do once again all those requests when I click "Create image"

jecisc avatar Mar 17 '20 13:03 jecisc

Something is weird with this issue. I added a halt in the request for Jenkins Built. When I select the artefact, the code launching the new request is the #selectionChanged: of fast table.

The weird part is that, if the update of the selection launch the new request, then why does it not happen with the selection of the subbuild for example?!

jecisc avatar Apr 08 '20 10:04 jecisc

Oh, I found why! When I expend items, I do not select the line. Thus the table does not update.

So the problem is that the tree recomputes the children at each change of selection.

jecisc avatar Apr 08 '20 10:04 jecisc