From 605d1e530ca087954ce4fe2940978ff7b2573353 Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Sun, 8 Sep 2024 12:31:59 -0300 Subject: [PATCH 01/21] fix: git hooks --- config/config.exs | 19 ------------------- config/dev.exs | 23 +++++++++++++++++++++++ mix.exs | 3 ++- mix.lock | 4 ++-- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/config/config.exs b/config/config.exs index 18a34de9..7af6a4a9 100644 --- a/config/config.exs +++ b/config/config.exs @@ -40,23 +40,4 @@ config :logger, :console, config :phoenix, :json_library, Jason -config :git_hooks, - verbose: false, - auto_install: true, - branches: [ - whitelist: ["main"] - ], - hooks: [ - pre_push: [ - tasks: [ - "mix clean", - "mix compile --warning-as-errors", - "mix format --check-formatted", - "mix credo --strict", - "mix test --only unit", - "mix test --only integration" - ] - ] - ] - import_config "#{config_env()}.exs" diff --git a/config/dev.exs b/config/dev.exs index c73a482e..8923751b 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -50,3 +50,26 @@ config :phoenix, :stacktrace_depth, 20 # Initialize plugs at runtime for faster development compilation config :phoenix, :plug_init_mode, :runtime + +config :git_hooks, + verbose: false, + auto_install: true, + branches: [ + whitelist: ["main"] + ], + hooks: [ + pre_push: [ + tasks: [ + {:mix_task, :clean}, + {:mix_task, :compile, ["--force"]}, + {:mix_task, :format, ["--check-formatted"]}, + {:mix_task, :credo, ["--strict"]}, + {:mix_task, :test, ["--only", "unit"]}, + {:mix_task, :test, ["--only", "integration"]} + ] + ] + ], + extra_success_returns: [ + {:noop, []}, + {:ok, []} + ] diff --git a/mix.exs b/mix.exs index 63052e88..7ceaa4a6 100644 --- a/mix.exs +++ b/mix.exs @@ -9,6 +9,7 @@ defmodule Pescarte.MixProject do deps: deps(), aliases: aliases(), elixirc_paths: elixirc_paths(Mix.env()), + elixirc_options: [warnings_as_errors: true], releases: [ pescarte: [ strip_beams: true, @@ -77,7 +78,7 @@ defmodule Pescarte.MixProject do {:dialyxir, "~> 1.3", only: [:dev], runtime: false}, {:credo, "~> 1.5", only: [:dev, :test], runtime: false}, # {:ex_doc, "> 0.0.0", only: [:dev, :test], runtime: false}, - {:git_hooks, "~> 0.4.0", only: [:test, :dev], runtime: false} + {:git_hooks, "~> 0.8.0-pre0", only: [:dev], runtime: false} ] end diff --git a/mix.lock b/mix.lock index 44cd2304..ae6688cc 100644 --- a/mix.lock +++ b/mix.lock @@ -44,7 +44,7 @@ "fss": {:hex, :fss, "0.1.1", "9db2344dbbb5d555ce442ac7c2f82dd975b605b50d169314a20f08ed21e08642", [:mix], [], "hexpm", "78ad5955c7919c3764065b21144913df7515d52e228c09427a004afe9c1a16b0"}, "gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"}, "gettext": {:hex, :gettext, "0.24.0", "6f4d90ac5f3111673cbefc4ebee96fe5f37a114861ab8c7b7d5b30a1108ce6d8", [:mix], [{:expo, "~> 0.5.1", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "bdf75cdfcbe9e4622dd18e034b227d77dd17f0f133853a1c73b97b3d6c770e8b"}, - "git_hooks": {:hex, :git_hooks, "0.4.2", "93604c8f6dff28500aaecc1988de319308fb7aa2c27bc89460b1f48aedd8bf7a", [:mix], [{:blankable, "~> 1.0.0", [hex: :blankable, repo: "hexpm", optional: false]}, {:recase, "~> 0.6.0", [hex: :recase, repo: "hexpm", optional: false]}], "hexpm", "0e46c04847b86d88857149840a614e018d57f79ca3f3b921a93e007cbea546d4"}, + "git_hooks": {:hex, :git_hooks, "0.8.0-pre0", "fea247cf08699cd1ddd6d54f6fa9c05196e56a23659c5b2f68f9aba54709fb0f", [:mix], [{:blankable, "~> 1.0.0", [hex: :blankable, repo: "hexpm", optional: false]}, {:recase, "~> 0.7.0", [hex: :recase, repo: "hexpm", optional: false]}], "hexpm", "51a50b20cd9910a43e22e4d51d9800cebad88253558ad9e6f55e2ff154c88ccf"}, "gollum": {:hex, :new_gollum, "0.4.0", "89e3e2fc5abd032455341c4a03bcef7042b8d08e02c51df24b99a1a0a1ad69b1", [:mix], [{:httpoison, "~> 1.7", [hex: :httpoison, repo: "hexpm", optional: false]}], "hexpm", "85c68465e8678637638656945677062a4e7086e91a04d5c4bca1027321c74582"}, "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.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.4.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", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, "hpax": {:hex, :hpax, "1.0.0", "28dcf54509fe2152a3d040e4e3df5b265dcb6cb532029ecbacf4ce52caea3fd2", [:mix], [], "hexpm", "7f1314731d711e2ca5fdc7fd361296593fc2542570b3105595bb0bc6d0fad601"}, @@ -89,7 +89,7 @@ "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm", "fec8660eb7733ee4117b85f55799fd3833eb769a6df71ccf8903e8dc5447cfce"}, "postgrex": {:hex, :postgrex, "0.19.0", "f7d50e50cb42e0a185f5b9a6095125a9ab7e4abccfbe2ab820ab9aa92b71dbab", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "dba2d2a0a8637defbf2307e8629cb2526388ba7348f67d04ec77a5d6a72ecfae"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, - "recase": {:hex, :recase, "0.6.0", "1dd2dd2f4e06603b74977630e739f08b7fedbb9420cc14de353666c2fc8b99f4", [:mix], [], "hexpm", "8712e318420a228eb2e6366ada230148ed3a4316a798319edd5512f64d78c990"}, + "recase": {:hex, :recase, "0.7.0", "3f2f719f0886c7a3b7fe469058ec539cb7bbe0023604ae3bce920e186305e5ae", [:mix], [], "hexpm", "36f5756a9f552f4a94b54a695870e32f4e72d5fad9c25e61bc4a3151c08a4e0c"}, "req": {:hex, :req, "0.4.14", "103de133a076a31044e5458e0f850d5681eef23dfabf3ea34af63212e3b902e2", [:mix], [{:aws_signature, "~> 0.3.2", [hex: :aws_signature, repo: "hexpm", optional: true]}, {:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.17", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.6 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:nimble_ownership, "~> 0.2.0 or ~> 0.3.0", [hex: :nimble_ownership, repo: "hexpm", optional: false]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "2ddd3d33f9ab714ced8d3c15fd03db40c14dbf129003c4a3eb80fac2cc0b1b08"}, "resend": {:hex, :resend, "0.4.2", "52f27c83068fbc558cc372df95978fe369da6fb2c7efc83ae316d41afa51bc0b", [:mix], [{:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: false]}, {:swoosh, "~> 1.3", [hex: :swoosh, repo: "hexpm", optional: false]}, {:tesla, "~> 1.5", [hex: :tesla, repo: "hexpm", optional: false]}], "hexpm", "bfec17802467c4a81190c576edcae816e882224c0e90573adae9fb45c29b6528"}, "rewire": {:hex, :rewire, "0.10.0", "129634f6885a74b7f994facf04d3f5375a8c543c4f9a41eab0ad0f8a37fe16f0", [:mix], [], "hexpm", "6fc3532b9972553ab1390567b215b1a78b956c17d2ff0a2823c1dc5d4b273709"}, From b559a49eabe94f44869e8a160e2459cb31024bb4 Mon Sep 17 00:00:00 2001 From: Rafael Mori <103967050+Rafael-Mori-2022@users.noreply.github.com> Date: Sun, 8 Sep 2024 12:45:33 -0300 Subject: [PATCH 02/21] fix: adding agenda warning text (#207) --- lib/pescarte_web/templates/agenda_html/show.html.heex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/pescarte_web/templates/agenda_html/show.html.heex b/lib/pescarte_web/templates/agenda_html/show.html.heex index bfbdf5a2..a8098e45 100644 --- a/lib/pescarte_web/templates/agenda_html/show.html.heex +++ b/lib/pescarte_web/templates/agenda_html/show.html.heex @@ -10,6 +10,9 @@
+ <.text size="lg" color="text-black-80"> + Agenda sujeita a alterações e inscrições prévias. Entre em contato com a equipe do seu município. + <%= for {_, rows} <- @mapa do %> <%= table_render(rows) %> <% end %> From 7b1baac16235cd69ee840df925c2ecd485ed705b Mon Sep 17 00:00:00 2001 From: Zoey de Souza Pessanha Date: Sun, 8 Sep 2024 12:50:29 -0300 Subject: [PATCH 03/21] fix: only fetch specific env deps for each ci part --- .github/workflows/ci.yml | 6 +++--- Earthfile | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f67e1d1a..75966d25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Docker Login run: echo "$DOCKERHUB_TOKEN" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin - name: Run build - run: earthly --ci +ci + run: earthly --ci --build-arg MIX_ENV=dev +ci test: runs-on: ubuntu-latest @@ -34,7 +34,7 @@ jobs: - name: Docker Login run: echo "$DOCKERHUB_TOKEN" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin - name: Run build - run: earthly -P --ci +test + run: earthly -P --ci --build-arg MIX_ENV=test +test build-prod: runs-on: ubuntu-latest @@ -48,5 +48,5 @@ jobs: - name: Docker Login run: echo "$DOCKERHUB_TOKEN" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin - name: Run build - run: earthly -P --ci --push --build-arg GITHUB_REPO=${{ github.repository }} +docker + run: earthly -P --ci --push --build-arg MIX_ENV=prod --build-arg GITHUB_REPO=${{ github.repository }} +docker diff --git a/Earthfile b/Earthfile index 557779af..2f5b7d52 100644 --- a/Earthfile +++ b/Earthfile @@ -4,6 +4,7 @@ deps: ARG ELIXIR=1.16.0 ARG OTP=26.1.2 ARG ALPINE_VERSION=3.18.4 + ARG MIX_ENV=test FROM hexpm/elixir:${ELIXIR}-erlang-${OTP}-alpine-${ALPINE_VERSION} RUN apk update --no-cache RUN apk add --no-cache build-base gcc git curl From e4942fd685ffcbd9d7e6b882a24f09f4d4864f6c Mon Sep 17 00:00:00 2001 From: Juan Cristo <99986112+juanzeen@users.noreply.github.com> Date: Sun, 8 Sep 2024 12:51:43 -0300 Subject: [PATCH 04/21] Fix/ apps card (#204) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: fixed the carousel images * feat: pagina de aplicativos criada * fix: imagens e textos alterados nos cards * fix: corrigindo erro nos textos de descrição dos cards da page aplicativos * fix: corrigindo conteudo do card de agenda * extract common tasks aliases * Update show.html.heex --------- Co-authored-by: Zoey de Souza Pessanha --- assets/css/landing.scss | 2 +- .../templates/aplicativos_html/show.html.heex | 10 +++++----- lib/pescarte_web/templates/landing_html/show.html.heex | 4 ++-- mix.exs | 4 +++- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/assets/css/landing.scss b/assets/css/landing.scss index f4d25d0a..00b270e9 100644 --- a/assets/css/landing.scss +++ b/assets/css/landing.scss @@ -94,7 +94,7 @@ } p { - text-wrap: nowrap; + text-wrap: wrap; margin-top: 0.5rem; padding: 0 1rem 1.5rem 1rem; } diff --git a/lib/pescarte_web/templates/aplicativos_html/show.html.heex b/lib/pescarte_web/templates/aplicativos_html/show.html.heex index b0d59b00..8d9dc0ec 100644 --- a/lib/pescarte_web/templates/aplicativos_html/show.html.heex +++ b/lib/pescarte_web/templates/aplicativos_html/show.html.heex @@ -1,10 +1,10 @@