add-azuredevops
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese📋 Shared Instructions: shared-instructions.md - Cross-cutting concerns.
📋 共享说明:shared-instructions.md - 跨领域关注点。
Add Azure DevOps
添加Azure DevOps连接器
Workflow
工作流程
- Check Memory Bank → 2. Add Connector → 3. Apply HttpRequest Fix → 4. Configure → 5. Build → 6. Update Memory Bank
- 检查内存库 → 2. 添加连接器 → 3. 应用HttpRequest修复 → 4. 配置 → 5. 构建 → 6. 更新内存库
Step 1: Check Memory Bank
步骤1:检查内存库
Check for per shared-instructions.md.
memory-bank.md按照shared-instructions.md的说明检查。
memory-bank.mdStep 2: Add Connector
步骤2:添加连接器
First, find the connection ID (see connector-reference.md):
Run the skill. Find the Azure DevOps connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from or a prior step): → + New connection → search for the connector → Create.
/list-connectionspower.config.jsonhttps://make.powerapps.com/environments/<environment-id>/connectionsbash
pwsh -NoProfile -Command "pac code add-data-source -a azuredevops -c <connection-id>"首先,找到连接ID(参见connector-reference.md):
运行技能。在输出中找到Azure DevOps连接。如果不存在,请引导用户使用特定环境的连接URL创建一个——根据上下文(来自或之前步骤)中的活动环境ID构建该URL: → + 新建连接 → 搜索该连接器 → 创建。
/list-connectionspower.config.jsonhttps://make.powerapps.com/environments/<environment-id>/connectionsbash
pwsh -NoProfile -Command "pac code add-data-source -a azuredevops -c <connection-id>"Step 3: Apply HttpRequest Fix (Required)
步骤3:应用HttpRequest修复(必填)
The generated code has a known issue: the method uses as the parameter name, but the API expects . Rename to in these 3 files:
HttpRequestparametersbodyparametersbodyUse the tool to rename to in each file:
Editparametersbody1. :
Find the method. Rename the parameter and its usage:
src/generated/services/AzureDevOpsService.tsHttpRequesttypescript
// BEFORE (generated):
async HttpRequest(parameters: any) {
const params = { parameters: parameters, ... };
// AFTER (fixed):
async HttpRequest(body: any) {
const params = { body: body, ... };2. :
Find the → → section. Rename the property key:
.power/appschemas/dataSourceInfo.tsvisualstudioteamservicesHttpRequestparameterstypescript
// BEFORE (generated):
HttpRequest: {
parameters: {
parameters: { ... }
// AFTER (fixed):
HttpRequest: {
parameters: {
body: { ... }3. :
Find the → → array. Change the field:
.power/schemas/visualstudioteamservices/visualstudioteamservices.Schema.json/{connectionId}/httprequestpostparametersnamejson
// BEFORE (generated):
{ "name": "parameters", "in": "body", ... }
// AFTER (fixed):
{ "name": "body", "in": "body", ... }生成的代码存在一个已知问题:方法使用作为参数名称,但API期望的是。在以下3个文件中将重命名为:
HttpRequestparametersbodyparametersbody使用工具在每个文件中把重命名为:
Editparametersbody1. :
找到方法。重命名参数及其用法:
src/generated/services/AzureDevOpsService.tsHttpRequesttypescript
// BEFORE (generated):
async HttpRequest(parameters: any) {
const params = { parameters: parameters, ... };
// AFTER (fixed):
async HttpRequest(body: any) {
const params = { body: body, ... };2. :
找到 → → 部分。重命名属性键:
.power/appschemas/dataSourceInfo.tsvisualstudioteamservicesHttpRequestparameterstypescript
// BEFORE (generated):
HttpRequest: {
parameters: {
parameters: { ... }
// AFTER (fixed):
HttpRequest: {
parameters: {
body: { ... }3. :
找到 → → 数组。修改字段:
.power/schemas/visualstudioteamservices/visualstudioteamservices.Schema.json/{connectionId}/httprequestpostparametersnamejson
// BEFORE (generated):
{ "name": "parameters", "in": "body", ... }
// AFTER (fixed):
{ "name": "body", "in": "body", ... }Step 4: Configure
步骤4:配置
Ask the user what Azure DevOps operations they need (query work items, create items, trigger pipelines, etc.).
HttpRequest -- make arbitrary ADO REST API calls:
typescript
await AzureDevOpsService.HttpRequest({
Uri: "https://dev.azure.com/{org}/{project}/_apis/wit/wiql?api-version=7.2",
Method: "POST",
Body: JSON.stringify({
query:
"SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.TeamProject] = @project"
})
});Docs: Azure DevOps REST API
Use to find specific methods in (generated files can be very large -- see connector-reference.md).
Grepsrc/generated/services/AzureDevOpsService.ts询问用户需要哪些Azure DevOps操作(查询工作项、创建项、触发管道等)。
HttpRequest -- 发起任意ADO REST API调用:
typescript
await AzureDevOpsService.HttpRequest({
Uri: "https://dev.azure.com/{org}/{project}/_apis/wit/wiql?api-version=7.2",
Method: "POST",
Body: JSON.stringify({
query:
"SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.TeamProject] = @project"
})
});使用在中查找特定方法(生成的文件可能非常大——参见connector-reference.md)。
Grepsrc/generated/services/AzureDevOpsService.tsStep 5: Build
步骤5:构建
powershell
npm run buildFix TypeScript errors before proceeding. Do NOT deploy yet.
powershell
npm run build在继续之前修复TypeScript错误。请勿部署。
Step 6: Update Memory Bank
步骤6:更新内存库
Update with: connector added, HttpRequest fix applied, build status.
memory-bank.md在中更新以下内容:已添加连接器、已应用HttpRequest修复、构建状态。
memory-bank.md