Commit 5e27629b authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

Initial commit

Pipeline #145941 failed with stage
in 34 seconds
image: python:3.10-slim
- build
stage: build
- apt-get update
- apt-get install -f git
- pip install flit==3.4.0
- flit build
# Kiwi TCMS Gitlab plugin
Kiwi TCMS Gitlab plugin customizes the creation of Gitlab issue to follow the
E Foundation issue [template](
## Install
First install the python package
pip install tcms_gitlab_efoundation_plugin
Then update the Kiwi settings like below
EXTERNAL_BUG_TRACKERS += ["tcms_gitlab_efoundation_plugin.gitlab.GitlabEFoundation"]
You can also refer to the Kiwi documentation about [plugin](
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
name = "tcms_gitlab_efoundation_plugin"
version = "0.1"
description = "Kiwi TCMS Gitlab plugin customizes the creation of Gitlab issue to follow the E Foundation guidelines"
authors = [
{name = "Nicolas Gelot", email = ""},
readme = ""
classifiers = [
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Testing :: Acceptance"
requires-python = ">=3.8"
dependencies = [
"kiwitcms >= 10.4",
Source = ""
tcms_gitlab_efoundation_plugin = "tcms_gitlab_efoundation_plugin"
from tcms.issuetracker.types import Gitlab
from tcms.core.contrib.linkreference.models import LinkReference
class GitlabEFoundation(Gitlab):
def report_issue_from_testexecution(self, execution, user):
repo_id = self.it_class.repo_id(self.bug_system)
project = self.rpc.projects.get(repo_id)
# see
new_issue = project.issues.create(
"title": f"Failed test: {}",
"description": self._report_comment(execution),
# and also add a link reference that will be shown in the UI
return new_issue.attributes["web_url"]
def _report_comment(self, execution): # pylint: disable=no-self-use
Returns the comment which is used in the original defect report.
comment = f"""
- /e/ version: {}
- Device model(s):
- Device rooted: yes/no
## Summary
Filed from execution {execution.get_full_url()} and reported by {execution.assignee.username}
## The problem
**Steps to reproduce**
Run the test case {{}][{execution.get_full_url()}]
**What is the current behavior?**
This test case fails with build {}
**What is the expected correct behavior?**
<What you should see instead>
## Technical informations
**Relevant logs (`adb logcat`)**
<Paste any relevant logs in the codeblock bellow>
**Relevant screenshots**
<Screenshots of the problem>
## Solutions
<To get the feature working or at least to make the device usable>
**Possible fixes**
<Any idea to fix the issue or a link to the line of code that might be the cause for this problem>
/label ~Bug
return comment
from django.urls import reverse_lazy
# Follows the format of ``tcms.settings.common.MENU_ITEMS``
("View gitlab issue template", reverse_lazy("gitlab-issue-tpl")),
{% extends "base.html" %}
{% load static %}
{% block title %}An example view of Telemetry plugin{% endblock %}
{% block body_class %}cards-pf{% endblock %}
{% block contents %}
<div class="container-fluid container-cards-pf">
<div class="row row-cards-pf">
<div class="col-sm-12 col-md-12 col-lg-12">
<div class="card-pf card-pf-accented card-pf-aggregate-status card-pf-aggregate-status-mini">
<h2 class="card-pf-title">
<span class="pficon pficon-template"></span>
<span class="card-pf-aggregate-status-count">Gitlab E Foundation plugin installed</span>
See the page of the <a href="">project</a>.
<div class="card-pf-body">
<p class="card-pf-aggregate-status-notifications">
<span class="card-pf-aggregate-status-notification">
<span class="pficon pficon-info"></span>
</div><!-- /row -->
</div><!-- /container -->
{% endblock %}
from django.urls import re_path
from . import views
urlpatterns = [
re_path(r"gitlab-issue-tpl/$", views.Gitlab.as_view(), name="gitlab-issue-tpl"),
from django.views.generic.base import TemplateView
class Gitlab(TemplateView): # pylint: disable=missing-permission-required
template_name = "tcms_gitlab_efoundation_plugin/main.html"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment