Skip to content

t2819: replace 2>/dev/null with --silent on gh api label POST calls#2829

Merged
alex-solovyev merged 1 commit intomainfrom
chore/t2819-pulse-silent-flag
Mar 4, 2026
Merged

t2819: replace 2>/dev/null with --silent on gh api label POST calls#2829
alex-solovyev merged 1 commit intomainfrom
chore/t2819-pulse-silent-flag

Conversation

@alex-solovyev
Copy link
Collaborator

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

Summary

  • Replace 2>/dev/null with --silent flag on three gh api label POST calls in pulse.md and pulse-wrapper.sh
  • 2>/dev/null suppresses all stderr including auth/network/API errors, making debugging difficult
  • --silent only suppresses the successful JSON response body on stdout while preserving genuine error output on stderr

Changes

.agents/scripts/commands/pulse.md (1 site):

  • Line 279: orphaned PR status:orphaned label application

.agents/scripts/pulse-wrapper.sh (2 sites):

  • Line 660: external-contributor label re-add (when comment exists but label is missing)
  • Line 671: external-contributor label on first flag

All three retain || true for resilience — the change only affects error visibility, not control flow.

Context

Addresses quality-debt review feedback from Gemini on PR #2794. The original PR replaced gh pr edit --add-label with gh api REST calls (fixing a GraphQL deprecation issue), but used 2>/dev/null for error suppression. The reviewer correctly noted this hides genuine errors and suggested --silent instead.

Closes #2819

Summary by CodeRabbit

  • Chores
    • Updated automation script configurations to improve error handling and output visibility in CI/CD workflows by refining GitHub CLI invocation behavior for label management operations.

Addresses quality-debt review feedback from PR #2794 (Gemini).

2>/dev/null suppresses all stderr, hiding auth, network, and API errors.
gh api --silent only suppresses the successful JSON response body on
stdout while preserving genuine error output on stderr. The || true
already handles non-zero exit codes for resilience.

Three call sites updated:
- pulse.md:279 (orphaned PR labeling)
- pulse-wrapper.sh:660 (external-contributor label re-add)
- pulse-wrapper.sh:671 (external-contributor label on first flag)

Closes #2819
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fd580697-9c78-44c7-a123-df749dfa21f2

📥 Commits

Reviewing files that changed from the base of the PR and between 1d730f7 and 7708e0b.

📒 Files selected for processing (2)
  • .agents/scripts/commands/pulse.md
  • .agents/scripts/pulse-wrapper.sh

Walkthrough

These changes replace stderr redirection (2>/dev/null) with the --silent flag in GitHub CLI API calls across two shell script files. This allows genuine errors to be surfaced to stderr while still suppressing successful JSON response output, improving debuggability.

Changes

Cohort / File(s) Summary
GitHub CLI Error Handling
.agents/scripts/commands/pulse.md, .agents/scripts/pulse-wrapper.sh
Replaced gh api calls using 2>/dev/null stderr redirection with --silent flag to suppress output without hiding errors. Preserves original behavior while enabling error visibility for debugging.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • #2794: Original PR that introduced the gh api calls for labeling PRs; this PR addresses review feedback from that merge
  • #2789: Modifies the same pulse scripts' GitHub CLI invocations for stderr handling
  • #2803: Adjusts stderr/output handling in the same pulse script label and comment API calls

Suggested labels

chore

Poem

🔇 Whispers of errors, once buried deep,
Now surface to light from silence's keep,
--silent speaks truth where /dev/null deceived,
A script refined, a debugger relieved! ✨

🚥 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 primary change: replacing 2>/dev/null with --silent on gh api label POST calls across the affected files.
Linked Issues check ✅ Passed The PR fully addresses issue #2819 by replacing all three identified 2>/dev/null occurrences with --silent flag on gh api POST label calls in pulse-related scripts.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective: replacing 2>/dev/null with --silent on gh api label POST calls. No unrelated modifications are present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/t2819-pulse-silent-flag

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.

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 107 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Mar 4 15:28:04 UTC 2026: Code review monitoring started
Wed Mar 4 15:28:04 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 107

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 107
  • VULNERABILITIES: 0

Generated on: Wed Mar 4 15:28:07 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

@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 enhances the robustness and debuggability of the pulse scripts by refining how GitHub API calls handle output. It transitions from broadly suppressing all standard error output to selectively silencing only successful JSON responses, thereby making critical error messages visible. This change directly addresses previous code review feedback, improving diagnostic capabilities without impacting the functional behavior of the scripts.

Highlights

  • Improved Error Visibility: Replaced 2>/dev/null with --silent in gh api label POST calls, ensuring that genuine error messages are no longer suppressed, which significantly aids in debugging.
  • Targeted Changes: The modification was applied to three specific gh api calls: one for the status:orphaned label in pulse.md and two for the external-contributor label within pulse-wrapper.sh.
  • Preserved Control Flow: The || true safeguard remains in place for all affected commands, meaning the change exclusively enhances error reporting without altering the existing script logic or control flow.
Changelog
  • .agents/scripts/commands/pulse.md
    • Replaced 2>/dev/null with --silent in the gh api command responsible for applying the status:orphaned label.
  • .agents/scripts/pulse-wrapper.sh
    • Replaced 2>/dev/null with --silent in the gh api command used to re-add the external-contributor label.
    • Replaced 2>/dev/null with --silent in the gh api command for initially applying the external-contributor label.
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.

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 replaces 2>/dev/null with the --silent flag on three gh api calls within .agents/scripts/commands/pulse.md and .agents/scripts/pulse-wrapper.sh. This change modifies error handling by allowing genuine errors (e.g., authentication, network issues) to be printed to stderr, which were previously suppressed. The --silent flag correctly suppresses the JSON response body on stdout for successful calls, while the || true construct is retained to prevent script termination on failure. The changes are consistent and correctly implemented as described.

Note: Security Review did not run due to the size of the PR.

@alex-solovyev alex-solovyev merged commit 8788bd5 into main Mar 4, 2026
27 of 28 checks passed
@alex-solovyev alex-solovyev deleted the chore/t2819-pulse-silent-flag branch March 4, 2026 15:34
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 #2794 review feedback (medium)

1 participant