-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add Typesense #44
base: main
Are you sure you want to change the base?
Add Typesense #44
Conversation
ca70475
to
859dd13
Compare
Thank you @ruslandoga! I am currently on holidays but I will try to carve some time sooner than later to give you feedback. /cc @wojtekmach |
Erlang uses ExDoc now, so they have the exact same structure. However, we will need to either poll them or ask them to ping us once they publish a new version or ask them to push their docs to Hexdocs! I'd say we can postpone this to a follow up pull request. On the other hand, I believe Gleam does not have the data in the format we need (we created our |
@ruslandoga I'll try to review this sooner than later but I have a lot on my plate until October 15th, after that it's gonna be my number one priority to see this through. Sorry about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very exiting! I left some comments below.
ce7af3b
to
e18e317
Compare
👋 I think it's ready for review now :) Updates since the last review:
|
search_data_js = | ||
Enum.find_value(files, fn {path, content} -> | ||
case Path.basename(path) do | ||
"search_data-" <> _digest -> content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot trust this data since it's user provided, can they do anything dangerous by providing something we don't expect? Maybe we should do some rudimentary validation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can provide long strings like https://github.com/cloudpods-dev/docker-engine-api-elixir/blob/813cc557da483f623a8f484db04efc7e58db0376/lib/docker_engine_api/api/container.ex#L67, but Typesense seems to handle it fine. We can check for content size, maybe. I think if Typesense doesn't like the payload, it would simply reject it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test that checks that invalid fields in search items (like type
being a map instead of a string, or doc
being a list) are rejected: 8d58e4f
Co-authored-by: Eric Meadows-Jönsson <[email protected]>
5d9f67d
to
bfc0539
Compare
@@ -5,6 +5,9 @@ if config_env() == :prod do | |||
port: System.fetch_env!("HEXDOCS_PORT"), | |||
hexpm_url: System.fetch_env!("HEXDOCS_HEXPM_URL"), | |||
hexpm_secret: System.fetch_env!("HEXDOCS_HEXPM_SECRET"), | |||
typesense_url: System.fetch_env!("TYPESENSE_URL"), | |||
typesense_api_key: System.fetch_env!("TYPESENSE_API_KEY"), | |||
typesense_collection: System.fetch_env!("TYPESENSE_COLLECTION"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created hexdocs-test
collection on Typesense Cloud, https://cloud.typesense.org/clusters/ent97o5sv4dzx2f0p/collections
I think we can use it during alpha/beta testing.
@@ -5,6 +5,9 @@ if config_env() == :prod do | |||
port: System.fetch_env!("HEXDOCS_PORT"), | |||
hexpm_url: System.fetch_env!("HEXDOCS_HEXPM_URL"), | |||
hexpm_secret: System.fetch_env!("HEXDOCS_HEXPM_SECRET"), | |||
typesense_url: System.fetch_env!("TYPESENSE_URL"), | |||
typesense_api_key: System.fetch_env!("TYPESENSE_API_KEY"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be the "Admin API Key" for https://cloud.typesense.org/clusters/ent97o5sv4dzx2f0p cluster, it can be downloaded from the dashboard.
@@ -5,6 +5,9 @@ if config_env() == :prod do | |||
port: System.fetch_env!("HEXDOCS_PORT"), | |||
hexpm_url: System.fetch_env!("HEXDOCS_HEXPM_URL"), | |||
hexpm_secret: System.fetch_env!("HEXDOCS_HEXPM_SECRET"), | |||
typesense_url: System.fetch_env!("TYPESENSE_URL"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this would be https://ent97o5sv4dzx2f0p.a1.typesense.net
👋 Just wanted to check if there’s anything else we'd need to address before it's merged? |
There was a problem hiding this 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. We plan to test this out in our staging server before merging. Thank you for all the work!
This PR that integrates Typesense into Hexdocs.
TODOs:
Logging excessively for now
Indexing in the same step for now
proglang
The format is the same: Add Typesense #44 (comment)
Commit reverted, approach needs discussion with Gleam team
CI results: ruslandoga#1