Skip to content

Commit

Permalink
add as hex package
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeyson committed Apr 4, 2023
1 parent 351f416 commit 7764c1f
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ erl_crash.dump
# Ignore package tarball (built via "mix hex.build").
ex_trello_notifier-*.tar

.DS_Store
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## 0.1.0 (2023.04.03)

* Initial release
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License

Copyright (c) 2023 Jaeyson Anthony Y.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43 changes: 34 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,43 @@
# ExTrelloNotifier

Create trello cards from errors using webhook

## TODO

- [x] ~implement trello card via rest api~
- [x] ~process webhook response body from error monitoring tools~
- [x] ~add trello label for cards resolved/unresolved~
- add Github project (kanban, automation)
- add Cachex for retrieving list id and labels
- verify webhook signature (security)
- add code docs (typespecs, docs/moduledocs)
- use markdown for creating card description (TBA)
- add Credo (code linter)
- add Sobelow (security checker for framework)
- add Honeybadger (error monitoring)
- add Uptimerobot (uptime monitoring)
- add Logflare (log aggregator)
- add ci workflow (unit, mocks)
- add code coverage (deps, ci)
- add badge (ci, coverage, dependabot, etc.)
- add semver
- update README file to contain instructions from Trello, error monitoring tool and sample deployment for Phoenix framework
- publish docs (hexdocs for Phoenix framework)
- add cd workflow (fly.io)

To start your Phoenix server:

* Install dependencies with `mix deps.get`
* Don't forget env variables (e.g. `export TRELLO_API_KEY=aaaa...`)
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.

Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
You can test the flow locally by:

## Learn more
1. Create a mix project: add error monitoring tool and install e.g. [`:rollbax`](https://github.com/ForzaElixir/rollbax) to trigger the error. **Note**: create a route and add the error as a trigger point, or use this [sample repo](https://github.com/jaeyson/rollbax_example_error)
2. Run `ex_trello_notifier` on another port (`PORT=4444 iex -S mix.phx server`).
3. Expose those two apps via tunneling. For this demo, use ngrok.io
4. Add auth token in `ngrok.yml`, then `ngrok start --config=ngrok.yml test notifier`.
5. `curl https://<DYNAMIC_SUBDOMAIN>.ap.ngrok.io/PATH_IF_ANY`.
6. Then check Trello board for changes.

* Official website: https://www.phoenixframework.org/
* Guides: https://hexdocs.pm/phoenix/overview.html
* Docs: https://hexdocs.pm/phoenix
* Forum: https://elixirforum.com/c/phoenix-forum
* Source: https://github.com/phoenixframework/phoenix
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
41 changes: 39 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
defmodule ExTrelloNotifier.MixProject do
use Mix.Project

@source_url "https://github.com/jaeyson/ex_trello_notifier"
@version "0.1.0"
@description "Create Trello cards from issues using webhook"
@canonical "http://hexdocs.pm/ex_trello_notifier"
@project_name "ExTrelloNotifier"

def project do
[
app: :ex_trello_notifier,
version: "0.1.0",
version: @version,
elixir: "~> 1.12",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
deps: deps(),
description: @description,
docs: docs(),
package: package(),
name: @project_name,
source_url: @source_url
]
end

Expand Down Expand Up @@ -38,10 +49,36 @@ defmodule ExTrelloNotifier.MixProject do
{:telemetry_poller, "~> 1.0"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"},
{:credo, "~> 1.7", only: [:dev, :test], runtime: false},
{:httpoison, "~> 2.1"}
]
end

defp docs do
[
api_reference: false,
main: "readme",
source_ref: "v#{@version}",
source_url: @source_url,
canonical: @canonical,
extras: [
"README.md",
"CHANGELOG.md",
"LICENSE"
]
]
end

defp package do
[
maintainers: ["Jaeyson Anthony Y."],
licenses: ["MIT"],
links: %{
"Github" => @source_url
}
]
end

# Aliases are shortcuts or tasks specific to the current project.
# For example, to install project dependencies and perform other setup tasks, run:
#
Expand Down
3 changes: 3 additions & 0 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
%{
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"castore": {:hex, :castore, "1.0.1", "240b9edb4e9e94f8f56ab39d8d2d0a57f49e46c56aced8f873892df8ff64ff5a", [:mix], [], "hexpm", "b4951de93c224d44fac71614beabd88b71932d0b1dea80d2f80fb9044e01bbb3"},
"certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"},
"cowboy": {:hex, :cowboy, "2.9.0", "865dd8b6607e14cf03282e10e934023a1bd8be6f6bacf921a7e2a96d800cd452", [:make, :rebar3], [{:cowlib, "2.11.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "2c729f934b4e1aa149aff882f57c6372c15399a20d54f65c8d67bef583021bde"},
"cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"},
"cowlib": {:hex, :cowlib, "2.11.0", "0b9ff9c346629256c42ebe1eeb769a83c6cb771a6ee5960bd110ab0b9b872063", [:make, :rebar3], [], "hexpm", "2b3e9da0b21c4565751a6d4901c20d1b4cc25cbb7fd50d91d2ab6dd287bc86a9"},
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"},
"httpoison": {:hex, :httpoison, "2.1.0", "655fd9a7b0b95ee3e9a3b535cf7ac8e08ef5229bab187fa86ac4208b122d934b", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "fc455cb4306b43827def4f57299b2d5ac8ac331cb23f517e734a4b78210a160c"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
Expand Down

0 comments on commit 7764c1f

Please sign in to comment.