Skip to content

Commit

Permalink
merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Gee committed Sep 10, 2020
2 parents 159a19e + bbcc72f commit c85d6e0
Show file tree
Hide file tree
Showing 750 changed files with 517,789 additions and 199,895 deletions.
9 changes: 6 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/sdk/identity/ @chlowell @schaabs

# PRLabel: %Event Hubs
/sdk/eventhub/ @annatisch @yunhaoling @YijunXieMS
/sdk/eventhub/ @annatisch @yunhaoling @KieranBrantnerMagee

# PRLabel: %Storage
/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft @tasherif-msft @kasobol-msft
Expand Down Expand Up @@ -56,7 +56,7 @@
/sdk/datadatamigration/ @vchske

# PRLabel: %Event Grid
/sdk/eventgrid/ @kalyanaj
/sdk/eventgrid/ @lmazuel @rakshith91 @KieranBrantnerMagee

# PRLabel: %HDInsight
/sdk/hdinsight/ @idear1203
Expand All @@ -67,6 +67,9 @@
# PRLabel: %Recovery Services
/sdk/recoveryservices/ @DheerendraRathor

# PRLabel: %Schema Registry
/sdk/schemaregistry/ @yunhaoling

# PRLabel: %Search
/sdk/search/ @xiangyan99 @rakshith91

Expand All @@ -77,7 +80,7 @@
/sql/sql/ @jaredmoo

# PRLabel: %Service Bus
/sdk/servicebus/ @annatisch @yunhaoling @YijunXieMS @KieranBrantnerMagee
/sdk/servicebus/ @annatisch @yunhaoling @KieranBrantnerMagee

# PRLabel: %Synapse
/sdk/synapse/ @aim-for-better @idear1203
Expand Down
4 changes: 2 additions & 2 deletions eng/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ The 'Sync eng/common directory' PRs will be created in the language repositories
3. More changes pushed to the **Tools PR**, will automatically triggered new pipeline runs in the respective **Sync PRs**. The **Sync PRs** are used to make sure the changes would not break any of the connected pipelines.
4. Once satisfied with the changes;
- First make sure all checks in the **Sync PRs** are green and approved. The **Tools PR** contains links to all the **Sync PRs**. If for some reason the PRs is blocked by a CI gate get someone with permission to override and manually merge the PR.
- To test the state of all the **Sync PRs**, you can download the `PRsCreated.txt` artifact from the `azure-sdk-tools - sync - eng-common` pipeline, with that run the [Verify-And-Merge-PRs.ps1](https://github.com/Azure/azure-sdk-tools/blob/master/scripts/powershell/Verify-And-Merge-PRs.ps1) passing the downloaded `PRsCreated.txt` file path for `PRDataArtifactPath` and `false` to `ShouldMerge`.
- Next approve the `VerifyAndMerge` job for the `azure-sdk-tools - sync - eng-common` pipeline triggered by your **Tools PR** which will automatically merge all the **Sync PRs**. You need `azure-sdk` devops contributor permissions to reach the `azure-sdk-tools - sync - eng-common` pipeline.
- To test the state of all the **Sync PRs**, you can download the `PRsCreated.txt` artifact from your `azure-sdk-tools - sync - eng-common` pipeline, then run `./eng/scripts/Verify-And-Merge.ps1 <path to PRsCreated.txt>` which will output the status of each associated PR.
- Next approve the `VerifyAndMerge` job for the `azure-sdk-tools - sync - eng-common` pipeline triggered by your **Tools PR** which will automatically merge all the **Sync PRs**. You need `azure-sdk` devops contributor permissions to reach the `azure-sdk-tools - sync - eng-common` pipeline.
- Finally merge the **Tools PR**.
13 changes: 9 additions & 4 deletions eng/common/Update-Change-Log.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ param (
[Parameter(Mandatory = $true)]
[String]$ChangeLogPath,
[String]$Unreleased = $True,
[String]$ReplaceVersion = $False
[String]$ReplaceVersion = $False,
[String]$ReleaseDate
)


Expand Down Expand Up @@ -46,8 +47,12 @@ function Get-VersionTitle($Version, $Unreleased)
# Generate version title
$newVersionTitle = "## $Version $UNRELEASED_TAG"
if ($Unreleased -eq $False) {
$releaseDate = Get-Date -Format "(yyyy-MM-dd)"
$newVersionTitle = "## $Version $releaseDate"
$actualReleaseDate = $ReleaseDate;

if (!$actualReleaseDate) {
$actualReleaseDate = Get-Date -Format "yyyy-MM-dd"
}
$newVersionTitle = "## $Version ($actualReleaseDate)"
}
return $newVersionTitle
}
Expand Down Expand Up @@ -95,7 +100,7 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
exit(0)
}

if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and $CurrentTitle.Contains($version) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG))) {
if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and $CurrentTitle.Contains($version) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG)) -and (-not $ReleaseDate)) {
Write-Host "Version is already present in change log with a release date."
exit(0)
}
Expand Down
4 changes: 4 additions & 0 deletions eng/common/pipelines/templates/steps/publish-blobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ parameters:
TargetLanguage: ''
BlobName: ''
ScriptPath: ''
ArtifactLocation: ''
RepoId: $(Build.Repository.Name)

steps:
- pwsh: |
Expand All @@ -21,6 +23,8 @@ steps:
-SASKey "${{ parameters.BlobSASKey }}"
-Language "${{ parameters.TargetLanguage }}"
-BlobName "${{ parameters.BlobName }}"
-PublicArtifactLocation "${{ parameters.ArtifactLocation }}"
-RepoReplaceRegex "(https://github.com/${{ parameters.RepoId }}/(?:blob|tree)/)master"
pwsh: true
workingDirectory: $(Pipeline.Workspace)
displayName: Copy Docs to Blob
Expand Down
7 changes: 4 additions & 3 deletions eng/common/pipelines/templates/steps/verify-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ parameters:
- name: ServiceName
type: string
default: 'not-specified'
- name: ServiceDirectory
type: string
default: ''
- name: ForRelease
type: boolean
default: false
Expand All @@ -15,9 +18,7 @@ steps:
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Verify-ChangeLog.ps1
arguments: >
-PackageName ${{ parameters.PackageName }}
-ServiceName ${{ parameters.ServiceName }}
-RepoRoot $(Build.SourcesDirectory)
-RepoName $(Build.Repository.Name)
-ServiceDirectory ${{ coalesce(parameters.ServiceDirectory, parameters.ServiceName) }}
-ForRelease $${{ parameters.ForRelease }}
pwsh: true
workingDirectory: $(Pipeline.Workspace)
Expand Down
102 changes: 50 additions & 52 deletions eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
@@ -1,66 +1,65 @@
# Helper functions for retireving useful information from azure-sdk-for-* repo
# Example Use : Import-Module .\eng\common\scripts\modules
class PackageProps
{
[string]$pkgName
[string]$pkgVersion
[string]$pkgDirectoryPath
[string]$pkgServiceName
[string]$pkgReadMePath
[string]$pkgChangeLogPath
[string]$pkgGroup

PackageProps([string]$pkgName,[string]$pkgVersion,[string]$pkgDirectoryPath,[string]$pkgServiceName)
[string]$Name
[string]$Version
[string]$DirectoryPath
[string]$ServiceDirectory
[string]$ReadMePath
[string]$ChangeLogPath
[string]$Group

PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory)
{
$this.Initialize($pkgName, $pkgVersion, $pkgDirectoryPath, $pkgServiceName)
$this.Initialize($name, $version, $directoryPath, $serviceDirectory)
}

PackageProps([string]$pkgName,[string]$pkgVersion,[string]$pkgDirectoryPath,[string]$pkgServiceName,[string]$pkgGroup="")
PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory, [string]$group = "")
{
$this.Initialize($pkgName, $pkgVersion, $pkgDirectoryPath, $pkgServiceName, $pkgGroup)
$this.Initialize($name, $version, $directoryPath, $serviceDirectory, $group)
}

hidden [void]Initialize(
[string]$pkgName,
[string]$pkgVersion,
[string]$pkgDirectoryPath,
[string]$pkgServiceName
[string]$name,
[string]$version,
[string]$directoryPath,
[string]$serviceDirectory
)
{
$this.pkgName = $pkgName
$this.pkgVersion = $pkgVersion
$this.pkgDirectoryPath = $pkgDirectoryPath
$this.pkgServiceName = $pkgServiceName
$this.Name = $name
$this.Version = $version
$this.DirectoryPath = $directoryPath
$this.ServiceDirectory = $serviceDirectory

if (Test-Path (Join-Path $pkgDirectoryPath "README.md"))
if (Test-Path (Join-Path $directoryPath "README.md"))
{
$this.pkgReadMePath = Join-Path $pkgDirectoryPath "README.md"
$this.ReadMePath = Join-Path $directoryPath "README.md"
}
else
{
$this.pkgReadMePath = $null
$this.ReadMePath = $null
}

if (Test-Path (Join-Path $pkgDirectoryPath "CHANGELOG.md"))
if (Test-Path (Join-Path $directoryPath "CHANGELOG.md"))
{
$this.pkgChangeLogPath = Join-Path $pkgDirectoryPath "CHANGELOG.md"
$this.ChangeLogPath = Join-Path $directoryPath "CHANGELOG.md"
}
else
{
$this.pkgChangeLogPath = $null
$this.ChangeLogPath = $null
}
}

hidden [void]Initialize(
[string]$pkgName,
[string]$pkgVersion,
[string]$pkgDirectoryPath,
[string]$pkgServiceName,
[string]$pkgGroup
[string]$name,
[string]$version,
[string]$directoryPath,
[string]$serviceDirectory,
[string]$group
)
{
$this.Initialize($pkgName, $pkgVersion, $pkgDirectoryPath, $pkgServiceName)
$this.pkgGroup = $pkgGroup
$this.Initialize($name, $version, $directoryPath, $serviceDirectory)
$this.Group = $group
}
}

Expand All @@ -72,18 +71,17 @@ function Get-PkgProperties
{
Param
(
[Parameter(Mandatory=$true)]
[Parameter(Mandatory = $true)]
[string]$PackageName,
[Parameter(Mandatory=$true)]
[string]$ServiceName
[Parameter(Mandatory = $true)]
[string]$ServiceDirectory
)

$pkgDirectoryName = $null
$pkgDirectoryPath = $null
$serviceDirectoryPath = Join-Path $RepoRoot "sdk" $ServiceName
$serviceDirectoryPath = Join-Path $RepoRoot "sdk" $ServiceDirectory
if (!(Test-Path $serviceDirectoryPath))
{
Write-Error "Service Directory $ServiceName does not exist"
Write-Error "Service Directory $ServiceDirectory does not exist"
exit 1
}

Expand All @@ -92,13 +90,13 @@ function Get-PkgProperties
foreach ($directory in $directoriesPresent)
{
$pkgDirectoryPath = Join-Path $serviceDirectoryPath $directory.Name
if ($ExtractPkgProps)
if ($GetPackageInfoFromRepoFn)
{
$pkgProps = &$ExtractPkgProps -pkgPath $pkgDirectoryPath -serviceName $ServiceName -pkgName $PackageName
$pkgProps = &$GetPackageInfoFromRepoFn -pkgPath $pkgDirectoryPath -serviceDirectory $ServiceDirectory -pkgName $PackageName
}
else
{
Write-Error "The function '${ExtractPkgProps}' was not found."
Write-Error "The function 'Get-${Language}-PackageInfoFromRepo' was not found."
}

if ($pkgProps -ne $null)
Expand All @@ -112,11 +110,11 @@ function Get-PkgProperties
# Takes ServiceName and Repo Root Directory
# Returns important properties for each package in the specified service, or entire repo if the serviceName is not specified
# Returns an Table of service key to array values of PS Object with properties @ { pkgName, pkgVersion, pkgDirectoryPath, pkgReadMePath, pkgChangeLogPath }
function Get-AllPkgProperties ([string]$ServiceName=$null)
function Get-AllPkgProperties ([string]$ServiceDirectory = $null)
{
$pkgPropsResult = @()

if ([string]::IsNullOrEmpty($ServiceName))
if ([string]::IsNullOrEmpty($ServiceDirectory))
{
$searchDir = Join-Path $RepoRoot "sdk"
foreach ($dir in (Get-ChildItem $searchDir -Directory))
Expand All @@ -128,32 +126,32 @@ function Get-AllPkgProperties ([string]$ServiceName=$null)
$activePkgList = Get-PkgListFromYml -ciYmlPath (Join-Path $serviceDir "ci.yml")
if ($activePkgList -ne $null)
{
$pkgPropsResult = Operate-OnPackages -activePkgList $activePkgList -serviceName $dir.Name -pkgPropsResult $pkgPropsResult
$pkgPropsResult = Operate-OnPackages -activePkgList $activePkgList -ServiceDirectory $dir.Name -pkgPropsResult $pkgPropsResult
}
}
}
}
else
{
$serviceDir = Join-Path $RepoRoot "sdk" $ServiceName
$serviceDir = Join-Path $RepoRoot "sdk" $ServiceDirectory
if (Test-Path (Join-Path $serviceDir "ci.yml"))
{
$activePkgList = Get-PkgListFromYml -ciYmlPath (Join-Path $serviceDir "ci.yml")
if ($activePkgList -ne $null)
{
$pkgPropsResult = Operate-OnPackages -activePkgList $activePkgList -serviceName $ServiceName -pkgPropsResult $pkgPropsResult
$pkgPropsResult = Operate-OnPackages -activePkgList $activePkgList -ServiceDirectory $ServiceDirectory -pkgPropsResult $pkgPropsResult
}
}
}

return $pkgPropsResult
}

function Operate-OnPackages ($activePkgList, $serviceName, [Array]$pkgPropsResult)
function Operate-OnPackages ($activePkgList, $ServiceDirectory, [Array]$pkgPropsResult)
{
foreach ($pkg in $activePkgList)
{
$pkgProps = Get-PkgProperties -PackageName $pkg["name"] -ServiceName $serviceName
$pkgProps = Get-PkgProperties -PackageName $pkg["name"] -ServiceDirectory $ServiceDirectory
$pkgPropsResult += $pkgProps
}
return $pkgPropsResult
Expand All @@ -168,11 +166,11 @@ function Get-PkgListFromYml ($ciYmlPath)
$ciYmlObj = ConvertFrom-Yaml $ciYmlContent -Ordered
if ($ciYmlObj.Contains("stages"))
{
$artifactsInCI = $ciYmlObj["stages"][0]["parameters"]["Artifacts"]
$artifactsInCI = $ciYmlObj["stages"][0]["parameters"]["Artifacts"]
}
elseif ($ciYmlObj.Contains("extends"))
{
$artifactsInCI = $ciYmlObj["extends"]["parameters"]["Artifacts"]
$artifactsInCI = $ciYmlObj["extends"]["parameters"]["Artifacts"]
}
if ($artifactsInCI -eq $null)
{
Expand Down
28 changes: 4 additions & 24 deletions eng/common/scripts/Verify-ChangeLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,11 @@ param (
[String]$ChangeLogLocation,
[String]$VersionString,
[string]$PackageName,
[string]$ServiceName,
[string]$RepoRoot,
[ValidateSet("net", "java", "js", "python")]
[string]$Language,
[string]$RepoName,
[string]$ServiceDirectory,
[boolean]$ForRelease = $False
)

$ProgressPreference = "SilentlyContinue"
. (Join-Path $PSScriptRoot SemVer.ps1)
Import-Module (Join-Path $PSScriptRoot modules ChangeLog-Operations.psm1)
. (Join-Path $PSScriptRoot common.ps1)

$validChangeLog = $false
if ($ChangeLogLocation -and $VersionString)
Expand All @@ -22,22 +16,8 @@ if ($ChangeLogLocation -and $VersionString)
}
else
{
Import-Module (Join-Path $PSScriptRoot modules Package-Properties.psm1)
if ([System.String]::IsNullOrEmpty($Language))
{
if ($RepoName -match "azure-sdk-for-(?<lang>[^-]+)")
{
$Language = $matches["lang"]
}
else
{
Write-Error "Failed to set Language automatically. Please pass the appropriate Language as a parameter."
exit 1
}
}

$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot
$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease
$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceDirectory $ServiceDirectory
$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $ForRelease
}

if (!$validChangeLog)
Expand Down
Loading

0 comments on commit c85d6e0

Please sign in to comment.