New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 750090 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Update ChangeID used in Gerrit SetReview

Project Member Reported by emso@chromium.org, Jul 28 2017

Issue description

This is needed to make sure a change is uniquely identified. Tricium currently uses a simplified URL with just a legacy change ID but it should instead incorporate the project and master. See https://dev.vaadin.com/review/Documentation/rest-api-changes.html#change-id for details. 
 

Comment 1 by emso@chromium.org, Aug 28 2017

Owner: qyears...@chromium.org

Comment 2 by emso@chromium.org, Aug 31 2017

Investigate if the current change ID info stored could just be fully qualified with the project name. This is something that could happen in the poller.
Reading through the code in general to get more background now...

Notes from email:

 - The URL mangling happens in setReview in gerrit.go:
   https://cs.chromium.org/chromium/infra/go/src/infra/tricium/appengine/gerrit/gerrit.go
   Now, this just uses whatever change string is passed in. As long as GerritChange is
   always a fully-qualified change ID in all AnalyzeRequests, then the URL will use
   fully-qualified change IDs...

 - Requests are tracked in AnalyzeRequest entities:
   https://cs.chromium.org/chromium/infra/go/src/infra/tricium/appengine/common/track/track.go
   Note that track.AnalyzeRequest (datastore entity) is different from tricium.AnalyzeRequest
   (protobuf). Both have a string field called GerritChange, and for consistency it would be
   nice if these were always fully-qualified change IDs.

 - The Gerrit poller enqueues analyze requests and sets the project to the Gerrit project of a change:
   https://cs.chromium.org/chromium/infra/go/src/infra/tricium/appengine/gerrit/poll.go
   It is here that tricium.AnalyzeRequest messages are made based on Gerrit ChangeInfo.
   https://cs.chromium.org/chromium/infra/go/src/infra/tricium/appengine/gerrit/poll.go?l=317

 - This is also relevant:
   https://cs.chromium.org/chromium/infra/go/src/infra/tricium/appengine/frontend/rpc_analyze.go
   It is here that track.AnalyzeRequest entities are created based on tricium.AnalyzeRequest messages?


One thing that's clear here is that the term "change ID" is ambiguous -- it could either mean a fully-qualified Gerrit change ID (project~branch~Change-Id), or just a "Change-Id" footer value ("I" + sha1 hash, unique only within a given project and branch). So we'll have to be really explicit to make it clear what is meant...

Comment 4 by emso@chromium.org, Sep 1 2017

Yes, let's make this clearer in the documentation and make sure it is propagated properly in the code. The change ID is currently taken from the response the poller gets. 
Status: Started (was: Assigned)
There is another related update that I wanted to make here:

For the Change datastore entity, the datastore ID is still gotten from gr.ChangeInfo.ChangeID, which may not be the fully-qualified change ID used in AnalyzeRequest. For consistency I'd like to change that entitiy to use fully-qualified change IDs too:
https://cs.chromium.org/chromium/infra/go/src/infra/tricium/appengine/gerrit/poll.go
Project Member

Comment 7 by bugdroid1@chromium.org, Oct 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/c1038579798db0616518eeaa0ab6008e325e73d0

commit c1038579798db0616518eeaa0ab6008e325e73d0
Author: Quinten Yearsley <qyearsley@chromium.org>
Date: Wed Oct 11 15:31:51 2017

In Change datastore entities, use fully qualified change IDs

Bug:  750090 
Change-Id: Ife41d58ec9e90a862c3733a77c2e00903f982aab
Reviewed-on: https://chromium-review.googlesource.com/710497
Reviewed-by: Emma Söderberg <emso@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>

[modify] https://crrev.com/c1038579798db0616518eeaa0ab6008e325e73d0/go/src/infra/tricium/appengine/gerrit/poll.go
[modify] https://crrev.com/c1038579798db0616518eeaa0ab6008e325e73d0/go/src/infra/tricium/appengine/gerrit/poll_test.go

Status: Fixed (was: Started)

Sign in to add a comment