feat(workato-connector): RocketRide custom connector for Workato#1264
feat(workato-connector): RocketRide custom connector for Workato#1264dsapandora wants to merge 2 commits into
Conversation
…onnector HTTP connector that sends data to a running RocketRide pipeline webhook and returns its output. Includes connector.rb (connection + send_to_pipeline action), Gemfile/RSpec, CI + release workflows, the rocket icon, and docs. Models packages/n8n-nodes (#1255).
…upport Single action with a lanes pick list (question/text/image/audio/video/document); the connector maps each lane to its Content-Type and serializes a Question for the questions lane. Parses answers from the synchronous webhook response. Adds the example pipeline (webhook -> agent_llamaindex -> catfact -> response_answers). Validated end-to-end with `workato exec` against a running pipeline.
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID. Do not edit or delete. |
📝 WalkthroughWalkthroughThis PR introduces ChangesRocketRide Workato Connector
Sequence Diagram(s)sequenceDiagram
participant User as Workato User
participant Action as send_to_pipeline Action
participant Webhook as RocketRide Webhook
participant Pipeline as RocketRide Pipeline
User->>Action: Choose lane, provide content
Action->>Webhook: POST lane-specific payload (Bearer auth)
Webhook->>Pipeline: Route to selected lane
Pipeline->>Pipeline: Process input
Pipeline->>Webhook: Return answers
Webhook->>Action: Response with answers array
Action->>User: Return answer & answers
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/workato-connector-ci.yml:
- Around line 1-12: The workflow "name: workato-connector CI" is missing an
explicit permissions block and a concurrency setting and its push.paths omits
the workflow file; add a minimal permissions: { contents: read, id-token: write,
checks: write } (or the least-privilege set required by your jobs) and a
concurrency: { group: 'workato-connector-ci-${{ github.ref }}',
cancel-in-progress: true } at the top-level of the YAML, and update the
push.paths array to include '.github/workflows/workato-connector-ci.yml' so
pushes that modify the workflow itself trigger CI; locate these changes in the
top-level "on:" section and the workflow metadata around "name:
workato-connector CI".
In @.github/workflows/workato-connector-release.yml:
- Around line 1-19: Add explicit minimal workflow permissions, set
persist-credentials: false on the checkout step, and add a concurrency policy to
the workflow to prevent parallel releases: add a top-level permissions block
granting only what this job needs (for example contents: read and id-token:
write only if required by deployments, or adjust to the minimum required),
update the checkout step in the "push" job (the step that references
actions/checkout@v4) to include persist-credentials: false, and add a top-level
concurrency setting (e.g., group using the workflow name and tag/ref and
cancel-in-progress: true) so tag pushes cannot run concurrently.
In `@packages/workato-connector/.gitignore`:
- Line 11: The repo is ignoring Gemfile.lock in packages/workato-connector and
the Gemfile uses an unpinned gem 'workato-connector-sdk'; stop ignoring and
commit the lockfile and pin the SDK to a specific version to ensure
deterministic dependency resolution: remove or comment out the "Gemfile.lock"
entry from packages/workato-connector/.gitignore, add and commit
packages/workato-connector/Gemfile.lock to the repo, and update
packages/workato-connector/Gemfile to pin gem 'workato-connector-sdk' to a
concrete version (e.g., gem 'workato-connector-sdk', 'MAJOR.MINOR.PATCH').
In `@packages/workato-connector/CHANGELOG.md`:
- Around line 5-9: Insert a blank line after the "### Added" header in
CHANGELOG.md so the header is separated from the following bullet list; update
the section containing "### Added" to have an empty line before the first "-"
bullet to satisfy markdownlint (MD022).
In `@packages/workato-connector/connector.rb`:
- Around line 40-43: The connection test currently hardcodes a text/plain POST
using the test lambda (post('').headers('Content-Type' =>
'text/plain').request_body('ping')), which will fail for lanes that expect
non-text payloads; update the test lambda to avoid forcing text by either
invoking the existing send_to_pipeline helper with a minimal/neutral payload
appropriate for any lane or by issuing a POST without a Content-Type and no body
(i.e., remove the headers('Content-Type' => 'text/plain') and
request_body('ping')), so the probe does not reject pipelines that accept only
question/file lanes.
- Around line 104-105: The content_type field is being allowed for all
non-question lanes but must be restricted to media lanes only; update the code
that applies content_type (the logic around where the lane is inspected and
content_type is assigned — reference the content_type field and the
lane/lane_type handling around the non-question branch) to check the lane's
type/is_media flag (e.g., only when lane.type == 'media' or lane.media? is true)
and skip setting or passing content_type for text or other non-media lanes so
custom MIME values cannot reroute or violate lane contracts.
In `@packages/workato-connector/README.md`:
- Around line 29-37: The README's lane table and the `workato exec` example are
inconsistent with the connector implementation: update the docs to list the
actual lanes `question` and `document` (singular) as defined by connector.rb and
change the execution example to use the action's `lane` and `content` fields
(e.g., set lane: "question" or "document" and provide content in the expected
`content` field) rather than `payload.text`; also make the same corrections
where the second occurrence is referenced (lines 54-55 in the file).
In `@packages/workato-connector/spec/connector_spec.rb`:
- Around line 8-25: Add focused request/response specs that call the
send_to_pipeline action's execute method to validate the runtime contract:
create a spec that invokes
connector.source['actions']['send_to_pipeline'].execute with a 'question' lane
payload and assert the outgoing request body is the expected JSON envelope and
Content-Type is "application/rocketride-question"; add a second spec that
iterates non-question lanes (text, image, audio, video, document) and asserts
the mapped Content-Type for each lane; and add assertions for the shape of
extract_answers output (it returns objects/keys named "answer" and "answers") by
calling the same execute flow and inspecting the returned value. Use the
existing connector reference and the send_to_pipeline and extract_answers
symbols to locate methods to exercise.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8b3ac31e-1a07-4cd6-ae1d-0283a2bb089e
⛔ Files ignored due to path filters (1)
packages/workato-connector/rocketride.svgis excluded by!**/*.svg
📒 Files selected for processing (14)
.github/workflows/workato-connector-ci.yml.github/workflows/workato-connector-release.ymlpackages/workato-connector/.gitignorepackages/workato-connector/.rspecpackages/workato-connector/.ruby-versionpackages/workato-connector/CHANGELOG.mdpackages/workato-connector/Gemfilepackages/workato-connector/LICENSEpackages/workato-connector/README.mdpackages/workato-connector/connector.rbpackages/workato-connector/examples/rocketride-webhook.pipepackages/workato-connector/settings.yaml.examplepackages/workato-connector/spec/connector_spec.rbpackages/workato-connector/spec/spec_helper.rb
| name: workato-connector CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'packages/workato-connector/**' | ||
| - '.github/workflows/workato-connector-ci.yml' | ||
| push: | ||
| branches: [develop] | ||
| paths: | ||
| - 'packages/workato-connector/**' | ||
|
|
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Add explicit permissions block and concurrency setting for security hardening and reliability.
The workflow uses default permissions which are broader than needed. Adding explicit minimal permissions and a concurrency group prevents wasted runner time on superseded commits and follows least-privilege.
Also, the push.paths filter omits the workflow file itself (unlike pull_request.paths), so changes to this workflow file won't trigger CI on pushes to develop.
Proposed fix
name: workato-connector CI
on:
pull_request:
paths:
- 'packages/workato-connector/**'
- '.github/workflows/workato-connector-ci.yml'
push:
branches: [develop]
paths:
- 'packages/workato-connector/**'
+ - '.github/workflows/workato-connector-ci.yml'
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
defaults:🧰 Tools
🪛 zizmor (1.25.2)
[warning] 1-29: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[warning] 3-11: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/workato-connector-ci.yml around lines 1 - 12, The workflow
"name: workato-connector CI" is missing an explicit permissions block and a
concurrency setting and its push.paths omits the workflow file; add a minimal
permissions: { contents: read, id-token: write, checks: write } (or the
least-privilege set required by your jobs) and a concurrency: { group:
'workato-connector-ci-${{ github.ref }}', cancel-in-progress: true } at the
top-level of the YAML, and update the push.paths array to include
'.github/workflows/workato-connector-ci.yml' so pushes that modify the workflow
itself trigger CI; locate these changes in the top-level "on:" section and the
workflow metadata around "name: workato-connector CI".
Source: Linters/SAST tools
| name: workato-connector Release | ||
|
|
||
| # Pushes the connector to the Workato workspace. Publishing a public version | ||
| # (Community / Partner) is a separate "release version" step; Partner adds code review. | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - 'workato-connector-v*' | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: packages/workato-connector | ||
|
|
||
| jobs: | ||
| push: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Harden release workflow with explicit permissions, persist-credentials: false, and concurrency.
This workflow handles secrets (WORKATO_API_TOKEN) and publishes to Workato, so it warrants stricter security settings:
- Explicit minimal permissions prevent accidental broad access.
persist-credentials: falseensures theGITHUB_TOKENisn't left in the workspace after checkout.- A concurrency group prevents parallel releases if multiple tags are pushed quickly.
Proposed fix
name: workato-connector Release
# Pushes the connector to the Workato workspace. Publishing a public version
# (Community / Partner) is a separate "release version" step; Partner adds code review.
on:
workflow_dispatch:
push:
tags:
- 'workato-connector-v*'
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: false
+
defaults:
run:
working-directory: packages/workato-connector
jobs:
push:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v4
+ with:
+ persist-credentials: false
- uses: ruby/setup-ruby@v1📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| name: workato-connector Release | |
| # Pushes the connector to the Workato workspace. Publishing a public version | |
| # (Community / Partner) is a separate "release version" step; Partner adds code review. | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'workato-connector-v*' | |
| defaults: | |
| run: | |
| working-directory: packages/workato-connector | |
| jobs: | |
| push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| name: workato-connector Release | |
| # Pushes the connector to the Workato workspace. Publishing a public version | |
| # (Community / Partner) is a separate "release version" step; Partner adds code review. | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'workato-connector-v*' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| defaults: | |
| run: | |
| working-directory: packages/workato-connector | |
| jobs: | |
| push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false |
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 19-19: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 1-32: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
[error] 19-19: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
[info] 16-16: workflow or action definition without a name (anonymous-definition): this job
(anonymous-definition)
[warning] 5-9: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting
(concurrency-limits)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/workato-connector-release.yml around lines 1 - 19, Add
explicit minimal workflow permissions, set persist-credentials: false on the
checkout step, and add a concurrency policy to the workflow to prevent parallel
releases: add a top-level permissions block granting only what this job needs
(for example contents: read and id-token: write only if required by deployments,
or adjust to the minimum required), update the checkout step in the "push" job
(the step that references actions/checkout@v4) to include persist-credentials:
false, and add a top-level concurrency setting (e.g., group using the workflow
name and tag/ref and cancel-in-progress: true) so tag pushes cannot run
concurrently.
Source: Linters/SAST tools
| .workato/ | ||
| .vcr/ | ||
| *.gem | ||
| Gemfile.lock |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Checking Gemfile dependency pins:"
rg -n "gem 'workato-connector-sdk'|gem 'rspec'" packages/workato-connector/Gemfile
echo
echo "Checking lockfile ignore rule:"
rg -n "^Gemfile.lock$" packages/workato-connector/.gitignore
echo
echo "Checking if a lockfile is present in the package:"
fd -a '^Gemfile\.lock$' packages/workato-connectorRepository: rocketride-org/rocketride-server
Length of output: 264
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "---- packages/workato-connector/Gemfile (lines 1-120) ----"
nl -ba packages/workato-connector/Gemfile | sed -n '1,120p'
echo
echo "---- packages/workato-connector/.gitignore ----"
nl -ba packages/workato-connector/.gitignore
echo
echo "---- Does packages/workato-connector/Gemfile.lock exist? ----"
if [ -f packages/workato-connector/Gemfile.lock ]; then
echo "FOUND: packages/workato-connector/Gemfile.lock"
wc -l packages/workato-connector/Gemfile.lock | cat
else
echo "NOT FOUND: packages/workato-connector/Gemfile.lock"
fi
echo
echo "---- Any Gemfile.lock files under packages/workato-connector/? ----"
find packages/workato-connector -maxdepth 3 -name 'Gemfile.lock' -printRepository: rocketride-org/rocketride-server
Length of output: 196
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "---- packages/workato-connector/Gemfile (lines 1-120) ----"
cat -n packages/workato-connector/Gemfile | sed -n '1,120p'
echo
echo "---- packages/workato-connector/.gitignore ----"
cat -n packages/workato-connector/.gitignore
echo
echo "---- Does packages/workato-connector/Gemfile.lock exist? ----"
if [ -f packages/workato-connector/Gemfile.lock ]; then
echo "FOUND: packages/workato-connector/Gemfile.lock"
wc -l packages/workato-connector/Gemfile.lock | cat
else
echo "NOT FOUND: packages/workato-connector/Gemfile.lock"
fi
echo
echo "---- Any Gemfile.lock files under packages/workato-connector/? ----"
find packages/workato-connector -maxdepth 4 -name 'Gemfile.lock' -printRepository: rocketride-org/rocketride-server
Length of output: 745
Stop ignoring Gemfile.lock for packages/workato-connector.
packages/workato-connector/.gitignore (line 11) excludes Gemfile.lock, while packages/workato-connector/Gemfile (line 6) has an unpinned gem 'workato-connector-sdk'. Commit/keep the lockfile (and pin the SDK version) so CI/release dependency resolution stays deterministic.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/workato-connector/.gitignore` at line 11, The repo is ignoring
Gemfile.lock in packages/workato-connector and the Gemfile uses an unpinned gem
'workato-connector-sdk'; stop ignoring and commit the lockfile and pin the SDK
to a specific version to ensure deterministic dependency resolution: remove or
comment out the "Gemfile.lock" entry from packages/workato-connector/.gitignore,
add and commit packages/workato-connector/Gemfile.lock to the repo, and update
packages/workato-connector/Gemfile to pin gem 'workato-connector-sdk' to a
concrete version (e.g., gem 'workato-connector-sdk', 'MAJOR.MINOR.PATCH').
| ### Added | ||
| - Initial skeleton of the RocketRide Workato custom connector. | ||
| - Connection: Webhook URL + Authorization key. | ||
| - Action: **Send to pipeline** (POST data to a running pipeline webhook, return its output). | ||
| - RSpec smoke tests and CI/CD workflows (`rspec` + `workato push`). |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Add the blank line required by markdownlint.
### Added runs straight into the bullet list, which matches the MD022 warning in the lint output. Insert a blank line here so the changelog passes docs lint.
Suggested fix
## [Unreleased]
### Added
+
- Initial skeleton of the RocketRide Workato custom connector.
- Connection: Webhook URL + Authorization key.
- Action: **Send to pipeline** (POST data to a running pipeline webhook, return its output).🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 5-5: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/workato-connector/CHANGELOG.md` around lines 5 - 9, Insert a blank
line after the "### Added" header in CHANGELOG.md so the header is separated
from the following bullet list; update the section containing "### Added" to
have an empty line before the first "-" bullet to satisfy markdownlint (MD022).
Source: Linters/SAST tools
| # No health endpoint; a minimal text POST validates the URL + auth reach it. | ||
| test: lambda do |_connection| | ||
| post('').headers('Content-Type' => 'text/plain').request_body('ping') | ||
| end, |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Connection test is hardwired to text/plain, which can reject valid lane-specific setups.
Line 42 always probes text content. If a pipeline is wired for question or file lanes only, connection testing can fail even when send_to_pipeline would work for the intended lane.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/workato-connector/connector.rb` around lines 40 - 43, The connection
test currently hardcodes a text/plain POST using the test lambda
(post('').headers('Content-Type' => 'text/plain').request_body('ping')), which
will fail for lanes that expect non-text payloads; update the test lambda to
avoid forcing text by either invoking the existing send_to_pipeline helper with
a minimal/neutral payload appropriate for any lane or by issuing a POST without
a Content-Type and no body (i.e., remove the headers('Content-Type' =>
'text/plain') and request_body('ping')), so the probe does not reject pipelines
that accept only question/file lanes.
| { name: 'content_type', label: 'Content type', optional: true, | ||
| hint: 'MIME type of the file for media lanes (e.g. image/jpeg, application/pdf). Defaults per lane.' } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Restrict content_type overrides to media lanes only.
Line 104 says this field is for media lanes, but Line 121 applies it to every non-question lane. For text, a custom MIME can route to an unintended lane and break the explicit lane contract.
Suggested fix
execute: lambda do |_connection, input|
lane = input['lane']
if lane == 'question'
question = {
type: 'question',
expectJson: false,
role: '',
instructions: [], history: [], examples: [], context: [], goals: [], documents: [],
questions: [{ text: input['content'] }]
}
call('post_to_lane', 'application/rocketride-question', question.to_json)
else
- call('post_to_lane', call('lane_content_type', lane, input['content_type']), input['content'])
+ effective_content_type =
+ if %w[image audio video document].include?(lane)
+ call('lane_content_type', lane, input['content_type'])
+ else
+ call('lane_content_type', lane, nil)
+ end
+ call('post_to_lane', effective_content_type, input['content'])
end
end,Also applies to: 121-121
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/workato-connector/connector.rb` around lines 104 - 105, The
content_type field is being allowed for all non-question lanes but must be
restricted to media lanes only; update the code that applies content_type (the
logic around where the lane is inspected and content_type is assigned —
reference the content_type field and the lane/lane_type handling around the
non-question branch) to check the lane's type/is_media flag (e.g., only when
lane.type == 'media' or lane.media? is true) and skip setting or passing
content_type for text or other non-media lanes so custom MIME values cannot
reroute or violate lane contracts.
| - **Connection** — Webhook URL + Authorization key (`pk_` public key or private token). | ||
| - **Actions** — one per pipeline lane; each POSTs with the matching `Content-Type` and returns the pipeline's `answers` synchronously: | ||
|
|
||
| | Action | Lane | Content-Type | | ||
| | --- | --- | --- | | ||
| | **Ask a pipeline** | `questions` | `application/rocketride-question` (serialized `Question`) | | ||
| | **Send text** | `text` | `text/plain` | | ||
| | **Send file** | `image` / `audio` / `video` / `documents` | the file's MIME type (`image/png`, `audio/mpeg`, `application/pdf`, …) | | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Align the README examples with the connector contract.
The lane table and workato exec sample don't match connector.rb: the connector exposes question and document singular, and the execution example needs the action's actual lane + content fields rather than payload.text. As written, users will be told to send payloads the connector does not accept.
Also applies to: 54-55
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/workato-connector/README.md` around lines 29 - 37, The README's lane
table and the `workato exec` example are inconsistent with the connector
implementation: update the docs to list the actual lanes `question` and
`document` (singular) as defined by connector.rb and change the execution
example to use the action's `lane` and `content` fields (e.g., set lane:
"question" or "document" and provide content in the expected `content` field)
rather than `payload.text`; also make the same corrections where the second
occurrence is referenced (lines 54-55 in the file).
| it 'loads with the right title' do | ||
| expect(connector.title).to eq('RocketRide Connector') | ||
| end | ||
|
|
||
| it 'exposes the send_to_pipeline action' do | ||
| action_names = connector.source['actions'].keys.map(&:to_s) | ||
| expect(action_names).to include('send_to_pipeline') | ||
| end | ||
|
|
||
| it 'declares the supported lanes' do | ||
| lanes = connector.source['pick_lists'][:lanes].call(nil).map(&:last) | ||
| expect(lanes).to include('question', 'text', 'image', 'audio', 'video', 'document') | ||
| end | ||
|
|
||
| it 'declares the connection fields' do | ||
| field_names = connector.source['connection'][:fields].map { |f| f[:name] } | ||
| expect(field_names).to include('webhook_url', 'auth_key') | ||
| end |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Add execute-path coverage for request/response contract.
Current specs validate only static metadata. Add focused tests for send_to_pipeline.execute to lock down:
- question lane JSON envelope +
application/rocketride-question, - lane-to-content-type behavior for non-question lanes,
extract_answersoutput shape (answer,answers).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/workato-connector/spec/connector_spec.rb` around lines 8 - 25, Add
focused request/response specs that call the send_to_pipeline action's execute
method to validate the runtime contract: create a spec that invokes
connector.source['actions']['send_to_pipeline'].execute with a 'question' lane
payload and assert the outgoing request body is the expected JSON envelope and
Content-Type is "application/rocketride-question"; add a second spec that
iterates non-question lanes (text, image, audio, video, document) and asserts
the mapped Content-Type for each lane; and add assertions for the shape of
extract_answers output (it returns objects/keys named "answer" and "answers") by
calling the same execute flow and inspecting the returned value. Use the
existing connector reference and the send_to_pipeline and extract_answers
symbols to locate methods to exercise.
Summary
workato-connector-sdk), self-contained inpackages/workato-connector— same pattern aspackages/n8n-nodes.send_to_pipelinewith an explicitlanepick list (question / text / image / audio / video / document); maps each lane to its Content-Type, serializes aQuestionfor the questions lane, and parsesanswersfrom the synchronous webhook response.workato-connector-{ci,release}.yml) + example pipeline (examples/rocketride-webhook.pipe).Type
feature
Testing
workato exec actions.send_to_pipeline.executeagainst a running pipeline — returns the agent answer)./builder testpasses (N/A — self-contained Ruby package; runs its own RSpec viaworkato-connector-ci.yml)Checklist
Linked Issue
Closes #1259
Summary by CodeRabbit
New Features
Documentation
Tests
Chores