score-compose
score-compose copied to clipboard
feat: improve error message clarity when no workloads are available
Summary
Improves the error message shown when users run score-compose generate without any workloads, making it clearer and more actionable.
Changes
- Better error messages: Replaced the confusing "the project is empty, please provide a score file to generate from" with contextual messages
- Smart detection: Added logic to detect if
score.yamlexists in the current directory- If
score.yamlexists: Shows "no workloads to generate from. Did you mean to run: score-compose generate score.yaml" - If no
score.yaml: Shows "no workloads to generate from. Please specify a score file, e.g., score-compose generate score.yaml"
- If
- Enhanced testing: Updated and added test cases to properly handle the init command's default behavior and new error message logic
Problem Addressed
The original error message "the project is empty, please provide a score file to generate from" was confusing because:
- It didn't clearly indicate what the user should do next
- It didn't suggest the most common case (using
score.yaml) - Users weren't sure if they needed to create a file or specify an existing one
Testing
- All existing tests pass
- Added new test case
TestGenerateWithScoreYamlPresentto verify behavior whenscore.yamlis present - Updated
TestGenerateWithoutScoreFilesto use--no-sampleflag to properly test the no-file scenario
Fixes #287
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
Hi @kotahorii, The DCO check is failing because your commit is missing a sign-off.