forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python …
…into regenerate_keys * 'master' of https://github.com/Azure/azure-sdk-for-python: re-apply updates after resetting master (Azure#12771) Sync eng/common directory with azure-sdk-tools repository (Azure#12745) Enable bandit for servicebus (Azure#12763) Skip pypy3 for service bus CI pipeline (Azure#12732) Update CODEOWNERS (Azure#12765) updated tox file (Azure#11087) Updating to match Microsoft recommended template (Azure#11045) [text analytics] update version in master (Azure#12749) Explicitly stringify message prints in samples per manual doc pass recommendation. (Azure#12709) Run only analyse dependency step for aggregate report (Azure#12728) VSCodeCredential supports Python 2.7 on Windows (Azure#12731) Enable bandit (Azure#12722) Move InteractiveCredential to a new module (Azure#12706)
- Loading branch information
Showing
45 changed files
with
763 additions
and
288 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
This file list any third-party libraries or other resources that may be | ||
distributed under licenses different than the Azure SDK for Python software. | ||
NOTICES AND INFORMATION | ||
Do Not Translate or Localize | ||
|
||
In the event that we accidentally failed to list a required notice, please | ||
bring it to our attention by opening an issue. | ||
This software incorporates material from third parties. Microsoft makes certain | ||
open source code available at https://3rdpartysource.microsoft.com, or you may | ||
send a check or money order for US $5.00, including the product name, the open | ||
source component name, and version number, to: | ||
|
||
The attached notices are provided for information only. | ||
Source Code Compliance Team | ||
Microsoft Corporation | ||
One Microsoft Way | ||
Redmond, WA 98052 | ||
USA | ||
|
||
Notwithstanding any other terms, you may reverse engineer this software to the | ||
extent required to debug changes to any libraries licensed under the GNU Lesser | ||
General Public License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# Common Changelog Operations | ||
|
||
$RELEASE_TITLE_REGEX = "(?<releaseNoteTitle>^\#+.*(?<version>\b\d+\.\d+\.\d+([^0-9\s][^\s:]+)?)(\s(?<releaseStatus>\(Unreleased\)|\(\d{4}-\d{2}-\d{2}\)))?)" | ||
|
||
# Returns a Collection of changeLogEntry object containing changelog info for all version present in the gived CHANGELOG | ||
function Get-ChangeLogEntries { | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[String]$ChangeLogLocation | ||
) | ||
|
||
$changeLogEntries = @{} | ||
if (!(Test-Path $ChangeLogLocation)) { | ||
Write-Error "ChangeLog[${ChangeLogLocation}] does not exist" | ||
return $null | ||
} | ||
|
||
try { | ||
$contents = Get-Content $ChangeLogLocation | ||
# walk the document, finding where the version specifiers are and creating lists | ||
$changeLogEntry = $null | ||
foreach ($line in $contents) { | ||
if ($line -match $RELEASE_TITLE_REGEX) { | ||
$changeLogEntry = [pscustomobject]@{ | ||
ReleaseVersion = $matches["version"] | ||
ReleaseStatus = $matches["releaseStatus"] | ||
ReleaseTitle = $line | ||
ReleaseContent = @() # Release content without the version title | ||
} | ||
$changeLogEntries[$changeLogEntry.ReleaseVersion] = $changeLogEntry | ||
} | ||
else { | ||
if ($changeLogEntry) { | ||
$changeLogEntry.ReleaseContent += $line | ||
} | ||
} | ||
} | ||
} | ||
catch { | ||
Write-Host "Error parsing $ChangeLogLocation." | ||
Write-Host $_.Exception.Message | ||
} | ||
return $changeLogEntries | ||
} | ||
|
||
# Returns single changeLogEntry object containing the ChangeLog for a particular version | ||
function Get-ChangeLogEntry { | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[String]$ChangeLogLocation, | ||
[Parameter(Mandatory = $true)] | ||
[String]$VersionString | ||
) | ||
$changeLogEntries = Get-ChangeLogEntries -ChangeLogLocation $ChangeLogLocation | ||
|
||
if ($changeLogEntries -and $changeLogEntries.ContainsKey($VersionString)) { | ||
return $changeLogEntries[$VersionString] | ||
} | ||
return $null | ||
} | ||
|
||
#Returns the changelog for a particular version as string | ||
function Get-ChangeLogEntryAsString { | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[String]$ChangeLogLocation, | ||
[Parameter(Mandatory = $true)] | ||
[String]$VersionString | ||
) | ||
|
||
$changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString | ||
return ChangeLogEntryAsString $changeLogEntry | ||
} | ||
|
||
function ChangeLogEntryAsString($changeLogEntry) { | ||
if (!$changeLogEntry) { | ||
return "[Missing change log entry]" | ||
} | ||
[string]$releaseTitle = $changeLogEntry.ReleaseTitle | ||
[string]$releaseContent = $changeLogEntry.ReleaseContent -Join [Environment]::NewLine | ||
return $releaseTitle, $releaseContent -Join [Environment]::NewLine | ||
} | ||
|
||
function Confirm-ChangeLogEntry { | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[String]$ChangeLogLocation, | ||
[Parameter(Mandatory = $true)] | ||
[String]$VersionString, | ||
[boolean]$ForRelease = $false | ||
) | ||
|
||
$changeLogEntry = Get-ChangeLogEntry -ChangeLogLocation $ChangeLogLocation -VersionString $VersionString | ||
|
||
if (!$changeLogEntry) { | ||
Write-Error "ChangeLog[${ChangeLogLocation}] does not have an entry for version ${VersionString}." | ||
return $false | ||
} | ||
|
||
Write-Host "Found the following change log entry for version '${VersionString}' in [${ChangeLogLocation}]." | ||
Write-Host "-----" | ||
Write-Host (ChangeLogEntryAsString $changeLogEntry) | ||
Write-Host "-----" | ||
|
||
if ([System.String]::IsNullOrEmpty($changeLogEntry.ReleaseStatus)) { | ||
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." | ||
return $false | ||
} | ||
|
||
if ($ForRelease -eq $True) { | ||
if ($changeLogEntry.ReleaseStatus -eq "(Unreleased)") { | ||
Write-Error "Entry has no release date set. Please ensure to set a release date with format 'yyyy-MM-dd'." | ||
return $false | ||
} | ||
|
||
if ([System.String]::IsNullOrWhiteSpace($changeLogEntry.ReleaseContent)) { | ||
Write-Error "Entry has no content. Please ensure to provide some content of what changed in this version." | ||
return $false | ||
} | ||
} | ||
return $true | ||
} |
Oops, something went wrong.