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

docs: use algolia for searchability #8410

Merged
merged 9 commits into from
Feb 21, 2024
Merged

Conversation

ncclementi
Copy link
Contributor

@ncclementi ncclementi commented Feb 21, 2024

Favor this PR instead of #8325

Closes: #7995

Needs to happen:

  • Decide which Algolia account we will use, ideally a team one.
  • Create an index from the website called prod_IBIS
  • Add Algolia API key to secrets (in their site, you can find it under Admin API key)
  • Test if it works.

To be able to know if this works, idk if the docs-preview label would be enough or if we will have to try this from a branch, due to the secret.

Sorry, something went wrong.

Copy link
Contributor

ACTION NEEDED

Ibis follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message.

Please update your PR title and description to match the specification.

@ncclementi ncclementi changed the title docs: Use algolia for seachability docs: use algolia for seachability Feb 21, 2024
@ncclementi ncclementi changed the title docs: use algolia for seachability docs: use algolia for searchability Feb 21, 2024
workflow_dispatch:
repository_dispatch:
schedule:
- cron: "0 0 * * *"
Copy link
Member

Choose a reason for hiding this comment

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

Should we run this in ibis-docs-main.yml instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess we could, this doesn't take to long to run. was keeping it separate because if this fails, it wouldn't messed with the docs build necessarily but, I don't have a strong opinion. I can move it, if you'd prefer so.

Copy link
Member

Choose a reason for hiding this comment

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

I think we should move it so that we get CI failures if the script fails instead of it silently failing and us forgetting to look it at for a long time.

We can determine what to do depending on the nature of the failures if/when they happen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cpcloud Do you have a preference here, happy either way?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, sorry yeah. I'd prefer if we moved it to the ibis-docs-main workflow if you don't mind.

.github/workflows/upload-algolia.py Outdated Show resolved Hide resolved
.github/workflows/upload-algolia.py Show resolved Hide resolved
api_key = os.getenv("ALGOLIA_API_KEY")
app_id = os.getenv("ALGOLIA_APP_ID")
index_name = "test_IBIS" # os.getenv("ALGOLIA_INDEX")
index_file = os.getenv("QUARTO_INDEX_PATH") # search.json
Copy link
Member

Choose a reason for hiding this comment

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

can we use os.environ instead of the lower-level os.getenv?

# Download the index generated by quarto from the ibis website
with urlopen("https://ibis-project.org/search.json") as response:
with open(index_file, "wb") as f:
f.write(response.read())
Copy link
Member

Choose a reason for hiding this comment

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

Do we actually need to write to disk here? How about calling json.load(f) directly instead of writing and then reading?

Copy link
Member

Choose a reason for hiding this comment

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

Actually, how about json.loads(response.read().decode("utf-8"))?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to convert this ruby code from quarto to python
https://github.com/quarto-dev/quarto-web/blob/main/.github/workflows/upload-algolia.rb

but I think you are right, I'll give that a try.

@ncclementi
Copy link
Contributor Author

I'm not sure I understand what's wrong with the PR title, that ci is complaining about. I check the ci job, but it's unclear to me what's happening.

@cpcloud
Copy link
Member

cpcloud commented Feb 21, 2024

I'm not sure I understand what's wrong with the PR title, that ci is complaining about. I check the ci job, but it's unclear to me what's happening.

There's a leading whitespace per https://github.com/ibis-project/ibis/actions/runs/7993226046/job/21828534190?pr=8410#step:5:38

image

@cpcloud
Copy link
Member

cpcloud commented Feb 21, 2024

I think others have also experienced this issue. Is there some tool that's prepending and/or appending whitespace to commit headers?

I don't ever experience this issue using nvim, vim or the gh CLI to commit/submit PRs.

@ncclementi ncclementi changed the title docs: use algolia for searchability docs: use algolia for searchability Feb 21, 2024
@ncclementi
Copy link
Contributor Author

I think others have also experienced this issue. Is there some tool that's prepending and/or appending whitespace to commit headers?

This is the first time that happens to me, and I use vim for commits, I did edit the title of the PR, I might have accidentally introduced a space, I have no clue 🤷‍♀️

@cpcloud
Copy link
Member

cpcloud commented Feb 21, 2024

Merging so we can iterate.

@cpcloud cpcloud merged commit f8d8ca3 into ibis-project:main Feb 21, 2024
81 checks passed
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.

docs - improve search functionality
2 participants