Skip to content

[Bug]: Bob Docker image LiveView and API no exact match on repo field #289

Description

@rhcarvalho

Product or component

Bob or package builds

Summary

It would be useful if the API/UI would allow exact match on the repo field.

Multiple of the filters in https://bob.hex.pm/docker and the respective public API documented in https://github.com/hexpm/bob/blob/main/docs/api.md#docker-tags use a prefix match, and that behavior is generally useful.

For the repo field, however, using the dropdown select filters with an unexpected, perhaps less useful behavior (even though it's now in the documented API). Single choice select input typically implies mutual exclusion.

What happened?

I'm updating the Phoenix mix phx.gen.release --docker task to make use of the new API capabilities to reduce API usage.

A typical request is like this one which returns 12 images, 8 of which we don't care about and cannot filter out on the server:

https://bob.hex.pm/api/docker?os_version=trixie-&os=debian&sort=elixir_version%2Cerlang_version%2Cos_version&elixir_version=1.20.3&repo=hexpm%2Felixir&erlang_version=29.0.5

The "repo=hexpm/elixir" matches too many images (we're explicitly looking for the multi-arch ones).

What did you expect?

It would be useful to filter the API/UI results to exact match on repo. There's a use case to list ONLY multi-arch images, just like one can list only amd64 or only arm64 today.

Steps to reproduce

  1. Intend to fetch only multi arch images: curl 'https://bob.hex.pm/api/docker?os_version=trixie-&os=debian&sort=elixir_version%2Cerlang_version%2Cos_version&elixir_version=1.20.3&repo=hexpm%2Felixir&erlang_version=29.0.5' | jq
  2. Both multi-arch and single-arch images are returned, requiring the client to filter the result.
  3. Compare to curl 'https://bob.hex.pm/api/docker?os_version=trixie-&os=debian&sort=elixir_version%2Cerlang_version%2Cos_version&elixir_version=1.20.3&repo=hexpm%2Felixir&erlang_version=29.0.5' | jq '.tags | map(select(.repo == "hexpm/elixir"))'

Environment / context

N/A

Logs / screenshots

Image

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions