Enforce WorkOS Vault style rules with oxlint#481
Merged
RhysSullivan merged 1 commit intomainfrom May 4, 2026
Merged
Conversation
Add seven repo-local oxlint rules scoped to packages/plugins/workos-vault/src to keep the provider's Effect-only surface, tagged-error discipline, and typed boundary patterns in place. Rules added: - no-inline-object-type-assertion - no-instanceof-tagged-error - no-manual-tag-check - no-promise-client-surface - no-raw-error-throw - no-redundant-error-factory - no-unknown-shape-probing Adapted to the existing flat scripts/oxlint-plugin-executor/utils.js layout on main; no rules already on main were duplicated. Cleanup in workos-vault to satisfy the new rules: - WorkOSVaultClientError now captures status + message at construction so callers consume typed fields instead of probing unknown causes. - Renamed exported WorkOSVaultSdk to module-private WorkOSVaultPromiseApi and removed it from the public package surface. - Replaced unwrapVaultError + inline shape probes in secret-store with direct typed access on WorkOSVaultClientError. - Introduced a named row type in secret-store.test.ts instead of an inline object type assertion.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 6e44b63 | Commit Preview URL Branch Preview URL |
May 04 2026, 03:11 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 6e44b63 | May 04 2026, 03:12 AM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/storage-core
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-google-discovery
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
RhysSullivan
added a commit
that referenced
this pull request
May 4, 2026
RhysSullivan
added a commit
that referenced
this pull request
May 4, 2026
* Add shared WorkOS Vault test client Extract the in-memory `WorkOSVaultClient` previously inlined in `apps/cloud/.../api-harness.ts` into a published subpath `@executor-js/plugin-workos-vault/testing` so other apps and downstream consumers can stand up vault-backed tests without copying the fake. `makeTestWorkOSVaultClient` matches the current Effect-shaped client surface (post v4 migration) and adds optional knobs for exercising secret-store retry paths: `conflictOnNextSecretUpdate`, `rejectNamesWithColon`, and `rejectReadNamesLongerThan`. Errors are tagged (`TestWorkOSVaultNotFoundError`/`Conflict`/`InvalidRequest`) and carry numeric `status` so the production `isStatusError` checks in `secret-store.ts` route 404/409/400 through the same paths the real SDK exercises. Re-cut from #424 against current `main`; the `mcp.ts` and contract test pieces from that PR are intentionally dropped (the audience-fallback removal landed via #429 and the contract test is out of scope for this extraction). * fixup: rename WorkOSVaultSdk -> WorkOSVaultPromiseApi after #481
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds seven repo-local oxlint rules scoped to
packages/plugins/workos-vault/src/**/*.{ts,tsx}so the provider's Effect-only surface, tagged-error discipline, and typed-boundary patterns stay enforced. Cherry-picks the rule logic from #425 and adapts the imports to the flatscripts/oxlint-plugin-executor/utils.jslayout onmain.Rules added
executor/no-inline-object-type-assertionexecutor/no-instanceof-tagged-errorexecutor/no-manual-tag-checkexecutor/no-promise-client-surfaceexecutor/no-raw-error-throwexecutor/no-redundant-error-factoryexecutor/no-unknown-shape-probingAll registered as
errorseverity under anoverridesblock targetingpackages/plugins/workos-vault/src/**/*.{ts,tsx}(matches the scope #425 used).Rules from #425 that were skipped
no-vitest-import— already onmainasexecutor/no-vitest-import.no-if-in-tests— overlaps withmain'sexecutor/no-conditional-tests. The two are not identical (the new rule blanket-bansifin tests; the existing rule bansexpect()only inside conditionals), but the existing rule is the more nuanced of the two and the WorkOS Vault tests pass under it. Adding both would double-up on the same intent, so skipping per the task brief.Source-file fixes required
The new rules apply to existing
workos-vaultsource. To make them pass:client.ts:WorkOSVaultClientErrornow capturesmessageandstatusat construction time via a small namedErrorWithStatusguard, so callers consume typed fields instead of probingunknowncauses. Renamed the exportedWorkOSVaultSdkinterface to module-privateWorkOSVaultPromiseApi(the rule forbids exposing Promise-shaped client surfaces); removed it fromindex.tsand updatedtesting.tsto import the new name.secret-store.ts: replacedunwrapVaultError+ inline shape probes ("status" in cause,(cause as { status: number }), etc.) inisStatusError,isKekNotReadyError, andformatVaultErrorwith direct typed access onWorkOSVaultClientError. Removed the now-unusedGenericServerException/NotFoundExceptionimports.secret-store.test.ts: introduced a namedVaultMetadataRowinterface instead of an inlineas { scope_id: string }cast.Validation
bun run lint— passes (Found 0 warnings and 0 errors).bun run --cwd packages/plugins/workos-vault typecheck— passes.bunx vitest run src/sdk/secret-store.test.tsfrompackages/plugins/workos-vault— 11/11 passing.Test plan
Based on #425.