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

ProjectSet parser isn't working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • cvs-plugin
    • None

      ProjectSet files support added in the 2.6 version of the CVS plugin parses incorrectly the psf file. The current regular expression has some shortcomings:

      • If the name of the server contains dots, (cvs.example.org, 192.168.0.24), the parsing fails.
      • If the port is not explicitly set, it also fails, since the colon after the hostname is mandatory, and the expression only acknowledges it before a port (:pserver:host:/cvsroot vs :pserver:host:2401/cvsroot)
      • The module remote name does not support nested folders, since it does not allow slashes (:pserver:host:/cvsroot,CORE/com.example.project,com.example.project)

      The following expression solves these problems while keeping the groups, so the rest of the code doesn't need changes:

      private static final Pattern PSF_PATTERN = Pattern.compile("<project reference=\"[^,]+,((:[a-z]+:)([a-z|A-Z|0-9|\\.]+)"
      			+ "(:([0-9]+)?)([/|a-z|A-Z|_|0-9]+)),(/|[A-Z|a-z|0-9|_|\\.]+),([A-Z|a-z|0-9|_|\\.]+)(,(.*?)){0,1}\"/>");
      

            mc1arke Michael Clarke
            felix_velasco FĂ©lix velasco
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: