• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nutshell-lab / meilisearch-ex / d27cebf122efce8fd383dbe16540808d3b805a61-PR-24
94%
main: 94%

Build:
Build:
LAST BUILD BRANCH: remove-duplicate-application-json
DEFAULT BRANCH: main
Ran 14 Feb 2025 10:10AM UTC
Jobs 3
Files 18
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Feb 2025 10:03AM UTC coverage: 93.939% (-1.2%) from 95.092%
d27cebf122efce8fd383dbe16540808d3b805a61-PR-24

Pull #24

github

wojtekmach
Use :name in child spec as child id

This is similar to https://github.com/sneako/finch/commit/6b42c8eec

While at it I made the following change which fixes what I think was
unintentional ommision of interpolation:

    -  defp to_name(name), do: :"__MODULE__:#{name}"
    +  defp to_name(name), do: :"#{inspect(__MODULE__)}:#{name}"

I also noticed we have:

    def start_link(opts) when is_list(opts) do
      with {:ok, name} <- Keyword.fetch(opts, :name) do
        GenServer.start_link(__MODULE__, opts, name: to_name(name))
      end
    end

And so if we do this, i.e. don't pass :name, we'll get :error

    iex> Meilisearch.start_link([])
    :error

That is not a common return value from start_link. Supervisor will crash
on it. So while the `child_spec/1` change that I am proposing is
technically a breaking change I think it is warranted as the current
behaviour under that circumstance, not passing name, was also crashing.

In this spirit, my suggestion is to change start_link, something like:

       def start_link(opts) when is_list(opts) do
    -    with {:ok, name} <- Keyword.fetch(opts, :name) do
    -      GenServer.start_link(__MODULE__, opts, name: to_name(name))
    -    end
    +    name = Keyword.fetch!(opts, :name)
    +    GenServer.start_link(__MODULE__, opts, name: to_name(name))
       end

Which I'm happy to do. let me know!
Pull Request #24: Use :name in child spec as child id

1 of 3 new or added lines in 1 file covered. (33.33%)

155 of 165 relevant lines covered (93.94%)

33.59 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
80.0
-20.0% lib/meilisearch.ex
Jobs
ID Job ID Ran Files Coverage
1 d27cebf122efce8fd383dbe16540808d3b805a61-PR-24.1 14 Feb 2025 10:10AM UTC 18
93.94
GitHub Action Run
2 d27cebf122efce8fd383dbe16540808d3b805a61-PR-24.2 14 Feb 2025 10:10AM UTC 18
93.94
GitHub Action Run
3 d27cebf122efce8fd383dbe16540808d3b805a61-PR-24.3 14 Feb 2025 10:10AM UTC 18
90.91
GitHub Action Run
Source Files on build d27cebf122efce8fd383dbe16540808d3b805a61-PR-24
  • Tree
  • List 18
  • Changed 3
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #24
  • PR Base - main (#31638432...)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc