Skip to content

feat(agent): add workflow executor proxy routes#293

Open
matthv wants to merge 1 commit intomainfrom
feature/prd-228-workflow-executor-proxy-ruby-v2
Open

feat(agent): add workflow executor proxy routes#293
matthv wants to merge 1 commit intomainfrom
feature/prd-228-workflow-executor-proxy-ruby-v2

Conversation

@matthv
Copy link
Copy Markdown
Member

@matthv matthv commented Apr 29, 2026

Add workflow executor proxy routes to the Forest Admin agent

  • Adds a new WorkflowExecutorProxy route class in workflow_executor_proxy.rb that mounts GET /_internal/workflow-executions/:run_id and POST /_internal/workflow-executions/:run_id/trigger when workflow_executor_url is configured.
  • Forwards matching requests to the configured executor via Faraday, passing through Authorization and Cookie headers, scalar query params, and request body; relays back status, body, and Content-Type.
  • Adds workflow_executor_url as a configurable setting (default nil) in forest_admin_rails.rb.
  • Returns 404 if no executor URL is configured, and 503 if the executor is unreachable or times out.

Macroscope summarized b5f90d2.

@linear
Copy link
Copy Markdown

linear Bot commented Apr 29, 2026

@qltysh
Copy link
Copy Markdown

qltysh Bot commented Apr 29, 2026

3 new issues

Tool Category Rule Count
qlty Structure Function with high complexity (count = 8): forwarded_query_params 2
qlty Structure Function with many parameters (count = 4): forward 1

"#{EXECUTOR_PREFIX}/#{run_id}#{suffix}"
end

def forward(method, base_url, path, args)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with many parameters (count = 4): forward [qlty:function-parameters]

next if value.is_a?(Hash) || value.is_a?(Array) # 'data' body, etc.

acc[key.to_s] = value
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with high complexity (count = 8): forwarded_query_params [qlty:function-complexity]

FORWARDED_HEADERS.each_with_object({}) do |name, acc|
value = headers[name] || headers[name.downcase] || headers["HTTP_#{name.upcase}"]
acc[name] = value if value && !value.to_s.empty?
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Function with high complexity (count = 5): forwarded_request_headers [qlty:function-complexity]

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