incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Bug][Bitbucket_server] collectApiPullRequestCommits fails when a PR losese it's commit

Open TihomirPop opened this issue 1 year ago • 3 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

What happened

The Bitbucket Server data collection task fails because one pull request has corrupted/deleted commits.

subtask collectApiPullRequestCommits ended unexpectedly Retry exceeded 3 times calling rest/api/1.0/projects/{projectKey}/repos/{repoName}/pull-requests/{pullRequestId}/commits. The last error was: Http DoAsync error calling [method:GET path:rest/api/1.0/projects/{projectKey}/repos/{repoName}/pull-requests/{pullRequestId}/commits query:map[limit:[100] state:[all]]]. Response: {"errors":[{"context":null,"message":"Commit '{commitHash}' does not exist in repository '{repoName}'.","exceptionName":"com.atlassian.bitbucket.commit.NoSuchCommitException"}]} (404)

What do you expect to happen

I think it would make sense for the data collection to continue even if a commit is missing, since we don't want to lose all of those Bitbucket metrics for the repository if just a single commit is missing.

How to reproduce

Start data collection for a project with a Bitbucket Server plugin connection. The data scope needs to be a repository where a commit from a pull request was deleted/corrupted after the pull request got merged.

Anything else

No response

Version

v1.0.0-beta2

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

TihomirPop avatar Mar 29 '24 13:03 TihomirPop

I agree. It should skip the pr with no commits.

Startrekzky avatar Apr 15 '24 01:04 Startrekzky

HI team, any updates regarding this issue?

sstojak1 avatar May 08 '24 08:05 sstojak1

@sstojak1 Not yet, but soon.

klesh avatar May 08 '24 09:05 klesh