jenkinsci / jenkinsci/branch-api-plugin

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

Open
#701 3 comments 0 reactions 0 assignees View on GitHub
component:branch-api-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
39
Forks
154
PR merge metrics
No merged PRs in 30d

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)

---
Originally reported by rempusze, imported from: can't use docker-compose - minimized workspace name start with underscore


  • status: Open
  • priority: Major
  • component(s): branch-api-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 20251211-141027

Raw content of original issue


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)

  • environment: Jenkins 2.107.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.