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

Mise à jour Elixir 1.15 -> 1.16 et Erlang 24 -> 25 #3815

Merged
merged 33 commits into from
Apr 8, 2024
Merged

Conversation

vdegove
Copy link
Contributor

@vdegove vdegove commented Mar 15, 2024

Changelogs :

ℹ️ On ne passe pas en OTP 26 pour le moment (voir #3315) en particulier car il y a des histoires d'ordre de clés dans les maps à mieux investiguer sur la code base et nos dépendances.

EDIT: pas mal de tickets créés sur des dépendances, mais rien de bloquant dans l'immédiat.

TODOs

Points restants

EDIT: ne pas éditer ici, j'ai "décalé" ces points vers:

Note @thbar, à discuter

Correctifs de codes et mises à jour de librairies

Warnings initiaux

Compilation

     warning: variable "&1" is unused (this might happen when using a capture argument as a pattern)
     │
 166 │       |> Enum.filter(fn %DB.Organization{badges: badges} -> Enum.any?(badges, &match?(&1, %{"kind" => "certified"})) end)
     │       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     │
     └─ lib/db/contact.ex:166: DB.Contact.organization_name/1

warning: variable "&1" is unused (this might happen when using a capture argument as a pattern)
└─ lib/db/contact.ex: DB.Contact.organization_name/1
warning: ~R/.../ is deprecated, use ~r/.../ instead
  lib/transport_web/views/backoffice/page_view.ex:80: TransportWeb.Backoffice.PageView.unaccent/1

### Credo

warning: negative steps are not supported in Enum.slice/2, pass 61..-1//1 instead
  (elixir 1.16.2) lib/enum.ex:2994: Enum.slice/2
  (credo 1.7.1) lib/credo/code/interpolation_helper.ex:61: Credo.Code.InterpolationHelper.replace_line/4
  (elixir 1.16.2) lib/list.ex:1351: List.do_update_at/3
  (elixir 1.16.2) lib/list.ex:1355: List.do_update_at/3
  (elixir 1.16.2) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
  (credo 1.7.1) lib/credo/code/interpolation_helper.ex:14: Credo.Code.InterpolationHelper.replace_interpolations/3

warning: negative steps are not supported in Enum.slice/2, pass 130..-1//1 instead
  (elixir 1.16.2) lib/enum.ex:2994: Enum.slice/2
  (credo 1.7.1) lib/credo/code/interpolation_helper.ex:61: Credo.Code.InterpolationHelper.replace_line/4
  (elixir 1.16.2) lib/list.ex:1351: List.do_update_at/3
  (elixir 1.16.2) lib/list.ex:1355: List.do_update_at/3
  (elixir 1.16.2) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
  (credo 1.7.1) lib/credo/code/interpolation_helper.ex:14: Credo.Code.InterpolationHelper.replace_interpolations/3

warning: negative steps are not supported in Enum.slice/2, pass 74..-1//1 instead
  (elixir 1.16.2) lib/enum.ex:2994: Enum.slice/2
  (credo 1.7.1) lib/credo/code/interpolation_helper.ex:61: Credo.Code.InterpolationHelper.replace_line/4
  (elixir 1.16.2) lib/list.ex:1351: List.do_update_at/3
  (elixir 1.16.2) lib/list.ex:1355: List.do_update_at/3
  (elixir 1.16.2) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
  (credo 1.7.1) lib/credo/code/interpolation_helper.ex:14: Credo.Code.InterpolationHelper.replace_interpolations/3

Etc.

Note : résolu par Credo 1.7.2 https://hexdocs.pm/credo/changelog.html#1-7-2

Dialyzer

Total errors: 22, Skipped: 3, Unnecessary Skips: 2
done in 0m16.75s
lib/S3/s3.ex:42:no_return
Function stream_to_s3!/3 has no local return.
________________________________________________________________________________
lib/S3/s3.ex:42:no_return
Function stream_to_s3!/4 has no local return.
________________________________________________________________________________
lib/hasher.ex:90:no_return
Function get_file_hash/1 has no local return.
________________________________________________________________________________
lib/hasher.ex:92:call
The function call will not succeed.

File.stream!(_file_path :: any(), [], 2048)

breaks the contract
(Path.t(), :line | pos_integer(), [stream_mode()]) :: File.Stream.t()

________________________________________________________________________________
lib/jobs/consolidate_bnlc_job.ex:68:exact_eq
The test {:discard, <<_::624>>} == :ok can never evaluate to 'true'.
________________________________________________________________________________
lib/jobs/consolidate_bnlc_job.ex:134:no_return
Function upload_temporary_file/0 has no local return.
________________________________________________________________________________
lib/jobs/consolidate_bnlc_job.ex:141:unused_fun
Function schedule_deletion/1 will never be called.
________________________________________________________________________________
lib/jobs/conversions/gtfs_generic_converter.ex:90:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
Transport.Jobs.GTFSGenericConverter.perform_single_conversion_job/3

Success typing:
@spec perform_single_conversion_job(_, <<_::40, _::size(16)>>, _) :: {:cancel, <<_::64, _::size(8)>>}

________________________________________________________________________________
lib/jobs/custom_logo_conversion_job.ex:10:no_return
Function perform/1 has no local return.
________________________________________________________________________________
lib/jobs/custom_logo_conversion_job.ex:50:no_return
Function stream_to_s3/2 has no local return.
________________________________________________________________________________
lib/jobs/database_backup_replication_job.ex:12:no_return
Function perform/1 has no local return.
________________________________________________________________________________
lib/jobs/database_backup_replication_job.ex:36:no_return
Function upload!/1 has no local return.
________________________________________________________________________________
lib/jobs/database_backup_replication_job.ex:105:unused_fun
Function upload_filename/1 will never be called.
________________________________________________________________________________
lib/jobs/gtfs_diff_job.ex:8:no_return
Function perform/1 has no local return.
________________________________________________________________________________
lib/jobs/resource_history_job.ex:236:unused_fun
Function store_resource_history!/2 will never be called.
________________________________________________________________________________
lib/transport_web/controllers/espace_producteur_controller.ex:11:no_return
Function upload_logo/2 has no local return.
________________________________________________________________________________
lib/transport_web/controllers/validation_controller.ex:196:no_return
Function stream_to_s3/2 has no local return.
________________________________________________________________________________
lib/transport_web/live/gtfs_diff_select_live.ex:49:no_return
The created anonymous function has no local return.
________________________________________________________________________________
lib/transport_web/live/gtfs_diff_select_live.ex:142:no_return
Function stream_to_s3/2 has no local return.
________________________________________________________________________________
done (warnings were emitted)
Halting VM with exit status 2

Tests

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/transport/jobs/dataset_quality_score_test.exs: Transport.Test.Transport.Jobs.DatasetQualityScoreTest."test resource freshness computation outdated GTFS resource"/1

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/transport/jobs/dataset_quality_score_test.exs: Transport.Test.Transport.Jobs.DatasetQualityScoreTest."test resource freshness computation outdated GBFS resource"/1

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/transport/jobs/dataset_quality_score_test.exs: Transport.Test.Transport.Jobs.DatasetQualityScoreTest."test current dataset freshness 2 resources with freshness"/1

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/transport/jobs/dataset_quality_score_test.exs: Transport.Test.Transport.Jobs.DatasetQualityScoreTest."test current dataset freshness 2 resources, but only one with freshness"/1

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/transport/jobs/dataset_quality_score_test.exs: Transport.Test.Transport.Jobs.DatasetQualityScoreTest."test current dataset freshness 2 resources, but only one with freshness"/1

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/transport/jobs/geo_data/lez_to_geo_data_test.exs: Transport.Jobs.LowEmissionZonesToGeoDataTest."test import a ZFE to the DB"/1

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/transport/jobs/geo_data/lez_to_geo_data_test.exs: Transport.Jobs.LowEmissionZonesToGeoDataTest."test import a ZFE to the DB"/1

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ test/transport/jobs/geo_data/lez_to_geo_data_test.exs: Transport.Jobs.LowEmissionZonesToGeoDataTest."test import a ZFE to the DB"/1

Warnings non traités de compilation de dépendances tierces après la PR

==> sizeable
Compiling 1 file (.ex)
    warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
    │
 19 │     Logger.warn("Using maps for options is deprecated. Please use Keyword Lists.")
    │            ~
    │
    └─ (sizeable 1.0.2) lib/sizeable.ex:19:12: Sizeable.filesize/2

warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ (sizeable 1.0.2) lib/sizeable.ex: Sizeable.filesize/2


==> ecto_erd
Compiling 15 files (.ex)
     warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
     │
 104 │       Logger.warn("Skipping schema #{schema_module}: not found")
     │              ~
     │
     └─ (ecto_erd 0.5.1) lib/ecto/erd/graph.ex:104:14: Ecto.ERD.Graph.components/2

     warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
     │
 140 │       Logger.warn(
     │              ~
     │
     └─ (ecto_erd 0.5.1) lib/ecto/erd/graph.ex:140:14: Ecto.ERD.Graph.from_relation_struct/1

     warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
     │
 167 │       Logger.warn(
     │              ~
     │
     └─ (ecto_erd 0.5.1) lib/ecto/erd/graph.ex:167:14: Ecto.ERD.Graph.from_relation_struct/1

     warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
     │
 195 │       Logger.warn(
     │              ~
     │
     └─ (ecto_erd 0.5.1) lib/ecto/erd/graph.ex:195:14: Ecto.ERD.Graph.from_relation_struct/1

     warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
     │
 264 │       Logger.warn(
     │              ~
     │
     └─ (ecto_erd 0.5.1) lib/ecto/erd/graph.ex:264:14: Ecto.ERD.Graph.from_relation_struct/1

     warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
     │
 212 │         Logger.warn(
     │                ~
     │
     └─ (ecto_erd 0.5.1) lib/ecto/erd/graph.ex:212:16: Ecto.ERD.Graph.from_relation_struct/1


==> crontab
Compiling 7 files (.ex)
    warning: Application.get_env/3 is discouraged in the module body, use Application.compile_env/3 instead
    │
 21 │     @max_runs Application.get_env(:crontab, :max_runs, 10_000)
    │                           ~
    │
    └─ lib/crontab/scheduler.ex:21:27: Crontab.Scheduler (module)

==> protobuf
Compiling 37 files (.ex)
warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+. Instead you must match on +0.0 or -0.0
└─ (protobuf 0.12.0) lib/protobuf/encoder.ex: Protobuf.Encoder.skip_field?/3

==> vex
Compiling 25 files (.ex)
Generated vex app
warning: in order to compile .yrl files, you must add "compilers: [:yecc] ++ Mix.compilers()" to the "def project" section of erlex's mix.exs
  (mix 1.16.2) lib/mix/tasks/compile.yecc.ex:70: Mix.Tasks.Compile.Yecc.preload/1
  (mix 1.16.2) lib/mix/compilers/erlang.ex:66: Mix.Compilers.Erlang.compile/6
  (mix 1.16.2) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.16.2) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2
  (mix 1.16.2) lib/mix/tasks/compile.all.ex:104: Mix.Tasks.Compile.All.compile/4
  (mix 1.16.2) lib/mix/tasks/compile.all.ex:93: Mix.Tasks.Compile.All.with_logger_app/2

warning: in order to compile .xrl files, you must add "compilers: [:leex] ++ Mix.compilers()" to the "def project" section of erlex's mix.exs
  (mix 1.16.2) lib/mix/tasks/compile.leex.ex:69: Mix.Tasks.Compile.Leex.preload/1
  (mix 1.16.2) lib/mix/compilers/erlang.ex:66: Mix.Compilers.Erlang.compile/6
  (mix 1.16.2) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
  (mix 1.16.2) lib/mix/tasks/compile.all.ex:124: Mix.Tasks.Compile.All.run_compiler/2
  (mix 1.16.2) lib/mix/tasks/compile.all.ex:104: Mix.Tasks.Compile.All.compile/4
  (mix 1.16.2) lib/mix/tasks/compile.all.ex:93: Mix.Tasks.Compile.All.with_logger_app/2

==> mint
Compiling 1 file (.erl)
Compiling 19 files (.ex)
    warning: function set_flag/2 is unused
    │
 69 │     defp set_flag(unquote(frame), unquote(flag_name)), do: unquote(flag_value)
    │          ~
    │
    └─ lib/mint/http2/frame.ex:69:10: Mint.HTTP2.Frame (module)


==> vix
Compiling 27 files (.ex)
     warning: Logger.warn/1 is deprecated. Use Logger.warning/2 instead
     │
 494 │                 Logger.warn("argument must be stream of iodata")
     │                        ~
     │
     └─ (vix 0.26.0) lib/vix/vips/image.ex:494:24: Vix.Vips.Image.new_from_enum/2

==> earmark
Compiling 3 files (.erl)
Compiling 61 files (.ex)
warning: ~R/.../ is deprecated, use ~r/.../ instead
  (earmark 1.4.46) lib/earmark_parser/line_scanner.ex:87: Earmark.Parser.LineScanner._type_of/3

==> phoenix_markdown
Compiling 2 files (.ex)
    warning: Regex.regex?/1 is deprecated. Use Kernel.is_struct(term, Regex) or pattern match on %Regex{} instead
    │
 82 │     if Regex.regex?(regex) do
    │              ~
    │
    └─ (phoenix_markdown 1.0.4) lib/phoenix_markdown/engine.ex:82:14: PhoenixMarkdown.Engine.only?/3
    └─ (phoenix_markdown 1.0.4) lib/phoenix_markdown/engine.ex:106:14: PhoenixMarkdown.Engine.except?/3

==> phoenix_live_view
Compiling 37 files (.ex)
      warning: Plug.Conn.Query.decode_pair/2 is deprecated. Use decode_init/0, decode_each/2, and decode_done/2 instead
      │
 1100 │         {:ok, Plug.Conn.Query.decode_pair({name, DOM.attribute(node, "value")}, defaults)}
      │                               ~
      │
      └─ (phoenix_live_view 0.19.5) lib/phoenix_live_view/test/client_proxy.ex:1100:31: Phoenix.LiveViewTest.ClientProxy.collect_submitter/4
      └─ (phoenix_live_view 0.19.5) lib/phoenix_live_view/test/client_proxy.ex:1178:23: Phoenix.LiveViewTest.ClientProxy.form_defaults/3
      └─ (phoenix_live_view 0.19.5) lib/phoenix_live_view/test/client_proxy.ex:1183:21: Phoenix.LiveViewTest.ClientProxy.form_defaults/3
      └─ (phoenix_live_view 0.19.5) lib/phoenix_live_view/test/client_proxy.ex:1187:21: Phoenix.LiveViewTest.ClientProxy.form_defaults/3
      └─ (phoenix_live_view 0.19.5) lib/phoenix_live_view/test/client_proxy.ex:1197:27: Phoenix.LiveViewTest.ClientProxy.form_defaults/3
      └─ (phoenix_live_view 0.19.5) lib/phoenix_live_view/test/client_proxy.ex:1206:25: Phoenix.LiveViewTest.ClientProxy.form_defaults/3

Copy link
Contributor

@thbar thbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concernant Credo, comme discuté, je recommande vu le nouveau warning qui apparaît à l'upgrade, de créer une issue pour ne pas le perdre, puis de le désactiver par configuration.

Voir:

Il sera préférable d'avoir une PR dédiée à ce correctif pour ne pas rater d'autres choses.

@vdegove
Copy link
Contributor Author

vdegove commented Mar 18, 2024

@thbar j’ai des warnings sur des dépendances tierces lors de la compilation, voir ici https://app.circleci.com/pipelines/github/etalab/transport-site/9715/workflows/e13a436d-ee05-4f6b-803b-67d3a39ffb0c/jobs/42963/parallel-runs/0/steps/0-107 Rien de grave, à ton avis, on en fait quoi ? Juste je note ces warnings ici et quelles librairies ça concerne ?

@thbar
Copy link
Contributor

thbar commented Mar 19, 2024

@thbar j’ai des warnings sur des dépendances tierces lors de la compilation, voir ici https://app.circleci.com/pipelines/github/etalab/transport-site/9715/workflows/e13a436d-ee05-4f6b-803b-67d3a39ffb0c/jobs/42963/parallel-runs/0/steps/0-107 Rien de grave, à ton avis, on en fait quoi ? Juste je note ces warnings ici et quelles librairies ça concerne ?

L'idéal c'est effectivement de noter ça en TODOs (façon Github - [ ]) pour temporiser et souffler là dessus, puis de revenir "enquêter" sur chaque librairie (voir #3307 pour un exemple typique) quand on en a l'énergie.

L'enquête (qui n'a pas besoin d'être forcément d'être poussée) est une bonne opportunité de prendre le pouls de chaque dépendance, voir si elle est bien mise à jour régulièrement ou pas, et dans ce cas voir s'il y a ou pas déjà une issue/PR pour traiter ces warnings (qui ne posent pas problème à court terme), ou bien d'en ouvrir une nous-même pour faire avancer le schmilblick.

.credo.exs Outdated Show resolved Hide resolved
@thbar
Copy link
Contributor

thbar commented Mar 19, 2024

C'est prêt à review, mais ne pas merger !!!

@thbar thbar marked this pull request as ready for review March 19, 2024 19:09
@thbar thbar requested a review from a team as a code owner March 19, 2024 19:09
@thbar thbar changed the title Mise à jour Erlang 25 et Elixir 1.16 [Do not merge!] Mise à jour Erlang 25 et Elixir 1.16 Mar 19, 2024
@thbar
Copy link
Contributor

thbar commented Mar 30, 2024

Quelques points avant de partir en week-end:

  • J'ai recollé une bonne dizaine de sources de warnings dans la description, créé des tickets dans les projets concernés, et récupéré la maintenance de sizeable. On verra tout ça mardi.
  • Concernant Rambo j'ai fait des tests et ça semble concluant (en jouant avec des jobs qui l'appellent)
  • Pour l'historisation ça me fait penser à une façon d'améliorer la non régression là dessus, j'y reviendrai

Je décroche, on en reparle mardi !

@thbar
Copy link
Contributor

thbar commented Apr 2, 2024

Il reste un peu de test HTTP (historisation) que je ferai cet après-midi.

Par ailleurs j'ai décalé la dizaine d'issues que j'avais déterré dans un ticket à part:

Donc @vdegove je regarde le dernier point manquant (historisation HTTP) et après on pourra déployer à mon avis.

@vdegove vdegove changed the title [Do not merge!] Mise à jour Erlang 25 et Elixir 1.16 Mise à jour Erlang 25 et Elixir 1.16 Apr 2, 2024
@thbar
Copy link
Contributor

thbar commented Apr 7, 2024

J'ai refait un petit tour des téléchargements HTTP (point parfois sensible sur les mises à jour OTP), je ne vois rien de choquant, ça me paraît bon ! On mergera demain matin pour suivre tout ça.

Script:

DB.Resource
|> DB.Repo.all
|> Enum.reject(fn(x) -> x.dataset_id == 641 end)
|> Task.async_stream(fn(resource) ->
  IO.puts "Processing #{resource.title} (#{resource.id})"
  path = Path.expand(__ENV__.file <> "/../../cache-dir/test-regression-resource-#{resource.id}.dat")
  report_path = path <> ".report"
  unless File.exists?(report_path) do
    result = Transport.Jobs.ResourceHistoryJob.download_resource(:req, resource, path)
    File.write!(report_path, :erlang.term_to_binary(result))
  end
  result = File.read!(report_path) |> :erlang.binary_to_term()
  IO.inspect(result, IEx.inspect_opts)
  result
end, max_concurrency: 25, timeout: 60_000)
|> Stream.map(fn({:ok, res}) -> res end)
|> Enum.group_by(fn(x) ->
  case x do
    {:error, _} -> :error
    {:ok, _, _} -> :ok
  end
end, fn(x) ->
  case x do
    {:error, x} -> x
    {:ok, _, _} -> 1
  end
end)
|> IO.inspect(IEx.inspect_opts)

@thbar
Copy link
Contributor

thbar commented Apr 8, 2024

Je vais mettre l'OS à jour - il y a eu une nouvelle release, et avec les histoires de xz cela me paraît préférable (même si à ce stade Ubuntu ne contient pas de version de xz identifiée comme vulnérable sur les failles déjà connues).

@thbar
Copy link
Contributor

thbar commented Apr 8, 2024

@etalab/transport-tech pour avancer sur ce déploiement, j'ai besoin que l'un d'entre vous review etalab/transport-ops#58 pour mettre à jour l'OS avec les derniers patchs. Après cela je créerai une nouvelle image là-bas, et je mettrai à jour ici, et je ferai un dernier déploiement sur prochainement pour vérifier que rien de trivial ne casse. Merci !

@thbar
Copy link
Contributor

thbar commented Apr 8, 2024

Déploiement fonctionnel en test très rapide sur prochainement. Je fixe la build ici puis je déploirai, poke @etalab/transport-tech pour info !

@thbar thbar changed the title Mise à jour Erlang 25 et Elixir 1.16 Mise à jour Elixir 1.15 -> 1.16 et Erlang 24 -> 25 Apr 8, 2024
@thbar
Copy link
Contributor

thbar commented Apr 8, 2024

Hum, test qui plante à nouveau ce n'était pas "temporaire". Je regarde.

@thbar
Copy link
Contributor

thbar commented Apr 8, 2024

  1) test perform sends an email (Transport.Test.Transport.Jobs.NewDatagouvDatasetsJobTest)
     apps/transport/test/transport/jobs/new_datagouv_datasets_job_test.exs:163
     Assertion with =~ failed
     code:  assert body =~ ~s"Les jeux de données suivants ont été ajoutés sur data.gouv.fr dans les dernières 24h"
     left:  "Bonjour,\n\nLes jeux de données suivants ont été ajoutés sur data.gouv.fr dans les dernières 72h et sont susceptibles d'avoir leur place sur le PAN :\n\n* GTFS de Dijon - https://example.com/link\n\n---\nVous pouvez consulter et modifier les règles de cette tâche : https://github.com/etalab/transport-site/blob/master/apps/transport/lib/jobs/new_datagouv_datasets_job.ex\n"
     right: "Les jeux de données suivants ont été ajoutés sur data.gouv.fr dans les dernières 24h"
     stacktrace:
       (transport 0.0.1) lib/jobs/new_datagouv_datasets_job.ex:51: Transport.Jobs.NewDatagouvDatasetsJob.perform/1
       (oban 2.17.6) lib/oban/queue/executor.ex:129: Oban.Queue.Executor.perform/1
       (oban 2.17.6) lib/oban/queue/executor.ex:74: Oban.Queue.Executor.call/1
       (oban 2.17.6) lib/oban/testing.ex:228: Oban.Testing.perform_job/3
       test/transport/jobs/new_datagouv_datasets_job_test.exs:198: (test)

@thbar
Copy link
Contributor

thbar commented Apr 8, 2024

Pour le test, c'était au final non lié à la PR:

On peut déployer.

@thbar thbar self-requested a review April 8, 2024 11:20
@@ -165,8 +165,7 @@ defmodule DB.Contact do

def organization_name(orgs) do
certified_orgs =
orgs
|> Enum.filter(fn %DB.Organization{badges: badges} -> Enum.any?(badges, &match?(&1, %{"kind" => "certified"})) end)
Enum.filter(orgs, fn %DB.Organization{badges: badges} -> %{"kind" => "certified"} in badges end)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cette partie gagnera à être retravaillée car c'est en fait une égalité stricte actuellement, et la construction précédente était "confusante" pour moi.

Copy link
Contributor

@thbar thbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🎸 🚅

@thbar thbar added this pull request to the merge queue Apr 8, 2024
Merged via the queue into master with commit 69f45d1 Apr 8, 2024
4 checks passed
@thbar thbar deleted the elixir-1-16 branch April 8, 2024 11:27
@ptitfred
Copy link
Contributor

ptitfred commented Apr 8, 2024

👏 bravo

@thbar
Copy link
Contributor

thbar commented Apr 8, 2024

👏 bravo

@ptitfred merci !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dette technique Entretien & maintenance générale, nécessaire pour que le code reste de bonne qualité 🚢🛑 À merger plus tard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants