Address review feedback

- Move getOwnServiceCredentials() before the pagination loop in DefaultTechDocsCollatorFactory
- Fix stale test comment that referenced the deleted MSW /entities handler

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
This commit is contained in:
Fredrik Adelöw
2026-04-03 23:05:02 +02:00
parent 7d9d185654
commit 52a45c308b
2 changed files with 4 additions and 5 deletions
@@ -186,9 +186,9 @@ describe('DefaultTechDocsCollatorFactory', () => {
});
it('paginates through catalog entities using batchSize', async () => {
// A parallelismLimit of 1 is a catalog limit of 50 per request. Code
// above in the /entities handler ensures valid entities are only
// returned on the second page.
// A parallelismLimit of 1 results in a batchSize of 50 per request.
// The catalog returns fewer entities than the batchSize, so the loop
// exits after a single page, producing 3 documents (1 entity × 3 search index docs).
const _config = new ConfigReader({
...config.get(),
search: {
@@ -143,9 +143,8 @@ export class DefaultTechDocsCollatorFactory implements DocumentCollatorFactory {
// at index-time. The batchSize is calculated as a factor of the given
// parallelism limit to simplify configuration.
const batchSize = this.parallelismLimit * 50;
const credentials = await this.auth.getOwnServiceCredentials();
while (moreEntitiesToGet) {
const credentials = await this.auth.getOwnServiceCredentials();
const entities = (
await this.catalog.getEntities(
{