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

[test purpose]Sync eng/common preprocess 1170 #17233

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
31df116
Some basic changes to preproces
sima-zhu Nov 5, 2020
9408261
Added more comments
sima-zhu Nov 6, 2020
db1d93e
Addressed comments
sima-zhu Nov 6, 2020
73cf382
add renamed files
sima-zhu Nov 6, 2020
2733ecc
remove unnecessary chagnes
sima-zhu Nov 6, 2020
4482266
Added bug fix and warning message.
sima-zhu Nov 6, 2020
d817e50
remove extra parameters
sima-zhu Nov 6, 2020
46a1580
Fixed the prints
sima-zhu Nov 6, 2020
8c1e857
Fix bugs
sima-zhu Nov 7, 2020
545cebb
Added more stuff for link verification
sima-zhu Nov 7, 2020
5ce7b4d
run new scripts
sima-zhu Nov 7, 2020
e638bf0
some tests
sima-zhu Nov 10, 2020
1a32959
remove mandatory
sima-zhu Nov 10, 2020
71d8b15
new chagnes
sima-zhu Nov 10, 2020
e14a3e5
Some basic changes to preproces
sima-zhu Nov 5, 2020
0136a9c
Added more comments
sima-zhu Nov 6, 2020
8548d27
Addressed comments
sima-zhu Nov 6, 2020
22a59b4
add renamed files
sima-zhu Nov 6, 2020
95cc0a5
remove unnecessary chagnes
sima-zhu Nov 6, 2020
fb4bc05
Added bug fix and warning message.
sima-zhu Nov 6, 2020
31a9971
remove extra parameters
sima-zhu Nov 6, 2020
4dd8178
Fixed the prints
sima-zhu Nov 6, 2020
b506785
Fix bugs
sima-zhu Nov 7, 2020
f9cad59
Renamed files cannot be excluded as it may get modified.
sima-zhu Nov 7, 2020
2b29a32
Update eng/common/scripts/get-markdown-files-from-changed-files.ps1
sima-zhu Nov 10, 2020
3c9131e
Make change on target branch
sima-zhu Nov 10, 2020
9c1702b
Added comments
sima-zhu Nov 10, 2020
351f9d2
Update eng/common/scripts/get-markdown-files-from-changed-files.ps1
sima-zhu Nov 10, 2020
3947c2b
Merge from upstream
sima-zhu Nov 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions eng/common/scripts/Verify-Links.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ $checkedLinks = @{};
$badLinks = @{};
$pageUrisToCheck = new-object System.Collections.Queue
foreach ($url in $urls) {
if (!$url) {
LogWarning "There is an empty markdown in the input urls."
continue
}
$uri = NormalizeUrl $url
$pageUrisToCheck.Enqueue($uri);
}
Expand Down
47 changes: 47 additions & 0 deletions eng/common/scripts/get-markdown-files-from-changed-files.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
param (
# The root repo we scaned with.
[string[]] $RootRepo = '$PSScriptRoot/../../..',
# The target branch to compare with.
[string] $targetBranch = "origin/${env:SYSTEM_PULLREQUEST_TARGETBRANCH}"
)
$deletedFiles = (git diff $targetBranch HEAD --name-only --diff-filter=D)
$renamedFiles = (git diff $targetBranch HEAD --diff-filter=R)
$changedMarkdowns = (git diff $targetBranch HEAD --name-only -- '*.md')

$beforeRenameFiles = @()
# Retrieve the renamed from files.
foreach($file in $renamedFiles) {
if ($file -match "^rename from (.*)$") {
$beforeRenameFiles += $file -replace "^rename from (.*)$", '$1'
}
}
# A combined list of deleted and renamed files.
$relativePathLinks = ($deletedFiles + $beforeRenameFiles)
# Removed the deleted markdowns.
$changedMarkdowns = $changedMarkdowns | Where-Object { $deletedFiles -notcontains $_ }
# Scan all markdowns and find if it contains the deleted or renamed files.
$markdownContainLinks = @()
$allMarkdownFiles = Get-ChildItem -Path $RootRepo -Recurse -Include *.md
foreach ($f in $allMarkdownFiles) {
$filePath = $f.ToString()
$content = Get-Content -Path $filePath -Raw
foreach($l in $relativePathLinks) {
if ($content -match $l) {
$markdownContainLinks += $filePath
break
}
}
}

# Convert markdowns path of the PR to absolute path.
$adjustedReadmes = $changedMarkdowns | Foreach-Object {Resolve-Path $_}
$markdownContainLinks += $adjustedReadmes

# Get rid of any duplicated ones.
$allMarkdowns = [string[]]($markdownContainLinks | Sort-Object | Get-Unique)

Write-Host "Here are all markdown files we need to check based on the changed files:"
foreach ($file in $allMarkdowns) {
Write-Host " $file"
}
return $allMarkdowns
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
parameters:
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
Directory: ''
Urls: (git diff origin/${env:SYSTEM_PULLREQUEST_TARGETBRANCH} HEAD --name-only -- '*.md')
Urls: (eng/common/scripts/get-markdown-files-from-changed-files.ps1)
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
Directory: sdk/${{ parameters.ServiceDirectory }}
CheckLinkGuidance: $true
Expand Down

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions sdk/template/azure-sdk-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,6 @@ If the package or a related package supports it, include tips for logging or ena

<!-- LINKS -->
[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization
[EventHubProducerAsyncClient]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClient.java

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Ftemplate%2Fazure-sdk-template%2FREADME.png)