Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37285 - Properly process data we get from checking on proxy #749

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def process_task_results(tasks, results)
notify ::Actions::ProxyAction::ProxyActionMissing.new, missing if missing.any?

stopped = present.select { |task| %w[stopped paused].include? results.dig(task.remote_task_id, 'state') }
notify ::Actions::ProxyAction::ProxyActionStopped.new, stopped if stopped.any?
Copy link
Member

Choose a reason for hiding this comment

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

Do I understand right, that this should correspond with

def run(event = nil)
with_connection_error_handling(event) do |event|
case event
when nil
start_or_resume
when ::Dynflow::Action::Skip
# do nothing
when ::Dynflow::Action::Cancellable::Cancel
cancel_proxy_task
when ::Dynflow::Action::Cancellable::Abort
abort_proxy_task
when CallbackData
on_data(event.data, event.meta)
when ProxyActionMissing
on_proxy_action_missing
when ProxyActionStoppedEvent
on_proxy_action_stopped(event)
else
raise "Unexpected event #{event.inspect}"
end
end
end
?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly

notify ::Actions::ProxyAction::ProxyActionStoppedEvent[nil], stopped if stopped.any?
end

def notify(event, tasks)
Expand Down