Skip to content

Commit

Permalink
Merge pull request #340 from airbrake/api-endpoint-change
Browse files Browse the repository at this point in the history
Send errors to 'api.airbrake.io' instead of 'airbrake.io'
  • Loading branch information
kyrylo authored Sep 12, 2018
2 parents 6ae11ca + a659226 commit 63918b6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ Airbrake Ruby Changelog

* Stopped passing project id on `Airbrake.create_deploy` as a query param
([#339](https://github.com/airbrake/airbrake-ruby/pull/339))
* Changed the endpoint that Airbrake Ruby sends errors to.

Before: `https://airbrake.io/api/v4/projects/PROJECT_ID/notices`

After: `https://api.airbrake.io/api/v4/projects/PROJECT_ID/notices`

The endpoint neither accepts anything new nor removes existing functionality.
([#340](https://github.com/airbrake/airbrake-ruby/pull/340))

### [v2.11.0][v2.11.0] (June 27, 2018)

Expand Down
2 changes: 1 addition & 1 deletion lib/airbrake-ruby/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def initialize(user_config = {})

self.project_id = user_config[:project_id]
self.project_key = user_config[:project_key]
self.host = 'https://airbrake.io'
self.host = 'https://api.airbrake.io'

self.ignore_environments = []

Expand Down
2 changes: 1 addition & 1 deletion spec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
end

it "sets the default host" do
expect(config.host).to eq('https://airbrake.io')
expect(config.host).to eq('https://api.airbrake.io')
end

it "sets the default endpoint" do
Expand Down
10 changes: 5 additions & 5 deletions spec/notifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
end

describe "#notify" do
let(:endpoint) { 'https://airbrake.io/api/v3/projects/1/notices' }
let(:endpoint) { 'https://api.airbrake.io/api/v3/projects/1/notices' }

subject { described_class.new(user_params) }

Expand Down Expand Up @@ -179,7 +179,7 @@
end

describe "#notify_sync" do
let(:endpoint) { 'https://airbrake.io/api/v3/projects/1/notices' }
let(:endpoint) { 'https://api.airbrake.io/api/v3/projects/1/notices' }

let(:user_params) do
{ project_id: 1, project_key: 'abc', logger: Logger.new('/dev/null') }
Expand Down Expand Up @@ -393,7 +393,7 @@

describe "#create_deploy" do
it "returns a promise" do
stub_request(:post, 'https://airbrake.io/api/v4/projects/1/deploys')
stub_request(:post, 'https://api.airbrake.io/api/v4/projects/1/deploys')
.to_return(status: 201, body: '')
expect(subject.create_deploy({})).to be_an(Airbrake::Promise)
end
Expand All @@ -403,7 +403,7 @@
expect_any_instance_of(Airbrake::SyncSender).to receive(:send).with(
{ environment: 'barenv' },
instance_of(Airbrake::Promise),
URI('https://airbrake.io/api/v4/projects/1/deploys')
URI('https://api.airbrake.io/api/v4/projects/1/deploys')
)
described_class.new(
user_params.merge(environment: 'fooenv')
Expand All @@ -416,7 +416,7 @@
expect_any_instance_of(Airbrake::SyncSender).to receive(:send).with(
{ environment: 'fooenv' },
instance_of(Airbrake::Promise),
URI('https://airbrake.io/api/v4/projects/1/deploys')
URI('https://api.airbrake.io/api/v4/projects/1/deploys')
)
subject.create_deploy(environment: 'fooenv')
end
Expand Down
2 changes: 1 addition & 1 deletion spec/notifier_spec/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def expect_a_request_with_body(body)
let(:localhost) { 'http://localhost:8080' }

let(:endpoint) do
"https://airbrake.io/api/v3/projects/#{project_id}/notices"
"https://api.airbrake.io/api/v3/projects/#{project_id}/notices"
end

let(:airbrake_params) do
Expand Down
4 changes: 2 additions & 2 deletions spec/sync_sender_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

let(:sender) { described_class.new(config) }
let(:notice) { Airbrake::Notice.new(config, AirbrakeTestError.new) }
let(:endpoint) { 'https://airbrake.io/api/v3/projects/1/notices' }
let(:endpoint) { 'https://api.airbrake.io/api/v3/projects/1/notices' }

before { stub_request(:post, endpoint).to_return(body: '{}') }

Expand Down Expand Up @@ -90,7 +90,7 @@
end

context "when IP is rate limited" do
let(:endpoint) { %r{https://airbrake.io/api/v3/projects/1/notices} }
let(:endpoint) { %r{https://api.airbrake.io/api/v3/projects/1/notices} }

before do
stub_request(:post, endpoint).to_return(
Expand Down

0 comments on commit 63918b6

Please sign in to comment.