Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with main #22166

Merged
merged 118 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
a0ec874
corrected release date in changelog
tanyasethi-msft Nov 15, 2023
3b7e8b0
[Release] sdk/resourcemanager/hybridcompute/armhybridcompute/1.2.0 ge…
Alancere Nov 17, 2023
f186c62
[Release] sdk/resourcemanager/containerregistry/armcontainerregistry/…
Alancere Nov 17, 2023
3e7bdbf
[Release] sdk/resourcemanager/eventgrid/armeventgrid/2.2.0 (#22002)
Alancere Nov 17, 2023
2e7902e
[Release] sdk/resourcemanager/postgresql/armpostgresqlflexibleservers…
Alancere Nov 17, 2023
7fb1598
[Release] sdk/resourcemanager/communication/armcommunication/2.1.0 ge…
Alancere Nov 17, 2023
4661007
Increment package version after release of resourcemanager/internal (…
azure-sdk Nov 17, 2023
db669c5
Replace interface{} with any (#22021)
jhendrixMSFT Nov 20, 2023
a2be5d2
Sync eng/common directory with azure-sdk-tools for PR 7310 (#22020)
azure-sdk Nov 20, 2023
189c10a
Update CodeownersLinter to 1.0.0-dev.20231120.3 (#22022)
azure-sdk Nov 20, 2023
c0bce11
Update links to docs (#22023)
jhendrixMSFT Nov 21, 2023
3d4816b
Sync eng/common directory with azure-sdk-tools for PR 7322 (#22037)
azure-sdk Nov 21, 2023
6a155b3
azblob: Remove blob tags (#22026)
souravgupta-msft Nov 22, 2023
c933ba3
Fix incorrect downloaded file size when size of the file is not a mul…
tanyasethi-msft Nov 22, 2023
0d4e015
[Release] sdk/resourcemanager/mobilenetwork/armmobilenetwork/3.1.0 (#…
azure-sdk Nov 23, 2023
4350e35
[Release] sdk/resourcemanager/quota/armquota/1.0.0 (#21943)
azure-sdk Nov 23, 2023
a8696ec
[Release] sdk/resourcemanager/containerservice/armcontainerservice/4.…
Alancere Nov 23, 2023
0e69dd0
[Release] sdk/resourcemanager/integrationspaces/armintegrationspaces/…
azure-sdk Nov 23, 2023
256cbe2
[Release] sdk/resourcemanager/confluent/armconfluent/1.2.0 (#21954)
azure-sdk Nov 23, 2023
cd8f6b5
[Release] sdk/resourcemanager/postgresql/armpostgresqlflexibleservers…
Alancere Nov 23, 2023
bccd404
[Release] sdk/resourcemanager/eventgrid/armeventgrid/2.3.0-beta.1 (#2…
Alancere Nov 23, 2023
781e6d6
[Release] sdk/resourcemanager/containerregistry/armcontainerregistry/…
Alancere Nov 23, 2023
14abe2c
[Release] sdk/resourcemanager/networkanalytics/armnetworkanalytics/0.…
azure-sdk Nov 23, 2023
e3335b9
[Release] sdk/resourcemanager/communication/armcommunication/2.2.0-be…
Alancere Nov 23, 2023
211732a
[Release] sdk/resourcemanager/nginx/armnginx/3.0.0 (#21940)
azure-sdk Nov 23, 2023
92bbfb8
[Refresh] sdk/resourcemanager/compute/armcompute/5.3.0 (#22013)
Alancere Nov 23, 2023
651a245
[Refresh] sdk/resourcemanager/resources (#22015)
Alancere Nov 23, 2023
a8fb27a
[Refresh] sdk/resourcemanager/network/armnetwork/4.3.0 (#22014)
Alancere Nov 23, 2023
e4a2a1f
Release refresh all package 1700466320 (#22016)
Alancere Nov 23, 2023
35cab9d
geneator tool (#22049)
Alancere Nov 23, 2023
99d6ba2
[Release] sdk/resourcemanager/dashboard/armdashboard/1.2.0 (#21959)
azure-sdk Nov 23, 2023
66b5009
[Release] sdk/resourcemanager/hybridcontainerservice/armhybridcontain…
azure-sdk Nov 23, 2023
705dea9
[Release] sdk/resourcemanager/hybridcompute/armhybridcompute/2.0.0-be…
Alancere Nov 23, 2023
00c001f
[Release] sdk/resourcemanager/chaos/armchaos/1.0.0 (#21955)
azure-sdk Nov 23, 2023
da23f8f
[Release] sdk/resourcemanager/containerservice/armcontainerservice/4.…
Alancere Nov 23, 2023
0cd0cc0
Release refresh all package 1700547206 (#22027)
Alancere Nov 23, 2023
a858e36
Release refresh all package 1700550325 (#22028)
Alancere Nov 23, 2023
55c6e6c
Release refresh all package 1700552900 (#22029)
Alancere Nov 23, 2023
5c73429
Release refresh all package 1700554533 (#22030)
Alancere Nov 23, 2023
a82ae0c
Release refresh all package 1700554784 (#22031)
Alancere Nov 23, 2023
47a4a0a
Release refresh all package 1700555708 (#22032)
Alancere Nov 23, 2023
80b7808
Release refresh all package 1700556176 (#22033)
Alancere Nov 24, 2023
a36e07f
Release refresh all package 1700556744 (#22034)
Alancere Nov 24, 2023
1d0940c
Release refresh all package 1700623495 (#22038)
Alancere Nov 24, 2023
2e2377d
Release refresh all package 1700635160 (#22040)
Alancere Nov 24, 2023
65fc248
Release refresh all package 1700635245 (#22041)
Alancere Nov 24, 2023
463de81
Release refresh all package 1700637223 (#22042)
Alancere Nov 24, 2023
ad6f69e
Release refresh all package 1700637272 (#22043)
Alancere Nov 24, 2023
6e4a0fb
Release refresh all package 1700639086 (#22044)
Alancere Nov 24, 2023
f890ed1
Release refresh all package 1700641154 (#22046)
Alancere Nov 24, 2023
76585be
Release refresh all package 1700623469 (#22039)
Alancere Nov 24, 2023
8eea548
Release refresh all package 1700639191 (#22045)
Alancere Nov 24, 2023
d495d41
[Release] sdk/resourcemanager/paloaltonetworksngfw/armpanngfw/1.1.0 (…
azure-sdk Nov 24, 2023
95173db
[Release] sdk/resourcemanager/servicenetworking/armservicenetworking/…
azure-sdk Nov 24, 2023
9858c48
[Release] sdk/resourcemanager/containerservice/armcontainerservice/4.…
Alancere Nov 24, 2023
134f376
[Release] sdk/resourcemanager/datafactory/armdatafactory/4.0.0 (#21992)
Alancere Nov 27, 2023
4e25117
[Release] sdk/resourcemanager/hybridnetwork/armhybridnetwork/2.0.0 (#…
azure-sdk Nov 27, 2023
760c460
Release refresh all package 1700812814 (#22053)
Alancere Nov 27, 2023
22f79af
Release refresh all package 1700815965 (#22055)
Alancere Nov 27, 2023
23ddc72
Release refresh all package 1701064274 (#22057)
Alancere Nov 27, 2023
74a6034
Release refresh all package 1701064593 (#22058)
Alancere Nov 27, 2023
61137f4
[azeventgrid] Updating to the latest swagger. Changes doc'd in the CH…
richardpark-msft Nov 28, 2023
c97411a
Release refresh all package 1701069411 (#22059)
Alancere Nov 28, 2023
f2a3ea9
Fix ACR (#22056)
tadelesh Nov 28, 2023
bb32c8d
[Release] sdk/resourcemanager/appservice/armappservice/2.3.0 generati…
Alancere Nov 28, 2023
aeb1bcd
[Release] sdk/resourcemanager/sql/armsql/1.2.0 generation from spec c…
Alancere Nov 28, 2023
2989c8a
[Release] sdk/resourcemanager/automation/armautomation/0.9.0 generati…
Alancere Nov 28, 2023
a2d83f8
[Release] sdk/resourcemanager/security/armsecurity/0.12.0 generation …
Alancere Nov 28, 2023
64f4fc9
fix vulnerability (#22066)
Alancere Nov 28, 2023
1e7c204
Release refresh all package 1701161912 (#22067)
Alancere Nov 28, 2023
0d3efbd
Sync eng/common directory with azure-sdk-tools for PR 7334 (#22068)
azure-sdk Nov 29, 2023
c23f220
Lets not treat https code 401 as broken link (#22072)
azure-sdk Nov 30, 2023
943ecbb
Sync eng/common directory with azure-sdk-tools for PR 7346 (#22063)
azure-sdk Dec 1, 2023
8404d16
Add CODEOWNERS linter baseline error file (#22083)
JimSuplizio Dec 1, 2023
c85cf6c
Add docs on writing testable examples (#22084)
jhendrixMSFT Dec 4, 2023
12712c9
Add AzureCLICredentialOptions.Subscription (#21962)
chlowell Dec 4, 2023
f8be4a3
suffix .go (#22096)
Alancere Dec 6, 2023
4bc279b
Restore scheme/host when recording HTTP(S) (#22102)
jhendrixMSFT Dec 6, 2023
12830d0
Prep internal for release (#22110)
jhendrixMSFT Dec 6, 2023
0270c00
Refactor 4bc279bfefcf94d2049aee9801efd418a12e0314 (#22111)
jhendrixMSFT Dec 6, 2023
622779c
Increment package version after release of internal (#22113)
azure-sdk Dec 6, 2023
50131f5
Sync eng/common directory with azure-sdk-tools for PR 7385 (#22112)
azure-sdk Dec 6, 2023
837ae16
[Release] sdk/resourcemanager/baremetalinfrastructure/armbaremetalinf…
Alancere Dec 7, 2023
423e02b
[azopenai] Updating to the latest 2023-12-01 API (#22081)
richardpark-msft Dec 7, 2023
b44962e
azblob: Return io.ErrUnexpectedEOF as error in UploadStream (#22109)
souravgupta-msft Dec 8, 2023
074d2cc
Doc fix (#22117)
souravgupta-msft Dec 8, 2023
e96bba7
Add more retry after headers to check during retries (#22121)
jhendrixMSFT Dec 8, 2023
24e7b76
[azopenai] Fixing some issues with incorrect/incomplete types in gene…
richardpark-msft Dec 8, 2023
bfa1322
Prep azcore for release (#22122)
jhendrixMSFT Dec 9, 2023
3a1e9b9
Increment package version after release of azcore (#22124)
azure-sdk Dec 11, 2023
b1a2f3d
[azopenai] Updating to the latest azcore to allow for supporting smal…
richardpark-msft Dec 11, 2023
f94bde2
azblob: Updating dependencies (#22128)
souravgupta-msft Dec 12, 2023
9a5e714
Add version naming and deprecation link (#21679)
dtzar Dec 13, 2023
36d9f8d
fix mgmt README.md module link (#22132)
Alancere Dec 13, 2023
58ac9ec
Updating changelog for azblob 1.2.1 release (#22140)
souravgupta-msft Dec 13, 2023
ed5bc4b
[azopenai] Re-enable the tests for vision and expand it to include Az…
richardpark-msft Dec 13, 2023
ef773b3
Sanitize (#22142)
RickWinter Dec 13, 2023
7703881
[Cosmos] Add Global Endpoint Manager (#22100)
simorenoh Dec 14, 2023
981f3ef
Added replaceReadmeModule function (#22135)
Alancere Dec 14, 2023
8536f47
Increment package version after release of storage/azblob (#22146)
azure-sdk Dec 14, 2023
8867496
Prevent panic in exported.Payload (#22148)
jhendrixMSFT Dec 14, 2023
178fe26
Add Snapshot support for SDK (#22118)
MBSolomon Dec 14, 2023
2621632
Add notice for version 1 deprecation (#21680)
dtzar Dec 15, 2023
82712d0
[Release] sdk/resourcemanager/containerservice/armcontainerservice/4.…
azure-sdk Dec 20, 2023
0101345
[Release] sdk/resourcemanager/selfhelp/armselfhelp/2.0.0-beta.3 gener…
azure-sdk Dec 20, 2023
f497335
[Release] sdk/resourcemanager/servicefabric/armservicefabric/2.0.0 (#…
azure-sdk Dec 20, 2023
166d7c0
[Release] sdk/resourcemanager/postgresql/armpostgresqlflexibleservers…
azure-sdk Dec 20, 2023
9725a99
[Release] sdk/resourcemanager/dataprotection/armdataprotection/3.0.0 …
azure-sdk Dec 20, 2023
72768a2
[Release] sdk/resourcemanager/healthcareapis/armhealthcareapis/2.0.0 …
azure-sdk Dec 20, 2023
2454e9f
[Release] sdk/resourcemanager/deviceupdate/armdeviceupdate/1.3.0 gene…
azure-sdk Dec 20, 2023
959a71b
[Release] sdk/resourcemanager/virtualmachineimagebuilder/armvirtualma…
azure-sdk Dec 20, 2023
38a3d6f
[Release] sdk/resourcemanager/network/armnetwork/5.0.0 (#22093)
azure-sdk Dec 20, 2023
270c1d6
[Release] sdk/resourcemanager/netapp/armnetapp/6.0.0-beta.1 generatio…
azure-sdk Dec 20, 2023
e7bf410
[Release] sdk/resourcemanager/batch/armbatch/2.2.0 generation from sp…
azure-sdk Dec 20, 2023
775c707
[Release] sdk/resourcemanager/compute/armcompute/5.4.0 (#22114)
azure-sdk Dec 20, 2023
babccdd
fix sdk/resourcemanager/connectedvmware/armconnectedvmware README (#2…
Alancere Dec 20, 2023
ff93a33
Merge branch 'main' of github.com:tanyasethi-msft/azure-sdk-for-go in…
tanyasethi-msft Dec 20, 2023
1d0bcf3
Merge branch 'main' of github.com:tanyasethi-msft/azure-sdk-for-go in…
tanyasethi-msft Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

#############
# SDK (track2)
#############
#############

# Catch all for non-code project files and unowned files | folders
/** @rickwinter @jhendrixMSFT
/sdk/ @rickwinter @chlowell @richardpark-msft

# Samples
/samples/ @rickwinter @chlowell @jhendrixMSFT @richardpark-msft
/sdk/samples/ @rickwinter @chlowell @jhendrixMSFT @richardpark-msft

# PRLabel: %Azure.Core
/sdk/azcore/ @rickwinter @chlowell @jhendrixMSFT @richardpark-msft
Expand All @@ -19,7 +19,7 @@
/sdk/azidentity/ @chlowell @jhendrixMSFT @rickwinter @Azure/azure-sdk-write-identity

# PRLable: %OpenAI
/sdk/ai @richardpark-msft @jhendrixMSFT
/sdk/ai @richardpark-msft @jhendrixMSFT

# PRLabel: %Internal
/sdk/internal/ @chlowell @jhendrixMSFT @richardpark-msft @rickwinter
Expand Down
219 changes: 219 additions & 0 deletions .github/CODEOWNERS_baseline_errors.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ To get started with a module, see the README.md file located in the module's pro

> NOTE: Go **1.18** or later is required. You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).

> NOTE: The [root azure-sdk-for-go Go module](https://godoc.org/github.com/Azure/azure-sdk-for-go) which contains subpaths of `/services/**/mgmt/**` (also known as track 1) is [deprecated and no longer recieving support](https://azure.github.io/azure-sdk/releases/deprecated/go.html). See [the migration guide](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/MIGRATION_GUIDE.md) to learn how to migrate to the current version.

## Packages available

Each service can have both 'client' and 'management' modules. 'Client' modules are used to consume the service, whereas 'management' modules are used to configure and manage the service.
Expand Down
2 changes: 1 addition & 1 deletion documentation/MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Guide for migrating to `sdk/resourcemanager/**/arm**` from `services/**/mgmt/**`

This document is intended for users that are familiar with the previous version of the Azure SDK For Go for management modules (`services/**/mgmt/**`) and wish to migrate their application to the next version of Azure resource management libraries (`sdk/resourcemanager/**/arm**`)
This document is intended for users that are familiar with the older version of Azure SDKs of management libraries for Go language (package name starts with `services/**/mgmt/**`, also known as track1) and pursue to migrate their application code on to the latest version of Azure SDKs for Go that conform to our [current Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html) (SDK package name starts with `sdk/resourcemanager/**/arm**`, also known as track2). The older Golang libraries that do not conform to [Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html) are deprecated by 30 September 2023. Although the older libraries can still be used beyond deprecation, they will no longer receive official support and updates from Microsoft after that date.

**For users new to the Azure SDK For Go for resource management modules, please see the [README for 'sdk/azcore`](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/azcore) and the README for every individual package.**

Expand Down
16 changes: 16 additions & 0 deletions documentation/developer_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [Module Skeleton](#create-module-skeleton)
* [Create SDK](#create-your-sdk)
* [Write Tests](#write-tests)
* [Write Examples](#write-examples)

## Installing Go

Expand Down Expand Up @@ -366,6 +367,20 @@ test-proxy push -a <path-to-assets.json>

On completion of the push, a newly created tag will be stamped into the `assets.json` file. This new tag must be committed and pushed to your package directory along with any other changes.

## Write Examples

Examples are built into the Go toolchain by way of [testable examples][testable_examples]. By convention, examples are placed in a file named `example_test.go` and
may be spread across multiple files, grouped by feature (e.g. `example_<feature>_test.go`). Since testable examples are by definition tests, the file(s) must have the `_test.go` suffix.

Examples **should** be succinct allowing for copy/paste usage and **must** be clearly commented so they're easy to understand.

Examples **must** be provided as testable examples, not as markdown blocks in README files (code snippets are ok but should be used sparingly as they tend to rot over time).
This ensures that examples actually compile (and work!) and remain current as a SDK evolves. It also allows the doc tooling to automatically link API docs to their examples.

Please consult the canonical documentation on [testable examples][testable_examples] for instructions on how to create/name testable examples and enabling testable example execution.

All SDKs **must** include, at minimum, examples for their champion scenarios.

## Create Pipelines

When you create the first PR for your library you will want to create this PR against a `track2-<package>` library. Submitting PRs to the `main` branch should only be done once your package is close to being released. Treating `track2-<package>` as your main development branch will allow nightly CI and live pipeline runs to pick up issues as soon as they are introduced. After creating this PR add a comment with the following:
Expand Down Expand Up @@ -398,3 +413,4 @@ This creates the pipelines that will verify future PRs. The `azure-sdk-for-go` i
[autorest_directives]: https://github.com/Azure/autorest/blob/main/docs/generate/directives.md
[test_resources]: https://github.com/Azure/azure-sdk-tools/tree/main/eng/common/TestResources
[recording_package]: https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/internal/recording
[testable_examples]: https://go.dev/blog/examples
9 changes: 8 additions & 1 deletion eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,14 @@ function BuildDeploymentOutputs([string]$serviceName, [object]$azContext, [objec
}
}

return $deploymentOutputs
# Force capitalization of all keys to avoid Azure Pipelines confusion with
# variable auto-capitalization and OS env var capitalization differences
$capitalized = @{}
foreach ($item in $deploymentOutputs.GetEnumerator()) {
$capitalized[$item.Name.ToUpperInvariant()] = $item.Value
}

return $capitalized
}

function SetDeploymentOutputs(
Expand Down
2 changes: 1 addition & 1 deletion eng/common/pipelines/codeowners-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ stages:
vmImage: ubuntu-22.04

variables:
CodeownersLinterVersion: '1.0.0-dev.20231107.2'
CodeownersLinterVersion: '1.0.0-dev.20231120.3'
DotNetDevOpsFeed: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"
RepoLabelUri: "https://azuresdkartifacts.blob.core.windows.net/azure-sdk-write-teams/repository-labels-blob"
TeamUserUri: "https://azuresdkartifacts.blob.core.windows.net/azure-sdk-write-teams/azure-sdk-write-teams-blob"
Expand Down
4 changes: 2 additions & 2 deletions eng/common/scripts/Cadl-Project-Generate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param (
[ValidateNotNullOrEmpty()]
[string] $ProjectDirectory,
[Parameter(Position=1)]
[string] $CadlAdditionalOptions ## addtional cadl emitter options, separated by semicolon if more than one, e.g. option1=value1;option2=value2
[string] $CadlAdditionalOptions ## additional cadl emitter options, separated by semicolon if more than one, e.g. option1=value1;option2=value2
)

$ErrorActionPreference = "Stop"
Expand Down Expand Up @@ -98,4 +98,4 @@ finally {
$shouldCleanUp = $configuration["cleanup"] ?? $true
if ($shouldCleanUp) {
Remove-Item $tempFolder -Recurse -Force
}
}
96 changes: 64 additions & 32 deletions eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function BuildHashKey()
}

$parentWorkItems = @{}
function FindParentWorkItem($serviceName, $packageDisplayName, $outputCommand = $false, $ignoreReleasePlannerTests = $true)
function FindParentWorkItem($serviceName, $packageDisplayName, $outputCommand = $false, $ignoreReleasePlannerTests = $true, $tag = $null)
{
$key = BuildHashKey $serviceName $packageDisplayName
if ($key -and $parentWorkItems.ContainsKey($key)) {
Expand All @@ -154,6 +154,9 @@ function FindParentWorkItem($serviceName, $packageDisplayName, $outputCommand =
else {
$serviceCondition = "[ServiceName] <> ''"
}
if ($tag) {
$serviceCondition += " AND [Tags] CONTAINS '${tag}'"
}
if($ignoreReleasePlannerTests){
$serviceCondition += " AND [Tags] NOT CONTAINS 'Release Planner App Test'"
}
Expand Down Expand Up @@ -185,10 +188,10 @@ function FindParentWorkItem($serviceName, $packageDisplayName, $outputCommand =
$packageWorkItems = @{}
$packageWorkItemWithoutKeyFields = @{}

function FindLatestPackageWorkItem($lang, $packageName, $outputCommand = $true, $ignoreReleasePlannerTests = $true)
function FindLatestPackageWorkItem($lang, $packageName, $outputCommand = $true, $ignoreReleasePlannerTests = $true, $tag = $null)
{
# Cache all the versions of this package and language work items
$null = FindPackageWorkItem $lang $packageName -includeClosed $true -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests
$null = FindPackageWorkItem $lang $packageName -includeClosed $true -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests -tag $tag

$latestWI = $null
foreach ($wi in $packageWorkItems.Values)
Expand All @@ -208,7 +211,7 @@ function FindLatestPackageWorkItem($lang, $packageName, $outputCommand = $true,
return $latestWI
}

function FindPackageWorkItem($lang, $packageName, $version, $outputCommand = $true, $includeClosed = $false, $ignoreReleasePlannerTests = $true)
function FindPackageWorkItem($lang, $packageName, $version, $outputCommand = $true, $includeClosed = $false, $ignoreReleasePlannerTests = $true, $tag = $null)
{
$key = BuildHashKeyNoNull $lang $packageName $version
if ($key -and $packageWorkItems.ContainsKey($key)) {
Expand Down Expand Up @@ -254,6 +257,9 @@ function FindPackageWorkItem($lang, $packageName, $version, $outputCommand = $tr
if ($version) {
$query += " AND [PackageVersionMajorMinor] = '${version}'"
}
if ($tag) {
$query += " AND [Tags] CONTAINS '${tag}'"
}
if($ignoreReleasePlannerTests){
$query += " AND [Tags] NOT CONTAINS 'Release Planner App Test'"
}
Expand Down Expand Up @@ -331,7 +337,8 @@ function CreateWorkItemParent($id, $parentId, $oldParentId, $outputCommand = $tr

Invoke-AzBoardsCmd "work-item relation add" $parameters $outputCommand | Out-Null
}
function CreateWorkItem($title, $type, $iteration, $area, $fields, $assignedTo, $parentId, $outputCommand = $true)

function CreateWorkItem($title, $type, $iteration, $area, $fields, $assignedTo, $parentId, $relatedId = $null, $outputCommand = $true, $tag = $null)
{
$parameters = $ReleaseDevOpsCommonParametersWithProject
$parameters += "--title", "`"${title}`""
Expand All @@ -341,25 +348,51 @@ function CreateWorkItem($title, $type, $iteration, $area, $fields, $assignedTo,
if ($assignedTo) {
$parameters += "--assigned-to", "`"${assignedTo}`""
}
if ($tag)
{
if ($fields)
{
$fields += "`"System.Tags=${tag}`""
}
else
{
$parameters += "--fields"
$parameters += "`"System.Tags=${tag}`""
}
}
if ($fields) {
$parameters += "--fields"
$parameters += $fields
}

Write-Host "Creating work item"
$workItem = Invoke-AzBoardsCmd "work-item create" $parameters $outputCommand

if ($parentId) {
$parameters = $ReleaseDevOpsCommonParameters
$parameters += "--id", $workItem.id
$parameters += "--relation-type", "parent"
$parameters += "--target-id", $parentId

Invoke-AzBoardsCmd "work-item relation add" $parameters $outputCommand | Out-Null
Write-Host $workItem
$workItemId = $workItem.id
Write-Host "Created work item [$workItemId]."
if ($parentId)
{
CreateWorkItemRelation $workItemId $parentId "parent" $outputCommand
}

# Add a work item as related if given.
if ($relatedId)
{
CreateWorkItemRelation $workItemId $relatedId "Related" $outputCommand
}

return $workItem
}

function CreateWorkItemRelation($id, $relatedId, $relationType, $outputCommand = $true)
{
$parameters = $ReleaseDevOpsCommonParameters
$parameters += "--id", $id
$parameters += "--relation-type", $relationType
$parameters += "--target-id", $relatedId
Write-Host "Updating work item [$relatedId] as [$relationType] of [$id]."
Invoke-AzBoardsCmd "work-item relation add" $parameters $outputCommand | Out-Null
}

function UpdateWorkItem($id, $fields, $title, $state, $assignedTo, $outputCommand = $true)
{
$parameters = $ReleaseDevOpsCommonParameters
Expand Down Expand Up @@ -387,12 +420,12 @@ function UpdatePackageWorkItemReleaseState($id, $state, $releaseType, $outputCom
return UpdateWorkItem -id $id -state $state -fields $fields -outputCommand $outputCommand
}

function FindOrCreateClonePackageWorkItem($lang, $pkg, $verMajorMinor, $allowPrompt = $false, $outputCommand = $false)
function FindOrCreateClonePackageWorkItem($lang, $pkg, $verMajorMinor, $allowPrompt = $false, $outputCommand = $false, $relatedId = $null, $tag= $null, $ignoreReleasePlannerTests = $true)
{
$workItem = FindPackageWorkItem -lang $lang -packageName $pkg.Package -version $verMajorMinor -includeClosed $true -outputCommand $outputCommand
$workItem = FindPackageWorkItem -lang $lang -packageName $pkg.Package -version $verMajorMinor -includeClosed $true -outputCommand $outputCommand -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests

if (!$workItem) {
$latestVersionItem = FindLatestPackageWorkItem -lang $lang -packageName $pkg.Package -outputCommand $outputCommand
$latestVersionItem = FindLatestPackageWorkItem -lang $lang -packageName $pkg.Package -outputCommand $outputCommand -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests
$assignedTo = "me"
$extraFields = @()
if ($latestVersionItem) {
Expand Down Expand Up @@ -428,15 +461,13 @@ function FindOrCreateClonePackageWorkItem($lang, $pkg, $verMajorMinor, $allowPro
$packageInfo.ServiceName = $readInput
}
}


$workItem = CreateOrUpdatePackageWorkItem $lang $pkg $verMajorMinor -existingItem $null -assignedTo $assignedTo -extraFields $extraFields -outputCommand $outputCommand
$workItem = CreateOrUpdatePackageWorkItem $lang $pkg $verMajorMinor -existingItem $null -assignedTo $assignedTo -extraFields $extraFields -outputCommand $outputCommand -relatedId $relatedId -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests
}

return $workItem
}

function CreateOrUpdatePackageWorkItem($lang, $pkg, $verMajorMinor, $existingItem, $assignedTo = $null, $extraFields = $null, $outputCommand = $true)
function CreateOrUpdatePackageWorkItem($lang, $pkg, $verMajorMinor, $existingItem, $assignedTo = $null, $extraFields = $null, $outputCommand = $true, $relatedId = $null, $tag = $null, $ignoreReleasePlannerTests = $true)
{
if (!$lang -or !$pkg -or !$verMajorMinor) {
Write-Host "Cannot create or update because one of lang, pkg or verMajorMinor aren't set. [$lang|$($pkg.Package)|$verMajorMinor]"
Expand Down Expand Up @@ -495,23 +526,24 @@ function CreateOrUpdatePackageWorkItem($lang, $pkg, $verMajorMinor, $existingIte
}
}

$newparentItem = FindOrCreatePackageGroupParent $serviceName $pkgDisplayName -outputCommand $false
$newparentItem = FindOrCreatePackageGroupParent $serviceName $pkgDisplayName -outputCommand $false -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests
UpdateWorkItemParent $existingItem $newParentItem -outputCommand $outputCommand
return $existingItem
}

$parentItem = FindOrCreatePackageGroupParent $serviceName $pkgDisplayName -outputCommand $false
$workItem = CreateWorkItem $title "Package" "Release" "Release" $fields $assignedTo $parentItem.id -outputCommand $outputCommand
$parentItem = FindOrCreatePackageGroupParent $serviceName $pkgDisplayName -outputCommand $false -tag $tag -ignoreReleasePlannerTests $ignoreReleasePlannerTests
Write-Host "Found product work item [$($parentItem.id)]. Creating package work item."
$workItem = CreateWorkItem $title "Package" "Release" "Release" $fields $assignedTo $parentItem.id -outputCommand $outputCommand -relatedId $relatedId -tag $tag
Write-Host "[$($workItem.id)]$lang - $pkgName($verMajorMinor) - Created"
return $workItem
}

function FindOrCreatePackageGroupParent($serviceName, $packageDisplayName, $outputCommand = $true, $ignoreReleasePlannerTests = $true)
function FindOrCreatePackageGroupParent($serviceName, $packageDisplayName, $outputCommand = $true, $ignoreReleasePlannerTests = $true, $tag = $null)
{
$existingItem = FindParentWorkItem $serviceName $packageDisplayName -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests
$existingItem = FindParentWorkItem $serviceName $packageDisplayName -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests -tag $tag
if ($existingItem) {
Write-Host "Found existing product work item [$($existingItem.id)]"
$newparentItem = FindOrCreateServiceParent $serviceName -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests
$newparentItem = FindOrCreateServiceParent $serviceName -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests -tag $tag
UpdateWorkItemParent $existingItem $newParentItem
return $existingItem
}
Expand All @@ -520,18 +552,18 @@ function FindOrCreatePackageGroupParent($serviceName, $packageDisplayName, $outp
$fields += "`"PackageDisplayName=${packageDisplayName}`""
$fields += "`"ServiceName=${serviceName}`""
$fields += "`"Custom.EpicType=Product`""
$serviceParentItem = FindOrCreateServiceParent $serviceName -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests
$workItem = CreateWorkItem $packageDisplayName "Epic" "Release" "Release" $fields $null $serviceParentItem.id
$serviceParentItem = FindOrCreateServiceParent $serviceName -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests -tag $tag
$workItem = CreateWorkItem $packageDisplayName "Epic" "Release" "Release" $fields $null $serviceParentItem.id -tag $tag

$localKey = BuildHashKey $serviceName $packageDisplayName
Write-Host "[$($workItem.id)]$localKey - Created Parent"
$parentWorkItems[$localKey] = $workItem
return $workItem
}

function FindOrCreateServiceParent($serviceName, $outputCommand = $true, $ignoreReleasePlannerTests = $true)
function FindOrCreateServiceParent($serviceName, $outputCommand = $true, $ignoreReleasePlannerTests = $true, $tag = $null)
{
$serviceParent = FindParentWorkItem $serviceName -packageDisplayName $null -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests
$serviceParent = FindParentWorkItem $serviceName -packageDisplayName $null -outputCommand $outputCommand -ignoreReleasePlannerTests $ignoreReleasePlannerTests -tag $tag
if ($serviceParent) {
Write-Host "Found existing service work item [$($serviceParent.id)]"
return $serviceParent
Expand All @@ -542,7 +574,7 @@ function FindOrCreateServiceParent($serviceName, $outputCommand = $true, $ignore
$fields += "`"ServiceName=${serviceName}`""
$fields += "`"Custom.EpicType=Service`""
$parentId = $null
$workItem = CreateWorkItem $serviceName "Epic" "Release" "Release" $fields $null $parentId -outputCommand $outputCommand
$workItem = CreateWorkItem $serviceName "Epic" "Release" "Release" $fields $null $parentId -outputCommand $outputCommand -tag $tag

$localKey = BuildHashKey $serviceName
Write-Host "[$($workItem.id)]$localKey - Created service work item"
Expand Down
1 change: 1 addition & 0 deletions eng/common/scripts/Test-SampleMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ begin {
"azure-active-directory-b2c",
"azure-active-directory-domain",
"azure-advisor",
"azure-ai-content-safety",
"azure-analysis-services",
"azure-anomaly-detector",
"azure-api-apps",
Expand Down
Loading
Loading