pharo-project / pharo-launcher

Lets you manage your pharo images and download new ones
https://pharo-project.github.io/pharo-launcher/
MIT License
109 stars 46 forks source link

Jenkins template can do too many request #435

Open jecisc opened 4 years ago

jecisc commented 4 years ago

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 commented 4 years ago

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

jecisc commented 4 years ago

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 commented 4 years ago

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.