Skip to content

Commit 0ef37ef

Browse files
authored
Merge pull request #352 from Yelp/fix-pipeline-ubuntu-bump
Attempt at fixing pipeline issue
2 parents 42acd25 + 5bead4b commit 0ef37ef

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
test:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-22.04
1010
steps:
1111
- uses: actions/checkout@v2
1212
- uses: actions/setup-python@v2
@@ -20,7 +20,7 @@ jobs:
2020

2121
publish-npm:
2222
needs: test
23-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-22.04
2424
steps:
2525
- uses: actions/checkout@v2
2626
- uses: actions/setup-node@v2

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Run Tests
33
on: [push]
44
jobs:
55
test:
6-
runs-on: ubuntu-20.04
6+
runs-on: ubuntu-22.04
77
steps:
88
- uses: actions/checkout@v2
99
- uses: actions/setup-python@v2

API_DOCS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Describes the shape and behaviour of the resources object you will pass to `getL
188188
| `isBatchKeyASet` | (Optional) Set to true if the interface of the resource takes the batch key as a set (rather than an array). For example, when using a generated clientlib based on swagger where `uniqueItems: true` is set for the batchKey parameter. Default: false. |
189189
| `propertyBatchKey` | (Optional) The argument to the resource that represents the optional properties we want to fetch. (e.g. usually 'properties' or 'features'). |
190190
| `responseKey` | (Non-optional when propertyBatchKey is used) The key in the response objects corresponds to `batchKey`. This should be the only field that are marked as required in your swagger endpoint response, except nestedPath. |
191-
| `maxBatchSize` | (Optional) Limits the number of items that can be batched together in a single request. When more items are requested than this limit, multiple requests will be made. This can help prevent hitting URI length limits or timeouts for large batches. |
191+
| `maxBatchSize` | (Optional) Limits the number of items that can be batched together in a single request. When more items are requested than this limit, multiple requests will be made. This can help prevent hitting URI length limits or timeouts for large batches. |
192192
193193
### `typings`
194194

__tests__/implementation.test.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,26 +1259,26 @@ test('batch endpoint with maxBatchSize', async () => {
12591259
},
12601260
},
12611261
};
1262-
1262+
12631263
// Track each batch of IDs that the resource function receives
12641264
const receivedBatches = [];
1265-
1265+
12661266
const resources = {
12671267
foo: ({ foo_ids, properties }) => {
12681268
receivedBatches.push([...foo_ids]);
12691269
return Promise.resolve(
1270-
foo_ids.map(id => ({
1271-
id,
1272-
name: `name-${id}`,
1273-
rating: id + 1
1274-
}))
1270+
foo_ids.map((id) => ({
1271+
id,
1272+
name: `name-${id}`,
1273+
rating: id + 1,
1274+
})),
12751275
);
12761276
},
12771277
};
1278-
1278+
12791279
await createDataLoaders(config, async (getLoaders) => {
12801280
const loaders = getLoaders(resources);
1281-
1281+
12821282
// Request 5 items at once, which should be split by maxBatchSize later in the test.
12831283
const results = await Promise.all([
12841284
loaders.foo.load({ foo_id: 1, properties: ['name', 'rating'] }),
@@ -1287,7 +1287,7 @@ test('batch endpoint with maxBatchSize', async () => {
12871287
loaders.foo.load({ foo_id: 4, properties: ['name', 'rating'] }),
12881288
loaders.foo.load({ foo_id: 5, properties: ['name', 'rating'] }),
12891289
]);
1290-
1290+
12911291
// Verify that all results were returned correctly
12921292
expect(results).toEqual([
12931293
{ id: 1, name: 'name-1', rating: 2 },
@@ -1296,10 +1296,10 @@ test('batch endpoint with maxBatchSize', async () => {
12961296
{ id: 4, name: 'name-4', rating: 5 },
12971297
{ id: 5, name: 'name-5', rating: 6 },
12981298
]);
1299-
1299+
13001300
// Verify that the requests were batched correctly
1301-
expect(receivedBatches.map(batch => batch.length)).toEqual([3, 2]);
1302-
1301+
expect(receivedBatches.map((batch) => batch.length)).toEqual([3, 2]);
1302+
13031303
// Verify that all IDs were requested
13041304
const allRequestedIds = receivedBatches.flat().sort();
13051305
expect(allRequestedIds).toEqual([1, 2, 3, 4, 5]);
@@ -1320,26 +1320,26 @@ test('batch endpoint with propertyBatchKey and maxBatchSize', async () => {
13201320
},
13211321
},
13221322
};
1323-
1323+
13241324
// Track each batch of IDs that the resource function receives
13251325
const receivedBatches = [];
1326-
1326+
13271327
const resources = {
13281328
foo: ({ foo_ids, properties }) => {
13291329
receivedBatches.push([...foo_ids]);
13301330
return Promise.resolve(
1331-
foo_ids.map(id => ({
1332-
id,
1333-
name: `name-${id}`,
1334-
rating: id + 1
1335-
}))
1331+
foo_ids.map((id) => ({
1332+
id,
1333+
name: `name-${id}`,
1334+
rating: id + 1,
1335+
})),
13361336
);
13371337
},
13381338
};
1339-
1339+
13401340
await createDataLoaders(config, async (getLoaders) => {
13411341
const loaders = getLoaders(resources);
1342-
1342+
13431343
// Request 5 items at once, which should be split by maxBatchSize later in the test.
13441344
const results = await Promise.all([
13451345
loaders.foo.load({ foo_id: 1, properties: ['name', 'rating'] }),
@@ -1348,7 +1348,7 @@ test('batch endpoint with propertyBatchKey and maxBatchSize', async () => {
13481348
loaders.foo.load({ foo_id: 4, properties: ['name', 'rating'] }),
13491349
loaders.foo.load({ foo_id: 5, properties: ['name', 'rating'] }),
13501350
]);
1351-
1351+
13521352
// Verify that all results were returned correctly
13531353
expect(results).toEqual([
13541354
{ id: 1, name: 'name-1', rating: 2 },
@@ -1357,10 +1357,10 @@ test('batch endpoint with propertyBatchKey and maxBatchSize', async () => {
13571357
{ id: 4, name: 'name-4', rating: 5 },
13581358
{ id: 5, name: 'name-5', rating: 6 },
13591359
]);
1360-
1360+
13611361
// Verify that the requests were batched correctly
1362-
expect(receivedBatches.map(batch => batch.length)).toEqual([2, 2, 1]);
1363-
1362+
expect(receivedBatches.map((batch) => batch.length)).toEqual([2, 2, 1]);
1363+
13641364
// Verify that all IDs were requested
13651365
const allRequestedIds = receivedBatches.flat().sort();
13661366
expect(allRequestedIds).toEqual([1, 2, 3, 4, 5]);

0 commit comments

Comments
 (0)