Skip to content

Commit cf7c463

Browse files
authored
Merge branch 'main' into ew/mcp-inspector-docs
2 parents 225c011 + f88aefd commit cf7c463

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+381
-721
lines changed

packages/mcp-provider-devops/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [0.2.1](https://github.com/salesforcecli/mcp/compare/mcp-provider-devops@0.2.0...mcp-provider-devops@0.2.1) (2026-03-05)
2+
3+
4+
### Bug Fixes
5+
6+
* Use getConnection instead of axios ([#398](https://github.com/salesforcecli/mcp/issues/398)) ([8894550](https://github.com/salesforcecli/mcp/commit/889455069660ccfe0e64672139d29239c4be0236))
7+
8+
9+
110
# [0.2.0](https://github.com/salesforcecli/mcp/compare/mcp-provider-devops@0.1.9...mcp-provider-devops@0.2.0) (2026-02-19)
211

312

packages/mcp-provider-devops/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@salesforce/mcp-provider-devops",
33
"description": "MCP provider for DevOps tools and operations",
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"author": "Salesforce",
66
"license": "Apache-2.0",
77
"type": "module",
@@ -18,7 +18,6 @@
1818
"@salesforce/core": "^8.24.3",
1919
"@salesforce/source-deploy-retrieve": "^12.31.7",
2020
"@salesforce/ts-types": "^2.0.12",
21-
"axios": "^1.10.0",
2221
"zod": "^3.25.76"
2322
},
2423
"devDependencies": {

packages/mcp-provider-devops/src/commitLiteWorkItem.ts

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import axios from 'axios';
2-
import { getConnection, getRequiredOrgs } from './shared/auth.js';
1+
import { type Connection } from '@salesforce/core';
32
import { execFileSync } from 'child_process';
43
import { normalizeAndValidateRepoPath } from './shared/pathUtils.js';
54
import path from 'path';
@@ -8,68 +7,60 @@ import * as os from 'os';
87
import { RegistryAccess } from '@salesforce/source-deploy-retrieve';
98
import { convertToSourceComponents } from './shared/sfdxService.js';
109

10+
const API_VERSION = 'v65.0';
11+
1112
interface Change {
1213
fullName: string;
1314
type: string;
1415
operation: string;
1516
}
1617

17-
interface CommitWorkItemParams {
18+
export interface CommitWorkItemParams {
19+
connection: Connection;
1820
workItem: { id: string };
1921
requestId: string;
2022
commitMessage: string;
21-
username: string;
2223
repoPath?: string;
2324
}
2425

25-
26+
/**
27+
* Commits work item changes (lite flow) using the provided Connection.
28+
* API: POST /services/data/v65.0/connect/devops/workItems/<id>/commitlite
29+
*/
2630
export async function commitWorkItem({
31+
connection,
2732
workItem,
2833
requestId,
2934
commitMessage,
30-
username,
3135
repoPath
3236
}: CommitWorkItemParams): Promise<any> {
33-
const connection = await getConnection(username);
34-
const accessToken = connection.accessToken;
35-
const instanceUrl = connection.instanceUrl;
36-
37-
if (!accessToken || !instanceUrl) {
38-
throw new Error('Missing access token or instance URL. Please check if you are authenticated to the org.');
39-
}
40-
41-
4237
const workingDir = normalizeAndValidateRepoPath(repoPath);
43-
4438
const computedChanges = buildComputedChanges(workingDir);
45-
46-
const { commitSha, branch } = AddAndCommitChanges(workingDir, commitMessage);
47-
48-
const url = `${instanceUrl}/services/data/v65.0/connect/devops/workItems/${workItem.id}/commitlite`;
49-
50-
const headers = {
51-
'Authorization': `Bearer ${accessToken}`,
52-
'Content-Type': 'application/json'
53-
};
39+
const { commitSha } = AddAndCommitChanges(workingDir, commitMessage);
5440

41+
const pathUrl = `/services/data/${API_VERSION}/connect/devops/workItems/${workItem.id}/commitlite`;
5542
const requestBody = {
5643
requestId,
5744
commitMessage,
58-
'commitId': commitSha,
45+
commitId: commitSha,
5946
changes: computedChanges
6047
};
6148

6249
try {
63-
const response = await axios.post(url, requestBody, { headers });
64-
65-
return {
50+
await connection.request({
51+
method: 'POST',
52+
url: pathUrl,
53+
body: JSON.stringify(requestBody),
54+
headers: { 'Content-Type': 'application/json' }
55+
});
56+
return {
6657
content: [{
67-
type: "text",
68-
text: `Changes committed successfully.
58+
type: "text",
59+
text: `Changes committed successfully.
6960
Commit SHA: ${commitSha}
7061
Agent execution guide (perform these steps now)
7162
- Push the commit: 'git push'`,
72-
actionRequired: true
63+
actionRequired: true
7364
}],
7465
isError: false
7566
};

packages/mcp-provider-devops/src/commitWorkItem.ts

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

0 commit comments

Comments
 (0)