Skip to content

(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

Merged
merged 8 commits into from
May 5, 2025

Conversation

yakubova92
Copy link
Collaborator

Jira: https://jira.mongodb.org/browse/EAI-1003

Changes

  • getDataSourceVersions returns a list of available versions for a given data source
  • tests

Notes

@yakubova92 yakubova92 requested review from nlarew and mongodben May 1, 2025 23:59
Comment on lines +348 to +351
beforeEach(async () => {
assert(store);
await store.updatePages(moviePagesWithVersion);
});
Copy link
Collaborator

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

Copy link
Collaborator Author

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>>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}): Promise<Array<SourceVersions>>;
}): Promise<SourceVersions[]>;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

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?

Copy link
Collaborator Author

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)

Copy link
Collaborator

@mongodben mongodben left a 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

@yakubova92 yakubova92 merged commit b9947e4 into EAI-428-feature-versioned-docs May 5, 2025
1 check passed
@yakubova92 yakubova92 deleted the EAI-1003 branch May 5, 2025 17:18
yakubova92 added a commit that referenced this pull request May 19, 2025
* (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
mongodben pushed a commit that referenced this pull request May 20, 2025
* (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
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.

2 participants