Discontinue draft workflow

Change-Id: Ica5b7343d317a33c9cee60f83d9b3054926191d8
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/CommentAdded.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/CommentAdded.java
index 531f0ce..7dc1624 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/CommentAdded.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/CommentAdded.java
@@ -36,7 +36,6 @@
 
     ChangeInfo c = event.getChange();
     args.add("--change", c.id);
-    args.add("--is-draft", event.getRevision().draft);
     args.addUrl(c);
     args.add("--change-owner", c.owner);
     args.add("--project", c.project);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/DraftPublished.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/DraftPublished.java
deleted file mode 100644
index 8fe8cde..0000000
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/DraftPublished.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (C) 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package com.googlesource.gerrit.plugins.hooks;
-
-import com.google.gerrit.extensions.common.ChangeInfo;
-import com.google.gerrit.extensions.events.DraftPublishedListener;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
-@Singleton
-class DraftPublished implements DraftPublishedListener {
-  private final Hook hook;
-  private final HookFactory hookFactory;
-
-  @Inject
-  DraftPublished(HookFactory hookFactory) {
-    this.hook = hookFactory.createAsync("draftPublishedHook", "draft-published");
-    this.hookFactory = hookFactory;
-  }
-
-  @Override
-  public void onDraftPublished(DraftPublishedListener.Event event) {
-    HookArgs args = hookFactory.createArgs();
-
-    ChangeInfo c = event.getChange();
-    args.add("--change", c.id);
-    args.addUrl(c);
-    args.add("--change-owner", c.owner);
-    args.add("--project", c.project);
-    args.add("--branch", c.branch);
-    args.add("--topic", c.topic);
-    args.add("--uploader", event.getWho());
-    args.add("--commit", event.getRevision().commit.commit);
-    args.add("--patchset", event.getRevision()._number);
-
-    hook.execute(c.project, args);
-  }
-}
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/Module.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/Module.java
index 427d15b..df16d15 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/Module.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/Module.java
@@ -20,7 +20,6 @@
 import com.google.gerrit.extensions.events.ChangeMergedListener;
 import com.google.gerrit.extensions.events.ChangeRestoredListener;
 import com.google.gerrit.extensions.events.CommentAddedListener;
-import com.google.gerrit.extensions.events.DraftPublishedListener;
 import com.google.gerrit.extensions.events.GitReferenceUpdatedListener;
 import com.google.gerrit.extensions.events.HashtagsEditedListener;
 import com.google.gerrit.extensions.events.LifecycleListener;
@@ -50,7 +49,6 @@
     DynamicSet.bind(binder(), ChangeMergedListener.class).to(ChangeMerged.class);
     DynamicSet.bind(binder(), ChangeRestoredListener.class).to(ChangeRestored.class);
     DynamicSet.bind(binder(), CommentAddedListener.class).to(CommentAdded.class);
-    DynamicSet.bind(binder(), DraftPublishedListener.class).to(DraftPublished.class);
     DynamicSet.bind(binder(), GitReferenceUpdatedListener.class).to(GitReferenceUpdated.class);
     DynamicSet.bind(binder(), HashtagsEditedListener.class).to(HashtagsEdited.class);
     DynamicSet.bind(binder(), NewProjectCreatedListener.class).to(NewProjectCreated.class);
diff --git a/src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java b/src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java
index ebf5a7b..8ccc226 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java
@@ -36,7 +36,6 @@
 
     ChangeInfo c = event.getChange();
     args.add("--change", c.id);
-    args.add("--is-draft", event.getRevision().draft);
     args.add("--kind", String.valueOf(event.getRevision().kind));
     args.addUrl(c);
     args.add("--change-owner", c.owner);
diff --git a/src/main/resources/Documentation/hooks.md b/src/main/resources/Documentation/hooks.md
index 0787fb3..09a7c25 100644
--- a/src/main/resources/Documentation/hooks.md
+++ b/src/main/resources/Documentation/hooks.md
@@ -37,31 +37,22 @@
 patchset-created
 ----------------
 
-Called whenever a patchset is created (this includes new changes and drafts).
+Called whenever a patchset is created (this includes new changes).
 
 ```
-  patchset-created --change <change id> --is-draft <boolean> --kind <change kind> --change-url <change url> --change-owner <change owner> --change-owner-username <username> --project <project name> --branch <branch> --topic <topic> --uploader <uploader> --uploader-username <username> --commit <sha1> --patchset <patchset id>
+  patchset-created --change <change id> --kind <change kind> --change-url <change url> --change-owner <change owner> --change-owner-username <username> --project <project name> --branch <branch> --topic <topic> --uploader <uploader> --uploader-username <username> --commit <sha1> --patchset <patchset id>
 ```
 
 The `--kind` parameter represents the kind of change uploaded. See documentation
 of [`patchSet`][2] for details.
 
-draft-published
----------------
-
-Called whenever a draft change is published.
-
-```
-  draft-published --change <change id> --change-url <change url> --change-owner <change owner> --change-owner-username <username> --project <project name> --branch <branch> --topic <topic> --uploader <uploader> --uploader-username <username> --commit <sha1> --patchset <patchset id>
-```
-
 comment-added
 -------------
 
 Called whenever a comment is added to a change.
 
 ```
-  comment-added --change <change id> --is-draft <boolean> --change-url <change url> --change-owner <change owner> --change-owner-username <username> --project <project name> --branch <branch> --topic <topic> --author <comment author> --author-username <username> --commit <commit> --comment <comment> [--<approval category id> <score> --<approval category id> <score> --<approval category id>-oldValue <score> ...]
+  comment-added --change <change id> --change-url <change url> --change-owner <change owner> --change-owner-username <username> --project <project name> --branch <branch> --topic <topic> --author <comment author> --author-username <username> --commit <commit> --comment <comment> [--<approval category id> <score> --<approval category id> <score> --<approval category id>-oldValue <score> ...]
 ```
 
 change-merged