Skip to content

t2814: Remove 2>/dev/null from pulse external-contributor label API calls#2822

Closed
alex-solovyev wants to merge 1 commit intomainfrom
bugfix/t2814-pulse-stderr-visible
Closed

t2814: Remove 2>/dev/null from pulse external-contributor label API calls#2822
alex-solovyev wants to merge 1 commit intomainfrom
bugfix/t2814-pulse-stderr-visible

Conversation

@alex-solovyev
Copy link
Collaborator

@alex-solovyev alex-solovyev commented Mar 4, 2026

Summary

  • Removed 2>/dev/null stderr suppression from two gh api label POST calls in the external-contributor gate (lines 109 and 114)
  • || true already prevents script exit on non-zero — the stderr suppression was masking auth, network, and API errors that are critical for debugging

Changes

File: .agents/scripts/commands/pulse.md

Both gh api "repos/<slug>/issues/<number>/labels" -X POST -f 'labels[]=external-contributor' calls in the external-contributor section now allow stderr to flow through while still using || true to prevent script abort.

Source

Gemini code review finding on PR #2803 (critical severity).

Closes #2814

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced error visibility for label management operations by displaying previously hidden error messages.

…tributor gate

The gh api calls for adding the external-contributor label suppressed
stderr with 2>/dev/null, masking auth, network, and API errors. The
|| true already prevents script exit on failure — stderr suppression
was unnecessary and harmful for debugging.

Closes #2814
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the debuggability of the external-contributor gate script by ensuring that potential authentication, network, or API errors from gh api calls are no longer masked. By removing stderr suppression, the script now allows error messages to flow through, facilitating quicker identification and resolution of issues, while maintaining its non-aborting behavior on failure.

Highlights

  • Error Visibility: Removed 2>/dev/null stderr suppression from two gh api label POST calls within the external-contributor gate, allowing critical debugging information to be visible.
Changelog
  • .agents/scripts/commands/pulse.md
    • Removed 2>/dev/null from two gh api commands to allow stderr to be displayed.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Walkthrough

This PR removes stderr redirection (2>/dev/null) from two GitHub CLI API calls in the pulse script that add the external-contributor label. The change allows API errors to be visible for debugging while maintaining script resilience via || true guards.

Changes

Cohort / File(s) Summary
GitHub CLI Error Visibility
.agents/scripts/commands/pulse.md
Removed stderr suppression from two gh api calls adding the external-contributor label, allowing API error output to surface for debugging while preserving fault tolerance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

bug

Poem

🔍 Silent errors fled the night,
stderr flows, debugging's light ✨
Two gh api calls now speak true,
No more /dev/null hiding clue.
Transparency wins the fight! 🎯

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: removing stderr suppression from two GitHub CLI API calls in the pulse.md script.
Linked Issues check ✅ Passed The PR fully addresses the critical finding from issue #2814: both gh api calls that add the external-contributor label now have stderr visible while retaining || true for non-fatal failure handling.
Out of Scope Changes check ✅ Passed All changes are scoped to the objective of removing stderr suppression from the two GitHub API calls; no unrelated modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/t2814-pulse-stderr-visible

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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 removes 2>/dev/null from two gh api calls in .agents/scripts/commands/pulse.md used for labeling external contributor pull requests. This change allows potential API, network, or authentication errors to be displayed, which is beneficial for debugging, while || true is retained to prevent script termination on failure. The changes correctly address the issue of suppressed error messages.

Note: Security Review has been skipped due to the limited scope of the PR.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.agents/scripts/commands/pulse.md (1)

113-114: Nice consistency; consider grouping chained commands for clarity.

Behavior is correct, and stderr visibility is now preserved. Optional: group the guarded block to make intent explicit and reduce shell-precedence ambiguity for future edits.

Optional clarity refactor
-  gh pr comment <number> --repo <slug> --body "This PR is from an external contributor (@<author>). Auto-merge is disabled for external PRs — a maintainer must review and merge manually." \
-    && gh api "repos/<slug>/issues/<number>/labels" -X POST -f 'labels[]=external-contributor' || true
+  {
+    gh pr comment <number> --repo <slug> --body "This PR is from an external contributor (@<author>). Auto-merge is disabled for external PRs — a maintainer must review and merge manually." \
+      && gh api "repos/<slug>/issues/<number>/labels" -X POST -f 'labels[]=external-contributor'
+  } || true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.agents/scripts/commands/pulse.md around lines 113 - 114, Group the two
chained shell commands into a single guarded block so the intent is explicit and
the entire sequence is short-circuited by the trailing || true; specifically,
place the gh pr comment and gh api commands into one grouped block (e.g., using
braces or a subshell) so the && between them is evaluated inside the group and
then append || true to the group instead of to the second command alone,
ensuring stderr visibility is preserved while making the control flow clearer.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.agents/scripts/commands/pulse.md:
- Around line 113-114: Group the two chained shell commands into a single
guarded block so the intent is explicit and the entire sequence is
short-circuited by the trailing || true; specifically, place the gh pr comment
and gh api commands into one grouped block (e.g., using braces or a subshell) so
the && between them is evaluated inside the group and then append || true to the
group instead of to the second command alone, ensuring stderr visibility is
preserved while making the control flow clearer.

ℹ️ Review info
Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6b05556e-de55-42ab-98ac-cd50bcf089f9

📥 Commits

Reviewing files that changed from the base of the PR and between b5173be and c81881b.

📒 Files selected for processing (1)
  • .agents/scripts/commands/pulse.md

@alex-solovyev
Copy link
Collaborator Author

Closing — this change is superseded by PR #2810 (fix: move external-contributor idempotency guard from prompt to shell function).

PR #2810 refactored the inline gh api ... labels[]=external-contributor calls out of pulse.md entirely, replacing them with the check_external_contributor_pr shell function in pulse-wrapper.sh. The two lines this PR was modifying (removing 2>/dev/null) no longer exist in main.

After rebasing onto main, this branch produces zero diff — the commit was dropped as empty. The underlying issue (stderr suppression masking errors) is fully resolved by the refactoring in #2810.

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.

quality-debt: .agents/scripts/commands/pulse.md — PR #2803 review feedback (critical)

1 participant