Skip to content

node: include previous state/result in update events#702

Draft
nuclearcat wants to merge 1 commit into
kernelci:mainfrom
nuclearcat:dup-fix
Draft

node: include previous state/result in update events#702
nuclearcat wants to merge 1 commit into
kernelci:mainfrom
nuclearcat:dup-fix

Conversation

@nuclearcat

Copy link
Copy Markdown
Member

Node update events were published on every change carrying only the node's current values. Consumers such as the pipeline scheduler match on those values alone, with no way to tell an actual state transition apart from an unrelated update (e.g. adding an artifact or bumping a timeout on a node that is already in a matching state).

Add previous_state and previous_result to the payload of "updated" events emitted by put_node, patch_node and put_nodes, so consumers can act on the transition into a state rather than on every update.

This is the API-side half of the fix for duplicate child-node creation: an audit of production found identical jobs (same parent, name, runtime and platform, same retry_counter) created seconds apart, recreated each time the parent node was updated while staying in a matching state.

Addresses kernelci/kernelci-core#2912

Node update events were published on every change carrying only the
node's current values. Consumers such as the pipeline scheduler match
on those values alone, with no way to tell an actual state transition
apart from an unrelated update (e.g. adding an artifact or bumping a
timeout on a node that is already in a matching state).

Add previous_state and previous_result to the payload of "updated"
events emitted by put_node, patch_node and put_nodes, so consumers can
act on the transition into a state rather than on every update.

This is the API-side half of the fix for duplicate child-node creation:
an audit of production found identical jobs (same parent, name, runtime
and platform, same retry_counter) created seconds apart, recreated each
time the parent node was updated while staying in a matching state.

Addresses kernelci/kernelci-core#2912

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
@nuclearcat nuclearcat marked this pull request as draft June 14, 2026 18:47
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