Skip to content

fix(pegboard): create missing normal runner configs#4619

Merged
MasterPtato merged 1 commit intomainfrom
04-12-fix_pegboard_create_missing_normal_runner_configs
Apr 13, 2026
Merged

fix(pegboard): create missing normal runner configs#4619
MasterPtato merged 1 commit intomainfrom
04-12-fix_pegboard_create_missing_normal_runner_configs

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

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

@claude
Copy link
Copy Markdown

claude bot commented Apr 13, 2026

PR Review: fix(pegboard): create missing normal runner configs

Summary

This is a minimal, correct one-character logic inversion bug fix. The function pegboard_runner_config_ensure_normal_if_missing is supposed to create a default "normal" runner config if one does not already exist. The original code had the condition inverted:

// Before (bug): creates config only when one already exists
if !pool_res.is_empty() { ... }

// After (fix): creates config only when none exists
if pool_res.is_empty() { ... }

The broken condition caused the upsert to fire when a config already existed and silently skip creation when one was missing — the exact inverse of the intended semantics described in the function's doc comment.


Feedback

Correctness — Fix is correct. The get call returns a Vec<RunnerConfig> filtered to found entries, so an empty result means the config is absent. The corrected is_empty() guard now matches the documented intent.

Pre-existing doc comment nit (not introduced by this PR): the doc comment fragment Returns true when the config was created is stale since the function returns Result<()>, not Result<bool>. Worth cleaning up.

Test coverage — No tests are added. Given the function is used as a workflow activity in runner2.rs, a regression test confirming that configs are created when absent (and not overwritten when present) would prevent this class of inversion bug from re-appearing.


Assessment

Correct, minimal, and safe. No style/convention violations, no security concerns, no performance impact. The only suggestions are a pre-existing stale doc comment and the absence of a regression test.

@MasterPtato MasterPtato force-pushed the 04-12-fix_pegboard_create_missing_normal_runner_configs branch from 5c3d2c5 to a142b3e Compare April 13, 2026 19:35
@github-actions
Copy link
Copy Markdown
Contributor

Preview packages published to npm

Install with:

npm install rivetkit@pr-4619

All packages published as 0.0.0-pr.4619.7b60796 with tag pr-4619.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-7b60796
docker pull rivetdev/engine:full-7b60796
Individual packages
npm install rivetkit@pr-4619
npm install @rivetkit/react@pr-4619
npm install @rivetkit/rivetkit-native@pr-4619
npm install @rivetkit/sqlite-wasm@pr-4619
npm install @rivetkit/workflow-engine@pr-4619

Copy link
Copy Markdown
Contributor

MasterPtato commented Apr 13, 2026

Merge activity

  • Apr 13, 8:40 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 13, 8:42 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 13, 8:42 PM UTC: @MasterPtato merged this pull request with Graphite.

@MasterPtato MasterPtato changed the base branch from 04-12-fix_epoxy_reuse_cached_optimistic_value to graphite-base/4619 April 13, 2026 20:40
@MasterPtato MasterPtato changed the base branch from graphite-base/4619 to main April 13, 2026 20:40
@MasterPtato MasterPtato force-pushed the 04-12-fix_pegboard_create_missing_normal_runner_configs branch from a142b3e to 666f86f Compare April 13, 2026 20:41
@MasterPtato MasterPtato merged commit c1b1e03 into main Apr 13, 2026
17 of 20 checks passed
@MasterPtato MasterPtato deleted the 04-12-fix_pegboard_create_missing_normal_runner_configs branch April 13, 2026 20:42
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.

2 participants