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:
IssueTrackerTypeSupport for GitHub. Requires:
- Base_url:
URL to a GitHub repository for which we’re going to report issues
- Api_password:
GitHub API token - needs
repoorpublic_repopermissions
Note
You can leave the
api_urlandapi_usernamefields 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:
- post_comment(execution, bug_id)[source]¶
- Parameters:
execution (
tcms.testruns.models.TestExecution) – TestExecution objectbug_id (int or str) – Unique defect identifier in the system. Usually an int.
- property repo_id¶
- class tcms.issuetracker.types.Gitlab(bug_system, request)[source]¶
Bases:
IssueTrackerTypeSupport 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
apiscope. See https://gitlab.com/-/profile/personal_access_tokens
Note
You can leave
api_usernamefield 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:
- post_comment(execution, bug_id)[source]¶
- Parameters:
execution (
tcms.testruns.models.TestExecution) – TestExecution objectbug_id (int or str) – Unique defect identifier in the system. Usually an int.
- property repo_id¶
- class tcms.issuetracker.types.JIRA(bug_system, request)[source]¶
Bases:
IssueTrackerTypeSupport 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 URLis not used for Jira integration and can be left blank!Additional control can be applied via the
JIRA_OPTIONSconfiguration setting (inproduct.py). By default this setting is not provided and the code usesjira.JIRA.DEFAULT_OPTIONSfrom thejiraPython module!Warning
TestCase.textwill be truncated to 30k chars for automated POST requests and 6k chars for fallback GET requests to fit inside Jira limitations. Otherwise you may see 400, 414 and/or 500 errors!- 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_TYPEif 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/
Added 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/
Added 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:
- post_comment(execution, bug_id)[source]¶
- Parameters:
execution (
tcms.testruns.models.TestExecution) – TestExecution objectbug_id (int or str) – Unique defect identifier in the system. Usually an int.
- class tcms.issuetracker.types.Redmine(bug_system, request)[source]¶
Bases:
IssueTrackerTypeSupport for Redmine. Requires:
- Base_url:
the URL for this Redmine instance. For example http://redmine.example.org:3000
- Api_username:
(Optional) A username registered in Redmine. If omitted, the value of
:api_password:is treated as an API access token.- Api_password:
Either the user’s password (when
:api_username:is provided), or the API access token (when:api_username:is empty).
Users can manage API tokens at: https://www.redmine.org/my/account and selecting “API access key” (or
https://<your-redmine-instance>/my/accountif self-hosted).- 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:
- post_comment(execution, bug_id)[source]¶
- Parameters:
execution (
tcms.testruns.models.TestExecution) – TestExecution objectbug_id (int or str) – Unique defect identifier in the system. Usually an int.