Release using branch does not show correct commits

Hello, I’m trying to configure “Releases” for my application but I see that Sentry does not present the commits when I’m working in a branch.

By using the recommended command sentry-cli releases set-commits $VERSION --auto and while I’m on a certain branch, Sentry only loads the commits from the master branch.

I tried using the parameters to specify the last commit (below) but this causes the “Unable to Fetch Commits” e-mail to be triggered.
sentry-cli releases set-commits $VERSION --commit "org/repo@branch_sha";

How can I achieve creating a release with commits from a branch?

Below is a release created with the first command showing only the initial commit on the wrong branch.

By contacting Sentry support about this issue I was prompted to try using the org@start..end notation to specify further which commits to use.

Sadly, even after trying that the results are the same and despite the successful result of the command (below) the commits are not loaded in the Sentry dashboard…

Created release project@c742903.
+----------------------+------------------------------+
| Repository           |            Revision          |
+----------------------+------------------------------+
| org / repo           | 1c4458f90000 -> c742903c0000 |
+----------------------+------------------------------+

We will try to use this feature again when we move our code to the master branch and see if we get the desired results but for now there seems to be a problem when using different branches.

1 Like

Is there any progress on this issue

Hey there, I haven’t updated here but by contacting Sentry support directly I was given some pointers that helped me fix this. The problem I had was that I used the short commit hash and this gave the unexpected results, basically changing to the full hash solves the problem.
Below I’ll post the relevant messages from my communication with the support:

Support
Sorry to hear that! One other thing you might try while debugging is to use --log-level debug with your CLI command, as it might give you more clues as to what’s going wrong. Keep in mind also that your branch must be pushed to GitLab in order for this to work. I hope someone on the forums is able to help you get things straightened out the rest of the way!

Me
I ran the command using --log-level debug as you suggested and by looking at the debug messages I noticed that Sentry mysteriously looked up the wrong commit when I passed only the short hash. Then, when I tried the complete hash, having [repo]@[last deploy tag]…[latest complete hash] everything worked as expected and the commits from my branch appeared in the interface! :tada:
I also added a deploy to the release later and it also worked fine.

Support
Oh, great to hear! (And yeah, depending on how long your short hash is, occasionally I’ve heard of people coming up with the wrong commit. When in doubt, you can always do git rev-parse <commit identifier> | git show to get data about which commit your identifier resolves to.)

I hope this can help you and others too :slight_smile: