Skip to content

chore(deps): upgrade to @webiny/di 2.0 and @webiny/stdlib 0.0.21 - #5969

Merged
adrians5j merged 1 commit into
nextfrom
chore/webiny-di-2
Oct 9, 2026
Merged

adrians5j merged 1 commit into
nextfrom
chore/webiny-di-2

Conversation

@adrians5j

@adrians5j adrians5j commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

What

Why the two fixes

@webiny/di 2.0 builds a singleton from the view of the container that holds its registration. Before, it was built from whichever child container resolved it first. Two root singletons relied on that to get something registered per request:

Provider Needs (registered per request) On 2.0 as a singleton
CognitoIdentityProvider optional CognitoIdpConfig, from extensions such as Entra ID Silently undefined. Custom getIdentity and verifyTokenClaims are skipped, and the identity falls back to the Cognito sub.
SelfHostedJwtIdentityProvider TokenIssuer → BuildParams (the signing secret) Every authenticated self-hosted request throws "No registration found for BuildParams".

Neither provider holds any state. They only read env vars and build params. So inContainerScope() costs nothing: they stay registered in the root but are built per request, from the request container.

The new tests reproduce both failures on 2.0 with inSingletonScope() and pass with the fix:

  • packages/cognito/__tests__/cognitoIdpConfig.test.ts;
  • packages/self-hosted-auth/__tests__/selfHostedIdpRequestContainer.test.ts.

How I looked for other breaks

I scanned every singleton registered in the root by the AWS (DDB, DDB+OpenSearch) and standalone (SQL) handlers for dependencies that only exist per request. Only these two break.

  • The rest depend only on root registrations: schema, encryption-key and JWKS caches, OpenSearch operators, SQL table managers, the websocket connection manager.
  • No Webiny code registers a per-request decorator on a root singleton, so 2.0's new "Cannot apply decorator" error doesn't fire.
  • One weaker case is left as is. The OpenSearch operator and index registries are root singletons. An operator registered by a user extension (per request) wouldn't be included, but that isn't new in 2.0, and nothing in the repo does it.

Why stdlib had to move too

stdlib's abstractions were typed against its own @webiny/di 1.x. TypeScript treats 1.x and 2.x Abstractions as different types, so api-sync-to-opensearch failed to build until stdlib moved to 2.0. The lockfile now has a single @webiny/di 2.0.0.

This also brings in stdlib 0.0.18 to 0.0.20, which Webiny hadn't picked up. 0.0.18 changed several void returns to Result (DirectoryTool.create, FileTool.writeFile, …). The full build passes, so none of Webiny's call sites were affected.

Safety for existing projects

Published Webiny packages declare @webiny/di ^1.1.0 and @webiny/stdlib ^0.0.17:

  • ^1.1.0 never matches 2.x;
  • ^0.0.17 matches only 0.0.17.

So existing projects can't pick up either new version by accident. They get both, together with these two fixes, when they upgrade Webiny.

Tests (local)

  • The full build passes, and adio, format, lint and sync-dependencies are clean.
  • cognito 14, self-hosted-auth 107, DDB handler tests 5.
  • api-core: 267 on DDB and 267 on SQL.
  • CMS storage: api-headless-cms-ddb 43, api-headless-cms-sql 4.
  • Full api-headless-cms on DDB: 320 files, 1,041 tests.
  • api-sync-to-opensearch 4, api-sync-pg-to-opensearch 6.
  • Full api-headless-cms on SQL: 320 files, 1,041 tests.
  • api-aco: 124 tests.
  • Not run locally: the DDB+OpenSearch variants. There's no OpenSearch here.

Follow-ups

Workspace: wby-next11 · STORAGE PER REQ

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Authentication providers now correctly use settings supplied for each request, including Cognito identity details and self-hosted signing secrets.

@webiny/di 2.0 builds a singleton from the view of the container that holds
its registration, instead of from whichever child container resolved it
first. Two root singletons relied on the old behaviour to pick up something
registered per request:

- CognitoIdentityProvider took its optional CognitoIdpConfig (e.g. Entra ID)
  from extensions; on 2.0 it would silently get undefined.
- SelfHostedJwtIdentityProvider's TokenIssuer reads the signing secret from
  BuildParams; on 2.0 every authenticated self-hosted request would throw
  "No registration found for BuildParams".

Both hold no state, so both are now registered with inContainerScope(): still
in the root, but built per request from the request container.

@webiny/stdlib 0.0.21 is the release that moves stdlib to @webiny/di 2.0;
with 1.x, its abstractions don't type-check against 2.0 containers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

🚓 Slop Cop

✅ Nothing worth flagging. The diff looks consistent with the PR's stated intent and the code-style rules.

Coherent dependency bump PR: version strings updated across 74 package.json files plus yarn.lock, with two deliberate, well-justified inContainerScope() fixes and matching regression tests; nothing suggests accidental content or style violations.

Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push.

@adrians5j

Copy link
Copy Markdown
Member Author

/vitest

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Vitest tests have been initiated (for more information, click here). ✨

Group Status
No storage ✅ 74/74 passed
DDB ✅ 17/17 passed
DDB+OS ✅ 19/19 passed
SQL ✅ 12/12 passed
PGlite ✅ 12/12 passed

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24fd126d-f353-4d3e-967a-d9789286f083

📥 Commits

Reviewing files that changed from the base of the PR and between 3fac87f and cefb18b.


⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

📒 Files selected for processing (77)
  • package.json
  • packages/ai-powerups/package.json
  • packages/api-aco/package.json
  • packages/api-audit-logs/package.json
  • packages/api-core-testing/package.json
  • packages/api-core/package.json
  • packages/api-event-handler-aws-ddb-os/package.json
  • packages/api-event-handler-aws-ddb/package.json
  • packages/api-event-handler-aws/package.json
  • packages/api-event-handler-core/package.json
  • packages/api-event-handler-standalone-sql/package.json
  • packages/api-event-handler-standalone/package.json
  • packages/api-file-manager-aco/package.json
  • packages/api-file-manager-s3/package.json
  • packages/api-file-manager/package.json
  • packages/api-graphql/package.json
  • packages/api-headless-cms-aco/package.json
  • packages/api-headless-cms-bulk-actions-aws/package.json
  • packages/api-headless-cms-bulk-actions-standalone/package.json
  • packages/api-headless-cms-bulk-actions/package.json
  • packages/api-headless-cms-ddb-es/package.json
  • packages/api-headless-cms-ddb/package.json
  • packages/api-headless-cms-pg-os/package.json
  • packages/api-headless-cms-sql/package.json
  • packages/api-headless-cms-storage/package.json
  • packages/api-headless-cms-testing/package.json
  • packages/api-headless-cms/package.json
  • packages/api-mailer/package.json
  • packages/api-opensearch/package.json
  • packages/api-record-locking/package.json
  • packages/api-scheduler-aws/package.json
  • packages/api-sync-ddb-to-opensearch/package.json
  • packages/api-sync-pg-to-opensearch/package.json
  • packages/api-sync-to-opensearch/package.json
  • packages/api-website-builder-scheduler/package.json
  • packages/api-website-builder/package.json
  • packages/api-websockets-aws/package.json
  • packages/api-websockets-sql/package.json
  • packages/api-websockets/package.json
  • packages/app-aco/package.json
  • packages/app-admin-ui/package.json
  • packages/app-admin/package.json
  • packages/app-file-manager/package.json
  • packages/app-graphql-playground/package.json
  • packages/app-headless-cms/package.json
  • packages/app-serverless-cms/package.json
  • packages/app-website-builder/package.json
  • packages/app/package.json
  • packages/background-tasks-aws/package.json
  • packages/background-tasks-standalone/package.json
  • packages/background-tasks/package.json
  • packages/build-tools/package.json
  • packages/cli-aws/package.json
  • packages/cli-core/package.json
  • packages/cli-standalone/package.json
  • packages/cognito/__tests__/cognitoIdpConfig.test.ts
  • packages/cognito/src/api/features/CognitoIdp/feature.ts
  • packages/db-dynamodb/package.json
  • packages/db-utils/package.json
  • packages/event-handler-aws/package.json
  • packages/event-handler-core/package.json
  • packages/event-handler-standalone/package.json
  • packages/feature/package.json
  • packages/frontend-settings/package.json
  • packages/handler/package.json
  • packages/languages/package.json
  • packages/project-aws/package.json
  • packages/project-standalone/package.json
  • packages/project/package.json
  • packages/self-hosted-auth/__tests__/selfHostedIdpRequestContainer.test.ts
  • packages/self-hosted-auth/package.json
  • packages/self-hosted-auth/src/api/features/SelfHostedIdp/feature.ts
  • packages/tenant-manager/package.json
  • packages/webhooks/package.json
  • scripts/buildPackages/package.json
  • scripts/cli/package.json
  • scripts/prepublishOnly/package.json

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.



📝 Walkthrough

Walkthrough

Package manifests update @webiny/di and @webiny/stdlib version ranges. Cognito and self-hosted identity provider registrations change to container scope, with tests covering configuration in request child containers.

Changes

Dependency updates and request-container identity providers

Layer / File(s) Summary
Update dependency ranges
package.json, packages/*/package.json, scripts/*/package.json
Manifests update @webiny/di from ^1.1.0 to ^2.0.0 and @webiny/stdlib from ^0.0.17 to ^0.0.21 where listed.
Resolve identity providers from request containers
packages/cognito/src/api/features/CognitoIdp/feature.ts, packages/cognito/__tests__/cognitoIdpConfig.test.ts, packages/self-hosted-auth/src/api/features/SelfHostedIdp/feature.ts, packages/self-hosted-auth/__tests__/selfHostedIdpRequestContainer.test.ts
Both provider registrations change from singleton scope to container scope. Tests register provider configuration in a request child container and verify the resolved identity provider uses it.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: brunozoric


Merge Risk: ⚪ Minimal · up to cefb1

This upgrades the dependency injection library and makes the Cognito and self-hosted identity providers resolve configuration from the request container. No concrete merge-blocking risk is evident from the supplied context. The author's reported validation should be confirmed with CI, including the SQL and OpenSearch suites that were not run locally.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely summarizes the main dependency upgrades: @webiny/di 2.0 and @webiny/stdlib 0.0.21.


✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant