API documentation¶
cli
¶
auth_verify
¶
auth_verify(instance_name: InstanceNameOption) -> None
Verify the authentication to the instance.
Source code in src/issx/cli.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
copy
¶
copy(
source_project_name: Annotated[
str,
typer.Option(
--source,
help="Source project name configured in the config file",
),
],
target_project_name: Annotated[
str,
typer.Option(
--target,
help="Target project name configured in the config file",
),
],
issue_id: int,
title_format: Annotated[
str,
typer.Option(
--title - format,
-T,
help="Template of a new issue title. Can contain placeholders of the issue attributes: {id}, {title}, {description}, {web_url}, {reference}",
),
] = "{title}",
description_format: Annotated[
str,
typer.Option(
--description - format,
-D,
help="Template of a new issue description. Can contain placeholders of the issue attributes: {id}, {title}, {description}, {web_url}, {reference}",
),
] = "{description}",
allow_duplicates: Annotated[
bool,
typer.Option(
--allow - duplicates,
-A,
help="Allow for duplicate issues. If set, the command will return the first issue found with the same title. If no issues are found, a new issue will be created.",
),
] = False,
assign_to_me: Annotated[
bool,
typer.Option(
--assign - to - me,
-M,
help="Whether to assign a newly created issue to the current user",
),
] = False,
) -> int
Copy an issue from one project to another.
Source code in src/issx/cli.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
generate_instance
¶
generate_instance(
instance_name: Annotated[
str,
typer.Option(
--instance,
help="Name of then instance to generate new_config for. Only alphanumeric and -_ allowed",
),
]
) -> None
Generate instance's new_config string
Source code in src/issx/cli.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
generate_project
¶
generate_project(
project_name: Annotated[
str,
typer.Option(
--project,
help="Name of then project to generate new_config for. Only alphanumeric and -_ allowed",
),
]
) -> None
Generate project's new_config string. Instance must be already configured.
Source code in src/issx/cli.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
|
cli_utils
¶
clients
¶
GitlabClient
¶
Bases: IssueClientInterface
, GitlabInstanceClient
Gitlab client implementations
Source code in src/issx/clients/gitlab.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
RedmineClient
¶
Bases: IssueClientInterface
, RedmineInstanceClient
Redmine client implementation
Source code in src/issx/clients/redmine.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
gitlab
¶
GitlabClient
¶
Bases: IssueClientInterface
, GitlabInstanceClient
Gitlab client implementations
Source code in src/issx/clients/gitlab.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
IssueMapper
¶
Maps Gitlab API objects to domain objects
Source code in src/issx/clients/gitlab.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
interfaces
¶
InstanceClientInterface
¶
Bases: ABC
Interface for a client that interacts with an issue tracker instance
Source code in src/issx/clients/interfaces.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
auth
abstractmethod
async
¶
auth() -> str | None
Authenticate the client with the instance. Raises an internal error if the authentication fails or returns None.
Returns:
Type | Description |
---|---|
str | None
|
The username of the authenticated user or None |
Source code in src/issx/clients/interfaces.py
15 16 17 18 19 20 21 22 |
|
get_instance_url
abstractmethod
¶
get_instance_url() -> str
Returns:
Type | Description |
---|---|
str
|
The URL of the instance |
Source code in src/issx/clients/interfaces.py
24 25 26 27 28 29 |
|
instance_from_config
abstractmethod
classmethod
¶
instance_from_config(
instance_config: InstanceConfig,
) -> Self
Create an instance of the client from a configuration dictionary.
If required, the instance_config can be converted to an instance-specific
configuration according to the instance_config_class
attribute of the client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance_config |
InstanceConfig
|
The configuration object. Higher level code should validate the configuration. |
required |
Returns:
Type | Description |
---|---|
Self
|
An instance of the client |
Source code in src/issx/clients/interfaces.py
31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
IssueClientInterface
¶
Bases: ABC
Source code in src/issx/clients/interfaces.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
create_issue
abstractmethod
async
¶
create_issue(
title: str, description: str, assign_to_me: bool = False
) -> Issue
Create a new issue.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str
|
The title of the issue |
required |
description |
str
|
The description of the issue |
required |
assign_to_me |
bool
|
Assign the issue to the authenticated user |
False
|
Returns:
Type | Description |
---|---|
Issue
|
|
Source code in src/issx/clients/interfaces.py
59 60 61 62 63 64 65 66 67 68 69 70 |
|
find_issues
abstractmethod
async
¶
find_issues(title: str) -> list[Issue]
Find issues by title using an exact match.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title |
str
|
The title of the issue |
required |
Returns:
Type | Description |
---|---|
list[Issue]
|
List of issues |
Source code in src/issx/clients/interfaces.py
72 73 74 75 76 77 78 79 |
|
from_config
abstractmethod
classmethod
¶
from_config(
instance_config: InstanceConfig,
project_config: ProjectFlatConfig,
) -> Self
Create an instance of the client from configuration classes.
If required, the project_config can be converted to a project-specific
configuration according to the project_config_class
attribute of the client.
Args:
instance_config: InstanceConfig to configure the client to the instance
project_config: ProjectFlatConfig to configure client. This config can then
be converted to a project-specific config according to
the project_config_class
attribute of the client.
to the particular project
Returns: An instance of the client
Source code in src/issx/clients/interfaces.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
get_issue
abstractmethod
async
¶
get_issue(issue_id: int) -> Issue
Retrieve an issue by its ID. Raises IssueDoesNotExistError if the issue does not exist.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
issue_id |
int
|
The ID of the issue |
required |
Returns:
Type | Description |
---|---|
Issue
|
Issue object |
Source code in src/issx/clients/interfaces.py
49 50 51 52 53 54 55 56 57 |
|
redmine
¶
RedmineClient
¶
Bases: IssueClientInterface
, RedmineInstanceClient
Redmine client implementation
Source code in src/issx/clients/redmine.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
RedmineIssueMapper
¶
Maps Redmine API objects to domain objects
Source code in src/issx/clients/redmine.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
domain
¶
config
¶
BaseConfig
¶
Base class for config classes. It contains a raw_config attribute that should store the raw dictionary that was used to create the object.
Source code in src/issx/domain/config.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
as_toml
¶
as_toml(key: str) -> str
Convert the object to a TOML string. Args: key: Key to use for the TOML table
Returns: TOML string
Source code in src/issx/domain/config.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
get_meaningful_fields
classmethod
¶
get_meaningful_fields() -> Iterable[attr.Attribute]
Get all fields except the raw_config field.
Returns: Iterable of fields
Source code in src/issx/domain/config.py
21 22 23 24 25 26 27 28 29 |
|
instance_managers
¶
managers
¶
InstanceManager
¶
Source code in src/issx/instance_managers/managers.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
get_instance_client
¶
get_instance_client(
instance: str,
) -> InstanceClientInterface
Get an instance client for a given instance name.
Converts the instance config to the appropriate config class and creates an instance client. Args: instance: Instance name
Returns: Instance of an instance client
Source code in src/issx/instance_managers/managers.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
get_project_client
¶
get_project_client(project: str) -> IssueClientInterface
Get a project client for a given project name.
Converts the project config to the appropriate config class and creates a project client. Args: project: Project name
Returns: Instance of a project client
Source code in src/issx/instance_managers/managers.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
services
¶
CopyIssueService
¶
Source code in src/issx/services.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
copy
async
¶
copy(
issue_id: int,
title_format: str = "{title}",
description_format: str = "{description}",
allow_duplicates: bool = False,
assign_to_me: bool = False,
) -> Issue
Copy an issue from the source client to the target client optionally
applying a title and description format. If allow_duplicates
is False
,
the method will return a first issue found with the same title.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
issue_id |
int
|
The ID of the issue to copy |
required |
title_format |
str
|
The format for the new issue title |
'{title}'
|
description_format |
str
|
The format for the new issue description |
'{description}'
|
allow_duplicates |
bool
|
Whether to allow duplicate issues |
False
|
assign_to_me |
bool
|
Whether to assign the new issue to the current user |
False
|
Returns:
Type | Description |
---|---|
Issue
|
Newly created or existing issue in the target client |
Source code in src/issx/services.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|