Fix issue with --dest-dir for CI usage#47792
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes how the CI check dispatcher (eng/scripts/dispatch_checks.py) computes the --dest-dir passed to the apistub check. Previously it passed the shared artifact staging directory directly, but the downstream Create-APIReview.ps1 step looks for the generated APIView token file under a per-package subfolder ($ArtifactPath/$packageName/${packageName}_python.json). The fix appends the package name to the destination for apistub only, keeping the apistub --dest-dir X contract intact (it still writes exactly where told) while producing the folder layout CI consumers expect.
Changes:
- Add
get_check_dest_dirhelper that appends the resolved package name todest_dirfor theapistubcheck and returns it unchanged otherwise. - Wire the helper into
run_checkso theapistubcommand targets the per-package subdirectory. - Add unit tests for the new helper and for the
generate_api_for_packagecommand construction in the API-review workflow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
eng/scripts/dispatch_checks.py |
Imports ParsedSetup, adds get_check_dest_dir, and uses it to compute the per-package --dest-dir for apistub. |
eng/tools/azure-sdk-tools/tests/test_dispatch_checks.py |
New tests covering apistub subfolder behavior, non-apistub pass-through, and empty dest-dir handling. |
scripts/api_md_workflow/create_api_review_pr_test.py |
Adds tests asserting generate_api_for_package builds the apistub --dest-dir <package_dir> command for both azpysdk and runtime-executable paths. |
7611774 to
212f3fd
Compare
Co-authored-by: tjprescott <5723682+tjprescott@users.noreply.github.com>
…-sdk-for-python into FixApiStubCIBehavior
Co-authored-by: tjprescott <5723682+tjprescott@users.noreply.github.com>
This reverts commit 16c0ddb.
danieljurek
left a comment
There was a problem hiding this comment.
This fixes the issue it intended to fix: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6508343&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=f14f2bed-72ab-5062-192c-a977bd0d104b&l=58
There are other failures, but they look related to mypy and azure-template... so I would not consider those blocking based on what I'm seeing.
Updates the CI package checks so that it targets the right folder which maintaining the contract that
apistub --dest-dir Xactually targets X.