注: 以下の翻訳の正確性は検証されていません。AIPを利用して英語版の原文から機械的に翻訳されたものです。
Code Repositories のほとんどの設定は、設定タブにあります。一部の追加の値は、リポジトリのルートにある repoSettings.json ファイルで設定します。ファイルが存在しない場合は、リポジトリのルートに repoSettings.json という名前のファイルを作成できます。
Code Repositories が適用するデフォルトの制約に加えて、リポジトリ内で新しく作成されるすべてのタグが特定の命名規則に従うようにするには、カスタム正規表現と、その正規表現に一致しない場合にユーザーに表示するエラーメッセージを設定できます。たとえば、次のように設定します。
Copied!1 2 3 4"tagNameValidation": { "regex": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(-rc\\d+)?$", "errorMessage": "Tag name must have the format x.x.x or x.x.x-rcx" }
tagNameValidation に値を設定する場合は、regex と errorMessage の両方を設定する必要があります。
新しいプルリクエストを作成するときにベストプラクティスを維持しやすくするため、プルリクエストの作成時に Description フィールドへ事前入力される説明テンプレートを設定できます。
Copied!1"prDescriptionTemplate": "First line of the description template\nAnd another line with instructions"
デフォルトでは、新しいトランスフォームファイルのテンプレートは、ファイルパスを初期の出力データセットパスとして使用します。たとえば、Python トランスフォームの場合は /path/to/your/repository/transforms-python/src/myproject/datasets/name_of_file です。outputPathPrefix を設定すると、プロジェクト内の特定のフォルダーなど、より使いやすい場所に変更できます。
Copied!1"outputPathPrefix": "/My/Custom/Prefix"
上記の設定では、出力データセットパスは代わりに /My/Custom/Prefix/name_of_file に設定されます。
repoSettings.json ファイルに prValidation エントリーを追加すると、リポジトリ内のプルリクエストにルールを適用できます。プルリクエストが作成されると、ベースブランチの repoSettings.json ファイルに照らして検証されます。
プルリクエストの検証ルールは、正規表現、その式との照合対象となるプルリクエストのフィールドのリスト、およびフィールドがルールに従っていない場合に表示するエラーメッセージで構成されます。
repoSettings.jsonCopied!1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20{ "tagNameValidation": { "regex": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(-rc\\d+)?$", "errorMessage": "Tag name must have the format x.x.x or x.x.x-rcx" }, "prDescriptionTemplate": "First line of the description template\nAnd another line with instructions", "outputPathPrefix": "/My/Custom/Prefix", "prValidation": [ { "regex": "TEST-\\d{3}", "fields": ["title", "branchName"], "errorMessage": "This field must contain a valid TEST-XXX ticket, such as 'TEST-123'." }, { "regex": "This is the description", "fields": ["description"], "errorMessage": "Please enter 'This is the description' somewhere in the description." } ] }