Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/ado-connection-data-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@roomote/ado': patch
'@roomote/sdk': patch
---

Request Azure DevOps `/_apis/connectionData` with api-version `7.1-preview`. The resource is preview-only, so the plain `7.1` version always failed with a 400, which silently disabled Roomote's own-comment detection on Azure DevOps pull request and work item comments and broke approve/request-changes reviewer votes on pull requests.
4 changes: 3 additions & 1 deletion packages/ado/src/__tests__/api.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/ado/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export * from './ci';
const ADO_PROVIDER = 'ado' satisfies SourceControlProvider;
const DEFAULT_ADO_BASE_URL = 'https://dev.azure.com';
export const ADO_API_VERSION = '7.1';
// `/_apis/connectionData` is a preview-only resource: Azure DevOps answers
// plain `7.1` (and `7.0`) with a 400 demanding the `-preview` suffix.
const ADO_CONNECTION_DATA_API_VERSION = '7.1-preview';
const ADO_TOKEN_VALIDATION_TIMEOUT_MS = 10_000;
// Fits the whole TF401444 sentence (~204 chars with its three GUIDs) while
// still keeping pathological provider messages toast-sized.
Expand Down Expand Up @@ -807,7 +810,7 @@ export async function getAdoDeploymentUser(options?: {
organizationApiBaseUrl,
fetchImpl: options?.fetchImpl,
path: '/_apis/connectionData',
params: { 'api-version': ADO_API_VERSION },
params: { 'api-version': ADO_CONNECTION_DATA_API_VERSION },
token: adoToken,
schema: adoConnectionDataSchema,
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import {
} from './source-control-pull-request-shared';

const ADO_API_VERSION = '7.1';
// `/_apis/connectionData` is a preview-only resource: Azure DevOps answers
// plain `7.1` (and `7.0`) with a 400 demanding the `-preview` suffix.
const ADO_CONNECTION_DATA_API_VERSION = '7.1-preview';

/**
* Optional id fields from LLM/tool clients often arrive as `""` or whitespace
Expand Down Expand Up @@ -1351,7 +1354,7 @@ async function writeAdoPullRequest({
const connectionData = await requestJson({
fetchImpl,
url: buildApiUrl(organizationApiBaseUrl, '/_apis/connectionData', {
'api-version': ADO_API_VERSION,
'api-version': ADO_CONNECTION_DATA_API_VERSION,
}),
tokenHeader,
schema: adoConnectionDataSchema,
Expand Down
Loading