Skip to content

Commit

Permalink
Mise à jour des dépendances Elixir (#3676)
Browse files Browse the repository at this point in the history
* Bump dependencies

* Changes for Oban 2.17

* gettext: add missing elixir-autogen

* Bump Mox to 1.1.0
  • Loading branch information
AntoineAugusti authored Dec 21, 2023
1 parent 7d9bb49 commit c16d891
Show file tree
Hide file tree
Showing 21 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion apps/datagouvfr/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defmodule Datagouvfr.MixProject do
{:shared, in_umbrella: true},
{:vex, "~> 0.9"},
{:exvcr, "~> 0.13", only: :test},
{:mox, "~> 1.0.0", only: :test},
{:mox, "~> 1.1", only: :test},
{:sentry, "~> 8.1"},
{:dialyxir, "~> 1.2", only: [:dev, :test], runtime: false},
]
Expand Down
2 changes: 1 addition & 1 deletion apps/shared/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule Shared.MixProject do
{:httpoison, ">= 0.0.0"},
{:req, "~> 0.4.0"},
{:bypass, "~> 2.1", only: :test},
{:mox, "~> 1.0.0", only: :test},
{:mox, "~> 1.1", only: :test},
# Mint is used by our HttpStream shared component, so we add an explicity dependency
{:mint, "~> 1.2"},
# Finch is used for built-in streaming
Expand Down
4 changes: 2 additions & 2 deletions apps/transport/lib/jobs/dataset_history_job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Transport.Jobs.DatasetHistoryDispatcherJob do
@moduledoc """
Job in charge of dispatching multiple `DatasetHistoryJob`
"""
use Oban.Worker, unique: [period: 60 * 60 * 20], tags: ["history"], max_attempts: 3
use Oban.Worker, unique: [period: {20, :hours}], tags: ["history"], max_attempts: 3
require Logger
import Ecto.Query

Expand All @@ -24,7 +24,7 @@ defmodule Transport.Jobs.DatasetHistoryJob do
Job historicising a single dataset
"""
use Oban.Worker,
unique: [period: 60 * 60 * 20, fields: [:args, :queue, :worker]],
unique: [period: {20, :hours}, fields: [:args, :queue, :worker]],
tags: ["history"],
max_attempts: 3

Expand Down
4 changes: 2 additions & 2 deletions apps/transport/lib/jobs/dataset_quality_score.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Transport.Jobs.DatasetQualityScoreDispatcher do
@moduledoc """
Computes quality scores for a dataset
"""
use Oban.Worker, unique: [period: 60 * 60 * 20], max_attempts: 1
use Oban.Worker, unique: [period: {20, :hours}], max_attempts: 1
import Ecto.Query

@impl Oban.Worker
Expand All @@ -21,7 +21,7 @@ defmodule Transport.Jobs.DatasetQualityScore do
@moduledoc """
Computes quality scores for a dataset
"""
use Oban.Worker, unique: [period: 60 * 60 * 20], max_attempts: 1
use Oban.Worker, unique: [period: {20, :hours}], max_attempts: 1
import Ecto.Query

@type compute_score_fn :: (integer() -> %{score: nil | float(), details: map()})
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/lib/jobs/dedupe_history_job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defmodule Transport.Jobs.DedupeHistoryJob do
@moduledoc """
Job removing duplicates for a specific datagouv_id.
"""
use Oban.Worker, unique: [period: 60 * 60, fields: [:args, :worker]], tags: ["history"], max_attempts: 3
use Oban.Worker, unique: [period: {1, :hour}, fields: [:args, :worker]], tags: ["history"], max_attempts: 3
require Logger
import Ecto.Query
alias DB.{Repo, ResourceHistory}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Transport.Jobs.PeriodicReminderProducersNotificationJob do
@notification_reason DB.NotificationSubscription.reason(:periodic_reminder_producers)

use Oban.Worker,
unique: [period: 60 * 60 * 24 * @min_days_before_sending_again],
unique: [period: {@min_days_before_sending_again, :days}],
max_attempts: 3,
tags: ["notifications"]

Expand Down
4 changes: 2 additions & 2 deletions apps/transport/lib/jobs/resource_history_job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule Transport.Jobs.ResourceHistoryAndValidationDispatcherJob do
@moduledoc """
Job in charge of dispatching multiple `ResourceHistoryJob`
"""
use Oban.Worker, unique: [period: 60 * 60 * 5], tags: ["history"], max_attempts: 5
use Oban.Worker, unique: [period: {5, :hours}], tags: ["history"], max_attempts: 5
require Logger
import Ecto.Query
alias DB.{Dataset, Repo, Resource}
Expand Down Expand Up @@ -45,7 +45,7 @@ defmodule Transport.Jobs.ResourceHistoryJob do
@moduledoc """
Job historicising a single resource
"""
use Oban.Worker, unique: [period: 60 * 60 * 5, fields: [:args, :queue, :worker]], tags: ["history"], max_attempts: 5
use Oban.Worker, unique: [period: {5, :hours}, fields: [:args, :queue, :worker]], tags: ["history"], max_attempts: 5
require Logger
import Ecto.Query
alias Transport.Shared.Schemas.Wrapper, as: Schemas
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/lib/jobs/resource_unavailable_job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ defmodule Transport.Jobs.ResourceUnavailableJob do
- is_available (if the availability of the resource changes)
- url (if lastest_url points to a new URL)
"""
use Oban.Worker, unique: [period: 60 * 9], max_attempts: 5
use Oban.Worker, unique: [period: {9, :minutes}], max_attempts: 5
require Logger
alias DB.{Repo, Resource, ResourceUnavailability}

Expand Down
2 changes: 1 addition & 1 deletion apps/transport/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ defmodule Transport.Mixfile do
{:phoenix_ecto, "~> 4.0"},
{:sizeable, "~> 1.0"},
{:plug_canonical_host, "~> 2.0"},
{:mox, "~> 1.0.0", only: :test},
{:mox, "~> 1.1", only: :test},
# temporary fix until https://github.com/jayjun/rambo/pull/13 is merged
# see https://github.com/etalab/transport-site/issues/2520.
# Not perfect since this will impact `mix.lock`
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/priv/gettext/en/LC_MESSAGES/page-index.po
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ msgstr ""
msgid "Public transport - realtime traffic"
msgstr ""

#, elixir-format
#, elixir-format, elixir-autogen
msgid "dataset"
msgid_plural "datasets"
msgstr[0] "%{count} dataset"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ msgstr ""
msgid "region"
msgstr ""

#, elixir-format
#, elixir-format, elixir-autogen
msgid "result"
msgid_plural "results"
msgstr[0] ""
Expand Down
8 changes: 4 additions & 4 deletions apps/transport/priv/gettext/en/LC_MESSAGES/validations.po
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ msgstr ""
msgid "Nice work, there are no issues!"
msgstr ""

#, elixir-format
#, elixir-format, elixir-autogen
msgid "network"
msgid_plural "networks"
msgstr[0] ""
msgstr[1] ""

#, elixir-format
#, elixir-format, elixir-autogen
msgid "transport mode"
msgid_plural "transport modes"
msgstr[0] ""
Expand Down Expand Up @@ -107,7 +107,7 @@ msgstr ""
msgid "This resource is also available in the following formats:"
msgstr ""

#, elixir-format
#, elixir-format, elixir-autogen
msgctxt "errors"
msgid "error"
msgid_plural "errors"
Expand Down Expand Up @@ -186,7 +186,7 @@ msgstr ""
msgid "Warnings"
msgstr ""

#, elixir-format, ex-autogen, fuzzy
#, elixir-format, elixir-autogen, fuzzy
msgctxt "warnings"
msgid "warning"
msgid_plural "warnings"
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/priv/gettext/fr/LC_MESSAGES/page-index.po
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ msgstr "Autocars longue distance"
msgid "Public transport - realtime traffic"
msgstr "Transport public collectif - horaires temps réel"

#, elixir-format
#, elixir-format, elixir-autogen
msgid "dataset"
msgid_plural "datasets"
msgstr[0] "%{count} jeu de données"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ msgstr "créé le"
msgid "region"
msgstr "région"

#, elixir-format
#, elixir-format, elixir-autogen
msgid "result"
msgid_plural "results"
msgstr[0] "résultat"
Expand Down
8 changes: 4 additions & 4 deletions apps/transport/priv/gettext/fr/LC_MESSAGES/validations.po
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ msgstr "ce lien permanent"
msgid "Nice work, there are no issues!"
msgstr "Félicitations, aucune erreur n'a été trouvée !"

#, elixir-format
#, elixir-format, elixir-autogen
msgid "network"
msgid_plural "networks"
msgstr[0] "réseau"
msgstr[1] "réseaux"

#, elixir-format
#, elixir-format, elixir-autogen
msgid "transport mode"
msgid_plural "transport modes"
msgstr[0] "mode de transport"
Expand Down Expand Up @@ -107,7 +107,7 @@ msgstr "Le format GeoJSON ne contient que les informations géographiques de la
msgid "This resource is also available in the following formats:"
msgstr "Cette ressource est également disponible dans les formats suivants :"

#, elixir-format
#, elixir-format, elixir-autogen
msgctxt "errors"
msgid "error"
msgid_plural "errors"
Expand Down Expand Up @@ -186,7 +186,7 @@ msgstr "Validation effectuée en utilisant <a href=\"%{gtfs_link}\">le fichier G
msgid "Warnings"
msgstr "Avertissements"

#, elixir-format, ex-autogen, fuzzy
#, elixir-format, elixir-autogen, fuzzy
msgctxt "warnings"
msgid "warning"
msgid_plural "warnings"
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/priv/gettext/page-index.pot
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ msgstr ""
msgid "Public transport - realtime traffic"
msgstr ""

#, elixir-format
#, elixir-format, elixir-autogen
msgid "dataset"
msgid_plural "datasets"
msgstr[0] ""
Expand Down
2 changes: 1 addition & 1 deletion apps/transport/priv/gettext/page-shortlist.pot
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ msgstr ""
msgid "region"
msgstr ""

#, elixir-format
#, elixir-format, elixir-autogen
msgid "result"
msgid_plural "results"
msgstr[0] ""
Expand Down
8 changes: 4 additions & 4 deletions apps/transport/priv/gettext/validations.pot
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ msgstr ""
msgid "Nice work, there are no issues!"
msgstr ""

#, elixir-format
#, elixir-format, elixir-autogen
msgid "network"
msgid_plural "networks"
msgstr[0] ""
msgstr[1] ""

#, elixir-format
#, elixir-format, elixir-autogen
msgid "transport mode"
msgid_plural "transport modes"
msgstr[0] ""
Expand Down Expand Up @@ -106,7 +106,7 @@ msgstr ""
msgid "This resource is also available in the following formats:"
msgstr ""

#, elixir-format
#, elixir-format, elixir-autogen
msgctxt "errors"
msgid "error"
msgid_plural "errors"
Expand Down Expand Up @@ -185,7 +185,7 @@ msgstr ""
msgid "Warnings"
msgstr ""

#, elixir-format, ex-autogen
#, elixir-format, elixir-autogen
msgctxt "warnings"
msgid "warning"
msgid_plural "warnings"
Expand Down
2 changes: 1 addition & 1 deletion apps/unlock/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ defmodule Unlock.MixProject do
{:cachex, "~> 3.5"},
{:cors_plug, "~> 3.0"},
{:saxy, "~> 1.5"},
{:mox, "~> 1.0.0", only: :test},
{:mox, "~> 1.1", only: :test},
{:ymlr, "~> 4.0", only: :test},
{:ecto, "~> 3.7", only: :test},
# required for `TransportWeb.Plugs.AppSignalFilter`
Expand Down
2 changes: 1 addition & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ if app_env == :staging do
}
end

base_oban_conf = [repo: DB.Repo]
base_oban_conf = [repo: DB.Repo, insert_trigger: false]

# Oban jobs that should run in every deployed environment (staging, prod)
# but not during dev or test.
Expand Down
Loading

0 comments on commit c16d891

Please sign in to comment.