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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ command is ported.
| `env:list`, `env:set`, `env:use`, `env:show`, `env:delete` | Ported |
| `server:health`, `server:info` (and `cluster:info`) | Ported |
| Compatibility preflight, session and `--version` warnings, exit 8 refusals | Ported |
| `server:start-dev`: local Laravel launch, Compose prerequisites and Unix signal cleanup | Ported |
| `server:start-dev`: built-in native Server, SQLite, private persistent data and shutdown | No external runtime or separate Server installation |
| `runtime:check`: native build identity and compilation target | Ported, intentional output/help difference |
| `doctor`: redacted connection sources, server metadata, warnings and next steps | Ported |
| `workflow:list`: one namespace/page, filters, Server envelopes, JSON and JSONL | Ported |
Expand All @@ -46,8 +46,9 @@ command is ported.
| `task-queue:pause-activities`, `task-queue:resume-activities`, `task-queue:activity-dispatch`: pause, resume and read activity dispatch on one task queue (Server #577), one request each after checking cluster info for `capabilities.task_queue_activity_dispatch_pause`; `task-queue:describe` and `task-queue:list` show the state when the Server reports it | Rust-only, new |
| `workflow:update-outcome`: read an update's outcome later by its update ID (Server #1131, durable-workflow/.github#212), one GET after checking cluster info for `capabilities.update_outcome_reads`; pending, completed (including a null result), failed (exit 2), rejected and `update_not_found` (exit 5) are reported distinctly, and the update is never sent again. `workflow:update` points an unfinished update at it when the Server advertises the capability | Rust-only, new |

Server calls go through the published `durable-workflow` crate, pinned to
the latest qualified release.
Server calls go through the `durable-workflow` crate. The unreleased native
development Server also links the Server library; exact dependency revisions
are recorded in `Cargo.toml` and `Cargo.lock`.

`workflow:list-runs` sends its workflow ID as one percent-encoded SDK path
segment. IDs containing slashes, query delimiters or fragments stay within
Expand Down
105 changes: 96 additions & 9 deletions rust/parity/cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,30 @@
"name": "unknown command in a known namespace",
"argv": [
"env:nope"
]
],
"expected_difference": {
"*": {
"fields": [
"stderr"
],
"reason": "Qualified command typos prioritize the nearest name in the requested namespace (cli#159)."
}
}
},
{
"name": "typo with several suggestions",
"argv": [
"env:lst",
"-n"
]
],
"expected_difference": {
"*": {
"fields": [
"stderr"
],
"reason": "Qualified command typos prioritize the nearest name in the requested namespace (cli#159)."
}
}
},
{
"name": "typo with one suggestion, no interaction",
Expand Down Expand Up @@ -617,11 +633,27 @@
"name": "list",
"argv": [
"list"
]
],
"expected_difference": {
"*": {
"fields": [
"stdout_text"
],
"reason": "Human command discovery begins with six common commands and connection guidance (cli#159)."
}
}
},
{
"name": "no arguments lists commands",
"argv": []
"argv": [],
"expected_difference": {
"*": {
"fields": [
"stdout_text"
],
"reason": "Human command discovery begins with six common commands and connection guidance (cli#159)."
}
}
},
{
"name": "list one namespace",
Expand Down Expand Up @@ -670,7 +702,15 @@
},
"argv": [
"env:nope"
]
],
"expected_difference": {
"*": {
"fields": [
"stderr"
],
"reason": "Qualified command typos prioritize the nearest name in the requested namespace (cli#159)."
}
}
},
{
"name": "server:info json",
Expand Down Expand Up @@ -899,7 +939,15 @@
"argv": [
"workflow:start",
"--help"
]
],
"expected_difference": {
"*": {
"fields": [
"stdout_text"
],
"reason": "Human workflow:start help puts its first example and common controls before advanced options (cli#159)."
}
}
},
{
"name": "help for a command with array options",
Expand Down Expand Up @@ -947,7 +995,15 @@
"argv": [
"help",
"env:lst"
]
],
"expected_difference": {
"*": {
"fields": [
"stderr"
],
"reason": "Qualified command typos prioritize the nearest name in the requested namespace (cli#159)."
}
}
},
{
"name": "help without a command",
Expand Down Expand Up @@ -1215,7 +1271,15 @@
"argv": [
"list",
"--ansi"
]
],
"expected_difference": {
"*": {
"fields": [
"stdout_text"
],
"reason": "Human command discovery begins with six common commands and connection guidance (cli#159)."
}
}
},
{
"name": "ansi version",
Expand Down Expand Up @@ -1294,7 +1358,15 @@
"argv": [
"list",
"--no-ansi"
]
],
"expected_difference": {
"*": {
"fields": [
"stdout_text"
],
"reason": "Human command discovery begins with six common commands and connection guidance (cli#159)."
}
}
},
{
"name": "quiet command",
Expand Down Expand Up @@ -22765,6 +22837,21 @@
"--json"
],
"server": true
},
{
"name": "workflow typo prioritizes its own list command",
"argv": [
"workflow:lst",
"-n"
],
"expected_difference": {
"*": {
"fields": [
"stderr"
],
"reason": "workflow:lst suggests workflow:list first while preserving the lookup failure and noninteractive behavior (cli#159)."
}
}
}
]
}
6 changes: 6 additions & 0 deletions rust/parity/catalog-updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,12 @@
}
}
},
"workflow:start": {
"help": {
"reference": "Start a workflow by type. The server accepts JSON input, memo, and\nsearch attributes. With <comment>--wait</comment> the command blocks until\nthe workflow reaches a terminal state and exits with\n<comment>SUCCESS (0)</comment> on completion or <comment>FAILURE (1)</comment> on\nfailure / cancellation / termination.\n\nStart commands are deduped by <comment>workflow_command_id</comment>. If the\ncaller retries after a network error it must send the same command id so\nthe engine recognises the retry. The <comment>--duplicate-policy</comment>\noption controls what happens when a second start targets an existing\n<comment>workflow_instance_id</comment> (e.g. <comment>reject_duplicate</comment>\nreturns a duplicate outcome, <comment>return_existing_active</comment>\nreturns the existing active run's identity).\n\nThe new run is pinned to the starter process's compatibility marker\n(<comment>DW_V2_CURRENT_COMPATIBILITY</comment>) exactly once at start. Retry\nruns, continue-as-new runs, and child workflows inherit that marker so the\nrun stays inside one compatibility family for its whole lifecycle. Only\nworkers whose <comment>DW_V2_SUPPORTED_COMPATIBILITIES</comment> set includes\nthe run's marker (or the workers-only <comment>*</comment> wildcard) will\nclaim the run's tasks; any other worker rejects the claim at claim time\nwith <comment>compatibility_blocked</comment> or\n<comment>compatibility_unsupported</comment> and the task stays on the queue\nfor a compatible worker to pick up.\n\n<comment>Examples:</comment>\n\n # Start with no input\n <info>dw workflow:start --type=orders.Checkout</info>\n\n # Start with JSON input and a custom workflow id\n <info>dw workflow:start -t orders.Checkout -w chk-42 -i '{\"order_id\":42}'</info>\n\n # Start, then wait for terminal state\n <info>dw workflow:start -t orders.Checkout -i '{\"order_id\":42}' --wait</info>\n\n # Start with search attributes for visibility filters\n <info>dw workflow:start -t orders.Checkout --search-attr env=prod --search-attr tier=gold</info>",
"candidate": "Start a workflow by type. The server accepts JSON input, memo, and\nsearch attributes. With <comment>--wait</comment> the command blocks until\nthe workflow reaches a terminal state and exits with\n<comment>SUCCESS (0)</comment> on completion or <comment>FAILURE (1)</comment> on\nfailure / cancellation / termination.\n\n<comment>Examples:</comment>\n\n # Start with no input\n <info>dw workflow:start --type=orders.Checkout</info>\n\n # Start with JSON input and a custom workflow id\n <info>dw workflow:start -t orders.Checkout -w chk-42 -i '{\"order_id\":42}'</info>\n\n # Start, then wait for terminal state\n <info>dw workflow:start -t orders.Checkout -i '{\"order_id\":42}' --wait</info>\n\n # Start with search attributes for visibility filters\n <info>dw workflow:start -t orders.Checkout --search-attr env=prod --search-attr tier=gold</info>\n\n # Print the start response as JSON\n <info>dw workflow:start --type=orders.Checkout --output=json</info>\n\nUse <comment>--output=json</comment> for JSON. <comment>--json</comment> is its alias.\n\n<comment>Advanced behavior:</comment>\n\nStart commands are deduped by <comment>workflow_command_id</comment>. If the\ncaller retries after a network error it must send the same command id so\nthe engine recognises the retry. The <comment>--duplicate-policy</comment>\noption controls what happens when a second start targets an existing\n<comment>workflow_instance_id</comment> (e.g. <comment>reject_duplicate</comment>\nreturns a duplicate outcome, <comment>return_existing_active</comment>\nreturns the existing active run's identity).\n\nThe new run is pinned to the starter process's compatibility marker\n(<comment>DW_V2_CURRENT_COMPATIBILITY</comment>) exactly once at start. Retry\nruns, continue-as-new runs, and child workflows inherit that marker so the\nrun stays inside one compatibility family for its whole lifecycle. Only\nworkers whose <comment>DW_V2_SUPPORTED_COMPATIBILITIES</comment> set includes\nthe run's marker (or the workers-only <comment>*</comment> wildcard) will\nclaim the run's tasks; any other worker rejects the claim at claim time\nwith <comment>compatibility_blocked</comment> or\n<comment>compatibility_unsupported</comment> and the task stays on the queue\nfor a compatible worker to pick up."
}
},
"server:start-dev": {
"description": {
"reference": "Serve an existing Laravel project for local development",
Expand Down
5 changes: 5 additions & 0 deletions rust/parity/parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,11 @@ def help_cases():
"fields": ["stdout_text"],
"reason": "The help accurately describes one Server response page and an unconsumed cursor (cli#113).",
}}
if case["argv"][0] == "workflow:start":
case["expected_difference"] = {"*": {
"fields": ["stdout_text"],
"reason": "Human workflow:start help puts its first example and common controls before advanced options (cli#159).",
}}
if case["argv"][0] == "workflow:signal":
# --request-id is PHP main's (cli#61); published 2.3.5 lacks it.
case["reference"] = "php-main"
Expand Down
15 changes: 15 additions & 0 deletions rust/parity/test_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,21 @@ def normalize(value, side, descriptions=None):
self.assertEqual({"result": "after"}, normalize({"result": "after"}, "candidate"))


class HumanHelpDifferenceScopeTest(unittest.TestCase):
def test_display_changes_cannot_hide_exit_json_or_config_regressions(self):
with open(parity.CASES, encoding="utf-8") as handle:
cases = json.load(handle)["cases"] + parity.help_cases()
for case in cases:
expected = case.get("expected_difference", {}).get("*", {})
if "cli#159" not in expected.get("reason", ""):
continue
fields = expected["fields"]
self.assertIn(fields, [["stdout_text"], ["stderr"]])
self.assertIsNotNone(parity.intentional_reason(case, fields))
for extra in ["exit_code", "stdout_json", "config", "stderr_category"]:
self.assertIsNone(parity.intentional_reason(case, [*fields, extra]))


class PhpMainReferenceTest(unittest.TestCase):
def setUp(self):
self.directories = list(parity.BIN_DIRECTORIES)
Expand Down
2 changes: 1 addition & 1 deletion rust/src/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -14467,7 +14467,7 @@
"synopsis": "workflow:start [-s|--server [SERVER]] [--namespace [NAMESPACE]] [--token [TOKEN]] [--tls-verify TLS-VERIFY] [--env ENV] [--output OUTPUT] [-t|--type TYPE] [-w|--workflow-id [WORKFLOW-ID]] [--business-key [BUSINESS-KEY]] [--task-queue [TASK-QUEUE]] [--duplicate-policy [DUPLICATE-POLICY]] [--memo [MEMO]] [--search-attr [SEARCH-ATTR]] [--execution-timeout EXECUTION-TIMEOUT] [--run-timeout RUN-TIMEOUT] [--priority PRIORITY] [--fairness-key FAIRNESS-KEY] [--fairness-weight FAIRNESS-WEIGHT] [--wait] [--json] [-i|--input [INPUT]] [--input-file [INPUT-FILE]] [--input-encoding [INPUT-ENCODING]]",
"aliases": [],
"hidden": false,
"help": "Start a workflow by type. The server accepts JSON input, memo, and\nsearch attributes. With <comment>--wait</comment> the command blocks until\nthe workflow reaches a terminal state and exits with\n<comment>SUCCESS (0)</comment> on completion or <comment>FAILURE (1)</comment> on\nfailure / cancellation / termination.\n\nStart commands are deduped by <comment>workflow_command_id</comment>. If the\ncaller retries after a network error it must send the same command id so\nthe engine recognises the retry. The <comment>--duplicate-policy</comment>\noption controls what happens when a second start targets an existing\n<comment>workflow_instance_id</comment> (e.g. <comment>reject_duplicate</comment>\nreturns a duplicate outcome, <comment>return_existing_active</comment>\nreturns the existing active run's identity).\n\nThe new run is pinned to the starter process's compatibility marker\n(<comment>DW_V2_CURRENT_COMPATIBILITY</comment>) exactly once at start. Retry\nruns, continue-as-new runs, and child workflows inherit that marker so the\nrun stays inside one compatibility family for its whole lifecycle. Only\nworkers whose <comment>DW_V2_SUPPORTED_COMPATIBILITIES</comment> set includes\nthe run's marker (or the workers-only <comment>*</comment> wildcard) will\nclaim the run's tasks; any other worker rejects the claim at claim time\nwith <comment>compatibility_blocked</comment> or\n<comment>compatibility_unsupported</comment> and the task stays on the queue\nfor a compatible worker to pick up.\n\n<comment>Examples:</comment>\n\n # Start with no input\n <info>dw workflow:start --type=orders.Checkout</info>\n\n # Start with JSON input and a custom workflow id\n <info>dw workflow:start -t orders.Checkout -w chk-42 -i '{\"order_id\":42}'</info>\n\n # Start, then wait for terminal state\n <info>dw workflow:start -t orders.Checkout -i '{\"order_id\":42}' --wait</info>\n\n # Start with search attributes for visibility filters\n <info>dw workflow:start -t orders.Checkout --search-attr env=prod --search-attr tier=gold</info>",
"help": "Start a workflow by type. The server accepts JSON input, memo, and\nsearch attributes. With <comment>--wait</comment> the command blocks until\nthe workflow reaches a terminal state and exits with\n<comment>SUCCESS (0)</comment> on completion or <comment>FAILURE (1)</comment> on\nfailure / cancellation / termination.\n\n<comment>Examples:</comment>\n\n # Start with no input\n <info>dw workflow:start --type=orders.Checkout</info>\n\n # Start with JSON input and a custom workflow id\n <info>dw workflow:start -t orders.Checkout -w chk-42 -i '{\"order_id\":42}'</info>\n\n # Start, then wait for terminal state\n <info>dw workflow:start -t orders.Checkout -i '{\"order_id\":42}' --wait</info>\n\n # Start with search attributes for visibility filters\n <info>dw workflow:start -t orders.Checkout --search-attr env=prod --search-attr tier=gold</info>\n\n # Print the start response as JSON\n <info>dw workflow:start --type=orders.Checkout --output=json</info>\n\nUse <comment>--output=json</comment> for JSON. <comment>--json</comment> is its alias.\n\n<comment>Advanced behavior:</comment>\n\nStart commands are deduped by <comment>workflow_command_id</comment>. If the\ncaller retries after a network error it must send the same command id so\nthe engine recognises the retry. The <comment>--duplicate-policy</comment>\noption controls what happens when a second start targets an existing\n<comment>workflow_instance_id</comment> (e.g. <comment>reject_duplicate</comment>\nreturns a duplicate outcome, <comment>return_existing_active</comment>\nreturns the existing active run's identity).\n\nThe new run is pinned to the starter process's compatibility marker\n(<comment>DW_V2_CURRENT_COMPATIBILITY</comment>) exactly once at start. Retry\nruns, continue-as-new runs, and child workflows inherit that marker so the\nrun stays inside one compatibility family for its whole lifecycle. Only\nworkers whose <comment>DW_V2_SUPPORTED_COMPATIBILITIES</comment> set includes\nthe run's marker (or the workers-only <comment>*</comment> wildcard) will\nclaim the run's tasks; any other worker rejects the claim at claim time\nwith <comment>compatibility_blocked</comment> or\n<comment>compatibility_unsupported</comment> and the task stays on the queue\nfor a compatible worker to pick up.",
"definition": {
"arguments": [],
"options": {
Expand Down
Loading
Loading