-
Notifications
You must be signed in to change notification settings - Fork 74
(EAI-1003) get available versions for data source #696
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
Conversation
beforeEach(async () => { | ||
assert(store); | ||
await store.updatePages(moviePagesWithVersion); | ||
}); |
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 can be beforeAll since you're only reading from the data in the tests
also add a clean up operation to remove the stuff you added to not interfere w/ other 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.
It fails with a beforeAll bc there's an afterEach in the parent describe that drops the db after each test. Keeping this as a beforeEach. I did add an afterAll to clean up
@@ -29,6 +30,9 @@ export type MongoDbPageStore = DatabaseConnection & | |||
expectedUrls: string[]; | |||
urlTransformer?: (url: string) => string; | |||
}): Promise<string[]>; | |||
getDataSourceVersions(args: { | |||
dataSources: string[]; | |||
}): Promise<Array<SourceVersions>>; |
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.
}): Promise<Array<SourceVersions>>; | |
}): Promise<SourceVersions[]>; |
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.
given the new SourceVersions
type, shouldn't this be a single object, not an array?
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.
maybe you just need to pull the first element out of the array returned by the aggregation?
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 there are multiple sources requested, or none, the result will be an array of objects (sourceNames with their version info)
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 % note about return type
* (EAI-968) ingest multiple versions (#683) * (EAI-969) query multiple versions (#693) * (EAI-1003) get available versions for data source (#696) * (EAI-922) ensure only current version on hugging face dataset (#698) * (EAI-1001) enable search by type (#703) * add sourceType to pages and embedded_content and ability to filter by it * change sourceRegex filter to sourceType filter
* (EAI-968) ingest multiple versions (#683) * remove snooty prefix * ingesting pages for all branches on each data source * do not ingest (and delete if already exists) pages on inactive branches * handle current version override * cleanup unused code from previous version override implementation, tests * update SnootyDataSource tests * remove override for docs current version * (EAI-969) query multiple versions (#693) * nearest neighbor search accepts filters, defaults to current version * parse filters to mdb query * (EAI-1003) get available versions for data source (#696) * get versions of a data source * get versions for multiple data sources * (EAI-922) ensure only current version on hugging face dataset (#698) * exclude old versions from dataset * add test case * fix other tests * fix return type of getDataSourceVersions - return object, not array * move QueryFilters type def to embedded content store * fix type * (EAI-1001) enable search by type (#703) * add sourceType to pages and embedded_content and ability to filter by it * test case * change sourceRegex filter to sourceType filter * lint
Jira: https://jira.mongodb.org/browse/EAI-1003
Changes
Notes