[JIRA] (JENKINS-52041) can't use docker-compose - minimized workspace name start with underscore

2 views
Skip to first unread message

bartosz.rempuszewski@gmail.com (JIRA)

unread,
Jun 19, 2018, 10:50:02 AM6/19/18
to jenkinsc...@googlegroups.com
Bartosz Rempuszewski created an issue
 
Jenkins / Bug JENKINS-52041
can't use docker-compose - minimized workspace name start with underscore
Issue Type: Bug Bug
Assignee: Stephen Connolly
Components: branch-api-plugin
Created: 2018-06-19 14:49
Environment: Jenkins 2.107.2
Priority: Major Major
Reporter: Bartosz Rempuszewski

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)

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

bartosz.rempuszewski@gmail.com (JIRA)

unread,
Jun 26, 2018, 5:24:02 AM6/26/18
to jenkinsc...@googlegroups.com
Bartosz Rempuszewski commented on Bug JENKINS-52041
 
Re: can't use docker-compose - minimized workspace name start with underscore

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}

"...

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

bartosz.rempuszewski@gmail.com (JIRA)

unread,
Jun 26, 2018, 5:29:01 AM6/26/18
to jenkinsc...@googlegroups.com
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 } > "...

stephen.alan.connolly@gmail.com (JIRA)

unread,
Oct 31, 2018, 6:00:24 AM10/31/18
to jenkinsc...@googlegroups.com
Stephen Connolly assigned an issue to Unassigned
 

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

Change By: Stephen Connolly
Assignee: Stephen Connolly
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

bartosz.rempuszewski@gmail.com (JIRA)

unread,
Dec 12, 2019, 8:09:03 AM12/12/19
to jenkinsc...@googlegroups.com
Bartosz Rempuszewski commented on Bug JENKINS-52041
 
Re: can't use docker-compose - minimized workspace name start with underscore

I just noticed in https://github.com/jenkinsci/branch-api-plugin/blob/master/src/main/java/jenkins/branch/WorkspaceLocatorImpl.java that PATH_MAX is deprecated.

New option (MAX_LENGTH) does not fix this issue - in some cases it will generate workspace names with underscore prefix.

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages