Skip to content

Conversation

@ilber
Copy link

@ilber ilber commented Jan 13, 2026

There is no -o parameter in newest version of glab. Fixed it by using the correct output param:

-F --output Format output as: text, json. (text)

Summary by CodeRabbit

  • Bug Fixes
    • Resolved compatibility issue with GitLab CLI when retrieving merge request branch information, ensuring consistent data retrieval.

✏️ Tip: You can customize this high-level summary in your review settings.

There is no -o parameter in newest version of glab. Fixed it by using the correct output param:

 -F --output       Format output as: text, json. (text)
@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

A flag in the GitLab MR view command was updated from -o json to -F json in the branch name extraction function. The underlying logic, error handling, and control flow remain unchanged.

Changes

Cohort / File(s) Summary
GitLab MR Output Flag Update
src/commands/pr.ts
Replaced glab MR view output flag from -o json to -F json in getBranchNameFromPR function. JSON parsing and source_branch extraction logic remain identical.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A rabbit hops through flags so bright,
From -o json to -F in flight,
The branch name flows through stdout still,
One simple swap to fit the bill! 🐰

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: glab output parameter' directly and concisely describes the main change: replacing an incorrect glab output flag parameter.
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 docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1301994 and b7b02d1.

📒 Files selected for processing (1)
  • src/commands/pr.ts
🧰 Additional context used
📓 Path-based instructions (1)
src/commands/*.ts

📄 CodeRabbit inference engine (.cursor/rules/project.mdc)

src/commands/*.ts: Leverage Execa to execute Git commands and other external processes.
Provide clear, colored console feedback for success and error messages in CLI commands.

Files:

  • src/commands/pr.ts
🧬 Code graph analysis (1)
src/commands/pr.ts (1)
build/commands/pr.js (3)
  • execa (16-16)
  • execa (112-116)
  • execa (124-124)

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.

@ilber ilber changed the title Fix glab output parameter fix: glab output parameter Jan 13, 2026
Copy link

@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.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/commands/pr.ts (1)

157-168: The -F json flag is correct for glab 1.80.4, but add error handling for the execa call and colored console feedback.

Confirmed: glab mr view in version 1.80.4 uses -F --output for format specification, so -F json is correct.

However, the code lacks error handling for the execa() call itself—it only catches JSON parse errors. The glab command could fail (e.g., not found, invalid credentials, network error). Add a try-catch around the execa call or handle the potential error. Additionally, per the coding guidelines for src/commands/*.ts files, provide colored console feedback for error messages to enhance the CLI experience.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1301994 and b7b02d1.

📒 Files selected for processing (1)
  • src/commands/pr.ts
🧰 Additional context used
📓 Path-based instructions (1)
src/commands/*.ts

📄 CodeRabbit inference engine (.cursor/rules/project.mdc)

src/commands/*.ts: Leverage Execa to execute Git commands and other external processes.
Provide clear, colored console feedback for success and error messages in CLI commands.

Files:

  • src/commands/pr.ts
🧬 Code graph analysis (1)
src/commands/pr.ts (1)
build/commands/pr.js (3)
  • execa (16-16)
  • execa (112-116)
  • execa (124-124)

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.

1 participant