Integrated: 2043: Skara mistakenly tagged the wrong commit when processing a /tag command
Erik Joelsson
erikj at openjdk.org
Fri Sep 29 17:34:37 UTC 2023
On Thu, 28 Sep 2023 18:17:29 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
> The method `GitLabRepository::recentCommitComments` may sometimes return a comment associated with the wrong commit. We have seen it happen, which caused a tag to be set on the wrong commit. My theory is that this was caused by a race, which was probably made more potent due to GitLab sometimes being slow in returning up to date data. See bug for more details.
>
> The main fix is to always verify that an event note about a recent commit comment actually matches a comment found on the commit in question. The current implementation has a quick return when only one potential commit is found.
>
> In addition to that, I'm also reworking the implementation to be a bit more robust. @zhaosongzs found that there is an alternate API for retrieving commit comments called "discussions" and that gives us more data, notably the same ID field as an event has. This makes it possible to match an event note with a commit comment note by ID instead of by the combination of author and created_at. From this further simplifications naturally fell out.
>
> A CommitComment returned from `GitLabRepository::addCommitComment` no longer contains a value for ID. I think this is more correct than making up a value. I verified that no code seems to be using the returned object currently, so this shouldn't impact anything.
>
> The two new tests were run and inspected manually.
This pull request has now been integrated.
Changeset: 439d2662
Author: Erik Joelsson <erikj at openjdk.org>
URL: https://git.openjdk.org/skara/commit/439d26621820896e247803f59e388976b9e4b957
Stats: 136 lines in 2 files changed: 76 ins; 20 del; 40 mod
2043: Skara mistakenly tagged the wrong commit when processing a /tag command
Reviewed-by: zsong
-------------
PR: https://git.openjdk.org/skara/pull/1564
More information about the skara-dev
mailing list