Skip to content

Conversation

@bankyadam
Copy link
Member

@bankyadam bankyadam commented Jan 11, 2026

Docker Compose requires project names to consist only of lowercase alphanumeric characters, hyphens, and underscores. Projects with periods (e.g., 'example.app') would fail with an error.

Changes:

  • Added sanitize_docker_project_name() function to convert invalid names
  • Applied sanitization to COMPOSE_PROJECT_NAME environment variable
  • Added validation during 'weft init' with interactive prompt
  • Added 11 unit tests + 1 integration test (100% coverage)
  • Updated troubleshooting.md with Docker Compose name requirements
  • Updated cli-reference.md to document naming constraints

The sanitization:

  • Converts to lowercase
  • Replaces invalid characters with hyphens
  • Removes leading/trailing hyphens/underscores
  • Provides fallback for edge cases

Fixes issue where 'weft up' would fail with:
"invalid project name: must consist only of lowercase alphanumeric characters, hyphens, and underscores"

Docker Compose requires project names to consist only of lowercase
alphanumeric characters, hyphens, and underscores. Projects with periods
(e.g., 'tektonio.app') would fail with an error.

Changes:
- Added sanitize_docker_project_name() function to convert invalid names
- Applied sanitization to COMPOSE_PROJECT_NAME environment variable
- Added validation during 'weft init' with interactive prompt
- Added 11 unit tests + 1 integration test (100% coverage)
- Updated troubleshooting.md with Docker Compose name requirements
- Updated cli-reference.md to document naming constraints

The sanitization:
- Converts to lowercase
- Replaces invalid characters with hyphens
- Removes leading/trailing hyphens/underscores
- Provides fallback for edge cases

Fixes issue where 'weft up' would fail with:
"invalid project name: must consist only of lowercase alphanumeric
characters, hyphens, and underscores"
@bankyadam bankyadam force-pushed the fix/docker-compose-project-name-sanitization branch from eef5fab to 1131b71 Compare January 11, 2026 15:31
- Simplified sanitize_docker_project_name() docstring (1 line)
- Removed 'tektonio.app' from tests, use generic 'example.app'
- Removed troubleshooting section (issue is now fixed automatically)
@bankyadam bankyadam merged commit 478e190 into main Jan 11, 2026
4 checks passed
@bankyadam bankyadam deleted the fix/docker-compose-project-name-sanitization branch January 11, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants