"No commits found" misleading when calling set-commits twice
Environment
Both v1 and v2 return a misleading "No commits found" error message if you call sentry-cli releases set-commits on a release that already has commits associated with it. This makes it hard to debug the problem when this situation arrises - for example when a customer is migrating from one build process/CI to another or testing build scripts and may be running same releases commands more than once.
Steps to Reproduce
SENTRY_ORG=kosty-org SENTRY_PROJECT=am-react /opt/homebrew/bin/sentry-cli releases set-commits 22.10.4 --auto
Could not determine any commits to be associated with a repo-based integration. Proceeding to find commits from local git tree.
Could not find the previous commit. Creating a release with 20 commits.
Success! Set commits for release 22.10.4
SENTRY_ORG=kosty-org SENTRY_PROJECT=am-react /opt/homebrew/bin/sentry-cli releases set-commits 22.10.4 --auto
Could not determine any commits to be associated with a repo-based integration. Proceeding to find commits from local git tree.
No commits found. Leaving release alone. If you believe there should be some, change commits range or initial depth and try again.
echo $?
0
/opt/homebrew/bin/sentry-cli --version
sentry-cli 2.8.0
SENTRY_ORG=kosty-org SENTRY_PROJECT=am-react /Users/kosty/.nvm/versions/node/v16.17.0/lib/node_modules/@sentry/cli/sentry-cli releases set-commits 22.10.4 --auto
Could not determine any commits to be associated with a repo-based integration. Proceeding to find commits from local git tree.
error: No commits found. Change commits range, initial depth or use --ignore-empty to allow empty patch sets.
Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.
echo $?
1
/Users/kosty/.nvm/versions/node/v16.17.0/lib/node_modules/@sentry/cli/sentry-cli --version
sentry-cli 1.74.5
Expected Result
Either
- a useful error message, e.g. "This release already has commits associated with it, you can only call release set-commits once". OR
- silently update commits
Actual Result
"No commits found" error message for both v1 and v2 (only difference is exit code)
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀