Skip to content

Commit

Permalink
Fix javadoc for allthethings
Browse files Browse the repository at this point in the history
  • Loading branch information
ascandella committed Aug 13, 2015
1 parent f18137e commit 6e801c4
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -7,4 +7,4 @@ jdk:
- oraclejdk8

after_success:
- mvn clean cobertura:cobertura coveralls:report
- mvn clean cobertura:cobertura coveralls:report javadoc:javadoc
4 changes: 0 additions & 4 deletions pom.xml
Expand Up @@ -142,10 +142,6 @@
</plugins>
</build>

<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>

<scm>
<connection>scm:git:ssh://github.com/jenkinsci/phabricator-plugin.git</connection>
<developerConnection>scm:git:ssh://git@github.com/jenkinsci/phabricator-plugin.git</developerConnection>
Expand Down
Expand Up @@ -150,9 +150,6 @@ private ConduitCredentials getConduitCredentials(Job owner) {
return getDescriptor().getCredentials(owner);
}

/**
* This is used in config.jelly to populate the state of the checkbox
*/
@SuppressWarnings("UnusedDeclaration")
public boolean isCreateCommit() {
return createCommit;
Expand Down
Expand Up @@ -227,9 +227,6 @@ private boolean ignoreBuild(PrintStream logger, String message) {
return true;
}

/**
* These are used in the config.jelly file to populate the state of the fields
*/
@SuppressWarnings("UnusedDeclaration")
public boolean isCommentOnSuccess() {
return commentOnSuccess;
Expand Down
Expand Up @@ -46,8 +46,9 @@ public RemoteCommentFetcher(FilePath workspace, Logger logger, String commentFil

/**
* Attempt to read a remote comment file
* @return the contents of the string
* @throws InterruptedException
* @return the content of the remote comment file, if present
* @throws InterruptedException if there is an error fetching the file
* @throws IOException if any network error occurs
*/
public String getRemoteComment() throws InterruptedException, IOException {
if (CommonUtils.isBlank(commentFile)) {
Expand Down
Expand Up @@ -89,8 +89,8 @@ public JSONObject perform(String action, Map<String, String> data) throws IOExce
* @param action The name of the Conduit method
* @param data The data to be sent to the Conduit method
* @return The request to perform
* @throws UnsupportedEncodingException
* @throws ConduitAPIException
* @throws UnsupportedEncodingException when the POST data can't be encoded
* @throws ConduitAPIException when the conduit URL is misconfigured
*/
public HttpUriRequest createRequest(String action, Map<String, String> data) throws UnsupportedEncodingException, ConduitAPIException {
HttpPost post;
Expand Down
Expand Up @@ -50,8 +50,8 @@ public String getRevisionID(boolean formatted) {

/**
* Get the summary message
* @param phabricatorURL
* @return
* @param phabricatorURL the root of the Phabricator URL for hyperlinks
* @return the summary message to display
*/
public String getSummaryMessage(String phabricatorURL) {
return String.format("This was a build of <a href=\"%s\">%s</a> by %s &lt;%s&gt;",
Expand Down Expand Up @@ -87,24 +87,24 @@ private PhabricatorPostbuildSummaryAction createSummary(final AbstractBuild buil

/**
* Get a build started message to post to phabricator
* @param environment
* @return
* @param environment the environment variables for the build
* @return the build started message
*/
public String getBuildStartedMessage(EnvVars environment) {
return String.format("Build started: %s (console: %sconsole)", environment.get("BUILD_URL"), environment.get("BUILD_URL"));
}

/**
* Return the base commit of the diff
* @return
* @return the base revision for git
*/
public String getBaseCommit() {
return (String) rawJSON.get("sourceControlBaseRevision");
}

/**
* Return the local branch name
* @return
* @return the name of the branch, or unknown
*/
public String getBranch() {
Object branchName = rawJSON.get("branch");
Expand Down
Expand Up @@ -42,11 +42,14 @@ public DifferentialClient(String diffID, ConduitAPIClient conduit) {
/**
* Posts a comment to a differential
* @param revisionID the revision ID (e.g. "D1234" without the "D")
* @param message
* @param message the content of the comment
* @param silent whether or not to trigger an email
* @param action phabricator comment action, e.g. 'resign', 'reject', 'none'
* @return the Conduit API response
* @throws IOException if there is a network error talking to Conduit
* @throws ConduitAPIException if any error is experienced talking to Conduit
*/
public JSONObject postComment(String revisionID, String message, boolean silent, String action) throws ConduitAPIException, IOException {
public JSONObject postComment(String revisionID, String message, boolean silent, String action) throws IOException, ConduitAPIException {
Map params = new HashMap<String, String>();
params.put("revision_id", revisionID);
params.put("action", action);
Expand All @@ -56,6 +59,12 @@ public JSONObject postComment(String revisionID, String message, boolean silent,
return this.callConduit("differential.createcomment", params);
}

/**
* Fetch a differential from Conduit
* @return the Conduit API response
* @throws IOException if there is a network error talking to Conduit
* @throws ConduitAPIException if any error is experienced talking to Conduit
*/
public JSONObject fetchDiff() throws IOException, ConduitAPIException {
Map params = new HashMap<String, String>();
params.put("ids", new String[]{diffID});
Expand Down Expand Up @@ -85,8 +94,9 @@ public JSONObject fetchDiff() throws IOException, ConduitAPIException {
* Sets a sendHarbormasterMessage build status
* @param phid Phabricator object ID
* @param pass whether or not the build passed
* @throws IOException
* @throws InterruptedException
* @return the Conduit API response
* @throws IOException if there is a network error talking to Conduit
* @throws ConduitAPIException if any error is experienced talking to Conduit
*/
public JSONObject sendHarbormasterMessage(String phid, boolean pass) throws ConduitAPIException, IOException {
Map params = new HashMap<String, String>();
Expand All @@ -100,10 +110,9 @@ public JSONObject sendHarbormasterMessage(String phid, boolean pass) throws Cond
* Post a comment on the differential
* @param revisionID the revision ID (e.g. "D1234" without the "D")
* @param message the string message to post
* @return
* @throws IOException
* @throws InterruptedException
* @throws ArcanistUsageException
* @return the Conduit API response
* @throws IOException if there is a network error talking to Conduit
* @throws ConduitAPIException if any error is experienced talking to Conduit
*/
public JSONObject postComment(String revisionID, String message) throws ConduitAPIException, IOException {
return postComment(revisionID, message, true, "none");
Expand Down
Expand Up @@ -43,7 +43,11 @@ public class PostCommentTask extends Task {

/**
* PostCommentTask constructor.
* @param logger The logger.
* @param logger the logger
* @param differentialClient the client for the differential
* @param revisionID the revision identifier from harbormaster
* @param comment the body of the comment
* @param commentAction the name of the comment action
*/
public PostCommentTask(Logger logger, DifferentialClient differentialClient,
String revisionID, String comment, String commentAction) {
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/uber/jenkins/phabricator/tasks/Task.java
Expand Up @@ -51,6 +51,7 @@ public Task(Logger logger) {

/**
* Runs the task workflow.
* @return the result of the task
*/
public Result run() {
setup();
Expand Down

0 comments on commit 6e801c4

Please sign in to comment.