Skip to content

Commit 16ef3e7

Browse files
authored
Use full commit SHA hash for release detection (#2174)
1 parent 4edfdf1 commit 16ef3e7

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Features
44

55
- Improve default slug generation for Crons [#2168](https://github.com/getsentry/sentry-ruby/pull/2168)
6+
- Change release name generator to use full SHA commit hash and align with `sentry-cli` and other Sentry SDKs [#2174](https://github.com/getsentry/sentry-ruby/pull/2174)
67
- Automatic Crons support for scheduling gems
78
- Add support for [`sidekiq-cron`](https://github.com/sidekiq-cron/sidekiq-cron) [#2170](https://github.com/getsentry/sentry-ruby/pull/2170)
89

sentry-ruby/lib/sentry/release_detector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def detect_release_from_capistrano(project_root)
2828
end
2929

3030
def detect_release_from_git
31-
Sentry.sys_command("git rev-parse --short HEAD") if File.directory?(".git")
31+
Sentry.sys_command("git rev-parse HEAD") if File.directory?(".git")
3232
end
3333

3434
def detect_release_from_env

sentry-ruby/spec/sentry_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@
844844
allow(File).to receive(:directory?).with(".git").and_return(true)
845845
end
846846
it 'gets release from git' do
847-
allow(Sentry).to receive(:`).with("git rev-parse --short HEAD 2>&1").and_return("COMMIT_SHA")
847+
allow(Sentry).to receive(:`).with("git rev-parse HEAD 2>&1").and_return("COMMIT_SHA")
848848

849849
described_class.init
850850
expect(described_class.configuration.release).to eq('COMMIT_SHA')

0 commit comments

Comments
 (0)