Draft shouldn't update Launchpad before being Published

Bug #1078231 reported by Julie Pichon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
Invalid
Low
Unassigned

Bug Description

Steps to reproduce:
1. Create a commit message such as "Fixes bug XXXX"
2. Push as Draft using git review -D

Expected result:
3. User can work on the draft privately without Launchpad being notified
4. If happy with the draft, user can click Publish - only then is a Launchpad comment for the review added

Actual result:
3. The bug report in Launchpad is updated with a link to the Draft no one else can access (see e.g. comment #4 on https://bugs.launchpad.net/horizon/+bug/1076216 - the draft was deleted before I noticed a comment had been created)

Tags: updatebug
Thierry Carrez (ttx)
tags: added: updatebug
Changed in openstack-ci:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Thierry Carrez (ttx) wrote :

Hmm, unfortunately Gerrit calls its hooks just the same in draft and no-draft cases. I'm researching options on how to fix that.

Revision history for this message
Julie Pichon (jpichon) wrote :

This might be obvious, but in case it's handled in different places: this also applies to blueprints, which will be uploaded with the gerrit topic even if the review is a draft.

Jeremy Stanley (fungi)
Changed in openstack-ci:
importance: Medium → Low
Changed in openstack-ci:
assignee: nobody → Ricardo Carrillo Cruz (rcarrillocruz)
Revision history for this message
Ricardo Carrillo Cruz (rcarrillocruz) wrote :

When the patchset-created hook is invoked by Gerrit, there is no flag stating the patchset is in draft.

This can be done by querying the database and checking if the patchset is indeed a draft within update_bug.py, which is the script called by the hook.
The table for patchsets contain the desired flag:

mysql> describe patch_sets;
+---------------------+-------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+-------------+------+-----+-------------------+-----------------------------+
| revision | varchar(40) | YES | | NULL | |
| uploader_account_id | int(11) | NO | | 0 | |
| created_on | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
| draft | char(1) | NO | | N | |
| change_id | int(11) | NO | PRI | 0 | |
| patch_set_id | int(11) | NO | PRI | 0 | |
+---------------------+-------------+------+-----+-------------------+-----------------------------+
6 rows in set (0.01 sec)

Changed in openstack-ci:
status: Confirmed → In Progress
Revision history for this message
Ricardo Carrillo Cruz (rcarrillocruz) wrote :

Draft reviews are being disabled the 30th May, unassigning myself and flagging this as INVALID

Changed in openstack-ci:
assignee: Ricardo Carrillo Cruz (rcarrillocruz) → nobody
Changed in openstack-ci:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.