Issue #10781 invalid
Anna Németh
created an issue

private static String NAME_REGEXP = "[a-zA-Z0-9_.-]*"; - private static final Pattern NAME_PATTERN = Pattern.compile(NAME_REGEXP); - - private static String PORT_REGEXP = "[0-9]{1,5}"; - private static final Pattern PORT_PATTERN = Pattern.compile(PORT_REGEXP); - private static final int MAX_PORT = 65535; - - private final static Predicate<String> isPortField = new Predicate<String>() - { - @Override - public boolean apply(final String input) - { - return input.startsWith(CONTAINER_PORT_PREFIX) || input.startsWith(HOST_PORT_PREFIX);

Comments (5)

  1. Anna Németh reporter

    There is a 1.0 and 2.0 version of the APIs. The two versions do not encompass the same endpoints or functionality. Currently, you will find that the API 1.0 covers resources that the 2.0 API is yet to cover. Conversely, the 2.0 API has several features that enhance its usability and performance. You should look first to use the 2.0 API whenever possible. The 1.0 APIs are available when the 2.0 does not make the resource you need available.

  2. Anna Németh reporter

    final String port = params.getString(key); Add a comment to this line + final String errorField = PORT_ERROR_PREFIX + StringUtils.removeStart(key, portPrefix); + + if (!PORT_PATTERN.matcher(port).matches() || Integer.parseInt(port) > MAX_PORT) + { + errorCollection.addError(errorField, i18nResolver.getText("docker.port.error.invalid", port)); + } + else if (definedPorts.contains(port)) + { + errorCollection.addError(errorField, i18nResolver.getText("docker.port.error.duplicate", port)); + } + + definedPorts.add(port); + } + } + + protected List<Integer> generatePortsList(final TaskDefinition taskDefinition) + { + final List<Integer> portsList = Lists.newArrayList(); + for (String key : Iterables.filter(taskDefinition.getConfiguration().keySet(), BambooPredicates.startsWith(CONTAINER_PORT_PREFIX))) + { + portsList.add(Integer.valueOf(StringUtils.removeStart(key, CONTAINER_PORT_PREFIX))); + } + return portsList; + } + + protected static Predicate<TaskDefinition> hasNameNotTaskId(@notnull final String name, final long taskId) + { + return Predicates.and( + DockerTaskPredicates.isConfigurationFieldEqual(NAME, name), + Predicates.not(BambooPredicates.hasTaskDefinitionEqualId(taskId)));

  3. Anna Németh reporter

    Teams use groups to grant members rights, to create repositories, access team owned repositories, and to administer the team. Groups consist of one or more members all of which must have a Bitbucket individual account.

    When you create a team, Bitbucket automatically creates an Administrators group and a Developers group for you. The creation process requires you to add at least one individual account as an admin. When you create a individual account, the system does not create any groups for you. You can always manually add a group to either an individual or a team.

  4. Log in to comment