fix: warn when project or service name exceeds 16 characters - #2080
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR adds validation warnings to detect when Docker Compose project and service names exceed 16 characters. The core implementation adds warning emissions in the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/pkg/cli/compose/fixup.go`:
- Around line 46-48: The length checks on project.Name and svccfg.Name use
len(...) which counts bytes and will misreport non-ASCII names; replace those
checks with utf8.RuneCountInString(project.Name) and
utf8.RuneCountInString(svccfg.Name) (import "unicode/utf8") so the comparisons
use rune/character counts, or if the real constraint is byte-length, change the
warning text to say "bytes" instead of "characters"; update the two places that
currently compare len(project.Name) > 16 and len(svccfg.Name) > 16 accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3f616338-8248-4fc8-a495-be3596aba516
📒 Files selected for processing (13)
src/pkg/cli/compose/fixup.gosrc/testdata/ambiguous-strings/compose.yaml.warningssrc/testdata/compose-go-warn/compose.yaml.warningssrc/testdata/dockerfile-validation-errors/compose.yaml.warningssrc/testdata/fixupenv/compose.yaml.warningssrc/testdata/llm/compose.yaml.warningssrc/testdata/longname/compose.yaml.warningssrc/testdata/mongo/compose.yaml.warningssrc/testdata/networks/compose.yaml.warningssrc/testdata/ports/compose.yaml.warningssrc/testdata/postgres/compose.yaml.warningssrc/testdata/railpack/compose.yaml.warningssrc/testdata/redis/compose.yaml.warnings
…ame issues per #2080 Co-authored-by: Copilot <copilot@github.com>
Description
Linked Issues
Checklist
Summary by CodeRabbit
New Features
Tests