Skip to content

Commit

Permalink
Merge branch 'main' into reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Jun 11, 2024
2 parents cc066b2 + bf73898 commit cb184c1
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 24 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "mix"
directory: "/"
schedule:
interval: "weekly"
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI
on:
pull_request:
push:

jobs:
main:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- elixir: '1.17'
erlang: '27.0'
# lint: true / enable once 1.17 stable is released
- elixir: '1.16'
erlang: '26.2.5'
lint: true
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
if: ${{ ! matrix.lint }}
with:
path: |
_build
deps
key: ${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.erlang }}-${{ hashFiles('mix.lock') }}
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang }}
elixir-version: ${{ matrix.elixir }}
- run: mix deps.get --check-locked
- run: mix format --check-formatted
if: ${{ matrix.lint }}
- run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- run: mix compile
if: ${{ ! matrix.lint }}
- run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- run: mix test
28 changes: 14 additions & 14 deletions lib/tower_rollbar/rollbar/client.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ defmodule TowerRollbar.Rollbar.Client do

def post(path, payload) when is_map(payload) do
case :httpc.request(
:post,
{
~c"#{@base_url}#{path}",
[{@access_token_header, access_token()}],
~c"application/json",
Jason.encode!(payload)
},
[
ssl: [
cacerts: :public_key.cacerts_get()
]
],
[]
) do
:post,
{
~c"#{@base_url}#{path}",
[{@access_token_header, access_token()}],
~c"application/json",
Jason.encode!(payload)
},
[
ssl: [
cacerts: :public_key.cacerts_get()
]
],
[]
) do
{:ok, result} ->
result
|> IO.inspect()
Expand Down
19 changes: 10 additions & 9 deletions lib/tower_rollbar/rollbar/item.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ defmodule TowerRollbar.Rollbar.Item do
person = Keyword.get(options, :person)

%{
"data" => %{
"environment" => environment(),
"timestamp" => :os.system_time(:second),
"body" => body
}
|> maybe_put_request_data(plug_conn)
|> maybe_put_level(level)
|> maybe_put_custom(custom)
|> maybe_put_person(person)
"data" =>
%{
"environment" => environment(),
"timestamp" => :os.system_time(:second),
"body" => body
}
|> maybe_put_request_data(plug_conn)
|> maybe_put_level(level)
|> maybe_put_custom(custom)
|> maybe_put_person(person)
}
end

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule TowerRollbar.MixProject do
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger]
extra_applications: [:logger, :public_key]
]
end

Expand Down

0 comments on commit cb184c1

Please sign in to comment.