Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-43755

GitHub username (repo owner) check is too restrictive

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Problem

      The regex

      "^[0-9A-Za-z]([0-9A-Za-z._-]+[0-9A-Za-z])$"
      

      that is used inĀ GitHubSCMSource is too restrictive. It doesn't allow one or two character names.

      The check is for example used in PushGHEventSubscriber and silently prevents the triggering of Multibranch jobs.

      Proposed Fix

      A new regex should allow GitHub usernames like:

      • a
      • ab
      • a-b
      • a-b-c

      And disallow usernames like:

      • -
      • -a
      • a-
      • a--b

      Replace the existing regex with the following:

      "^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$"
      

        Attachments

          Issue Links

            Activity

            Hide
            marbec Mark J. Becker added a comment -
            Show
            marbec Mark J. Becker added a comment - I created a fix in https://github.com/jenkinsci/github-branch-source-plugin/pull/135 . Feel free to review.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark J. Becker
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/7d68f5e31bb06e6002621080603de675b301404a
            Log:
            JENKINS-43755 - Update Github username regex to be less restrictive.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark J. Becker Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java http://jenkins-ci.org/commit/github-branch-source-plugin/7d68f5e31bb06e6002621080603de675b301404a Log: JENKINS-43755 - Update Github username regex to be less restrictive.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/f990e2e14c33881ac8f3731aa8a3f388a377aa35
            Log:
            Merge pull request #135 from herzog31/issue/JENKINS-43755

            JENKINS-43755 - Update Github username regex to be less restrictive.

            Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/63c6708ea935...f990e2e14c33

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java http://jenkins-ci.org/commit/github-branch-source-plugin/f990e2e14c33881ac8f3731aa8a3f388a377aa35 Log: Merge pull request #135 from herzog31/issue/ JENKINS-43755 JENKINS-43755 - Update Github username regex to be less restrictive. Compare: https://github.com/jenkinsci/github-branch-source-plugin/compare/63c6708ea935...f990e2e14c33

              People

              • Assignee:
                Unassigned
                Reporter:
                marbec Mark J. Becker
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: