Skip to content

fix: replace exit statements with returns in automated-pr-reviewer skill#680

Open
badMade wants to merge 8 commits into
mainfrom
fix/automated-pr-reviewer-exit-10103983659694188912
Open

fix: replace exit statements with returns in automated-pr-reviewer skill#680
badMade wants to merge 8 commits into
mainfrom
fix/automated-pr-reviewer-exit-10103983659694188912

Conversation

@badMade
Copy link
Copy Markdown
Owner

@badMade badMade commented Jun 1, 2026

What

Wrapped the bash script logic in skills/github/automated-pr-reviewer/SKILL.md inside a main() function and replaced exit 1/exit 0 with return statements (return 1 2>/dev/null || true). It also regenerates corresponding documentation.

Why

When the script is pasted into an agent's terminal or sourced within an interactive bash session, early exit conditions (like missing dependencies or no PRs to review) would trigger an exit and kill the entire active shell session. Wrapping it in a function and returning allows it to exit gracefully without terminating the session.

Verification

  • Applied diff and verified exit statements are gone.
  • Verified correct function wrapping.
  • Ran generate-skill-docs.py to regenerate the skill documentation and synced.
  • Ran tests/test_plugin_skills.py successfully.

Result

Agents can now safely run the script in an interactive session without crashing it when no PRs are found to review.


PR created automatically by Jules for task 10103983659694188912 started by @badMade

The `exit` statements in the `automated-pr-reviewer` bash script would prematurely terminate interactive bash sessions when the script was pasted into an agent's terminal or sourced.

This commit wraps the bash logic in a `main()` function and changes the top-level `exit 1` to `return 1 2>/dev/null || true` and `exit 0` to `return 0 2>/dev/null || true`. It also updates the autogenerated documentation pages.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several new optional and bundled skills (such as hyperliquid, stocks, pr-review, and rest-graphql-debug) to the catalog, updates documentation across various skills to improve shell safety and execution paths, and refactors the automated PR reviewer script to wrap its logic in a main() function. Feedback on the changes focuses on the refactored bash script, pointing out that the expressions return 1 2>/dev/null || true and return 0 2>/dev/null || true contain redundant redirection and fallback operators since return exits the function immediately. Additionally, the reviewer noted that returning a non-zero status from main will still trigger an exit under set -e unless handled at the call site.

Comment thread skills/github/automated-pr-reviewer/SKILL.md
Comment thread skills/github/automated-pr-reviewer/SKILL.md
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Auto-merge: review received — action required

Review activity detected (4 inline comment(s) by non-author(s); 1 comment(s)/review(s) from review bot(s): gemini-code-assist[bot]).

To confirm you have reviewed and accepted the feedback, please add the reviewed label to this PR. Auto-merge will then proceed.

View workflow run

@badMade badMade marked this pull request as ready for review June 2, 2026 03:31
Copilot AI review requested due to automatic review settings June 2, 2026 03:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the automated-pr-reviewer skill’s embedded bash workflow to avoid terminating the caller’s shell by wrapping logic in main() and replacing exit with return, and then regenerates/updates the website skill documentation and catalogs (including several additional skill doc pages).

Changes:

  • Refactors the skills/github/automated-pr-reviewer/SKILL.md bash snippet to use a main() function and return instead of exit.
  • Regenerates/updates multiple skill docs pages (bundled + optional), and adds new generated pages for several skills.
  • Updates skills catalogs to include new/previously-missing entries and sections.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
skills/github/automated-pr-reviewer/SKILL.md Refactors the embedded bash workflow to use main() + return instead of exit.
website/docs/user-guide/skills/bundled/github/github-automated-pr-reviewer.md Regenerated skill docs reflecting the updated workflow script.
website/docs/user-guide/skills/optional/productivity/productivity-memento-flashcards.md Updates docs to prefer the JSON stdin interface and adds shell-safety guidance.
website/docs/user-guide/skills/optional/mlops/mlops-hermes-atropos-environments.md Fixes related-skill links to point at optional-skill doc paths.
website/docs/user-guide/skills/optional/finance/finance-dcf-model.md Tightens recalc instructions to resolve excel-author path via skill_view.
website/docs/user-guide/skills/bundled/software-development/software-development-requesting-code-review.md Adjusts commit guidance to avoid git add -A post-verification.
website/docs/user-guide/skills/bundled/research/research-research-paper-writing.md Clarifies safe usage constraints for execute_code.
website/docs/user-guide/skills/bundled/red-teaming/red-teaming-godmode.md Updates guidance to “report-only” mode and disables persistence language.
website/docs/user-guide/skills/bundled/devops/devops-kanban-worker.md Adds “review-required” handoff pattern using kanban_block + metadata comment.
website/docs/user-guide/skills/bundled/pr-review/pr-review-pr-review.md Adds generated docs page for the pr-review bundled skill.
website/docs/user-guide/skills/optional/software-development/software-development-rest-graphql-debug.md Adds generated docs page for the optional rest-graphql-debug skill.
website/docs/user-guide/skills/optional/finance/finance-stocks.md Adds generated docs page for the optional stocks skill.
website/docs/user-guide/skills/optional/blockchain/blockchain-hyperliquid.md Adds generated docs page for the optional hyperliquid skill.
website/docs/reference/skills-catalog.md Updates bundled skills catalog (adds entries/sections).
website/docs/reference/optional-skills-catalog.md Updates optional skills catalog (adds entries/sections).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread skills/github/automated-pr-reviewer/SKILL.md
Comment thread skills/github/automated-pr-reviewer/SKILL.md
Comment on lines 39 to 44
| Skill | Description |
|-------|-------------|
| [**base**](/docs/user-guide/skills/optional/blockchain/blockchain-base) | Query Base (Ethereum L2) blockchain data with USD pricing — wallet balances, token info, transaction details, gas analysis, contract inspection, whale detection, and live network stats. Uses Base RPC + CoinGecko. No API key required. |
| [**hyperliquid**](/docs/user-guide/skills/optional/blockchain/blockchain-hyperliquid) | Hyperliquid market data, account history, trade review. |
| [**solana**](/docs/user-guide/skills/optional/blockchain/blockchain-solana) | Query Solana blockchain data with USD pricing — wallet balances, token portfolios with values, transaction details, NFTs, whale detection, and live network stats. Uses Solana RPC + CoinGecko. No API key required. |

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@gemini-code-assist, is this suggestion still valid? If so, what are the steps and line numbers to make this fix?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The suggestion provided by Copilot is valid. The pull request includes a broad set of documentation updates across multiple skill pages, which makes the review process less focused than the PR title and description suggest. To resolve this, you should either update the PR description to explicitly list these additional changes (e.g., adding hyperliquid, stocks, rest-graphql-debug, and pr-review documentation) or move the documentation regeneration to a separate, dedicated pull request. If you choose to keep the current scope, simply update the PR description body to reflect the broader changes. No specific code changes are required to address this comment, as it is a process-related suggestion.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@gemini-code-assist, what are the steps and line numbers to make this fix?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

To address the feedback regarding the PR scope, you should update the PR description to clearly outline all changes included in this pull request. Since this PR contains documentation updates for multiple skills (hyperliquid, stocks, rest-graphql-debug, pr-review) in addition to the automated-pr-reviewer script fix, listing these clearly will help reviewers understand the full scope. You can edit the PR description body directly in the GitHub UI to include a section like 'Additional Documentation Updates' that lists these files. No code changes are required to address this process-related feedback.

Comment thread website/docs/reference/skills-catalog.md
badMade and others added 6 commits June 2, 2026 21:14
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…-pr-reviewer.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…-pr-reviewer.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@badMade
Copy link
Copy Markdown
Owner Author

badMade commented Jun 3, 2026

@copilot resolve the merge conflicts in this pull request

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Auto-merge: checks failing

The following checks did not pass:

  • copilot (failure)

Please fix the failing checks before this PR can be merged.

View workflow run

The `exit` statements in the `automated-pr-reviewer` bash script would prematurely terminate interactive bash sessions when the script was pasted into an agent's terminal or sourced.

This commit wraps the bash logic in a `main()` function and changes the top-level `exit 1` to `return 1 2>/dev/null || true` and `exit 0` to `return 0 2>/dev/null || true`. It also updates the autogenerated documentation pages.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants