microsoft / microsoft/azure-devops-python-api

PipelinesClient is missing model implementation for pipeline creation

Offen
#432 0 Kommentare 8 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
684
Forks
218
Ø Merge
8 T. 10 Std.
Gemergte PRs (30 T.)
1

Beschreibung

Hi,

i tried to create a build pipeline with the azure.devops.v6_0.pipelines.PipelinesClient and noticed that this is currently not possible because of a missing model definition within the CreatePipelineConfigurationParameters. This object currently only has a type attribute but it also needs (at least) a repository and a path attribute to refer the corresponding repository.
Attached you'll find a minimal working example for my case. I don't know which fields might be missing in addition to get it working in general.

I found my solution in this blog post and I'll move to a simple requests call for this case until it is fixed.

class CreatePipelineConfigurationParameters(Model):
    """
    Configuration parameters of the pipeline.

    :param type: Type of configuration.
    :type type: object
    """

    _attribute_map = {
        'path': {'key': 'path', 'type': 'object'},
        'repository': {'key': 'repository', 'type': 'RepositoryReference'},      # currently missing
        'type': {'key': 'type', 'type': 'object'},                                                # currently missing
    }

    def __init__(self, path=None, repository=None, type=None):
        super(CreatePipelineConfigurationParameters, self).__init__()
        self.path = path
        self.repository = repository                                                            # currently missing
        self.type = type                                                                               # currently missing

# currently missing, added as minimal working sample
class RepositoryReference(Model):
    _attribute_map = {
        'id': {'key': 'id', 'type': 'object'},
        'type': {'key': 'type', 'type': 'object'}
    }

    def __init__(self, id=None, type=None):
        self.id = id
        self.type = type

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne in models.py bei CreatePipelineConfigurationParameters und vergleiche dessen aktuelle Felder mit dem funktionierenden Beispiel im Issue. Prüfe, wie RepositoryReference dargestellt wird und wie diese Modelle für die Pipeline-Erstellung serialisiert werden. Die Aufgabe ist erledigt, wenn der Client eine Pipeline unter Verwendung der im Issue beschriebenen Repository- und Pfadwerte erstellen kann.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, python
Bereich
api, devops
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.