Skip to content

fix: add wf registry command#4714

Open
MasterPtato wants to merge 1 commit into04-23-chore_move_codefrom
04-23-fix_add_wf_registry_command
Open

fix: add wf registry command#4714
MasterPtato wants to merge 1 commit into04-23-chore_move_codefrom
04-23-fix_add_wf_registry_command

Conversation

@MasterPtato
Copy link
Copy Markdown
Contributor

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app
Copy link
Copy Markdown

railway-app Bot commented Apr 23, 2026

🚅 Deployed to the rivet-pr-4714 environment in rivet-frontend

Service Status Web Updated (UTC)
kitchen-sink ❌ Build Failed (View Logs) Web Apr 25, 2026 at 1:14 am
frontend-cloud 😴 Sleeping (View Logs) Web Apr 24, 2026 at 12:15 am
website 😴 Sleeping (View Logs) Web Apr 24, 2026 at 12:07 am
frontend-inspector ❌ Build Failed (View Logs) Web Apr 23, 2026 at 11:51 pm
mcp-hub ✅ Success (View Logs) Web Apr 23, 2026 at 11:51 pm
ladle ❌ Build Failed (View Logs) Web Apr 23, 2026 at 11:50 pm

@claude
Copy link
Copy Markdown

claude Bot commented Apr 23, 2026

PR #4714 Review

Summary of changes:

  • Adds a Registry subcommand to the wf CLI that lists all registered workflow names in sorted order
  • Extracts a registry() function from workflow-worker start() so it can be called without starting the worker
  • Fixes envoy_key tracing format from Debug to Display in two places
  • Records namespace_id and envoy_key on the active span in pegboard-envoy after connection init
  • Removes an unused std::time::Duration import from pegboard-runner

Bug: span.record() calls are no-ops (pegboard-envoy/src/lib.rs)

The new span.record(...) calls in handle_websocket will be silently ignored at runtime. In tracing 0.1.x, Span::record() only has effect if the field was pre-declared in the #[tracing::instrument] macro's fields(...) argument. The handle_websocket function uses #[tracing::instrument(skip_all)] with no fields(...) clause, so neither namespace_id nor envoy_key are declared on the span and the record calls are no-ops.

The correct pattern is to declare the fields upfront:

#[tracing::instrument(skip_all, fields(namespace_id, envoy_key))]
async fn handle_websocket(...) {
    span.record("namespace_id", conn.namespace_id.to_string());
    span.record("envoy_key", &conn.envoy_key);
}

Minor Issues

Registry variant missing doc comment

All other SubCommand variants use /// doc comments that clap renders as help text. The Registry variant uses a regular // comment, so engine wf registry --help will show no description. Change to: /// Prints the current workflow registry.

Registry command initializes DB/pools unnecessarily

execute() always creates Pools and DatabaseKv before the match self dispatch, so running engine wf registry incurs a full DB pool initialization even though Registry never uses db. Consider restructuring execute() to only initialize db for variants that need it.

Registry variant style

Minor style inconsistency: all other zero-field variants in this file use the bare form (e.g. Registry rather than Registry {}).


Positive Observations

  • The registry() extraction from workflow-worker::start() is clean. The merge chain is preserved exactly, and .map_err(Into::into) correctly bridges WorkflowError into anyhow::Error.
  • Sorting workflow names before printing is a good UX touch.
  • The ? to % formatting fix for envoy_key is correct. envoy_key is a String so Display avoids redundant quote characters in log output.
  • The Duration import removal from pegboard-runner/src/lib.rs is correct.

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