Skip to content

Commit 0bba13b

Browse files
authored
Merge branch 'main' into copilot/optimize-breaking-changes-checker-performance
2 parents 3901ba4 + a37ee0c commit 0bba13b

172 files changed

Lines changed: 2554 additions & 4931 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: generate-api-markdown
3+
description: Generate an API markdown file and token file using ApiView. Use this when the user wants to generate an API markdown file and review API changes.
4+
---
5+
6+
# Generate API Markdown
7+
8+
## Prerequisites
9+
10+
1. Activate your virtual environment with a Python version that is strictly less than the version limit specified in `eng/tools/azure-sdk-tools/azpysdk/apistub.py`.
11+
2. Install the required dependencies:
12+
```bash
13+
cd <repo_root>
14+
pip install -e ./eng/tools/azure-sdk-tools
15+
```
16+
17+
## Instructions
18+
19+
1. Navigate to the desired package directory
20+
2. Run the command:
21+
```bash
22+
azpysdk apistub --md .
23+
3. The command outputs the location of the generated markdown file. Provide this file to the user for review.

eng/common/scripts/azsdk_tool_telemetry.ps1

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ $ErrorActionPreference = "SilentlyContinue"
22
. (Join-Path $PSScriptRoot '..' 'scripts' 'Helpers' 'AzSdkTool-Helpers.ps1')
33

44
$cliPath = Get-CommonInstallDirectory
5-
65
# check for azsdk.exe on Windows or azsdk on Linux/Mac in the install directory
76
if ($IsWindows)
87
{
@@ -54,8 +53,15 @@ try
5453
Write-Success
5554
}
5655

57-
$toolName = $inputData.toolName
58-
if (-not $toolName)
56+
$toolName = $null
57+
$sessionId = $null
58+
59+
# Get tool name. Both vscode and copilot-cli uses different property names, so check for both.
60+
if ($inputData.PSObject.Properties['toolName'])
61+
{
62+
$toolName = $inputData.toolName
63+
}
64+
if (-not $toolName -and $inputData.PSObject.Properties['tool_name'])
5965
{
6066
$toolName = $inputData.tool_name
6167
}
@@ -72,20 +78,27 @@ if ($toolsToIgnore -contains $toolName)
7278
Write-Success
7379
}
7480

75-
$sessionId = $inputData.sessionId
76-
if (-not $sessionId) {
81+
# Session id
82+
if ($inputData.PSObject.Properties['sessionId'])
83+
{
84+
$sessionId = $inputData.sessionId
85+
}
86+
if (-not $sessionId -and $inputData.PSObject.Properties['session_id'])
87+
{
7788
$sessionId = $inputData.session_id
7889
}
7990

8091
# Get tool input arguments
81-
$toolInput = $inputData.toolArgs
82-
if (-not $toolInput)
92+
$toolInput = $null
93+
if ($inputData.PSObject.Properties['toolArgs'])
94+
{
95+
$toolInput = $inputData.toolArgs
96+
}
97+
if (-not $toolInput -and $inputData.PSObject.Properties['tool_input'])
8398
{
8499
$toolInput = $inputData.tool_input
85100
}
86101

87-
$timestamp = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
88-
89102
# Helper to extract path from tool input (handles 'path', 'filePath', 'file_path')
90103
function Get-ToolInputPath
91104
{
@@ -112,11 +125,12 @@ else
112125
$clientType = "copilot-cli"
113126
}
114127

128+
115129
# Process skill invocations (looking for "azsdk" prefix in skill name)
116130
if ($toolName -eq "skill")
117131
{
118132
$skillName = $toolInput.skill
119-
if ($skillName -and $skillName.StartsWith("azsdk"))
133+
if ($skillName)
120134
{
121135
$eventType = "skill_invocation"
122136
$shouldTrack = $true
@@ -148,7 +162,6 @@ if ($toolName.StartsWith("mcp_azure-sdk") -or $toolName.StartsWith("azure-sdk-mc
148162
}
149163

150164
# === STEP 3: Publish event ===
151-
152165
if ($shouldTrack)
153166
{
154167
# Build MCP command arguments

eng/tools/azure-sdk-tools/azpysdk/apistub.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from ci_tools.parsing import ParsedSetup
1414

1515
REPO_ROOT = discover_repo_root()
16-
MAX_PYTHON_VERSION = (3, 11)
16+
PYTHON_VERSION_LIMIT = (3, 11) # apistub doesn't support Python 3.11+
1717

1818

1919
def get_package_wheel_path(pkg_root: str) -> str:
@@ -76,9 +76,9 @@ def run(self, args: argparse.Namespace) -> int:
7676
"""Run the apistub check command."""
7777
logger.info("Running apistub check...")
7878

79-
if sys.version_info > MAX_PYTHON_VERSION:
79+
if sys.version_info >= PYTHON_VERSION_LIMIT:
8080
logger.error(
81-
f"Python version {sys.version_info.major}.{sys.version_info.minor} is not supported. Maximum supported version is {MAX_PYTHON_VERSION[0]}.{MAX_PYTHON_VERSION[1]}."
81+
f"Python version {sys.version_info.major}.{sys.version_info.minor} is not supported. Version must be less than {PYTHON_VERSION_LIMIT[0]}.{PYTHON_VERSION_LIMIT[1]}."
8282
)
8383
return 1
8484

eng/tools/azure-sdk-tools/tests/test_apistub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _make_args(self, dest_dir=None, generate_md=False):
8686
@patch(
8787
"azpysdk.apistub.REPO_ROOT", os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..", ".."))
8888
)
89-
@patch("azpysdk.apistub.MAX_PYTHON_VERSION", (99, 99))
89+
@patch("azpysdk.apistub.PYTHON_VERSION_LIMIT", (99, 99))
9090
@patch("azpysdk.apistub.get_cross_language_mapping_path", return_value=None)
9191
@patch("azpysdk.apistub.get_package_wheel_path", return_value="/fake/pkg.whl")
9292
@patch("azpysdk.apistub.create_package_and_install")
@@ -139,7 +139,7 @@ def fake_pwsh(cmd, **kwargs):
139139
@patch(
140140
"azpysdk.apistub.REPO_ROOT", os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..", ".."))
141141
)
142-
@patch("azpysdk.apistub.MAX_PYTHON_VERSION", (99, 99))
142+
@patch("azpysdk.apistub.PYTHON_VERSION_LIMIT", (99, 99))
143143
@patch("azpysdk.apistub.get_cross_language_mapping_path", return_value=None)
144144
@patch("azpysdk.apistub.get_package_wheel_path", return_value="/fake/pkg.whl")
145145
@patch("azpysdk.apistub.create_package_and_install")

scripts/auto_release/PythonSdkLiveTest.yml

Lines changed: 0 additions & 111 deletions
This file was deleted.

scripts/auto_release/README.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

scripts/auto_release/auto_private_package.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)