New issue
Advanced search Search tips

Issue 753467 link

Starred by 0 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Investigate robustness of the Chromium commit -> PR lookup process and consider adding safety net

Project Member Reported by robertma@chromium.org, Aug 8 2017

Issue description

In  issue 748876 , we experienced the case that WPTGitHub.pr_for_chromium_commit mistakenly linked a random commit with an open pull request (because the pull request has an incorrect commit position that matches the commit), and hence merged the PR assuming the corresponding CL was reviewed and submitted.

The immediate fix is  issue 737178 , which removes commit positions from PRs generated from in-flight CLs, as they are simply ToT+1 but not the final commit positions. This would prevent premature merging in the exact same scenarios, but after discussion with foolip@, there might be still some open questions:

How reliable is the change ID? Are they globally unique, and, once created cannot be changed? Is it possible to land a change without a change ID (except via Rietveld)?

And shall we implement some kind of safeguards for the lookup process, like comparing the messages and/or lists of files, and failing loudly when things don't look right?
 
As far as I understand now, change IDs are supposed to be unique at least to a repository/branch (and so they should be unique for reviews for the chromium/src repo master branch).

I'm inclined to trust Change-Ids, since there seems to be a 1:1 mapping from Change Ids to Gerrit CLs (since you can make links like "https://chromium-review.googlesource.com/q/I33588ef09b3bd6d8a22870eaf222a2f17080d4a6").

Failing loudly when things don't look right is generally a good idea, but I'd only invest time in adding extra checks here if there's something that's quick to add.
Status: Available (was: Untriaged)
Status: WontFix (was: Available)
I found the Gerrit document on change-ID: https://gerrit-review.googlesource.com/Documentation/user-changeid.html

So the change ID is guaranteed to be unique in a branch. In our case, we only care about chromium master, so we should be good.

Besides, I did some experiments trying to modify the change ID from command line and the web interface, both were denied by Gerrit, which is in accordance with the document that once created/generated, change IDs must stay the same.

At this point, I'm pretty satisfied with the robustness of our current approach. Now that the issue regarding commit positions is fixed, it's unlikely to have the mismatch again. For now, I don't think it'd worth the effort to implement some heuristic safeguards. Closing as wontfix and we can come back later if the situation changes.

Comment 4 by foolip@chromium.org, Aug 10 2017

Thanks for looking into this, resolution sounds good.

Comment 5 by foolip@chromium.org, Aug 10 2017

Actually, there is still the issue of commit messages matching. If we trust the mapping fully, can we add an assert that the commit messages match exactly before merging PRs?
foolip@: yes! See issue 753487 for the exact problem (and it's not just a "good-to-have", but actually a potential bug at the moment).

Comment 7 by foolip@chromium.org, Aug 10 2017

Ah, thanks :)

Sign in to add a comment