Skip to content

Commit 6649248

Browse files
committed
merging with upstream/master
2 parents f8176f9 + 91f77c7 commit 6649248

File tree

706 files changed

+256293
-11413
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

706 files changed

+256293
-11413
lines changed

doc/dev/mgmt/tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ providing several features useful for the SDK tests, for example:
176176
* Patches for overriding functions and methods that don't work well with tests
177177
(such as long-running operations)
178178
179-
Code in the [`azure-sdk-tools/devtools_testutils`](tools/azure-sdk-tools/devtools_testutils) directory
179+
Code in the [`azure-sdk-tools/devtools_testutils`](https://github.com/Azure/azure-sdk-for-python/tree/master/tools/azure-sdk-tools/devtools_testutils) directory
180180
provides concrete implementations of the features provided in `scenario_tests`
181181
that are oriented around use in SDK testing
182182
and that you can use directly in your unit tests.

doc/sphinx/package_service_mapping.json

+5
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,11 @@
901901
"service_name": "Storage",
902902
"manually_generated": true
903903
},
904+
"azure-storage-blob-changefeed": {
905+
"category": "Client",
906+
"service_name": "Storage",
907+
"manually_generated": true
908+
},
904909
"azure-storage-file-share": {
905910
"category": "Client",
906911
"service_name": "Storage",

eng/.docsettings.yml

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ known_content_issues:
114114
- ['sdk/search/azure-search-nspkg/README.md', 'nspkg and common']
115115
- ['sdk/storage/azure-storage-blob/samples/README.md', 'nspkg and common']
116116
- ['sdk/storage/azure-storage-file-datalake/samples/README.md', 'nspkg and common']
117+
- ['sdk/storage/azure-storage-blob-changefeed/samples/README.md', 'nspkg and common']
117118
- ['sdk/storage/azure-storage-file-share/samples/README.md', 'nspkg and common']
118119
- ['sdk/storage/azure-storage-queue/samples/README.md', 'nspkg and common']
119120
- ['sdk/textanalytics/azure-ai-nspkg/README.md', 'nspkg and common']

eng/ci_tools.txt

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
# requirements leveraged by ci tools
22
setuptools==44.1.0; python_version == '2.7'
3-
setuptools==45.1.0; python_version >= '3.5'
3+
setuptools==46.4.0; python_version >= '3.5'
44
virtualenv==20.0.23
55
wheel==0.34.2
6-
Jinja2==2.11.1
6+
Jinja2==2.11.2
77
packaging==20.4
8-
tox==3.14.6
8+
tox==3.15.0
99
tox-monorepo==0.1.2
10-
twine==1.15.0
10+
twine==1.15.0; python_version == '2.7' or python_version == '3.5'
11+
twine==3.1.1; python_version >= '3.6'
1112
pathlib2==2.3.5
1213
readme-renderer[md]==25.0
13-
doc-warden==0.5.4
14+
doc-warden==0.7.1
15+
# we pin coverage to 4.5.4 because there is an bug with `pytest-cov`. the generated coverage files cannot be `coverage combine`ed
1416
coverage==4.5.4
15-
codecov==2.0.22
16-
beautifulsoup4==4.8.2
17+
codecov==2.1.0
18+
beautifulsoup4==4.9.1
1719
pkginfo==1.5.0.1
1820

1921
# locking packages defined as deps from azure-sdk-tools or azure-devtools
2022
pytoml==0.1.21
2123
pyOpenSSL==19.1.0
2224
json-delta==2.0
23-
ConfigArgParse==1.1
25+
ConfigArgParse==1.2.3
2426
six==1.14.0
2527
vcrpy==3.0.0
2628
pyyaml==5.3.1
27-
pytest==5.4.1; python_version >= '3.5'
29+
pytest==5.4.2; python_version >= '3.5'
2830
pytest==4.6.9; python_version == '2.7'
2931
pytest-cov==2.8.1
3032

3133
# local dev packages
3234
./tools/azure-devtools
3335
./tools/azure-sdk-tools
34-
35-
36-

eng/common/Update-Change-Log.ps1

+19-17
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ function Get-ChangelogPath($Path)
2727
{
2828
# Check if CHANGELOG.md is present in path
2929
$ChangeLogPath = Join-Path -Path $Path -ChildPath "CHANGELOG.md"
30-
if ((Test-Path -Path $ChangeLogPath) -eq $False){
30+
if ((Test-Path -Path $ChangeLogPath) -eq $False) {
3131
# Check if change log exists with name HISTORY.md
3232
$ChangeLogPath = Join-Path -Path $Path -ChildPath "HISTORY.md"
33-
if ((Test-Path -Path $ChangeLogPath) -eq $False){
33+
if ((Test-Path -Path $ChangeLogPath) -eq $False) {
3434
Write-Host "Change log is not found in path[$Path]"
3535
exit(1)
3636
}
@@ -45,7 +45,7 @@ function Get-VersionTitle($Version, $Unreleased)
4545
{
4646
# Generate version title
4747
$newVersionTitle = "## $Version $UNRELEASED_TAG"
48-
if ($Unreleased -eq $False){
48+
if ($Unreleased -eq $False) {
4949
$releaseDate = Get-Date -Format "(yyyy-MM-dd)"
5050
$newVersionTitle = "## $Version $releaseDate"
5151
}
@@ -67,10 +67,10 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
6767
# Version increment tool passes replaceversion as False and Unreleased as True
6868
$is_version_increment = $ReplaceVersion -eq $False -and $Unreleased -eq $True
6969

70-
for(; $Index -lt $ChangelogLines.Count; $Index++){
71-
if (Version-Matches($ChangelogLines[$Index])){
70+
for (; $Index -lt $ChangelogLines.Count; $Index++) {
71+
if (Version-Matches($ChangelogLines[$Index])) {
7272
# Find current title in change log
73-
if( -not $CurrentTitle){
73+
if( -not $CurrentTitle) {
7474
$CurrentTitle = $ChangelogLines[$Index]
7575
$CurrentIndex = $Index
7676
Write-Host "Current Version title: $CurrentTitle"
@@ -80,7 +80,7 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
8080
# update change log script is triggered for all packages with current version for Java ( or any language where version is maintained in common file)
8181
# and this can cause an issue if someone changes changelog manually to prepare for release without updating actual version in central version file
8282
# Do not add new line or replace existing title when version is already present and script is triggered to add new line
83-
if ($is_version_increment -and $ChangelogLines[$Index].Contains($Version)){
83+
if ($is_version_increment -and $ChangelogLines[$Index].Contains($Version)) {
8484
Write-Host "Version is already present in change log."
8585
exit(0)
8686
}
@@ -90,26 +90,24 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
9090
# Generate version title
9191
$newVersionTitle = Get-VersionTitle -Version $Version -Unreleased $Unreleased
9292

93-
if( $newVersionTitle -eq $CurrentTitle){
93+
if( $newVersionTitle -eq $CurrentTitle) {
9494
Write-Host "No change is required in change log. Version is already present."
9595
exit(0)
9696
}
9797

98-
99-
100-
if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG))){
98+
if (($ReplaceVersion -eq $True) -and ($Unreleased -eq $False) -and $CurrentTitle.Contains($version) -and (-not $CurrentTitle.Contains($UNRELEASED_TAG))) {
10199
Write-Host "Version is already present in change log with a release date."
102100
exit(0)
103101
}
104102

105103
# if current version title already has new version then we should replace title to update it
106-
if ($CurrentTitle.Contains($Version) -and $ReplaceVersion -eq $False){
104+
if ($CurrentTitle.Contains($Version) -and $ReplaceVersion -eq $False) {
107105
Write-Host "Version is already present in title. Updating version title"
108106
$ReplaceVersion = $True
109107
}
110108

111109
# if version is already found and not replacing then nothing to do
112-
if ($ReplaceVersion -eq $False){
110+
if ($ReplaceVersion -eq $False) {
113111
Write-Host "Adding version title $newVersionTitle"
114112
$ChangelogLines.insert($CurrentIndex, "")
115113
$ChangelogLines.insert($CurrentIndex, "")
@@ -121,24 +119,28 @@ function Get-NewChangeLog( [System.Collections.ArrayList]$ChangelogLines, $Versi
121119
$ChangelogLines[$CurrentIndex] = $newVersionTitle
122120
}
123121

124-
return $ChangelogLines
122+
return $ChangelogLines
125123
}
126124

127125

128126
# Make sure path is valid
129-
if ((Test-Path -Path $ChangeLogPath) -eq $False){
127+
if ((Test-Path -Path $ChangeLogPath) -eq $False) {
130128
Write-Host "Change log path is invalid. [$ChangeLogPath]"
131129
exit(1)
132130
}
133131

134132
# probe change log path if path is directory
135-
if (Test-Path -Path $ChangeLogPath -PathType Container)
136-
{
133+
if (Test-Path -Path $ChangeLogPath -PathType Container) {
137134
$ChangeLogPath = Get-ChangelogPath -Path $ChangeLogPath
138135
}
139136

140137
# Read current change logs and add/update version
141138
$ChangelogLines = [System.Collections.ArrayList](Get-Content -Path $ChangeLogPath)
139+
140+
if ($null -eq $ChangelogLines) {
141+
$ChangelogLines = @()
142+
}
143+
142144
$NewContents = Get-NewChangeLog -ChangelogLines $ChangelogLines -Version $Version -Unreleased $Unreleased -ReplaceVersion $ReplaceVersion
143145

144146
Write-Host "Writing change log to file [$ChangeLogPath]"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This script fragment is used across our repos to set a variable "SetDevVersion" which
2+
# is used when this pipeline is going to be generating and publishing daily dev builds.
3+
4+
steps:
5+
- pwsh: |
6+
$setDailyDevBuild = "false"
7+
if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) {
8+
$setDailyDevBuild = "true"
9+
}
10+
echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild"
11+
displayName: "Setup Versioning Properties"
12+
condition: eq(variables['SetDevVersion'], '')

eng/common/pipelines/templates/steps/verify-links.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
parameters:
22
Directory: 'not-specified'
3+
IgnoreLinksFile: "$(Build.SourcesDirectory)/eng/ignore-links.txt"
4+
35

46
steps:
57
- task: PowerShell@2
@@ -9,4 +11,4 @@ steps:
911
workingDirectory: $(Build.SourcesDirectory)/${{ parameters.Directory }}
1012
filePath: eng/common/scripts/Verify-Links.ps1
1113
arguments: >
12-
-urls $(dir -r -i *.md) -rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}"
14+
-urls $(dir -r -i *.md) -rootUrl "file://$(Build.SourcesDirectory)/${{ parameters.Directory }}" -recursive:$false -ignoreLinksFile ${{ parameters.IgnoreLinksFile }}
+35-18
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,48 @@
11
# Wrapper Script for ChangeLog Verification
22
param (
3-
[String]$ChangeLogLocation,
4-
[String]$VersionString,
5-
[string]$PackageName,
6-
[string]$ServiceName,
7-
[string]$RepoRoot,
8-
[ValidateSet("net","java","js","python")]
9-
[string]$Language,
10-
[string]$RepoName,
11-
[boolean]$ForRelease=$False
3+
[String]$ChangeLogLocation,
4+
[String]$VersionString,
5+
[string]$PackageName,
6+
[string]$ServiceName,
7+
[string]$RepoRoot,
8+
[ValidateSet("net", "java", "js", "python")]
9+
[string]$Language,
10+
[string]$RepoName,
11+
[boolean]$ForRelease = $False
1212
)
1313

14+
$ProgressPreference = "SilentlyContinue"
1415
. (Join-Path $PSScriptRoot SemVer.ps1)
1516
Import-Module (Join-Path $PSScriptRoot modules ChangeLog-Operations.psm1)
1617

17-
if ((Test-Path $ChangeLogLocation) -and -not([System.String]::IsNullOrEmpty($VersionString)))
18+
$validChangeLog = $false
19+
if ($ChangeLogLocation -and $VersionString)
1820
{
19-
Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease
21+
$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString -ForRelease $ForRelease
2022
}
21-
else
23+
else
2224
{
23-
Import-Module (Join-Path $PSScriptRoot modules Package-Properties.psm1)
24-
if ([System.String]::IsNullOrEmpty($Language))
25+
Import-Module (Join-Path $PSScriptRoot modules Package-Properties.psm1)
26+
if ([System.String]::IsNullOrEmpty($Language))
27+
{
28+
if ($RepoName -match "azure-sdk-for-(?<lang>[^-]+)")
2529
{
26-
$Language = $RepoName.Substring($RepoName.LastIndexOf('-') + 1)
30+
$Language = $matches["lang"]
2731
}
32+
else
33+
{
34+
Write-Error "Failed to set Language automatically. Please pass the appropriate Language as a parameter."
35+
exit 1
36+
}
37+
}
38+
39+
$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot
40+
$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease
41+
}
42+
43+
if (!$validChangeLog)
44+
{
45+
exit 1
46+
}
2847

29-
$PackageProp = Get-PkgProperties -PackageName $PackageName -ServiceName $ServiceName -Language $Language -RepoRoot $RepoRoot
30-
Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.pkgChangeLogPath -VersionString $PackageProp.pkgVersion -ForRelease $ForRelease
31-
}
48+
exit 0

eng/common/scripts/modules/ChangeLog-Operations.psm1

+31-20
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ function Get-ChangeLogEntries {
1111

1212
$changeLogEntries = @{}
1313
if (!(Test-Path $ChangeLogLocation)) {
14-
Write-Host "ChangeLog '{0}' was not found" -f $ChangeLogLocation
15-
exit 1
14+
Write-Error "ChangeLog[${ChangeLogLocation}] does not exist"
15+
return $null
1616
}
1717

1818
try {
@@ -51,14 +51,12 @@ function Get-ChangeLogEntry {
5151
[Parameter(Mandatory = $true)]
5252
[String]$VersionString
5353
)
54-
5554
$changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $ChangeLogLocation
5655

57-
if ($changeLogEntries.ContainsKey($VersionString)) {
56+
if ($changeLogEntries -and $changeLogEntries.ContainsKey($VersionString)) {
5857
return $changeLogEntries[$VersionString]
5958
}
60-
Write-Error "Release Notes for the Specified version ${VersionString} was not found"
61-
exit 1
59+
return $null
6260
}
6361

6462
#Returns the changelog for a particular version as string
@@ -70,9 +68,16 @@ function Get-ChangeLogEntryAsString {
7068
[String]$VersionString
7169
)
7270

73-
$changeLogEntries = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString
74-
[string]$releaseTitle = $changeLogEntries.ReleaseTitle
75-
[string]$releaseContent = $changeLogEntries.ReleaseContent -Join [Environment]::NewLine
71+
$changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString
72+
return ChangeLogEntryAsString $changeLogEntry
73+
}
74+
75+
function ChangeLogEntryAsString($changeLogEntry) {
76+
if (!$changeLogEntry) {
77+
return "[Missing change log entry]"
78+
}
79+
[string]$releaseTitle = $changeLogEntry.ReleaseTitle
80+
[string]$releaseContent = $changeLogEntry.ReleaseContent -Join [Environment]::NewLine
7681
return $releaseTitle, $releaseContent -Join [Environment]::NewLine
7782
}
7883

@@ -87,27 +92,33 @@ function Confirm-ChangeLogEntry {
8792

8893
$changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString
8994

95+
if (!$changeLogEntry) {
96+
Write-Error "ChangeLog[${ChangeLogLocation}] does not have an entry for version ${VersionString}."
97+
return $false
98+
}
99+
100+
Write-Host "Found the following change log entry for version '${VersionString}' in [${ChangeLogLocation}]."
101+
Write-Host "-----"
102+
Write-Host (ChangeLogEntryAsString $changeLogEntry)
103+
Write-Host "-----"
104+
90105
if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) {
91-
Write-Host ("##[error]Changelog '{0}' has wrong release note title" -f $ChangeLogLocation)
92-
Write-Host "##[info]Ensure the release date is included i.e. (yyyy-MM-dd) or (Unreleased) if not yet released"
93-
exit 1
106+
Write-Error "Entry does not have a correct release status. Please ensure the status is set to a date '(yyyy-MM-dd)' or '(Unreleased)' if not yet released."
107+
return $false
94108
}
95109

96110
if ($ForRelease -eq $True) {
97111
if ($changeLogEntry.ReleaseStatus -eq "(Unreleased)") {
98-
Write-Host ("##[error]No release date set. Please set a release date with format 'yyyy-MM-dd' in the heading for version '{0}' in the changelog '{1}'." -f $VersionString, $ChangelogLocation)
99-
exit 1
112+
Write-Error "Entry has no release date set. Please ensure to set a release date with format 'yyyy-MM-dd'."
113+
return $false
100114
}
101115

102116
if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) {
103-
Write-Host ("##[error]Empty Release Notes for '{0}' in '{1}'" -f $VersionString, $ChangeLogLocation)
104-
Write-Host "##[info]Please ensure there is a release notes entry before releasing the package."
105-
exit 1
117+
Write-Error "Entry has no content. Please ensure to provide some content of what changed in this version."
118+
return $false
106119
}
107120
}
108-
109-
Write-Host $changeLogEntry.ReleaseTitle
110-
Write-Host $changeLogEntry.ReleaseContent
121+
return $true
111122
}
112123

113124
Export-ModuleMember -Function 'Get-ChangeLogEntries'

0 commit comments

Comments
 (0)