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

feat: supported display all types of broadway's names #13

Merged
merged 4 commits into from
Sep 7, 2021

Conversation

feng19
Copy link
Contributor

@feng19 feng19 commented Sep 7, 2021

relate on #12

String.to_existing_atom(nav)
rescue
ArgumentError -> nil
nav && Enum.find(pipelines, fn name -> inspect(name) == nav end)
Copy link
Member

Choose a reason for hiding this comment

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

If it is not an atom, what is the other name? Is it a PID or is it a {:via, ...} tuple?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Show on dashboard like this:

# atom
iex> Demo.Pipeline |> inspect()
"Demo.Pipeline"

# tuple
iex> {:via, Registry, {MyRegistry, :atom}} |> inspect()
"{:via, Registry, {MyRegistry, :atom}}"

# pid
iex> self() |> inspect()
"#PID<0.3204.0>"

Show on url like this:

# atom
iex> Demo.Pipeline |> inspect() |> URI.encode_www_form()
"Demo.Pipeline"

# tuple
iex> {:via, Registry, {MyRegistry, :atom}} |> inspect() |> URI.encode_www_form()
"%7B%3Avia%2C+Registry%2C+%7BMyRegistry%2C+%3Aatom%7D%7D"

# pid
iex> self() |> inspect() |> URI.encode_www_form()
"%23PID%3C0.3204.0%3E"

Copy link
Member

@josevalim josevalim left a comment

Choose a reason for hiding this comment

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

Looks good to me! ❤️ @philss, please review and merge if you agree. :)

Copy link
Contributor

@philss philss left a comment

Choose a reason for hiding this comment

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

Looks great! 🚀

I think there is only a thing from the CI. Please take a look

lib/broadway_dashboard.ex Outdated Show resolved Hide resolved
mix.lock Outdated
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"},
"plug": {:hex, :plug, "1.12.1", "645678c800601d8d9f27ad1aebba1fdb9ce5b2623ddb961a074da0b96c35187d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "d57e799a777bc20494b784966dc5fbda91eb4a09f571f76545b72a634ce0d30b"},
"plug_cowboy": {:hex, :plug_cowboy, "2.5.1", "7cc96ff645158a94cf3ec9744464414f02287f832d6847079adfe0b58761cbd0", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "107d0a5865fa92bcb48e631cc0729ae9ccfa0a9f9a1bd8f01acb513abf1c2d64"},
"plug_cowboy": {:hex, :plug_cowboy, "2.3.0", "149a50e05cb73c12aad6506a371cd75750c0b19a32f81866e1a323dda9e0e99d", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "bc595a1870cef13f9c1e03df56d96804db7f702175e4ccacdb8fc75c02a7b97e"},
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a problem, but do you know why the downgrade of plug_cowboy?

Copy link
Member

Choose a reason for hiding this comment

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

It is something related to telemetry and hex, I can take a look at it later.

@feng19 feng19 requested a review from philss September 7, 2021 13:50
@philss
Copy link
Contributor

philss commented Sep 7, 2021

@feng19 to fix the CI issue you need to run mix deps.unlock --unused. Please take a look.

@feng19
Copy link
Contributor Author

feng19 commented Sep 7, 2021

@feng19 to fix the CI issue you need to run mix deps.unlock --unused. Please take a look.

If I upgrade plug_cowboy to 2.5.1 that has no problem about it.

Upgrade it?

@philss
Copy link
Contributor

philss commented Sep 7, 2021

If I upgrade plug_cowboy to 2.5.1 that has no problem about it.

Upgrade it?

@feng19 yes, I think it's fine to upgrade. 👍 It's only used in development.

Copy link
Contributor

@philss philss left a comment

Choose a reason for hiding this comment

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

:shipit:

@philss philss merged commit 7996eea into dashbitco:main Sep 7, 2021
@philss
Copy link
Contributor

philss commented Sep 7, 2021

@feng19 thank you! 💜

@feng19
Copy link
Contributor Author

feng19 commented Sep 7, 2021

❤️❤️❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants