#6817 Script to add new SLAs to PDC for ArbitraryBranching.
Merged 6 years ago by ralph. Opened 6 years ago by ralph.
ralph/releng new-slas  into  master

@@ -0,0 +1,35 @@ 

+ .. SPDX-License-Identifier:    CC-BY-SA-3.0

+ 

+ 

+ ======================

+ Adding New Branch SLAs

+ ======================

+ 

+ Description

+ ===========

+ 

+ In the ArbitraryBranching model, packagers can choose whatever SLAs they want

+ for the branches of their packages, but they must choose from a subset of

+ pre-defined SLAs stored in PDC, maintained by releng.

+ 

+ This SOP describes the steps necessary for a release engineer to create a new SLA.

+ 

+ Action

+ ======

+ 

+ Adding a new SLA is simple.  It involves running a script in the releng repo, with an authorized token.

+ There is a token available on `pdc-backend01` in the `/etc/pdc.d/` directory.

+ 

+ 

+ ::

+ 

+     $ ./scripts/pdc/insert-sla.py

+     Name of the SLA:  wild_and_cavalier

+     Description of the SLA:  Anything goes!  This branch may rebase at any time.  No stability guarantees provided.

+ 

+ Verification

+ ============

+ 

+ Verifying that the SLA is present is simple:  visit the `appropriate PDC

+ endpoint <https://pdc.fedoraproject.org/rest_api/v1/component-branch-slas/>`_

+ and verify that your newly-added SLA is present.

@@ -0,0 +1,32 @@ 

+ """ insert-sla.py - Add a new branch SLA to PDC.

+ 

+ https://pdc.fedoraproject.org/rest_api/v1/component-sla-types/

+ 

+ Branches in dist-git may have arbitrary EOLs and SLAs, but the SLAs must be

+ chosen from a set specified by release-engineering.

+ 

+ You can run this on pdc-backend01, the token is in /etc/pdc.d/

+ You can also find the token in the private git repo.

+ """

+ 

+ import os

+ import sys

+ 

+ import pdc_client

+ 

+ servername, token = sys.argv[-2], sys.argv[-1]

+ 

+ if os.path.basename(__file__) in (servername, token,):

+     raise ValueError("Provide a PDC server name defined in /etc/pdc.d/ and a token")

+ 

+ print("Connecting to PDC server %r with token %r" % (servername, token))

+ pdc = pdc_client.PDCClient(servername, token=token)

+ 

+ name = raw_input("Name of the SLA: ")

+ description = raw_input("Description of the SLA: ")

+ 

+ entry = dict(name=name, description=description)

+ 

+ print("Submitting POST.")

+ pdc['component-sla-types']._(entry)

+ print("Done.")

Lets wait on merging it until we have the arbitrary branching is setup.

Pull-Request has been merged by ralph

6 years ago