-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Fixes #17048: GitHub actions for retrieving commits #17052
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
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
@jeevikasirwani is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughA new GitHub Actions workflow for retrieving commit data and a new OpenAI chat action module have been introduced. The workflow fetches and uploads commit information as artifacts, while the module enables multi-turn chat interactions with OpenAI's Responses API, supporting built-in and external tools, customizable response formats, and dynamic schema integration. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant Repo
participant Artifact Store
User->>GitHub Actions: Trigger "Retrieve Commits" workflow
GitHub Actions->>Repo: Checkout repository
GitHub Actions->>Repo: Fetch latest 30 commits (API)
GitHub Actions->>Repo: Fetch current commit details (API)
GitHub Actions->>Artifact Store: Upload commits.json and commit.json as artifacts
sequenceDiagram
participant User
participant ChatAction
participant OpenAI API
participant MCP Server (optional)
User->>ChatAction: Provide input, options, and tools
ChatAction->>MCP Server: (If MCP tools enabled) Fetch available tools
ChatAction->>OpenAI API: Send chat request with model, input, tools, and optional JSON schema
OpenAI API-->>ChatAction: Return chat response and response ID
ChatAction->>User: Export output and summary
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Nitpick comments (2)
.github/workflows/retrieve-commits.yml (1)
1-39
: Fix YAML formatting issuesThe workflow has several formatting issues that should be addressed for consistency.
Remove trailing spaces from lines 3, 11, 15, 32, and 39, and add a newline at the end of the file. Most editors can be configured to automatically trim trailing whitespace and ensure files end with a newline.
🧰 Tools
🪛 actionlint (1.7.7)
13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
34-34: the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
[error] 11-11: trailing spaces
(trailing-spaces)
[error] 15-15: trailing spaces
(trailing-spaces)
[error] 32-32: trailing spaces
(trailing-spaces)
[error] 39-39: no new line character at the end of file
(new-line-at-end-of-file)
[error] 39-39: trailing spaces
(trailing-spaces)
components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs (1)
147-195
: Add input validation for required fieldsConsider adding validation for required inputs to provide better error messages to users.
async run({ $ }) { if (this.skipThisStep) { $.export("$summary", "Step execution skipped"); return; } + + // Validate required inputs + if (!this.input?.trim()) { + throw new Error("Chat input is required and cannot be empty"); + } + + if (this.responseFormat === constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value && !this.jsonSchema) { + throw new Error("JSON Schema is required when response format is set to json_schema"); + } + const tools = [];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (6)
components/quickbooks/package-lock.json
is excluded by!**/package-lock.json
components/smiirl/package-lock.json
is excluded by!**/package-lock.json
docs-v2/yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
helpers/package-lock.json
is excluded by!**/package-lock.json
packages/connect-react/examples/nextjs/package-lock.json
is excluded by!**/package-lock.json
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
.github/workflows/retrieve-commits.yml
(1 hunks)components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/retrieve-commits.yml
13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
34-34: the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
.github/workflows/retrieve-commits.yml
[error] 11-11: trailing spaces
(trailing-spaces)
[error] 15-15: trailing spaces
(trailing-spaces)
[error] 32-32: trailing spaces
(trailing-spaces)
[error] 39-39: no new line character at the end of file
(new-line-at-end-of-file)
[error] 39-39: trailing spaces
(trailing-spaces)
🔇 Additional comments (1)
components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs (1)
100-105
:⚠️ Potential issueFix quote escaping in description
The description string contains unescaped quotes that could cause parsing issues.
mcpServers: { type: "string[]", label: "MCP Server URLs", description: - "Enter your MCP server base URLs. To set one up, visit https://mcp.pipedream.com/ and click "Create new server.", + "Enter your MCP server base URLs. To set one up, visit https://mcp.pipedream.com/ and click \"Create new server.\"", optional: true, },Likely an incorrect or invalid review comment.
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Update to latest checkout action version
The workflow is using an outdated version of the checkout action. Please update to v4 for improved security and compatibility.
- - name: Checkout repository
- uses: actions/checkout@v3
+ - name: Checkout repository
+ uses: actions/checkout@v4
📝 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: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Checkout repository | |
uses: actions/checkout@v4 |
🧰 Tools
🪛 actionlint (1.7.7)
13-13: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🤖 Prompt for AI Agents
In .github/workflows/retrieve-commits.yml around lines 12 to 14, update the
checkout action version from v3 to v4 by changing the uses line to
actions/checkout@v4 to ensure improved security and compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not better to use actions/checkout@v4
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcortes Yes, absolutely! actions/checkout@v4
is definitely better than v3. As the actionlint tool flagged, v3 is too old to run on current GitHub Actions runners, and v4 provides improved security and compatibility.
The suggestion to update to v4 is spot on - it's a straightforward upgrade that will ensure the workflow continues to work properly on GitHub's infrastructure.
🐰✨
- name: Upload commit data | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: commit-data | ||
path: | | ||
commits.json | ||
commit.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Update to latest upload-artifact action version and fix formatting
The workflow is using an outdated version of the upload-artifact action and has formatting issues.
- name: Upload commit data
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: commit-data
path: |
commits.json
- commit.json
+ commit.json
📝 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: Upload commit data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: commit-data | |
path: | | |
commits.json | |
commit.json | |
- name: Upload commit data | |
uses: actions/upload-artifact@v4 | |
with: | |
name: commit-data | |
path: | | |
commits.json | |
commit.json |
🧰 Tools
🪛 actionlint (1.7.7)
34-34: the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.37.1)
[error] 39-39: no new line character at the end of file
(new-line-at-end-of-file)
[error] 39-39: trailing spaces
(trailing-spaces)
🤖 Prompt for AI Agents
In .github/workflows/retrieve-commits.yml around lines 33 to 39, update the
actions/upload-artifact action to the latest version (currently v4) to ensure
compatibility and improvements. Also, fix the formatting by removing any
trailing spaces in the path list and ensure consistent indentation for the
'name' and 'path' keys under 'with'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question here isn't better to use actions/upload-artifact@v4
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcortes Absolutely! You're correct that actions/upload-artifact@v4
is better. As I mentioned in my previous suggestion, v3 is flagged by actionlint as being too old to run on GitHub Actions.
Version v4 offers several improvements:
- Better compatibility with current GitHub Actions runners
- Enhanced security and performance optimizations
- Future-proofing to avoid deprecation warnings
The upgrade is straightforward and maintains the same API, so it's definitely the recommended approach for this workflow.
🐰💡
components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs
Show resolved
Hide resolved
if ( | ||
this.responseFormat === | ||
constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value | ||
) { | ||
try { | ||
data.text = { | ||
format: { | ||
type: this.responseFormat, | ||
...JSON.parse(this.jsonSchema), | ||
}, | ||
}; | ||
} catch { | ||
throw new Error("Invalid JSON format in the provided JSON Schema"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Fix response format property name and improve error handling
The response format configuration appears to use an incorrect property name, and the JSON parsing error message could be more helpful.
if (
this.responseFormat ===
constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
) {
try {
- data.text = {
+ data.response_format = {
format: {
type: this.responseFormat,
...JSON.parse(this.jsonSchema),
},
};
- } catch {
- throw new Error("Invalid JSON format in the provided JSON Schema");
+ } catch (error) {
+ throw new Error(`Invalid JSON Schema: ${error.message}. Please ensure your schema is valid JSON.`);
}
}
Please verify the correct property name for the OpenAI Responses API by checking the API documentation:
🌐 Web query:
What is the correct property name for specifying response format in OpenAI's Responses API?
💡 Result:
In OpenAI's API, the property used to specify the response format is format
. This property allows you to define how the API should structure its responses. For example, setting format
to json
instructs the API to return responses in JSON format.
Fix response format property and enhance JSON parsing error
The API expects a top-level format
property, not text
or response_format
. Also include the caught error message to aid debugging.
• File: components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs
• Lines 171–185
Proposed diff:
if (
this.responseFormat ===
constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value
) {
try {
- data.text = {
+ data.format = {
type: this.responseFormat,
- ...JSON.parse(this.jsonSchema),
+ ...JSON.parse(this.jsonSchema),
};
- } catch {
- throw new Error("Invalid JSON format in the provided JSON Schema");
+ } catch (error) {
+ throw new Error(`Invalid JSON Schema: ${error.message}. Please ensure your schema is valid JSON.`);
}
}
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs
around lines 171 to 185, the code incorrectly assigns the response format under
a nested 'text' property instead of the top-level 'format' property as required
by the OpenAI Responses API. To fix this, replace the assignment to data.text
with data.format and spread the parsed JSON schema inside it. Also, enhance the
error handling by catching the JSON parsing error and including the actual error
message in the thrown error to provide more helpful debugging information.
components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jeevikasirwani I've just left a few comments/suggestions so please review them, thanks for this great contribution!
components/openai/actions/chat-with-opeai-responses-api/chat-with-openai-responses-api.mjs
Show resolved
Hide resolved
mcpTools: { | ||
type: "string[]", | ||
label: "MCP Tools to Enable", | ||
description: | ||
"Select which tools from your MCP servers to include in the chat.", | ||
optional: true, | ||
async options({ mcpServers }) { | ||
if (!mcpServers?.length) return []; | ||
const all = []; | ||
for (let url of mcpServers) { | ||
url = url.replace(/\/$/, ""); | ||
const { data } = await axios.get(`${url}/tools`); | ||
for (const t of data.tools) { | ||
all.push({ | ||
label: t.name, | ||
value: t.id, | ||
}); | ||
} | ||
} | ||
return all; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please create a propDefinition for this one in openai.app.mjs
file and reference here, so you can use the axios lib from @pipedream/plaform
instead?
import { axios } from "@pipedream/platform";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is the solution to this issue #17031
Please increase the minor version in its package.json
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these modifications in *-lock.json
files necessary for this PR?
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is not better to use actions/checkout@v4
here?
- name: Upload commit data | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: commit-data | ||
path: | | ||
commits.json | ||
commit.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question here isn't better to use actions/upload-artifact@v4
?
Resolves ##17048
WHY
Implements GitHub Actions workflow for:
Summary by CodeRabbit