Repository navigation
Open
Description
This issue is the execution plan for ADR-050: Move to osls 4 for 2.0.1 (#664). It replaces the "stay on osls 3" position in #639. Line numbers are on next @ 747a479f. All paths are under packages/devtools/infrastructure/ unless noted.
The work ships in two PRs, so that each artifact diff isolates one change:
- PR 1 converts the config while Frigg is still on osls 3.
- PR 2 bumps osls to 4.
2.0.1 does not ship until every box is checked.
PR 1 — conversion, still on osls 3.78.0
Helper
- Add
domains/shared/utilities/package-patterns.js→toPackagePatterns({ include, exclude })returning[!exclude…, include…](an exclude that already starts with!becomes an include in exclude position, as osls 3 handles it) - Unit tests: ordering, a
!-prefixed exclude, an include re-adding an excluded path, empty lists,nestedNodeModulesExcludes()output for bothkeepNestedNodeModulesmodes
Convert each emitter to package.patterns
- E1
domains/shared/utilities/base-definition-factory.js:41skipEsbuildPackageConfig(include:43,exclude:49) →auth:288,user:304,health:311 - E2
base-definition-factory.js:117functionPackageConfig: delete (unused) - E3
domains/integration/integration-builder.js:254createFunctionPackageConfig(exclude:257) →<name>Webhook:346,<name>:373, extension routes :419,<name>QueueWorker:439,dlqProcessor:544 - E4
domains/database/migration-builder.js:243worker config (exclude:245; keepindividually) →dbMigrationWorker:437 - E5
migration-builder.js:333router config (exclude:335; keepindividually) →dbMigrationRouter:463 - E6
domains/admin-scripts/admin-script-builder.js:393skipEsbuildPackageConfig()(include:396,exclude:400) →adminScriptExecutor:195,adminScriptRouter:215,reportRouter:249,reportExecutor:316 - Leave
custom.esbuild.exclude(base-definition-factory.js:253,esbuild.config.js:46) unchanged; it is a serverless-esbuild option, not osls packaging
useDotenv
- U1
base-definition-factory.js:176→...(process.argv.includes('offline') && { useDotenv: true }) - Test: absent for
build/deployargv,trueforoffline
Tests
- Update assertions in
base-definition-factory.test.js,integration-builder.test.js,migration-builder.test.jsandadmin-script-builder.test.js(they assert on.include/.excludetoday) - Composer-level test: compose a fully featured definition (VPC, KMS, an integration with a webhook, a queue worker, an extension, migrations, admin scripts). Assert that no function has
package.include/package.exclude, and thatuseDotenvis neverfalse - Extend the scaffold default-infrastructure test from fix: lazy-load scheduler AWS SDK in core and repair
frigg initscaffolding #639, if it has merged, with the same assertions
Cleanup
-
packages/serverless-plugin/index.js: delete the deadasyncInit/setupOfflineQueues/createLocalStackSQSClientpath. Itsrequire('aws-sdk')(:103) is undeclared and resolves only through osls 3's SDK v2
Artifact gate 1 (expected: identical)
- Run
frigg build --stage prodon osls 3.78.0, before and after PR 1, for (a) the scaffold and (b) a featured app (integration + webhook + queue worker + migrations + admin scripts) - For each zip in
.serverless/, diff the sortedunzip -Z1and the per-file CRC fromunzip -lv. Attach the results to the PR
PR 2 — bump to osls 4.4.0
- Change
oslsto^4.4.0inpackages/devtools/package.json(devDependency) andpackages/devtools/frigg-cli/package.json(dependency); regenerate the lockfile - Use a single
frameworkVersionconstant'^4.4.0', replacingbase-definition-factory.js:169('>=3.17.0') anddomains/shared/utilities/logging-config.js:10('>=3.58.0'); update the tests - Set
engines.nodeto^22.13.0 || >=24on devtools and frigg-cli; the CLI prints a clear message when the Node version is unsupported - Leave
provider.iamRoleStatements(deprecated in osls 4, warning only). Open a follow-up issue forprovider.iam.role.statementsbefore osls 5 - Validate the composed definitions for (a) and (b) against the osls 4.4.0 schema with
configValidationMode: error
Artifact gate 2 (osls 3.78.0 vs 4.4.0, both converted)
- Per-function file-list and CRC diff for (a) and (b); every difference is explained in the PR
- Diff
cloudformation-template-update-stack.jsonafter normalising artifact hashes - Record zipped and unzipped size per function for v3 and v4 (the scratch run measured about 73 MB zipped per function with no baseline); every function stays under Lambda's 250 MB unzipped limit
Runtime checks
-
frigg starton (a) and (b):GET /health200, user create and login, integration list, one SQS message processed via serverless-offline-sqs -
frigg build --stage prodagainst moto (AWS_ENDPOINT_URL) and against real credentials - Sandbox deploy of (b):
frigg deploy --stage <sandbox>. Invoke health, auth, an integration route, a webhook, a queue worker,dlqProcessor(send a poison message), the migration router and worker, and an admin script. Then redeploy with no changes and confirm that no functions are updated -
frigg doctor <stack>on the sandbox stack is healthy, with no drift
Docs
-
docs/reference/aws-sdk-v3-osls-migration.md: replace the fix: lazy-load scheduler AWS SDK in core and repairfrigg initscaffolding #639 "Why osls 3 and not osls 4" section with osls 4 instructions and a link to ADR-050 - Write an "Upgrading to 2.0.1" note covering these customisations and their fixes:
package.include/exclude→patternsuseDotenv: false→ remove the keyframeworkVersion: '3'→^4.4.0- Service-level
package.patternsnow apply before function excludes - Plugins that use SDK v2 surfaces (
osls-aws-provider-request-shim) - Node 23 is unsupported
- Operator notes:
- Credential resolution: static keys plus
role_arnin the same profile now assume the role;mfa_serialprompts and fails in CI - Regional STS endpoints
- A leftover
AWS_ENDPOINT_URLredirects real deploys - CRC32 S3 checksums (
AWS_REQUEST_CHECKSUM_CALCULATION=WHEN_REQUIREDfor S3-compatible targets)
- Credential resolution: static keys plus
- Update the
friggskill and any doc that referencesosls ^3.x - Update
website/roadmap/data/adrs.jsonand the ADR-050 status toImplementedin PR 2 (per ADR-043)
Rollback
PR 1 is valid on osls 3, so rolling back means reverting PR 2 only. After release, 2.0.2 restores osls ^3.78.0 and a frameworkVersion range that accepts 3.x.
Metadata
Metadata
Assignees
Labels
No labels
Activity