-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cmd): Implemented a CLI for task management
This patch extends `CodeChecker cmd` with a new sub-command, `serverside-tasks`, which lets users and administrators deal with querying the status of running server-side tasks. By default, the CLI queries the information of the task(s) specified by their token(s) in the `--token` argument from the server using `getTaskInfo(token)`, and shows this information in either verbose "plain text" (available if precisely **one** task was specified), "table" or JSON formats. In addition to `--token`, it also supports 19 more parameters, each of which correspond to a filter option in the `TaskFilter` API type. If any filters in addition to `--token` is specified, it will exercise `getTasks(filter)` instead. This mode is only available to administrators. The resulting, more detailed information structs are printed in "table" or JSON formats. Apart from querying the current status, two additional flags are available, irrespective of which query method is used to obtain a list of "matching tasks": * `--kill` will call `cancelTask(token)` for each task. * `--await` will block execution until the specified task(s) terminate (in one way or another). `--await` is implemented by calling the new **`await_task_termination`** library function, which is implemented with the goal of being reusable by other clients later.
- Loading branch information
1 parent
a75244f
commit d73c1da
Showing
9 changed files
with
1,282 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# ------------------------------------------------------------------------- | ||
# | ||
# Part of the CodeChecker project, under the Apache License v2.0 with | ||
# LLVM Exceptions. See LICENSE for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
# ------------------------------------------------------------------------- | ||
""" | ||
Type hint (`typing`) extensions. | ||
""" | ||
from typing import Any, Protocol, TypeVar | ||
|
||
|
||
_T_contra = TypeVar("_T_contra", contravariant=True) | ||
|
||
|
||
class LTComparable(Protocol[_T_contra]): | ||
def __lt__(self, other: _T_contra, /) -> bool: ... | ||
|
||
|
||
class LEComparable(Protocol[_T_contra]): | ||
def __le__(self, other: _T_contra, /) -> bool: ... | ||
|
||
|
||
class GTComparable(Protocol[_T_contra]): | ||
def __gt__(self, other: _T_contra, /) -> bool: ... | ||
|
||
|
||
class GEComparable(Protocol[_T_contra]): | ||
def __ge__(self, other: _T_contra, /) -> bool: ... | ||
|
||
|
||
class Orderable(LTComparable[Any], LEComparable[Any], | ||
GTComparable[Any], GEComparable[Any], Protocol): | ||
"""Type hint for something that supports rich comparison operators.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.