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

pages/Run/index.tsx: Add kill run button #51

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Commits on Aug 28, 2024

  1. pages/Run/index.tsx: Add kill run button

    Signed-off-by: Devansh3712 <devanshamity@gmail.com>
    Devansh3712 authored and VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    8dbf469 View commit details
    Browse the repository at this point in the history
  2. Add component Alert and KillButton

    1. create `Alert` and `KillButton` components
    2. lib/teuthologyAPI: add useRunKill hook
        (which uses `useMutation` to send POST req at /kill to t-api)
    3. create lib/teuthologyAPI.d.ts and add 'KillRun'
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    72487d5 View commit details
    Browse the repository at this point in the history
  3. Optionally show & disable kill-run btn

    new features:
    1. Disable kill-run button for finished runs
    2. Hide kill-run button for users who don't own the run
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    d3c9118 View commit details
    Browse the repository at this point in the history
  4. components/KillButton: add KillButtonDialog component

    This commit also removes "--user" from the t-api /kill
    route request.
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    727e0ea View commit details
    Browse the repository at this point in the history
  5. components/KillButton: improve error handling

    Show error message received in response from api
    when killing a run.
    
    This commit also includes some minor UI improvements
    on KillButtonDialog. And removes "dry_run" query
    param from "useRunKill".
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    4b5680f View commit details
    Browse the repository at this point in the history
  6. KillButton: Add "Kill as Admin" btn

    If the run belongs to the logged-in user, then it'll
    show "Kill" button. If not, then  "Kill As Admin" btn.
    For now, pulpito-ng does not verify if user has admin
    privileges. That check happens on t-api after the request is sent.
    
    This commit also refreshes the mutation obj for kill-button,
    upon button click. This fixes the issue of retrying to kill runs
    by clicking the button again.
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    d645fb4 View commit details
    Browse the repository at this point in the history
  7. components/KillButton: Owner can also be "scheduled_<username>@teutho…

    …logy"
    
    "scheduled_<username>@teuthology" is the default owner name if
    run is scheduled from teuthology CLI tool. This commit allows
    users of same github username to recognize it as their jobs.
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    75eb951 View commit details
    Browse the repository at this point in the history
  8. KillButton: disable when user is not admin

    Read "isUserAdmin" from useSession and
    disable "Kill as Admin" button if isUserAdmin is false
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    fa407b4 View commit details
    Browse the repository at this point in the history
  9. KillButtonDialog: use CodeBlock to display logs

    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    da124fa View commit details
    Browse the repository at this point in the history
  10. add "--preserve-queue" in kill run request payload

    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    0e712f0 View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2024

  1. src/lib/teuthologyAPI.ts: add trailing slash to run-kill req

    Request get redirected to /kill/?logs=true if trailing
    slash is missing.
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    ebaaebe View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2024

  1. KillButton: Improve tooltip message

    Add getHelperMessage() to display better
    tooltip message on kill button.
    
    The message should help the user understand why
    the button is disabled and know if they are admin user.
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    54763f1 View commit details
    Browse the repository at this point in the history
  2. Fix login component to show user image

    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    5c733ec View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2024

  1. KillButton: don't show btn if user logged out or run's finished

    Fixes: ceph#51 (review)
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    e702359 View commit details
    Browse the repository at this point in the history
  2. Move useRunKill and it's payload from RunPage to KillButton

    Send Run query as KillButton props. Then do all
    processing of payload and ownership in KillButton
    component.
    
    This also refreshes Run query after killing a run.
    
    Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
    VallariAg committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    53d2449 View commit details
    Browse the repository at this point in the history