-
Notifications
You must be signed in to change notification settings - Fork 227
Updates to DevOps APi and Verify ReadMe #2396
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| parameters: | ||
| ScanPath: $(Build.SourcesDirectory) | ||
| RepoRoot: $(Build.SourcesDirectory) | ||
| SettingsPath: '$(Build.SourcesDirectory)/eng/.docsettings.yml' | ||
| DocWardenVersion : '0.7.2' | ||
|
|
||
| steps: | ||
| - task: PowerShell@2 | ||
| displayName: "Verify Readmes" | ||
| inputs: | ||
| filePath: "eng/common/scripts/Verify-Readme.ps1" | ||
| arguments: > | ||
| -DocWardenVersion ${{ parameters.DocWardenVersion }} | ||
| -ScanPath ${{ parameters.ScanPath }} | ||
| -RepoRoot ${{ parameters.RepoRoot }} | ||
| -SettingsPath ${{ parameters.SettingsPath }} | ||
| pwsh: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,5 +158,26 @@ function Add-RetentionLease { | |
| -Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) ` | ||
| -MaximumRetryCount 3 ` | ||
| -ContentType "application/json" | ||
| } | ||
|
|
||
| function Get-PackagesInArtifactFeed { | ||
| param ( | ||
| $Organization="azure-sdk", | ||
| $Project="public", | ||
| [Parameter(Mandatory = $true)] | ||
| $FeedId, | ||
| $ApiVersion="6.1-preview.1", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we use preview version by default?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No particular reason. It apears to be the latest release. |
||
| $IncludeAllVersions="false", | ||
| $Base64EncodedAuthToken | ||
| ) | ||
|
|
||
| $uri = "https://feeds.dev.azure.com/$Organization/$Project/_apis/packaging/Feeds/$FeedId/packages?api-version=$ApiVersion&includeAllVersions=$IncludeAllVersions" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you see my other feedback in your .NET PR? If we can avoid it lets not try pulling all the package versions when we can just use the package version min and max to get the package we want.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or could you default to latest one if no feed version passed in?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The challenge is to find the latest alpha version in the feed. Since sometime other versions other than alpha is listed as the latest thats why I need to retrieve all the abvailable versions.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can alternatively get all versions for the specific package, but I will have to call the api numerous times.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chidozieononiwu I'd like to better understand why my suggestion at Azure/azure-sdk-for-net#25503 (comment) doesn't work before we move forward with this new API.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried it and it is very unreliable. I installes some packages and fails to install other which are clearly present in the feed. I can not say why these failures occur.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just posted some updates to that code in your other PR. Please give that a try. Also I would like us to avoid taking a dependency on the devops api directly as I'd prefer we use general nuget feed apis so we could move to another nuget feed, l like nuget if we needed to. |
||
|
|
||
| $packages = Invoke-RestMethod ` | ||
| -Method GET ` | ||
| -Uri $uri ` | ||
| -Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) ` | ||
| -MaximumRetryCount 3 | ||
|
|
||
| return $packages.value | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am curious what we returned here. Could you add some comments and example?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The api returns an object like @{count, value} |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,23 @@ | ||
| # Wrapper Script for Readme Verification | ||
| [CmdletBinding()] | ||
| param ( | ||
| [string]$DocWardenVersion = "0.7.1", | ||
|
|
||
| [string]$DocWardenVersion = "0.7.2", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume we should either just default the version either here or in the yml but not both. |
||
| [Parameter(Mandatory = $true)] | ||
| [string]$ScanPath, | ||
|
|
||
| [string]$RepoRoot, | ||
| [Parameter(Mandatory = $true)] | ||
| [string]$SettingsPath | ||
| ) | ||
|
|
||
| pip install setuptools wheel --quiet | ||
| pip install doc-warden==$DocWardenVersion --quiet | ||
| ward scan -d $ScanPath -c $SettingsPath | ||
|
|
||
| if (-not [System.String]::IsNullOrWhiteSpace($RepoRoot)) | ||
| { | ||
| ward scan -d $ScanPath -u $RepoRoot -c $SettingsPath | ||
| } | ||
| else | ||
| { | ||
| ward scan -d $ScanPath -c $SettingsPath | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks unrelated.