tcms.issuetracker.types module

This module implements Kiwi TCMS interface to external issue tracking systems. Refer to each implementor class for integration specifics!

class tcms.issuetracker.types.GitHub(bug_system, request)[source]

Bases: IssueTrackerType

Support for GitHub. Requires:

Base_url:

URL to a GitHub repository for which we’re going to report issues

Api_password:

GitHub API token - needs repo or public_repo permissions

Note

You can leave the api_url and api_username fields blank because the integration code doesn’t use them!

details(url)[source]

Use GitHub’s API instead of OpenGraph to return bug details b/c it will work for both public and private URLs.

is_adding_testcase_to_issue_disabled()[source]

When is linking a TC to a Bug report disabled? Usually when not all of the required credentials are provided.

Returns:

True if bug system api url, username and password are provided

Return type:

bool

post_comment(execution, bug_id)[source]
Parameters:
property repo_id
class tcms.issuetracker.types.Gitlab(bug_system, request)[source]

Bases: IssueTrackerType

Support for GitLab. Requires:

Base_url:

URL to a GitLab repository for which we’re going to report issues. For example https://gitlab.com/kiwitcms/integration-testing

Api_url:

URL to a GitLab instance. For example https://gitlab.com

Api_password:

GitLab API token with the api scope. See https://gitlab.com/-/profile/personal_access_tokens

Note

You can leave api_username field blank because the integration code doesn’t use it!

details(url)[source]

Use Gitlab API instead of OpenGraph to return bug details b/c it will work for both public and private URLs.

is_adding_testcase_to_issue_disabled()[source]

When is linking a TC to a Bug report disabled? Usually when not all of the required credentials are provided.

Returns:

True if bug system api url, username and password are provided

Return type:

bool

post_comment(execution, bug_id)[source]
Parameters:
property repo_id
class tcms.issuetracker.types.JIRA(bug_system, request)[source]

Bases: IssueTrackerType

Support for JIRA. Requires:

Base_url:

the URL of this JIRA instance. For example https://kiwitcms.atlassian.net

Api_username:

an email address registered with JIRA

Api_password:

API token for this username, see https://id.atlassian.com/manage-profile/security/api-tokens

Important

The field API URL is not used for Jira integration and can be left blank!

Additional control can be applied via the JIRA_OPTIONS configuration setting (in product.py). By default this setting is not provided and the code uses jira.JIRA.DEFAULT_OPTIONS from the jira Python module!

classmethod bug_id_from_url(url)[source]

Jira IDs are the last group of chars at the end of the URL. For example https://issues.jenkins-ci.org/browse/JENKINS-31044 will return an ID of JENKINS-31044

details(url)[source]

Returns bug details to be used later. By default this method returns OpenGraph metadata (dict) which is shown in the UI as tooltips. You can override this method to provide different information.

get_issue_type_from_jira(project_key)[source]

Returns the issue type from the actual Jira instance. Will try to return settings.JIRA_ISSUE_TYPE if it exists, otherwise will return the first found!

You may override this method if you want more control and customization, see https://kiwitcms.org/blog/tags/customization/

New in version 11.4.

get_project_from_jira(execution)[source]

Returns the project from the actual Jira instance. Will try to match execution.run.plan.product.name, otherwise will return the first found!

You may override this method if you want more control and customization, see https://kiwitcms.org/blog/tags/customization/

New in version 11.4.

is_adding_testcase_to_issue_disabled()[source]

When is linking a TC to a Bug report disabled? Usually when not all of the required credentials are provided.

Returns:

True if bug system api url, username and password are provided

Return type:

bool

post_comment(execution, bug_id)[source]
Parameters:
class tcms.issuetracker.types.Redmine(bug_system, request)[source]

Bases: IssueTrackerType

Support for Redmine. Requires:

Base_url:

the URL for this Redmine instance. For example http://redmine.example.org:3000

Api_username:

a username registered in Redmine

Api_password:

the password for this username

details(url)[source]

Returns bug details to be used later. By default this method returns OpenGraph metadata (dict) which is shown in the UI as tooltips. You can override this method to provide different information.

is_adding_testcase_to_issue_disabled()[source]

When is linking a TC to a Bug report disabled? Usually when not all of the required credentials are provided.

Returns:

True if bug system api url, username and password are provided

Return type:

bool

post_comment(execution, bug_id)[source]
Parameters:
redmine_priority_by_name(name)[source]
redmine_project_by_name(name)[source]

Return a Redmine project which matches the given product name. Will try to match execution.run.plan.product.name, otherwise will return the first found!

static redmine_tracker_by_name(project, name)[source]

Return a Redmine tracker matching name (‘Bugs’). If there is no match then return the first one!