Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 4 additions & 14 deletions .cursor/rules/server-errors.mdc → .cursor/rules/integ-errors.mdc
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
---
description: HTTP ErrorAndStatus handling and trust-boundary rules for server code
globs: server/**/*.go
description: Error handling and trust-boundary rules for Go integration code
globs: server-zd/integ/**/*.go
alwaysApply: false
---

# Server Error Handling

- API failures that reach Gin handlers should use
`errors.ErrorAndStatus` from `github.com/superdurable/dex/service/common/errors`
with an `dexpb.ErrorSubStatus` and HTTP status code.
- Prefer constructors `NewErrorAndStatus` /
`NewErrorAndStatusWithWorkerError` over ad-hoc status maps.
- Propagate typed API errors to the handler boundary; do not invent parallel
error envelopes for the same OpenAPI `ErrorResponse`.
- Map bad client/SDK input to 4xx + an appropriate `ErrorSubStatus`; map
infrastructure / unexpected failures to 5xx.
# Go Integration Test Errors

## Never Ignore Errors

Expand All @@ -32,5 +22,5 @@ alwaysApply: false
- Values from HTTP requests, SDK/worker payloads, and any client-settable field
are untrusted, even if marked internal.
- Validate untrusted values with an error-returning helper and return an
`InvalidInput`-style `ErrorAndStatus`. Never allow untrusted input to reach a
input error. Never allow untrusted input to reach a
`Must*` helper or panic path.
17 changes: 4 additions & 13 deletions .cursor/rules/server-go.mdc → .cursor/rules/integ-go.mdc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
description: Go implementation conventions for the Dex server
globs: server/**/*.go
description: Go conventions for the server-zd integration suite
globs: server-zd/integ/**/*.go
alwaysApply: false
---

# Server Go Conventions
# Go Integration Test Conventions

## File Ordering

Expand All @@ -23,17 +23,8 @@ Leave generated code unchanged and keep tightly coupled subsystem clusters intac

## Pointers and Naming

- Within `server/service/interpreter/`, export every component type. Helper and
value types that are not components may remain unexported.
- Export constructors and methods called by another interpreter component,
even when both components share the `interpreter` package.
- Interpreter components may use `UnifiedContext` during construction but must
not retain it. Pass the operation-scoped context explicitly to methods.
- Handle every interpreter `Await` error immediately. After a successful
`Await`, write synchronously without a redundant context check; otherwise
check the context before mutating state.
- Use `ptr.Any(value)` for pointer literals. Import
`github.com/superdurable/dex/service/common/ptr`.
`github.com/superdurable/dex/sdk-go/dex/ptr`.
- Give numeric literals explicit types, such as `ptr.Any(int64(0))`.
- Do not use `ptr.Any` when the pointer must alias a named variable used elsewhere.
- Do not call `proto.Clone` (or other defensive deep copies) "just in case".
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
---
description: Server test execution and async test conventions
globs: server/**/*
description: Go integration test execution and async test conventions
globs: server-zd/integ/**/*
alwaysApply: false
---

# Server Testing
# Go Integration Testing

## Execution

- After every code change, run tests through the Makefile, never bare `go test`
for full suites.
- Always tee output:
`make -C server <target> 2>&1 | tee /tmp/test-<scope>.log`.
- Targets: `unitTests` for unit tests; `integTests` / `temporalIntegTests` /
`cadenceIntegTests` for integration; `ci-all-tests` for the CI matrix.
`make -C server-zd/integ <target> 2>&1 | tee /tmp/test-<scope>.log`.
- Targets: `compile`; `zdIntegTests`; `zdAttributeSyncIntegTests` for PostgreSQL integration.
- Fix all failures. After multiple unsuccessful attempts, report the failure,
attempted fixes, and exact blocker.

## Do Not Casually Skip Failing Tests

- Never skip, gate, or early-return around a failing assertion just to make the
suite green (e.g. `if backend == Cadence { return }` / `t.Skip` for a known
suite green (e.g. `t.Skip` for a known
flake) unless the user explicitly asks to skip.
- When a test fails: add targeted logs, dump Temporal/Cadence workflow history
(and relevant query/describe output), identify the root cause, then fix
- When a test fails: add targeted logs, inspect server-zd logs
(and relevant API output), identify the root cause, then fix
product code or the test expectation.
- Backend-specific skips need a proven platform limitation plus user agreement;
prefer fixing Reset/query/retry behavior over hiding the path.

## Isolation and Async

- Prefer package-level isolation so tests can run in parallel across packages.
- Use unique workflow IDs / namespaces per test when sharing a Temporal/Cadence
stack.
- Use unique workflow IDs / namespaces per test when sharing a server-zd
instance.
- Use `require.Eventually` or polling for convergence. Do not use `time.Sleep`
except inside the behavior under test.
- Put expensive shared setup (docker stacks, shared workers) in `TestMain` when
Expand Down
4 changes: 1 addition & 3 deletions .cursor/rules/planning.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ Every implementation plan must include all three sections below. Use
## Tests

- List specific integration and E2E scenarios and why each is needed.
- Default to integration tests in `server/integ/` and the relevant SDK integ
- Default to integration tests in `server-zd/integ/` and the relevant SDK integ
suites (`sdk-go/integ/`, Java/Python test stacks).
- Do not propose unit tests unless explicitly requested or the edge case cannot
be reached through integration/E2E paths.
- Cluster or multi-backend features should cover Temporal and Cadence when both
are affected.

## Documentation

Expand Down
15 changes: 1 addition & 14 deletions .cursor/rules/project-core.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ alwaysApply: true

# Dex Project Rules

Dex is a durable workflow framework: Go server (`server/`), OpenAPI IDL
Dex is a durable workflow framework: Rust server (`server-zd/`), OpenAPI IDL
(`protos/`), and SDKs/samples for Go, Java, and Python. See `README.md` for the
module map.

Expand Down Expand Up @@ -60,17 +60,6 @@ The docs site shell (navbar and footer in `docs/docusaurus.config.ts` and their
zh-Hans translations) may link to company product pages. Content pages must
still not describe downstream products.

## Temporal Skill Routing

- In this repository, use the `temporal-developer` skill only when changing or
diagnosing `server/service/interpreter/**` requires Temporal runtime or SDK
semantics.
- Do not use it for other modules, SDKs, examples, docs, routine integration
tests, or merely because Temporal, workflow, signal, query, worker,
heartbeat, or `temporalIntegTests` is mentioned.
- An explicit user request to use `temporal-developer` overrides this
restriction.

## Dex SDK Skill Routing

- Before changing or reviewing `examples/**`, application code snippets in
Expand Down Expand Up @@ -144,8 +133,6 @@ backend and its configuration.
- Preserve existing comments verbatim during refactors and move them with their
code. If one becomes stale, update only outdated references while retaining
every original detail and meaning.
- The new-comment rules do not apply to `server/config/`; configuration comments
should favor complete operational semantics.
- Comments documenting function or method return values are exempt from the
20-word limit and should describe complete return semantics.
- Public SDK API documentation is exempt from the short-comment and
Expand Down
2 changes: 1 addition & 1 deletion .cursor/rules/server-zd.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ alwaysApply: false
- Local tests use the in-process s3mock or the in-memory object store, never
MinIO.

### server-zd Rust conventions ported from the Server Go rules
### server-zd Rust conventions ported from the Go rules

These rules restate the applicable Server Go rules for `server-zd/**`. The
Rust table (R1–R19) still applies.
Expand Down
4 changes: 0 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
cli/dexcli
bin/dexcli-tls-darwin-arm64
cli/internal/command/testfixtures/registered-type-names/mainpackage/mainpackage
server/dex-server
web/node_modules/
web/assets/dist/
web/large-step-graph
Expand Down Expand Up @@ -39,8 +38,5 @@ sdk-java/publication-smoke-test/target/
sdk-typescript/coverage/
sdk-python/coverage/
sdk-go/coverage/
server/coverage/
server/coverage-raw/
server/all-in-one/bin/
script/licenseheaders/copyright/copyright
web/dex-web
9 changes: 0 additions & 9 deletions .github/scripts/dump-docker-logs.sh

This file was deleted.

37 changes: 15 additions & 22 deletions .github/workflows/check-gate-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ jobs:
if: github.event_name == 'pull_request'
with:
filters: |
server:
# Any-pattern matching makes a negation match every other file; use an extglob.
- 'server/*'
- 'server/!(all-in-one)/**'
- 'protos/**'
- '.github/scripts/dump-docker-logs.sh'
- '.github/workflows/server-ci.yml'
server_all_in_one:
- 'server/**'
- 'protos/**'
- '.github/workflows/server-all-in-one-ci.yml'
sdk_go:
- 'sdk-go/**'
- 'blob-cache-go/**'
Expand Down Expand Up @@ -142,18 +131,29 @@ jobs:
- 's3mock/**'
- 'protos/**'
- '.github/workflows/server-zd-ci.yml'
server_zd_integ:
- 'sdk-go/**'
- 'server-zd/**'
- 'protos/**'
- '.github/workflows/server-zd-integ-ci.yml'
server_zd_simulation_runner:
- 'script/server-zd-simulation-run.py'
- 'script/test_server_zd_simulation_run.py'
- '.github/workflows/server-zd-simulation-nightly.yml'
- '.github/workflows/server-zd-simulation-runner-ci.yml'
- 'Makefile'
server_zd_image:
- 'server-zd/LICENSE.md'
- 'server-zd/LEGACY_NOTICES.md'
- 'server-zd/LICENSES/**'
- 'server-zd/Dockerfile'
- '.dockerignore'
- '.github/workflows/server-zd-image-release.yml'
- '.github/workflows/server-zd-image-main.yml'
server_zd_binary:
- 'server-zd/LICENSE.md'
- 'server-zd/LEGACY_NOTICES.md'
- 'server-zd/LICENSES/**'
- '.github/workflows/server-zd-binary-release.yml'
server_zd_minio:
- '.github/workflows/server-zd-minio-nightly.yml'
Expand All @@ -163,7 +163,6 @@ jobs:
- 'examples/entity-store/**'
generated_code:
- 'protos/**'
- 'server/gen/dexpb/**'
- 'sdk-go/gen/dexpb/**'
- 'sdk-java/src/main/java/io/superdurable/gen/**'
- 'sdk-python/dex/dexpb/**'
Expand All @@ -184,7 +183,6 @@ jobs:
- 'skills/**'
- '.github/workflows/skills-ci.yml'
copyright:
- 'server/**'
- 'cli/**'
- 'sdk-go/**'
- 'sdk-java/**'
Expand Down Expand Up @@ -212,8 +210,6 @@ jobs:
REPO: ${{ github.repository }}
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
EVENT_NAME: ${{ github.event_name }}
FILTER_SERVER: ${{ steps.filter.outputs.server }}
FILTER_SERVER_ALL_IN_ONE: ${{ steps.filter.outputs.server_all_in_one }}
FILTER_SDK_GO: ${{ steps.filter.outputs.sdk_go }}
FILTER_SDK_RUST: ${{ steps.filter.outputs.sdk_rust }}
FILTER_SDK_JAVA: ${{ steps.filter.outputs.sdk_java }}
Expand All @@ -227,6 +223,7 @@ jobs:
FILTER_EXAMPLES_RUST: ${{ steps.filter.outputs.examples_rust }}
FILTER_S3MOCK: ${{ steps.filter.outputs.s3mock }}
FILTER_SERVER_ZD: ${{ steps.filter.outputs.server_zd }}
FILTER_SERVER_ZD_INTEG: ${{ steps.filter.outputs.server_zd_integ }}
FILTER_SERVER_ZD_SIMULATION_RUNNER: ${{ steps.filter.outputs.server_zd_simulation_runner }}
FILTER_SERVER_ZD_IMAGE: ${{ steps.filter.outputs.server_zd_image }}
FILTER_SERVER_ZD_BINARY: ${{ steps.filter.outputs.server_zd_binary }}
Expand Down Expand Up @@ -260,16 +257,13 @@ jobs:
"Rust SDK CI"
"TypeScript SDK CI"
"S3mock CI"
"Server CI"
"Server ZD CI"
"Server Integration against server-zd"
"Server ZD Simulation Runner CI"
"Server All-in-One CI"
"Web CI"
)
else
expected+=("CLA")
[[ "$FILTER_SERVER" == "true" ]] && expected+=("Server CI")
[[ "$FILTER_SERVER_ALL_IN_ONE" == "true" ]] && expected+=("Server All-in-One CI")
[[ "$FILTER_SDK_GO" == "true" ]] && expected+=("Go SDK CI")
[[ "$FILTER_SDK_RUST" == "true" ]] && expected+=("Rust SDK CI")
[[ "$FILTER_SDK_JAVA" == "true" ]] && expected+=("Java SDK CI")
Expand All @@ -283,6 +277,7 @@ jobs:
[[ "$FILTER_EXAMPLES_RUST" == "true" ]] && expected+=("Rust examples CI")
[[ "$FILTER_S3MOCK" == "true" ]] && expected+=("S3mock CI")
[[ "$FILTER_SERVER_ZD" == "true" ]] && expected+=("Server ZD CI")
[[ "$FILTER_SERVER_ZD_INTEG" == "true" ]] && expected+=("Server Integration against server-zd")
[[ "$FILTER_SERVER_ZD_SIMULATION_RUNNER" == "true" ]] && expected+=("Server ZD Simulation Runner CI")
[[ "$FILTER_SERVER_ZD_IMAGE" == "true" ]] && expected+=("Server ZD image release")
[[ "$FILTER_SERVER_ZD_BINARY" == "true" ]] && expected+=("Server ZD binary release")
Expand All @@ -294,7 +289,7 @@ jobs:
[[ "$FILTER_COPYRIGHT" == "true" ]] && expected+=("Copyright")
fi

# ci:fast-merge stops the existing Temporal/Cadence engine, SDK, CLI, Web, and examples
# ci:fast-merge stops the SDK, CLI, Web, and examples
# suites from blocking the merge. They still run on the pull request and on main.
# The SDK suites on server-zd are non-blocking too; Server ZD CI still blocks.
if [[ "$EVENT_NAME" == "pull_request" && "$IS_FAST_MERGE" == "true" ]]; then
Expand All @@ -306,8 +301,6 @@ jobs:
"Python SDK CI"
"Rust SDK CI"
"TypeScript SDK CI"
"Server CI"
"Server All-in-One CI"
"Web CI"
"Go examples CI"
"Java examples CI"
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/cli-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
cache-dependency-path: |
cli/go.sum
web/go.sum
server/go.sum
- name: Resolve version
id: version
shell: bash
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/copyright-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [main]
paths:
- "server/**"
- "cli/**"
- "sdk-go/**"
- "blob-cache-go/**"
Expand All @@ -30,7 +29,6 @@ on:
- ".github/workflows/copyright-ci.yml"
pull_request:
paths:
- "server/**"
- "cli/**"
- "sdk-go/**"
- "blob-cache-go/**"
Expand Down
Loading
Loading