@friggframework/devtools 2.0.0--canary.743.265a5cd.0 → 2.0.0--canary.743.a254104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -474,10 +474,19 @@ class IntegrationBuilder extends InfrastructureBuilder {
474
474
  timeout: 900, // 15 minutes max for queue workers (Lambda maximum)
475
475
  };
476
476
  console.log(` ✓ Queue worker function defined`);
477
+ const concurrencySource = queueWorkerConcurrencySource(integration);
478
+ if (
479
+ maximumConcurrency === undefined &&
480
+ concurrencySource.value !== undefined
481
+ ) {
482
+ console.log(
483
+ ` ⚠ Queue worker maximumConcurrency ${concurrencySource.value} not set: it is not below the reserved concurrency of ${queueWorkerReservedConcurrency}`
484
+ );
485
+ }
477
486
  if (maximumConcurrency !== undefined) {
478
487
  console.log(
479
488
  ` ✓ Queue worker maximumConcurrency ${maximumConcurrency} for the whole queue (${
480
- queueWorkerConcurrencySource(integration).source === 'integration'
489
+ concurrencySource.source === 'integration'
481
490
  ? 'Definition.queueWorker.maximumConcurrency'
482
491
  : `smallest module maxConcurrency ${declaredMaxConcurrency(integration)}; set Definition.queueWorker.maximumConcurrency to change or false to turn off`
483
492
  })`
@@ -464,6 +464,12 @@ describe('IntegrationBuilder', () => {
464
464
  expect(sqsOf(result).maximumConcurrency).toBe(8);
465
465
  });
466
466
 
467
+ it('refuses a Definition.queueWorker.maximumConcurrency that is not an integer or false', async () => {
468
+ await expect(
469
+ integrationBuilder.build(withSetting('8', 3), {})
470
+ ).rejects.toThrow('must be an integer from 2 to 1000, or false');
471
+ });
472
+
467
473
  it('sets nothing when Definition.queueWorker.maximumConcurrency is false', async () => {
468
474
  const result = await integrationBuilder.build(
469
475
  withSetting(false, 3),
@@ -45,6 +45,7 @@ function declaredMaxConcurrency(integration) {
45
45
 
46
46
  /**
47
47
  * Where the value comes from: the integration's own setting, or its modules.
48
+ * Throws for a setting that is neither a positive integer nor `false`.
48
49
  * @returns {{ value: number|undefined, source: 'integration'|'modules'|'off'|'none' }}
49
50
  */
50
51
  function queueWorkerConcurrencySource(integration) {
@@ -53,6 +54,11 @@ function queueWorkerConcurrencySource(integration) {
53
54
  if (Number.isInteger(setting) && setting > 0) {
54
55
  return { value: setting, source: 'integration' };
55
56
  }
57
+ if (setting !== undefined) {
58
+ throw new Error(
59
+ `Definition.queueWorker.maximumConcurrency of integration "${integration?.Definition?.name}" must be an integer from 2 to 1000, or false`
60
+ );
61
+ }
56
62
  const declared = declaredMaxConcurrency(integration);
57
63
  return declared === undefined
58
64
  ? { value: undefined, source: 'none' }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@friggframework/devtools",
3
3
  "prettier": "@friggframework/prettier-config",
4
- "version": "2.0.0--canary.743.265a5cd.0",
4
+ "version": "2.0.0--canary.743.a254104.0",
5
5
  "bin": {
6
6
  "frigg": "./frigg-cli/index.js"
7
7
  },
@@ -28,9 +28,9 @@
28
28
  "@babel/eslint-parser": "^7.18.9",
29
29
  "@babel/parser": "^7.25.3",
30
30
  "@babel/traverse": "^7.25.3",
31
- "@friggframework/core": "2.0.0--canary.743.265a5cd.0",
32
- "@friggframework/schemas": "2.0.0--canary.743.265a5cd.0",
33
- "@friggframework/test": "2.0.0--canary.743.265a5cd.0",
31
+ "@friggframework/core": "2.0.0--canary.743.a254104.0",
32
+ "@friggframework/schemas": "2.0.0--canary.743.a254104.0",
33
+ "@friggframework/test": "2.0.0--canary.743.a254104.0",
34
34
  "@hapi/boom": "^10.0.1",
35
35
  "@inquirer/prompts": "^5.3.8",
36
36
  "axios": "^1.18.0",
@@ -58,8 +58,8 @@
58
58
  "validate-npm-package-name": "^5.0.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@friggframework/eslint-config": "2.0.0--canary.743.265a5cd.0",
62
- "@friggframework/prettier-config": "2.0.0--canary.743.265a5cd.0",
61
+ "@friggframework/eslint-config": "2.0.0--canary.743.a254104.0",
62
+ "@friggframework/prettier-config": "2.0.0--canary.743.a254104.0",
63
63
  "aws-sdk-client-mock": "^4.1.0",
64
64
  "aws-sdk-client-mock-jest": "^4.1.0",
65
65
  "jest": "^30.1.3",
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "265a5cd5f39515f47164aec0b99fed86048b59d9"
94
+ "gitHead": "a25410415a2aed83688bd93a995f1185ee722501"
95
95
  }