Skip to content

feat: reintroduce the mock streams trigger on develop#21828

Merged
cawthorne merged 17 commits intodevelopfrom
feature/aptos-develop-mock-trigger
Apr 22, 2026
Merged

feat: reintroduce the mock streams trigger on develop#21828
cawthorne merged 17 commits intodevelopfrom
feature/aptos-develop-mock-trigger

Conversation

@cawthorne
Copy link
Copy Markdown
Contributor

Summary

  • forward-port the Aptos-init mock streams trigger onto develop
  • gate registration behind an explicit local capability config entry so it stays test-only
  • keep the dummy metadata registry F=1 behavior needed by the legacy workflow smoke path
  • add focused tests for the gate and the mock trigger lifecycle/event path

Testing

  • GOWORK=off go test ./core/capabilities/streams -run 'TestMockTriggerService|TestStreamsTrigger' -count=1
  • GOWORK=off go test ./core/services/chainlink -run TestShouldRegisterMockStreamsTrigger -count=1

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

✅ No conflicts with other open PRs targeting develop

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Apr 2, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@cawthorne cawthorne force-pushed the feature/aptos-develop-mock-trigger branch from e6d895c to 3ae8a65 Compare April 2, 2026 13:07
@cawthorne cawthorne force-pushed the feature/aptos-develop-mock-trigger branch from 3ae8a65 to 89ac6bd Compare April 2, 2026 13:09
@cawthorne cawthorne force-pushed the feature/aptos-develop-mock-trigger branch from 465d17c to 22994a0 Compare April 6, 2026 10:54
@cawthorne cawthorne marked this pull request as ready for review April 6, 2026 16:55
@cawthorne cawthorne requested review from a team as code owners April 6, 2026 16:55
Copilot AI review requested due to automatic review settings April 6, 2026 16:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Risk Rating: MEDIUM

This PR forward-ports a test-only “mock streams trigger” into develop, gating it behind an explicit [Capabilities.Local] config entry so it’s opt-in, and adjusts the local CRE test metadata registry to preserve a legacy F=1 compatibility path when the mock trigger is enabled.

Changes:

  • Add optional registration of the mock streams trigger based on local capability config.
  • Introduce a mock streams trigger implementation that emits signed mock reports and supports trigger lifecycle (register/emit/unregister).
  • Add/adjust local CRE test metadata registry behavior to advertise WorkflowDON.F=1 only when the mock trigger is opted in, with focused tests.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
core/services/standardcapabilities/local_capabilities.go Adds gating + optional mock trigger registration helper.
core/services/standardcapabilities/local_capabilities_test.go Unit tests for the gating logic.
core/services/standardcapabilities/delegate.go Calls optional registration during delegate construction and propagates init errors.
core/services/cre/cre.go Uses a helper to build a local TestMetadataRegistry with conditional WorkflowDONF.
core/services/cre/cre_test.go Tests that the conditional WorkflowDONF override is applied.
core/capabilities/streams/mock_trigger.go Implements the mock trigger service and report/signature generation loop.
core/capabilities/streams/mock_trigger_test.go Tests mock trigger lifecycle and event emission path.
core/capabilities/registry.go Adds configurable WorkflowDONF in TestMetadataRegistry and uses it in LocalNode().
core/capabilities/registry_test.go Tests that WorkflowDONF is respected.

Targeted areas for scrupulous human review:

  • core/capabilities/streams/mock_trigger.go: trigger lifecycle and internal state management (RegisterTrigger/UnregisterTrigger, background loop + Close semantics).
  • core/services/standardcapabilities/delegate.go: impact of initErr gating on job startup behavior when optional registration fails.

Comment thread core/capabilities/streams/mock_trigger.go Outdated
Comment thread core/capabilities/streams/mock_trigger.go Outdated
@cawthorne cawthorne marked this pull request as draft April 7, 2026 13:17
@cl-sonarqube-production
Copy link
Copy Markdown

@cawthorne cawthorne marked this pull request as ready for review April 20, 2026 13:22
@ilija42 ilija42 added this pull request to the merge queue Apr 22, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2026
@cawthorne cawthorne added this pull request to the merge queue Apr 22, 2026
Merged via the queue into develop with commit 43a6f27 Apr 22, 2026
291 of 294 checks passed
@cawthorne cawthorne deleted the feature/aptos-develop-mock-trigger branch April 22, 2026 18:11
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.

4 participants