Clarity on the draft-published stream event.

56 views
Skip to first unread message

Khai Do

unread,
Aug 13, 2014, 2:34:52 PM8/13/14
to repo-d...@googlegroups.com
I just ran some tests against Gerrit stream events on master and noticed that I am not getting draft-published events.  I also noticed some discrepancies on the implementation of this feature so I wanted to get some clarity.  

First off repro steps:
1. run the ssh command to view gerrit stream events (i.e. ssh -p 29418 localhost gerrit stream-events)
2. push a draft to gerrit (i.e. git push origin HEAD:refs/drafts/master)

There is a draftPublishedEvent class [1] and the docs indicate that there is a "draft-published" event [2] so I'm not sure why I'm not getting the event.  When I push a draft to gerrit I do not get a draft-published event however I do get a patchset-created event [3] that includes attributes "status:DRAFT" and "isDraft:true".   So now my question, should there even be a draft-publish event at all?  The patchset-created event seems to already contain the attributes that indicate the status of the change.    




[3]
{"type":"patchset-created","change":{"project":"sea","branch":"master","id":"I65c4acb1a0ad88307258d7785d47ef2c45b5a461","number":"5","subject":"try draft1","owner":{"name":"Zaro","email":"za...@gmail.com","username":"zaro"},"url":"http://localhost:8080/5","commitMessage":"try draft1\n\nChange-Id: I65c4acb1a0ad88307258d7785d47ef2c45b5a461\n","status":"DRAFT"},"patchSet":{"number":"1","revision":"d8fb37726f6122c6d7de353fa39865f6075f1aea","parents":["04a5f8d447a9e274925bf138ab0c4ffb36802092"],"ref":"refs/changes/05/5/1","uploader":{"name":"Zaro","email":"za...@gmail.com","username":"zaro"},"createdOn":1407952486,"author":{"name":"Zaro","email":"za...@gmail.com","username":"zaro"},"isDraft":true,"kind":"REWORK","sizeInsertions":1,"sizeDeletions":-1},"uploader":{"name":"Zaro","email":"za...@gmail.com","username":"zaro"}}

Marcelo Ávila

unread,
Aug 13, 2014, 3:15:03 PM8/13/14
to Khai Do, Repo and Gerrit Discussion
The draft-published event is triggered when someone clicks on the "Publish" button on a draft change.

--
Marcelo Ávila de Oliveira
CPqD - Information Technology Engineer



--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Khai Do

unread,
Aug 13, 2014, 5:00:51 PM8/13/14
to repo-d...@googlegroups.com, zaro...@gmail.com
ohh of course.  I thought it triggered on a new draft patchset.  Makes much sense now.  Thanks.
Reply all
Reply to author
Forward
0 new messages