Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default environment to 'development' #1565

Merged
merged 2 commits into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

- Change default environment to 'development' [#1565](https://github.com/getsentry/sentry-ruby/pull/1565)
- Fixes [#1559](https://github.com/getsentry/sentry-ruby/issues/1559)


## 4.7.1

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/lib/sentry/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def resolve_hostname
end

def environment_from_env
ENV['SENTRY_CURRENT_ENV'] || ENV['SENTRY_ENVIRONMENT'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'default'
ENV['SENTRY_CURRENT_ENV'] || ENV['SENTRY_ENVIRONMENT'] || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
end

def server_name_from_env
Expand Down
4 changes: 2 additions & 2 deletions sentry-ruby/spec/sentry/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
ENV.delete('RACK_ENV')
end

it 'defaults to "default"' do
expect(subject.environment).to eq('default')
it 'defaults to "development"' do
expect(subject.environment).to eq('development')
end

it 'uses `SENTRY_CURRENT_ENV` env variable' do
Expand Down
2 changes: 1 addition & 1 deletion sentry-ruby/spec/sentry_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@
it "returns the csp_report_uri generated from the main Configuration" do
expect(Sentry.configuration).to receive(:csp_report_uri).and_call_original

expect(described_class.csp_report_uri).to eq("http://sentry.localdomain/api/42/security/?sentry_key=12345&sentry_environment=default")
expect(described_class.csp_report_uri).to eq("http://sentry.localdomain/api/42/security/?sentry_key=12345&sentry_environment=development")
end
end

Expand Down