Skip to content

Experimental: Branch Restriction not working with 2 or more branch names #388

@kabua

Description

@kabua

Configuration:

  • Windows Server 2019
  • Jenkins 2.440.1
  • GitHub Integration Plugin 0.7.0

After a lot of work, we finally got this plugin working. Except when trying to whitelist two or more branches under the Experimental: Branch Restriction > Whitelist Target Restrictions section.

We have the following top-level protected branches: DEV, RELEASE, PROD, and HOTFIX.

In my test repo, I have PR from Features/100-testing merging into DEV.

If I set the WhiteList to DEV it works. If I set it to ABC, it fails - as expected.

BUT, if I try and use a multi-line, like so:
image

It fails, with this log entry:
image

Before searching the source code, I also tried using semi-colons (:), commas (,), and spaces ( ), which also failed.

I don't understand why Java's System.lineSeparator() doesn't recognize Jenkin's line separator.

public class GitHubPRBranchRestriction implements Describable<GitHubPRBranchRestriction> {
    private static final String LINE_SEPARATOR = System.lineSeparator();

Source file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions