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

can't use docker-compose - minimized workspace name start with underscore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: branch-api-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.107.2
    • Similar Issues:

      Description

      For certain project names minimized workspace name will start with underscore:

      // add this test case to WorkspaceLocatorImplTest
      assertEquals("_my.service.name.abcde_PR-1-J66S6RX2LGBP3IYNJHSVLYWU5WQXTLZJDQRJIBNFPNM3HOWPZASQ",
        WorkspaceLocatorImpl.minimize("one/or/more/parent/elements/abcdefghijk/my.service.name.abcde/PR-1"));
      

      docker-compose uses directory name as container name (-p can be used to set custom name).

      Docker does not allow underscore as first letter of the container name.

      Because of that jobs that call docker-compose without -p will fail.

      Workarounds:
      1) use docker-compose -p
      2) use custom workspace name
      3) jenkins.branch.WorkspaceLocatorImpl.PATH_MAX=0 (or other value)

        Attachments

          Activity

          Hide
          rempusze Bartosz Rempuszewski added a comment - - edited

          After some testing:

          • PATH_MAX=0 is not a good solution: two different projects with the same PR number will end up with the same docker-compose project name.
          • PATH_MAX=1 is an option, but directory names will be "<last character of PR name>-<10 characters of sha256 hash>" - quite obscure).
          • PATH_MAX=<number big enough to handle full service path + hash> can be used but very long names are also hard to read

          It would be great to use something like "<project-name>_<pr>-<hash from full path>"...

          Show
          rempusze Bartosz Rempuszewski added a comment - - edited After some testing: PATH_MAX=0 is not a good solution: two different projects with the same PR number will end up with the same docker-compose project name. PATH_MAX=1 is an option, but directory names will be "<last character of PR name>-<10 characters of sha256 hash>" - quite obscure). PATH_MAX=<number big enough to handle full service path + hash> can be used but very long names are also hard to read It would be great to use something like "<project-name>_<pr>-<hash from full path>"...
          Hide
          stephenconnolly Stephen Connolly added a comment -

          Removing myself as assignee. My current work assignments do not provide sufficient bandwidth to review these issues and in the majority of cases I am only assigned by virtue of being the default assignee. For the credentials-api and scm-api related plugins I have permission to allocate time reviewing changes to these APIs themselves to ensure these APIs remain cohesive, but that can be handled through PR reviews rather than assigning issues in JIRA

          Show
          stephenconnolly Stephen Connolly added a comment - Removing myself as assignee. My current work assignments do not provide sufficient bandwidth to review these issues and in the majority of cases I am only assigned by virtue of being the default assignee. For the credentials-api and scm-api related plugins I have permission to allocate time reviewing changes to these APIs themselves to ensure these APIs remain cohesive, but that can be handled through PR reviews rather than assigning issues in JIRA

            People

            • Assignee:
              Unassigned
              Reporter:
              rempusze Bartosz Rempuszewski
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: