| | |
| | | continue;
|
| | | }
|
| | |
|
| | | LOGGER.info(MessageFormat.format("Verifying {0} push ref \"{1}\" received from {2}",
|
| | | repository.name, cmd.getRefName(), user.username));
|
| | |
|
| | | // responsible verification
|
| | | String responsible = PatchsetCommand.getSingleOption(cmd, PatchsetCommand.RESPONSIBLE);
|
| | | if (!StringUtils.isEmpty(responsible)) {
|
| | |
| | | // watcher verification
|
| | | List<String> watchers = PatchsetCommand.getOptions(cmd, PatchsetCommand.WATCH);
|
| | | if (!ArrayUtils.isEmpty(watchers)) {
|
| | | boolean verified = true;
|
| | | for (String watcher : watchers) {
|
| | | UserModel user = gitblit.getUserModel(watcher);
|
| | | if (user == null) {
|
| | | // watcher does not exist
|
| | | sendRejection(cmd, "Sorry, \"{0}\" is not a valid username for the watch list!", watcher);
|
| | | continue;
|
| | | verified = false;
|
| | | break;
|
| | | }
|
| | | }
|
| | | if (!verified) {
|
| | | continue;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | * @return the patchset command
|
| | | */
|
| | | private PatchsetCommand preparePatchset(ReceiveCommand cmd) {
|
| | | LOGGER.info(MessageFormat.format("Preparing {0} patchset command for \"{1}\" received from {2}",
|
| | | repository.name, cmd.getRefName(), user.username));
|
| | | String branch = getIntegrationBranch(cmd.getRefName());
|
| | | long number = getTicketId(cmd.getRefName());
|
| | |
|
| | |
| | | }
|
| | |
|
| | | TicketModel ticket = ticketService.getTicket(repository, ticketNumber);
|
| | | if (ticket == null) {
|
| | | continue;
|
| | | }
|
| | | String integrationBranch;
|
| | | if (StringUtils.isEmpty(ticket.mergeTo)) {
|
| | | // unspecified integration branch
|
| | |
| | | Pattern p = Pattern.compile("(?:fixes|closes)[\\s-]+#?(\\d+)", Pattern.CASE_INSENSITIVE);
|
| | | Matcher m = p.matcher(commit.getFullMessage());
|
| | | while (m.find()) {
|
| | | String val = m.group();
|
| | | String val = m.group(1);
|
| | | return Long.parseLong(val);
|
| | | }
|
| | | }
|