Skip to content

Instantly share code, notes, and snippets.

@kkamegawa
Created January 30, 2024 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkamegawa/ab23e713d9c00f494b660fa473576867 to your computer and use it in GitHub Desktop.
Save kkamegawa/ab23e713d9c00f494b660fa473576867 to your computer and use it in GitHub Desktop.

チームの自動ルールと AB# 検証の改善が一般提供されました - Sprint 233 Update

In this article

GitHubのAzure Boards AppによるAB#検証の改善とTeam Automationのルールが一般的に利用可能になったことをお知らせします!AB# 検証を改善し、ワークアイテムへのリンクが無効な場合に通知を受け取れるようになりました。チーム自動化ルールでは、子アイテムの状態に基づいてワークアイテムのオープンとクローズ/解決を自動化するために、各バックログレベルを設定できるようになりました。

今回の更新では、コードスキャンでカスタムCodeQLクエリのサポートも導入しました!これにより、コードベースに固有の問題を特定するために調整された独自のクエリを作成できるようになります。

詳細はリリースノートをご覧ください。

コードスキャンでカスタムCodeQLクエリをサポートするようになりました!これにより、コードベースに固有の問題を特定するために調整された独自のクエリの作成が可能になります。カスタムクエリを含むパックを作成して公開し、パイプラインでこれらのクエリを実行して、組織に関連する脆弱性の検出をカスタマイズできるようになりました。

GitHub Advanced Security for Azure DevOpsのコードスキャンにカスタムクエリを活用する方法の詳細については、Code scanning alerts for GitHub Advanced Security for Azure DevOpsをご覧ください。

皆様のご意見を重視します。ご質問やご意見がありましたら、Developer Communityでコミュニティにご参加ください。

数スプリント前に、GitHub の Azure Boards App による AB#検証の改善プレビューを発表しました。ワークアイテムのリンクの妥当性をユーザーに通知し、Pull Request をマージする前に問題を発見して修正できるよう、アプリを強化しました。

数週間のテストとフィードバックの後、この機能はGitHub + Azure Boards統合を使用しているすべてのユーザーが利用できるようになりました。

Screenshots of improved validation.

これは、現在の統合を改善するために作っているいくつかの機能の最初のものです。公開ロードマップで計画している他の Azure Boards + GitHub 統合機能もぜひチェックしてください。

Azure DevOps Service のすべてのお客様にこの機能のリリースをお知らせできることを嬉しく思います。

注意事項

この機能は今後2~3週間かけて展開されます。2024年2月上旬までご利用いただけない場合があります。

各バックログレベルを設定し、子アイテムの状態に基づいてワークアイテムのオープンとクローズ(または解決)を自動化できるようになりました。解決しようとするシナリオは主にふたつです。

  • ひとつの子アイテムがアクティブになったら、親アイテムをアクティブにする。
  • すべての子アイテムが閉じられたら、親アイテムを閉じる(または解決する)。

これらの設定を有効にするには、チームのバックログレベル設定をクリックします。次に、[Automation] > [Rules] タブに移動し、バックログに適用できる2つの異なるルールを確認します。各バックログ レベル(requirements, features, epics)は、チームの作業方法に応じて異なる設定が可能です。

Screenshots of team settings.

例えば、子タスクがアクティブに設定されたら、親ユーザストーリーをアクティブにします。そして、すべてのタスクが完了したら、User StoryをClosedに設定します。

Gif to demo closing user story.

この機能の詳細については、ドキュメントとこのブログをご覧ください。

この機能は、Developer Communityの提案チケットに基づいて優先されました。

2024年1月31日に非推奨タスクを廃止します。これらのタスクを使用しているパイプラインを特定しやすくするため、代替案が記載された警告メッセージが表示されます。2024年1月31日までに、新しいバージョンのタスクまたは代替タスクを使用するようにパイプラインを更新することをお勧めします。

Screenshot of task-specific deprecation warnings.

廃止されるタスクに関する以前のお知らせはこちらです。

すべての Microsoft ホストエージェントは、1月28日から PowerShell 7.2 LTS から PowerShell 7.4 LTSへ移行を開始します。PowerShell 7.4 の新機能PowerShell 7.4 の一般提供を参照してください。

変更点に注意し、それに従ってスクリプトを更新してください:

  • Breaking changes between PowerShell 7.3 & 7.4 LTS
  • Breaking changes between PowerShell 7.2 LTS & 7.3
  • $PSNativeCommandArgumentPassingで制御する引数解析の動作を更新しました。以下のサンプルスクリプトでは、$PSNativeCommandArgumentPassingを明示的に設定することで、Linux、macOS、Windowsで同じ動作を強制しています。

Azure DevOps がシークレットを作成する Azure サービス接続では、シークレットの有効期限が2年ではなく3か月になります。

シークレットをローテーションする必要性をなくすには、代わりにWorkload ID federationを使用するようにサービス接続を変換します。以下のサンプルスクリプトを使用して、複数のAzureサービス接続をWorkload ID federationに変換できます。

#!/usr/bin/env pwsh
<# 
.SYNOPSIS 
    Convert multiple Azure Resource Manager service connection(s) to use Workload identity federation

.LINK
    https://aka.ms/azdo-rm-workload-identity-conversion

.EXAMPLE
    ./convert_azurerm_service_connection_to_oidc_simple.ps1 -Project <project> -OrganizationUrl https://dev.azure.com/<organization>
#> 
#Requires -Version 7.3

param ( 
    [parameter(Mandatory=$true,HelpMessage="Name of the Azure DevOps Project")]
    [string]
    [ValidateNotNullOrEmpty()]
    $Project,

    [parameter(Mandatory=$true,HelpMessage="Url of the Azure DevOps Organization")]
    [uri]
    [ValidateNotNullOrEmpty()]
    $OrganizationUrl
) 
$apiVersion = "7.1"
$PSNativeCommandArgumentPassing = "Standard" 

#-----------------------------------------------------------
# Log in to Azure
$azdoResource = "499b84ac-1321-427f-aa17-267ca6975798"
az login --allow-no-subscriptions --scope ${azdoResource}/.default
$OrganizationUrl = $OrganizationUrl.ToString().Trim('/')

#-----------------------------------------------------------
# Retrieve the service connection
$getApiUrl = "${OrganizationUrl}/${Project}/_apis/serviceendpoint/endpoints?authSchemes=ServicePrincipal&type=azurerm&includeFailed=false&includeDetails=true&api-version=${apiVersion}"
az rest --resource $azdoResource -u "${getApiUrl} " -m GET --query "sort_by(value[?authorization.scheme=='ServicePrincipal' && data.creationMode=='Automatic' && !(isShared && serviceEndpointProjectReferences[0].projectReference.name!='${Project}')],&name)" -o json `
        | Tee-Object -Variable rawResponse | ConvertFrom-Json | Tee-Object -Variable serviceEndpoints | Format-List | Out-String | Write-Debug
if (!$serviceEndpoints -or ($serviceEndpoints.count-eq 0)) {
    Write-Warning "No convertible service connections found"
    exit 1
}

foreach ($serviceEndpoint in $serviceEndpoints) {
    # Prompt user to confirm conversion
    $choices = @(
        [System.Management.Automation.Host.ChoiceDescription]::new("&Convert", "Converting service connection '$($serviceEndpoint.name)'...")
        [System.Management.Automation.Host.ChoiceDescription]::new("&Skip", "Skipping service connection '$($serviceEndpoint.name)'...")
        [System.Management.Automation.Host.ChoiceDescription]::new("&Exit", "Exit script")
    )
    $prompt = $serviceEndpoint.isShared ? "Convert shared service connection '$($serviceEndpoint.name)'?" : "Convert service connection '$($serviceEndpoint.name)'?"
    $decision = $Host.UI.PromptForChoice([string]::Empty, $prompt, $choices, $serviceEndpoint.isShared ? 1 : 0)

    if ($decision -eq 0) {

        Write-Host "$($choices[$decision].HelpMessage)"
    } elseif ($decision -eq 1) {
        Write-Host "$($PSStyle.Formatting.Warning)$($choices[$decision].HelpMessage)$($PSStyle.Reset)"
        continue 
    } elseif ($decision -ge 2) {
        Write-Host "$($PSStyle.Formatting.Warning)$($choices[$decision].HelpMessage)$($PSStyle.Reset)"
        exit 
    }

    # Prepare request body
    $serviceEndpoint.authorization.scheme = "WorkloadIdentityFederation"
    $serviceEndpoint.data.PSObject.Properties.Remove('revertSchemeDeadline')
    $serviceEndpoint | ConvertTo-Json -Depth 4 | Write-Debug
    $serviceEndpoint | ConvertTo-Json -Depth 4 -Compress | Set-Variable serviceEndpointRequest
    $putApiUrl = "${OrganizationUrl}/${Project}/_apis/serviceendpoint/endpoints/$($serviceEndpoint.id)?operation=ConvertAuthenticationScheme&api-version=${apiVersion}"
    # Convert service connection
    az rest -u "${putApiUrl} " -m PUT -b $serviceEndpointRequest --headers content-type=application/json --resource $azdoResource -o json `
            | ConvertFrom-Json | Set-Variable updatedServiceEndpoint
    
    $updatedServiceEndpoint | ConvertTo-Json -Depth 4 | Write-Debug
    if (!$updatedServiceEndpoint) {
        Write-Debug "Empty response"
        Write-Error "Failed to convert service connection '$($serviceEndpoint.name)'"
        exit 1
    }
    Write-Host "Successfully converted service connection '$($serviceEndpoint.name)'"
}

注意事項

ここで議論されている機能は今後二~三週にわたって順次展開されます。

Azure DevOpsサービスを体験してみてください。

これらの機能についてどう思っているかお聞きしたいと思います。 フィードバックメニューを使用して問題を報告するか、提案を提出してください。

Make a suggestion

アドバイスや回答を必要とする質問がある場合、Stack Overflowコミュニティで聞いてください。

ありがとうございました。

Dan Hellem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment