HUE-7018 [jb] disable_killing_jobs option is not supported in the new job browser

Review Request #11278 - Created Aug. 5, 2017 and submitted

Ying Chen
hue
master
HUE-7018
8575ef9...
enricoberti, johan, krish, romain, weixia
commit 1ed49b64e248ec07e0c4970e3ff9ca60b28d5442
Author: Ying Chen <yingchen@cloudera.com>
Date:   Mon Aug 7 17:29:11 2017 -0700

    HUE-7018 [jb] disable_killing_jobs option is not supported in the new job browser

:100644 100644 b29174057a... 375b88444c... M    apps/jobbrowser/src/jobbrowser/api2.py
:100644 100644 ae5823ae08... cafeca8411... M    apps/jobbrowser/src/jobbrowser/templates/job_browser.mako


  • 0
  • 0
  • 6
  • 1
  • 7
Description From Last Updated
  1. Question: we already have a 'killEnabled' property, can we re-use/fix that instead for this case?

    1. killEnabled seems to be computed bases jobs' status.
      disableKillingJobs is a global config by admin, and Jira asks to hide the button if it is true.
      So, I separated disableKillingJobs from killEnabled.
  2. nit: disableKillingJobs() -> disableKillingJobs

    (the () is redundant in Knockout for these cases)

    1. I have tried without (), but it doesn't reflect the config value change.
      Is it because I declared it as ko.observable()?

    2. ok!

  3. 
      
  1. Ship It!
  2. 
      
  1. 
      
  2. apps/jobbrowser/src/jobbrowser/api2.py (Diff revision 1)
     
     

    Could we check here if we have the DISABLE_KILLING_JOBS.get() flag or not?

  3. apps/jobbrowser/src/jobbrowser/templates/job_browser.mako (Diff revision 1)
     
     
     
     
     
     
     

    Could we revert the changes and instead do in mako?

    % if DISABLE_KILLING_JOBS.get():
    ...
    % endif

  4. 
      
  1. 
      
  2. Could we also check in the view?

  3. 
      
  1. 
      
  2. apps/jobbrowser/src/jobbrowser/api2.py (Diff revision 3)
     
     

    if operation == 'kill' and DISABLE_KILLING_JOBS.get():
    return serve_403_error(request)

    ?

  3. from jobbrowser.conf import MAX_JOB_FETCH, DISABLE_KILLING_JOBS

  4. 
      
  1. 
      
  2. apps/jobbrowser/src/jobbrowser/api2.py (Diff revision 4)
     
     

    1

    'operation is not None' does not seem needed?
    Did you see cases where 'operation' was None?
    (seems unlikely and more probable to blow-up before because of the json loads)

    2 2 extra spaces after 'and'?

    operation.get('action') == 'kill' and

  3. 
      
  1. Ship It!
  2. 
      
Review request changed

Status: Closed (submitted)

Loading...