You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Node version: v20.10.0
Npm version: 10.2.3
OS and version: macOS 13.6.3
azure-devops-node-api version: 12.3.0
Issue Description
I am using Azure DevOps free plan. I have create a PAT with full access.
When I try to create a getAPI object with connection.getGitApi() , it returns an error.
Here is my code:
exportconstcommentOnPR=async(comment: string): Promise<void>=>{console.log(comment);try{const{ organization, azureToken, pullRequestId, repositoryId, project }=gitAzureEnvVariables();// your collection urlconstorgUrl=`https://dev.azure.com/${organization}/`;constpullRequestIdNumber=Number(pullRequestId);console.log({ organization, azureToken, pullRequestId, repositoryId, project });constauthHandler=azdev.getPersonalAccessTokenHandler(azureToken);// The PAT has Full permissionsconsole.log('authHandler',authHandler);constconnection=newazdev.WebApi(orgUrl,authHandler);console.log('connection',connection);constgitApiObject: gitApiObject.IGitApi=awaitconnection.getGitApi();// the error throw form this lineconstrepos: GitInterfaces.GitRepository[]=awaitgitApiObject.getRepositories(project);console.log("There are",repos.length,"repositories in this project");constthreads: GitInterfaces.GitPullRequestCommentThread[]=awaitgitApiObject.getThreads(repositoryId,pullRequestIdNumber,project);console.log('threads',threads);constprComment: GitInterfaces.Comment=<GitInterfaces.Comment>{content: comment,};
// createComment(comment: GitInterfaces.Comment, repositoryId: string, pullRequestId: number, threadId: number, project?: string): Promise<GitInterfaces.Comment>;
await gitApiObject.createComment(
prComment,
repositoryId,
pullRequestIdNumber,
threads[0].id || 0,
project
);
}catch(error){console.log(error);logger.error(`Failed to comment on PR: ${JSON.stringify(error)}`);throwerror;}
Expected behaviour
It should create a comment for the specific PR
Actual behaviour
Error: Failed to find api location for area: Location id: e81700f7-3be2-46de-8624-2eb35882fcaa
Logs
Error: Failed to find api location for area: Location id: e81700f7-3be2-46de-8624-2eb35882fcaa
at code-review-gpt/packages/code-review-gpt/node_modules/azure-devops-node-api/VsoClient.js:85:23
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The text was updated successfully, but these errors were encountered:
Environment
Node version: v20.10.0
Npm version: 10.2.3
OS and version: macOS 13.6.3
azure-devops-node-api version: 12.3.0
Issue Description
I am using Azure DevOps free plan. I have create a PAT with full access.
When I try to create a getAPI object with
connection.getGitApi()
, it returns an error.Here is my code:
Expected behaviour
It should create a comment for the specific PR
Actual behaviour
Error: Failed to find api location for area: Location id: e81700f7-3be2-46de-8624-2eb35882fcaa
Logs
Error: Failed to find api location for area: Location id: e81700f7-3be2-46de-8624-2eb35882fcaa at code-review-gpt/packages/code-review-gpt/node_modules/azure-devops-node-api/VsoClient.js:85:23 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The text was updated successfully, but these errors were encountered: