-
Notifications
You must be signed in to change notification settings - Fork 16
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 Backfilled data script #28
Conversation
e95b5d4
to
774bb13
Compare
e2f719e
to
ef9d43a
Compare
0ee91a8
to
059a2dd
Compare
059a2dd
to
73d0fea
Compare
@@ -20,23 +20,20 @@ jobs: | |||
with: | |||
node-version: 14 | |||
- name: Install dependencies | |||
run: npm run install:functions | |||
run: yarn install:functions |
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.
Any particular reason to change? 😸
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 have no particular opinion on the matter but all js repo use yarn by default so ... I change it
- Run the project for development: | ||
Launch Meilisearch instance: | ||
``` bash | ||
curl -L https://install.meilisearch.com | sh # download Meilisearch |
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 saw that earlier 👀 😄
|
||
test('adaptDocument with fields not set and with id field in document', () => { | ||
mockedGetFieldsToIndex.mockReturnValueOnce([]) | ||
const snapshot = firebaseMock.firestore.makeDocumentSnapshot( |
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.
Could apply the http://xunitpatterns.com/Four%20Phase%20Test.html in these tests?
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 made some changes is this better?
@@ -40,7 +40,7 @@ describe('extension', () => { | |||
|
|||
beforeEach(() => { | |||
restoreEnv = mockedEnv(defaultEnvironment) | |||
config = require('../src/config').default | |||
config = require('../src/config').config |
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 config can be loaded like this import config from '../src/config'
, no?
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.
No, defaultEnvironment
variables must be loaded first otherwise the config
has no access to them.
31573f4
to
9aeb93a
Compare
9aeb93a
to
ccc2e7c
Compare
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.
If we use yarn everywhere there should not be a package-lock.json
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"main": "lib/index.js", | ||
"dependencies": { | ||
"firebase-admin": "^9.8.0", | ||
"meilisearch": "^0.21.0" | ||
"firebase-functions": "^3.16.0", | ||
"meilisearch": "^0.24.0" |
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.
Should be updated in a later PR
return config.meilisearch.fieldsToIndex | ||
? config.meilisearch.fieldsToIndex.split(/[ ,]+/) | ||
: [] |
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.
Yes be before we arrive here, were they validated by your validation functions?
aaf03a0
to
5450478
Compare
5450478
to
26d094b
Compare
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.
🔥🔥🔥🔥🔥 LGTM 🔥🔥🔥🔥🔥 GREAT WORK
bors merge |
28: Add Backfilled data script r=alallema a=alallema # Pull Request ## What does this PR do? Add a script to back-filled data from Firestore to MeiliSearch to give the possibility to import existing documents or reindex them if you already have documents in a Firestore Collection when you enable the MeiliSearch extension. Check [an example from google extension](https://github.com/firebase/extensions/tree/master/firestore-bigquery-export#backfill-your-bigquery-dataset) #15 ## PR checklist - [x] Handles different possibilities to launch the script - [x] Command line with parameter - [x] interactively - [x] Add the possibility to import documents by batch - [x] Add the possibility to import documents from sub-collections - [x] Write a guide **Notes:** - The ability to run the script with a configuration file is not part of the MVP and may be implemented later #29 Co-authored-by: alallema <[email protected]> Co-authored-by: Amélie <[email protected]>
Build succeeded: |
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.
Still LGTM 🔥🔥🔥
bors merge |
Already running a review |
Pull Request
What does this PR do?
Add a script to back-filled data from Firestore to MeiliSearch to give the possibility to import existing documents or reindex them if you already have documents in a Firestore Collection when you enable the MeiliSearch extension.
Check an example from google extension
#15
PR checklist
Notes: