-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Descend from the alps/swagger api view #31320
base: main
Are you sure you want to change the base?
Descend from the alps/swagger api view #31320
Conversation
Next Steps to Merge⌛ Please wait. Next steps to merge this PR are being evaluated by automation. ⌛ |
PR validation pipeline restarted successfully. If there is ApiView generated, it will be updated in this comment. |
ad604d4
to
1588bf8
Compare
7d12a35
to
a686d6e
Compare
aa18a6b
to
60e3173
Compare
eng/scripts/Swagger-APIView.ps1
Outdated
.OUTPUTS | ||
the readme.md file associated with the swagger file or null if not found. | ||
#> | ||
function Get-SwaggerReadMeFile { |
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.
How about moving this function and the subsequent one into a common PS script? They can be reused by other CI checks as well.
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.
looks like this could also happen to Get-ResourceProviderFromReadMePath
00e600e
to
cc13604
Compare
|
||
. "$PSScriptRoot/Logging-Functions.ps1" | ||
|
||
$apiViewArtifactsDirectory = [System.IO.Path]::Combine($ArtiFactsStagingDirectory, $APIViewArtifactsDirectoryName) |
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.
Any reason we should not try to refactor https://github.com/Azure/azure-sdk-tools/blob/991e31e2493483cf61cd11a5b0703ec6b81b1271/eng/common/scripts/Detect-Api-Changes.ps1 to share some of this logic?
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.
Perhaps we can add some more helpers to https://github.com/Azure/azure-sdk-tools/blob/991e31e2493483cf61cd11a5b0703ec6b81b1271/eng/common/scripts/Helpers/ApiView-Helpers.ps1
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.
That script depends a lot on packageProperties
logic which is not implemented for azure-rest-api-spec
. I tried to do a refactor but felt it made the script overly complex
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.
It feels like we could consider creating a helper function to do the APIView call itself. That way we can use common invoking and error handling. Even if for now you just use that new function here with the intent to also consume it elsewhere that might be a good step in the right direction.
$query.Add('pullRequestNumber', $PullRequestNumber) | ||
$query.Add('packageName', $_.BaseName) | ||
$query.Add('language', $Language) | ||
$query.Add('commentOnPR', $false) |
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.
Shouldn't this be true?
8ba5aa0
to
6c30ecf
Compare
faf9563
to
d50a544
Compare
d50a544
to
e886b12
Compare
49768b2
to
7273e1f
Compare
c36a1dd
to
9c517ef
Compare
ab3e67c
to
946c398
Compare
DOTNET_ROOT: /home/runner/.dotnet | ||
|
||
- name: Publish Swagger APIView Artifacts | ||
uses: actions/upload-artifact@v3 |
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.
uses: actions/upload-artifact@v3 | |
uses: actions/upload-artifact@v4 |
-RepoName ${{ github.repository }} ` | ||
-PullRequestNumber ${{ env.PullRequestNumber }} ` | ||
-Language 'Swagger' ` | ||
-CommitSha ${{ github.sha }} |
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.
-CommitSha ${{ github.sha }} | |
-CommitSha ${{ github.sha }} | |
|
||
LogGroupStart " See all generated Swagger APIView Artifacts..." | ||
Get-ChildItem -Path $swaggerAPIViewArtifactsDirectory -Recurse | ||
LogGroupEnd |
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.
LogGroupEnd | |
LogGroupEnd | |
b615d04
to
c6788b4
Compare
This adds a job for identifying swagger files in a given pull-request and generate relevant swagger APIView token artifacts.