SUSE-Enceladus / blue-horizon

web-based user interface to terraforming the public cloud
GNU General Public License v3.0
11 stars 8 forks source link

Fix plan view authorization #189

Closed arbulu89 closed 3 years ago

arbulu89 commented 3 years ago

Fix the plan view functionality when it is reached the first one. If we check the deploy_path authorization, the loading gif will stay spinning forever

codecov[bot] commented 3 years ago

Codecov Report

Merging #189 (c6e3804) into master (6569eba) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #189   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines          711       711           
=========================================
  Hits           711       711           
Impacted Files Coverage Δ
app/controllers/plans_controller.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6569eba...e7a6122. Read the comment docs.

bear454 commented 3 years ago

I can't reproduce this locally, I suspect it may have to do with other changes on your fork.

arbulu89 commented 3 years ago

I can't reproduce this locally, I suspect it may have to do with other changes on your fork.

@bear454 I reproduce it always when I remove the internal tmp folder before starting the application. The loading gif remains looping there forever. I guess that this happens because the current_plan file is not there. This makes sense to me based on this code: https://github.com/SUSE-Enceladus/blue-horizon/blob/master/app/helpers/authorization_helper.rb#L65 https://github.com/SUSE-Enceladus/blue-horizon/blob/master/app/controllers/plans_controller.rb#L11

As far as I see, the can method with deploy checks for this file. And as it doesn't exist, the code goes through the unless statement without setting anything to trigger_update, and without it, the js code is not executed (which is the one running the update request).

I guess that one of the recent PRs changed the behaviour: https://github.com/SUSE-Enceladus/blue-horizon/pull/186