/** * Edit issue * * @param repoId * @param repository * @param issue * @return created issue * @throws IOException */ private Issue editIssue(String repoId, Issue issue) throws IOException { if (issue == null) throw new IllegalArgumentException("Issue cannot be null"); //$NON-NLS-1$ StringBuilder uri = new StringBuilder(SEGMENT_REPOS); uri.append('/').append(repoId); uri.append(SEGMENT_ISSUES); uri.append('/').append(issue.getNumber()); Map<Object, Object> params = createIssueMap(issue, false); String state = issue.getState(); if (state != null) params.put(FILTER_STATE, state); return client.post(uri.toString(), params, Issue.class); }
@Override public ExecutionDecision resolve() { Validate.notNull(gitHubIssue, "GitHub issue must be specified."); Validate.notNull(annotation, "Annotation must be specified."); // Execute test if detector failed because GitHub issue is not related to specified environment. if (!(new DetectorProcessor().process(annotation))) { return ExecutionDecision.execute(); } final String gitHubStatus = gitHubIssue.getState(); if (gitHubStatus == null || gitHubStatus.length() == 0) { return ExecutionDecision.execute(); } if (annotation.force()) { return ExecutionDecision.execute(FORCING_EXECUTION_REASON_STRING); } if (gitHubGovernorConfiguration.getForce()) { return ExecutionDecision.execute(FORCING_EXECUTION_REASON_STRING); } if (gitHubStatus.equals(GITHUB_CLOSED_STRING)) { return ExecutionDecision.execute(); } return ExecutionDecision.dontExecute(String.format(SKIPPING_EXECUTION_REASON_STRING, gitHubIssue.getNumber(), gitHubStatus)); }
toUser(issue.getAssignee()), toLabels(issue.getLabels()), toState(issue.getState()), toMilestone(repository, issue.getMilestone()), toDateTime(issue.getCreatedAt()),
setProperty(issuenode, PropertyName.STATE, issue.getState().toString()); setProperty(issuenode, PropertyName.TITLE, issue.getTitle()); setProperty(issuenode, PropertyName.UPDATED_AT, issue.getUpdatedAt());