Skip to content

Instantly share code, notes, and snippets.

@sochotnicky
Created December 11, 2018 16:08
Show Gist options
  • Save sochotnicky/3cee94c2f57cdb0299d8295f897729b8 to your computer and use it in GitHub Desktop.
Save sochotnicky/3cee94c2f57cdb0299d8295f897729b8 to your computer and use it in GitHub Desktop.
create_kr_issues.py
import sys
import logging
import requests
import json
from ticketutil.jira import JiraTicket
# TEST ON JIRA STAGE FIRST!
# ADJUST DESCRIPTION TEMPLATE!
# ADJUST EPIC!
#JIRA_URL = "https://projects.stage.engineering.redhat.com"
JIRA_URL = "https://projects.engineering.redhat.com"
EPIC = "DEVOPSA-4777"
CONTACT="[~sochotni]"
COMPONENTS = [
"AMB"
"Automate CPTS"
"Auto-Signing"
"Cloud Image Pipeline"
"Comet"
"Content-ISOs-Automation"
"E2E-Container"
"E2E-RPM"
"Expunger"
"Image Manager"
"MetaXOR"
"M+R"
"OpenSCAP"
"RCM-SS"
"registry verification"
"Repomeister"
"rhel-package-process"
"Semaphore"
]
DESC_TEMPLATE="""
Your project is part of our KR for this quarter to provide Service Level
Objectives (SLOs) for our core services {EPIC}. SLOs are basically
specific values of measurable metrics on which we can agree on with stakeholders
that our services have to meet. Metrics themselves are referred to as Service
Level Indicators (SLIs).
Quoting Wikipedia:
{quote}
Service Level Objectives (SLOs) are a key element of a service-level agreement
(SLA) between a service provider and a customer. SLOs are agreed upon as a means
of measuring the performance of the Service Provider and are outlined as a way
of avoiding disputes between the two parties based on misunderstanding.
{quote}
The task here is to sit down, think about what relevant SLOs might be, think how
you could measure them and whether other services would need to be put in place.
Ideally also talk to your stakeholders and have them review what you came up
with. Goal is *not* to implement SLOs measurments. Yet :-)
Example SLO document:
https://docs.engineering.redhat.com/display/HSSP/MetaXOR+SLOs
Please add a link to your service catalog entry with your documents. There are
no hard limits/requirements on their number. Fewer but easily measurable can be
better. Once you have the SLOs documented please reach out to {CONTACT} for
review.
Keep your eye on {EPIC} for updated information. If you have questions
reach out to {CONTACT}.
"""
################################################################
### ###
### ###
################################################################
logging.basicConfig(level=logging.DEBUG)
t = JiraTicket(JIRA_URL,
"DEVOPSA",
auth='kerberos')
for component in sorted(COMPONENTS):
logging.info("Updating ticket for component %s", component)
desc = DESC_TEMPLATE.format(EPIC=EPIC, CONTACT=CONTACT, quote="{quote}")
t.create(description=desc,
type='Sub-task',
summary="[%s] Document Service Level Objectives(SLOs)" % component,
components=[component],
parent=EPIC)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment