Skip to content

refactor(eventbridge): bundle fire_rule context refs into FireRuleContext#350

Merged
vieiralucas merged 1 commit intomainfrom
worktree-cleanup-eventbridge-fire-rule
Apr 13, 2026
Merged

refactor(eventbridge): bundle fire_rule context refs into FireRuleContext#350
vieiralucas merged 1 commit intomainfrom
worktree-cleanup-eventbridge-fire-rule

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 13, 2026

Summary

`fire_rule` took 7 positional args (state + delivery + lambda_state + logs_state + container_runtime + bus_name + rule_name). Bundle the five that are "where the surrounding services live" into a borrowed `FireRuleContext<'a>`; keep `bus_name` and `rule_name` as regular params since they're the actual lookup keys, not context. Same shape as the SNS `TopicFanoutContext` from PR #344.

Updates the three unit tests in `simulation.rs` and the server's `/_fakecloud/eventbridge/fire-rule` handler in `main.rs` to construct the context inline.

Test plan

  • `cargo fmt`
  • `cargo clippy --workspace --all-targets -- -D warnings`
  • `cargo test -p fakecloud-eventbridge --lib` — 60 passed
  • `cargo test --workspace --exclude fakecloud-e2e --exclude fakecloud-conformance`

Summary by cubic

Bundled the environment args for fire_rule into a borrowed FireRuleContext to simplify call sites and match the SNS TopicFanoutContext. No behavior changes.

  • Refactors
    • Replaced five positional refs with FireRuleContext<'a>; kept bus_name and rule_name as parameters.
    • Updated unit tests and the server /_fakecloud/eventbridge/fire-rule handler to construct the context inline.

Written for commit b9fc560. Summary will update on new commits.

…text

fire_rule took 7 positional args (state + delivery + lambda_state +
logs_state + container_runtime + bus_name + rule_name). Bundle the five
that are 'where the surrounding services live' into FireRuleContext<'a>;
keep bus_name and rule_name as regular params since they're the actual
lookup keys. Same shape as the SNS TopicFanoutContext from PR #344.

Updates the three unit tests and the server's /_fakecloud/eventbridge/
fire-rule handler call site.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@vieiralucas vieiralucas merged commit 4936c6b into main Apr 13, 2026
22 checks passed
@vieiralucas vieiralucas deleted the worktree-cleanup-eventbridge-fire-rule branch April 13, 2026 14:26
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