Skip to content

Conversation

@allevo
Copy link
Contributor

@allevo allevo commented Dec 11, 2025

Description

Orama provides the temporary datasource feature, which allows the client to insert documents there and swap the datasource atomically, without downtime. I've also added comments to explain the change.

Validation

Related Issues

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

Copilot AI review requested due to automatic review settings December 11, 2025 13:56
@allevo allevo requested review from a team as code owners December 11, 2025 13:56
@vercel
Copy link

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Dec 11, 2025 1:58pm

@github-actions
Copy link
Contributor

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website @nodejs/web-infra

Please review the changes when you have a chance. Thank you! 🙏

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes search result duplication by upgrading @orama/core from version 1.2.13 to 1.2.14 and implementing Orama's temporary datasource feature with atomic swapping. The changes ensure that search index updates occur without downtime and prevent duplicate entries during synchronization.

Key changes:

  • Upgraded @orama/core dependency to version 1.2.14
  • Implemented temporary index creation and atomic swap pattern for zero-downtime updates
  • Updated documentation URL reference to point to the current Orama documentation

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/site/package.json Upgraded @orama/core dependency from ^1.2.13 to ^1.2.14
apps/site/scripts/orama-search/sync-orama-cloud.mjs Refactored sync logic to use temporary index with atomic swap; updated documentation URL and added explanatory comments
pnpm-lock.yaml Updated lockfile to reflect new dependency versions and transitive dependency changes
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const datasource = orama.dataSource(process.env.NEW_ORAMA_DATASOURCE_ID || '');

// Create a temporary index to perform the insertions
const temporary = await datasource.createTemporaryIndex();
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The temporary index is created at the top level before documents are fetched. If createTemporaryIndex() fails or if the script crashes after creating the temporary index but before swapping, the temporary index may remain orphaned. Consider creating the temporary index inside runUpdate() after successfully fetching documents, or add cleanup logic to handle failures.

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.68%. Comparing base (d53301c) to head (7f6c517).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8409      +/-   ##
==========================================
- Coverage   73.73%   73.68%   -0.05%     
==========================================
  Files         107      107              
  Lines        9155     9161       +6     
  Branches      308      311       +3     
==========================================
  Hits         6750     6750              
- Misses       2403     2409       +6     
  Partials        2        2              

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

Copy link
Member

@mikeesto mikeesto left a comment

Choose a reason for hiding this comment

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

Thanks! CI is failing?

> @node-core/website@ lint:types /home/runner/work/nodejs.org/nodejs.org/apps/site
> tsc --noEmit

Error: components/Common/Searchbox/index.tsx(34,7): error TS2322: Type 'import("/home/runner/work/nodejs.org/nodejs.org/node_modules/.pnpm/@orama+core@1.2.14/node_modules/@orama/core/esm/cloud").OramaCloud | null' is not assignable to type 'import("/home/runner/work/nodejs.org/nodejs.org/node_modules/.pnpm/@orama+core@1.2.13/node_modules/@orama/core/esm/cloud").OramaCloud | null'.
  Type 'import("/home/runner/work/nodejs.org/nodejs.org/node_modules/.pnpm/@orama+core@1.2.14/node_modules/@orama/core/esm/cloud").OramaCloud' is not assignable to type 'import("/home/runner/work/nodejs.org/nodejs.org/node_modules/.pnpm/@orama+core@1.2.13/node_modules/@orama/core/esm/cloud").OramaCloud'.
    Types have separate declarations of a private property 'client'.
 ELIFECYCLE  Command failed with exit code 2.
Error:  command finished with error: command (/home/runner/work/nodejs.org/nodejs.org/apps/site) /home/runner/setup-pnpm/node_modules/.bin/pnpm run lint:types exited (2)

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