Skip to content

Conversation

amanycodes
Copy link
Contributor

Added search capability in website using Algolia DocSearch.

I think the stock template looks good, and we can use that without any UI changes!

Closes: #320

Signed-off-by: amanycodes <amanycodes@gmail.com>
@@ -80,6 +80,12 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
algolia: {
appId: 'V764HJRQUN',
apiKey: 'd590e629131c1318f2b996bc14efdfa8',
Copy link
Contributor

Choose a reason for hiding this comment

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

I am seeing a different Search API key on the site? Also I've added the one I see as a repo secret ALGOLIA_API_KEY. I also stored app id as ALGOLIA_ID. Lets use these instead of hardcoding it

Copy link
Contributor

Choose a reason for hiding this comment

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

one more question - would there be any way of testing this before we merge the PR?

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 am seeing a different Search API key on the site? Also I've added the one I see as a repo secret ALGOLIA_API_KEY. I also stored app id as ALGOLIA_ID. Lets use these instead of hardcoding it

Sure, using variables makes sense! I still see the current API key on the site. Also will a video demo of the search working on my local machine work as valid test of the search working?

Copy link
Contributor

Choose a reason for hiding this comment

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

@amanycodes sure - can you try with both keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! Please share the other key through Slack as I can't view the repo secrets.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ashnamehrotra Also I was wondering should I push the .env holding key and id values? Since people pulling changes will also need them anyways for them to run the website locally? Or else we'd have to like mention it somewhere explicitly..WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

@amanycodes thanks! I don't think we should expose any key values in the repo

Copy link
Contributor

Choose a reason for hiding this comment

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

@amanycodes can we change it to the github secrets vars? I'll remove the comment from above since it exposes the key

@project-copacetic project-copacetic deleted a comment from amanycodes Jun 6, 2025
Signed-off-by: amanycodes <amanycodes@gmail.com>
Copy link

codecov bot commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.28%. Comparing base (de8cc86) to head (fbfea33).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1082   +/-   ##
=======================================
  Coverage   43.28%   43.28%           
=======================================
  Files          21       21           
  Lines        3301     3301           
=======================================
  Hits         1429     1429           
  Misses       1763     1763           
  Partials      109      109           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

amanycodes and others added 3 commits June 6, 2025 23:54
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
@amanycodes
Copy link
Contributor Author

@ashnamehrotra Are the github secret vars not updated for Algolia search?

@ashnamehrotra
Copy link
Contributor

@ashnamehrotra Are the github secret vars not updated for Algolia search?

they are updated, can you try running an echo in the workflow to debug?

@amanycodes amanycodes marked this pull request as draft June 6, 2025 22:23
@amanycodes amanycodes marked this pull request as ready for review June 6, 2025 22:23
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
@amanycodes
Copy link
Contributor Author

@ashnamehrotra I still can't figure out how do i access the variables, i have echoed both secrets and vars and they both dont have the required vars. Maybe the workflow doesn't have access to those variables or something. Please let me know where am i going wrong 🤔

@ashnamehrotra
Copy link
Contributor

@amanycodes are the keys also stored in your fork of copa?

@amanycodes
Copy link
Contributor Author

@amanycodes are the keys also stored in your fork of copa?

I checked and there were no keys stored in my fork. Are the workflows trying to fetch from my repo's variables?

@ashnamehrotra
Copy link
Contributor

@amanycodes I'm not sure but if possible we can test that way? we can also change the workflow type to trigger, and then run on your fork

@amanycodes
Copy link
Contributor Author

amanycodes commented Jun 10, 2025

@amanycodes I'm not sure but if possible we can test that way? we can also change the workflow type to trigger, and then run on your fork

sure! I'll just add these vars to my fork and check.

amanycodes and others added 4 commits June 10, 2025 23:25
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
Signed-off-by: amanycodes <amanycodes@gmail.com>
@amanycodes
Copy link
Contributor Author

@ashnamehrotra I tested by storing keys in my fork and running the doc workflow there and I could see the keys in the echo. workflow link: https://github.com/amanycodes/copacetic/actions/runs/15567823815/job/43836147476

I used this stackoverflow reference for secret creation: https://stackoverflow.com/questions/67964110/how-to-access-secrets-when-using-flutter-web-with-github-actions/67998780#67998780

@ashnamehrotra
Copy link
Contributor

@amanycodes I created the secrets again to confirm they are there. Can we double check any permissions for the workflow and site?

amanycodes and others added 2 commits June 17, 2025 01:43
Signed-off-by: amanycodes <amanycodes@gmail.com>
@sozercan
Copy link
Member

A fork can't access the main repo's environment variables. Assuming this is all tested on a fork with fork's env vars, these should work after we merge the PR as long as we have the same env vars in main repo.

@sozercan sozercan changed the title feat: Add Search to website using Algolia docs: Add Search to website using Algolia Jun 16, 2025
Signed-off-by: amanycodes <amanycodes@gmail.com>
@amanycodes
Copy link
Contributor Author

A fork can't access the main repo's environment variables. Assuming this is all tested on a fork with fork's env vars, these should work after we merge the PR as long as we have the same env vars in main repo.

Thanks for the clarification! we were stuck on this for quite sometime. I will reset the perms whichever I changed and here is the working check on my fork:
https://github.com/amanycodes/copacetic/actions/runs/15567823815/job/43836147476
Please let me know if it's good to go.

Signed-off-by: amanycodes <amanycodes@gmail.com>
@sozercan
Copy link
Member

Let's merge it, and we can fix it afterwards if it's still broken.

Copy link
Member

@sozercan sozercan left a comment

Choose a reason for hiding this comment

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

LGTM

@sozercan sozercan merged commit 936e5ee into project-copacetic:main Jun 16, 2025
23 of 24 checks passed
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Copacetic Workboard Jun 16, 2025
@sozercan
Copy link
Member

looks like it's all working now, thanks @amanycodes!

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

Successfully merging this pull request may close these issues.

[DOC] add search to website
3 participants