build: migrate effect v3 → v4 (beta.103) - #747
Conversation
Migrate all packages from effect@^3.20 to effect@4.0.0-beta.103. Key changes: - Replace Micro with Effect throughout oidc-client and davinci-client - Migrate Either to Result in sdk-utilities and journey-client - Migrate MicroExit/exitIsFail/exitIsSuccess to Exit/Cause API - Update e2e/mock-api-v2 from @effect/platform to effect/unstable/httpapi - Bump vitest catalog to ^4.1.0 to match @effect/vitest peer requirement - Remove consolidated packages: @effect/platform, @effect/cli - Fix handleMicroExit → handleExit (renamed) - Add vi.clearAllMocks() to oidc-client afterEach (accumulated mock counts)
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (58)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
View your CI Pipeline Execution ↗ for commit 0f15944
💡 Dealing with memory or CPU issues? See memory and CPU details with the resource usage add-on ↗. ☁️ Nx Cloud last updated this comment at |
Effect.sleep in v4 beta.103 hangs in Vite-bundled browser environments due to ClockRef/withFiber/clockWith indirection chain. Replace with delayMs helper using Effect.callback + plain setTimeout to match v3 Micro.sleep behavior. Also fix: - pollStatus: use Effect.runPromiseExit(effect) direct call (not pipe) - pollStatus: add Cause.squash fallback for defect errors - password-policy.rules.ts: Result.failVoid → Result.fail(undefined)
There was a problem hiding this comment.
Nx Cloud has identified a possible root cause for your failed CI:
This CI failure appears to be related to the environment or external dependencies rather than your code changes.
No code changes were suggested for this issue.
Trigger a rerun:
🎓 Learn more about Self-Healing CI on nx.dev
Summary
Migrates the entire SDK from
effect@^3.20(v3) toeffect@4.0.0-beta.103(v4 beta).Changes by package
pnpm-workspace.yaml(catalog)effect: '4.0.0-beta.103'@effect/vitest: '4.0.0-beta.103'@effect/platform-node: '4.0.0-beta.103'@effect/platformand@effect/cli(consolidated intoeffectcore)vitestcatalog to^4.1.0packages/sdk-utilitiesmicro.utils.ts:MicroExit/exitIsFail/exitIsSuccess/causeIsDie→Exit/Cause; renamedhandleMicroExit→handleExitconfig.types/utils/effects/test:Either→Result(succeed/fail/isSuccess/isFailure)packages/journey-clientjourney.utils.ts:Either.right/left→Result.succeed/failclient.store.ts:Either.match→Result.match(onFailure/onSuccess)_tag: 'Right'/'Left'→'Success'/'Failure';.right/.left→.success/.failurepackages/oidc-client(12 files)Micro.*→Effect.*Cause.failureOption→Cause.findErrorOption(returnsOption<E>)exitIsFail(exit)→Cause.findErrorOption(exit.cause)+Option.isSomevi.clearAllMocks()inafterEachto fix accumulated mock call countspackages/davinci-client(5 files)Micro.*→Effect.*Effect.repeat({while})→Effect.gen+ manual loop (v4whilereceives schedule output type, not effect output)password-policy.rules.ts:Array.filterMapnow expectsResultcallbacks;Option.some/none()→Result.succeed/failVoidContext.Tag→Context.Servicee2e/mock-api-v2(full migration)from '@effect/platform'→from 'effect/unstable/httpapi'Context.Tag→Context.ServiceEffect.if→Effect.suspend(() => bool ? ... : ...)Option.fromNullable→Option.fromNullishOrSchema.Union(a, b)→Schema.Union([a, b])Schema.Record({key, value})→Schema.Record(key, value)Schema.Schema<T, T>→Schema.Schema<T>HttpApiMiddleware.Tag→HttpApiMiddleware.Service<Self, {provides: T}>()nxBuild→buildVerification
Summary by CodeRabbit
Bug Fixes
Improvements
Tests