microsoft / microsoft/azure-devops-python-api

Is there a way to get the same contents from the python sdk as from the az cli?

オープン
#403 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
684
フォーク
218
平均マージ
8日 10時間
マージ済み PR(30日)
1

説明

I'm trying to harvest information from our pipelines/repositories for governance purposes. I want to create a dashboard of some sort. For this I need to pull information from our project and all its repos and pipelines.
If I use the python sdk's pipeline_client I get this output:

{
 '_links': {},
  'folder': '\\',
  'id': 337,
  'name': 'pipelineName',
  'revision': 37,
  'url': 'https://dev.azure.com/orgnanization/d48489-c201-8sun3-952e-83e5a8593c66/_apis/pipelines/337?revision=37'
}

If I use the azure cli I get a lot more informaiton, including e.g. the dictionaries
authoredBy and repository.

Exploring the code, i found this:

as_dict(self, keep_readonly=True, key_transformer=<function attribute_transformer at 0x7f8b1f4aa0d0>, **kwargs)
| Return a dict that can be JSONify using json.dump.
|
| Advanced usage might optionaly use a callback as parameter:
|
| .. code::python
|
| def my_key_transformer(key, attr_desc, value):
| return key

Probably I'm just having trouble parsing this information. Is this something I could use to achieve my purpose?

I'd like to know which pipelines are triggered form which repos, so that I can trace them back to the dev teams and create a report on this. If this is not possible with python, I might then need to use the CLI and a bash script, but that's not what I'd like the most.

Thanks

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Python SDK の pipeline_client とその as_dict メソッドから始め、次に、それらが返すパイプラインデータを、issue に記載された Azure CLI の出力と比較します。authoredBy、repository、trigger の関係が公開されているかを確認します。ガバナンスレポートに必要なリポジトリからパイプラインへの情報を取得する明確な方法を文書化または実装できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, python
領域
api, devops
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。