Skip to content

Commit c97ac63

Browse files
authored
Merge pull request #6846 from reactioncommerce/pending-fixes
Pending fixes for Release5
2 parents 5264638 + 84a0320 commit c97ac63

File tree

28 files changed

+177
-34
lines changed

28 files changed

+177
-34
lines changed

.github/workflows/docker-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
contents: write
1414
pull-requests: write
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-focal
1616

1717
steps:
1818
- uses: actions/checkout@v2

.github/workflows/prerelease.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
permissions:
1515
contents: write # to create release (changesets/action)
1616
pull-requests: write # to create pull request (changesets/action)
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-focal
1818
steps:
1919
- uses: actions/checkout@v2
2020
with:
@@ -29,10 +29,10 @@ jobs:
2929
key: reaction-v6-node-modules-${{ hashFiles('package.json') }}-${{ hashFiles('pnpm-lock.yaml') }}
3030
path: "**/node_modules"
3131

32-
- name: Use Node.js 14.x
32+
- name: Use Node.js 18.x
3333
uses: actions/setup-node@v2
3434
with:
35-
node-version: 14
35+
node-version: 18.10
3636

3737
- name: Install pnpm
3838
run: npm i -g pnpm@latest
@@ -84,16 +84,16 @@ jobs:
8484
permissions:
8585
contents: write # to create release (changesets/action)
8686
pull-requests: write # to create pull request (changesets/action)
87-
runs-on: ubuntu-latest
87+
runs-on: ubuntu-focal
8888
steps:
8989
- uses: actions/checkout@v2
9090
with:
9191
fetch-depth: 0
9292

93-
- name: Use Node.js 14.x
93+
- name: Use Node.js 18.x
9494
uses: actions/setup-node@v2
9595
with:
96-
node-version: 14
96+
node-version: 18.10
9797

9898
- name: Install pnpm
9999
run: npm i -g pnpm@latest

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Use Node.js 18.x
3131
uses: actions/setup-node@v2
3232
with:
33-
node-version: 18
33+
node-version: 18.10
3434

3535
- name: Install pnpm
3636
run: npm i -g pnpm@latest

.github/workflows/tagging-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Use Node.js 18.x
2626
uses: actions/setup-node@v2
2727
with:
28-
node-version: 18
28+
node-version: 18.10
2929

3030
- name: Install dependencies
3131
run: |

apps/reaction/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@
103103
"test:integration:watch": "node node_modules/jest/bin/jest --runInBand --watch --testPathIgnorePatterns '<rootDir>/src/'",
104104
"test:integration:file": "jest --runInBand",
105105
"test:integration:file:watch": "jest --runInBand --watch",
106-
"test:integration:query": "node --max-old-space-size=6144 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/mutations/'",
107-
"test:integration:mutation": "node --max_old_space_size=6144 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/queries/'",
106+
"test:integration:query": "node --max-old-space-size=7168 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/mutations/'",
107+
"test:integration:mutation": "node --max_old_space_size=7168 --expose-gc ../../node_modules/jest/bin/jest.js --forceExit --runInBand --logHeapUsage --testPathIgnorePatterns '<rootDir>/src/' '<rootDir>/tests/integration/api/queries/'",
108108
"lint": "eslint .",
109109
"lint:gql": "graphql-schema-linter ./src/**/*.graphql",
110110
"version": "echo $npm_package_version",

packages/api-plugin-fulfillment-method-pickup-store/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@reactioncommerce/api-plugin-fulfillment-method-pickup-store",
33
"description": "Implements Store-pickup as a fulfillment method under the type pickup",
44
"label": "Fulfillment Method Store Pickup",
5-
"version": "1.0.0",
5+
"version": "0.0.0",
66
"main": "index.js",
77
"type": "module",
88
"engines": {

packages/api-plugin-fulfillment-method-pickup-store/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export default async function register(app) {
2828
functionsByType: {
2929
preStartup: [fulfillmentMethodPickupStorePreStartup],
3030
startup: [fulfillmentMethodPickupStoreStartup],
31-
validateOrderMethods: [{ key: "store", handler: validateOrderMethodsStore }],
32-
fulfillmentMethodsWithQuotes: [{ key: "pickup", handler: fulfillmentMethodsWithQuotesPickupStore }]
31+
validateOrderMethods: [{ key: "store", handler: validateOrderMethodsStore, name: "validateOrderMethodsStore" }],
32+
fulfillmentMethodsWithQuotes: [{ key: "pickup", handler: fulfillmentMethodsWithQuotesPickupStore, name: "fulfillmentMethodsWithQuotesPickupStore" }]
3333
}
3434
});
3535
}

packages/api-plugin-fulfillment-method-pickup-store/src/startup.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ import checkAndCreateFulfillmentMethod from "./util/checkAndCreateFulfillmentMet
66
* @returns {undefined}
77
*/
88
export default async function fulfillmentMethodPickupStoreStartup(context) {
9+
const { collections: { Shops } } = context;
10+
const session = context.app.mongoClient.startSession();
11+
12+
const allShops = await Shops.find().toArray();
13+
for (const shop of allShops) {
14+
const { _id: shopId } = shop;
15+
try {
16+
// eslint-disable-next-line no-await-in-loop
17+
await session.withTransaction(async () => {
18+
const insertedMethod = await checkAndCreateFulfillmentMethod(context, shopId);
19+
if (!insertedMethod) {
20+
throw new ReactionError("server-error", "Error in creating fulfillment method");
21+
}
22+
});
23+
} catch (error) {
24+
// eslint-disable-next-line no-await-in-loop
25+
await session.endSession();
26+
throw error;
27+
}
28+
// eslint-disable-next-line no-await-in-loop
29+
await session.endSession();
30+
}
31+
932
context.appEvents.on("afterShopCreate", async (payload) => {
1033
const { shop } = payload;
1134
const shopId = shop._id;

packages/api-plugin-fulfillment-method-shipping-dynamic-rate/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@reactioncommerce/api-plugin-fulfillment-method-shipping-dynamic-rate",
33
"description": "Implements Shipping-Dynamic Rate as a fulfillment method under the type shipping",
44
"label": "Fulfillment Method Shipping Dynamic Rate",
5-
"version": "1.0.0",
5+
"version": "0.0.0",
66
"main": "index.js",
77
"type": "module",
88
"engines": {

packages/api-plugin-fulfillment-method-shipping-dynamic-rate/src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ export default async function register(app) {
2828
functionsByType: {
2929
preStartup: [preStartup],
3030
startup: [startup],
31-
validateOrderMethods: [{ key: "dynamicRate", handler: validateOrderMethodsDynamicRate }],
32-
fulfillmentMethodsWithQuotes: [{ key: "shipping", handler: fulfillmentMethodsWithQuotesShippingDynamicRate }]
31+
validateOrderMethods: [{ key: "dynamicRate", handler: validateOrderMethodsDynamicRate, name: "validateOrderMethodsDynamicRate" }],
32+
fulfillmentMethodsWithQuotes: [
33+
{ key: "shipping", handler: fulfillmentMethodsWithQuotesShippingDynamicRate, name: "fulfillmentMethodsWithQuotesShippingDynamicRate" }
34+
]
3335
}
3436
});
3537
}

0 commit comments

Comments
 (0)