Issue
When I associate commits to my release, I always get the last 20 commits pulled instead of just the ones that are relevant to this specific release.
Applies To
Users of sentry-cli set-commits
Users of any of the bundler plugins with the setCommits option
Any other Sentry integration that manages releases
Resolution
When the set-commits command is run, Sentry will first look for the most recent earlier release (by timestamp) in the same project(s) that has associated commits. If no earlier release with commits exists, then the default last 20 will be grabbed.
To ensure you have the correct commits associated, the set-commits command should be run every time for all releases. To specify the correct commit ranges for your release, use the following command:
sentry-cli releases set-commits "$RELEASE" \ --commit "REPO_OWNER/REPO_NAME@$BASE_SHA..$COMMIT_SHA"
Example:
Define the baseline and latest commits:
PREV_SHA=<baseline from prior release> LATEST_SHA=<current release commit>
Use the
sentry-clicommand to set the commit range:
sentry-cli releases set-commits "$RELEASE" \
--commit "REPO_OWNER/REPO_NAME@$PREV_SHA..$LATEST_SHA"Ensure that the repository identifier (REPO_OWNER/REPO_NAME) is correct and consistent across all releases.
Troubleshooting Common Issues
If you encounter problems with commit data, follow these steps:
Verify Repository Identifier: Ensure the correct repository identifier is used in the
--commitargument.Use Explicit Ranges: Always specify both
BASE_SHAandCOMMIT_SHAexplicitly for each release.Consistency Across Releases: Use the same
BASE_SHAandCOMMIT_SHAfor all operating systems and environments derived from the same build. By following these steps, Sentry will process the commit data correctly, ensuring consistent information across all releases.
