Skip to content

feat: nbctl more commands and enhancements#2

Merged
blue4209211 merged 2 commits into
mainfrom
i_135_shiv_nbctl
Oct 27, 2025
Merged

feat: nbctl more commands and enhancements#2
blue4209211 merged 2 commits into
mainfrom
i_135_shiv_nbctl

Conversation

@blue4209211

@blue4209211 blue4209211 commented Oct 27, 2025

Copy link
Copy Markdown
Contributor

cleanups

  • removed unnecessary files
  • changes interface{} to any

commands

  • new log-groups command
  • new security > images command
  • fix for metrics_query
  • fix for logs_query
  • waiting state support in nubi

configs

  • added support for profile global args

Related #19863

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @blue4209211, 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 significantly expands the nbctl command-line tool's capabilities by introducing several new commands and enhancing existing ones. It focuses on providing more granular control and visibility into logs, security recommendations, and distributed traces. The changes also include improvements to the interactive Nubi shell for better user interaction and a more flexible configuration system.

Highlights

  • New Log Group Listing: Introduced nbctl logs list-log-groups to identify critical/error log messages using PromQL queries, providing quick insights into system health.
  • Enhanced Security Commands: Added a new nbctl security command group, including nbctl security list-image-cves for detailed image vulnerability recommendations with various filtering capabilities (severity, namespace, workload, CVE ID, package ID, image name).
  • Advanced Trace Querying: Replaced the basic traces list command with a more powerful nbctl traces query command, offering extensive filtering options for distributed traces by workload, span, trace ID, time range, status code, and HTTP status code.
  • Interactive Nubi Shell Improvements: The nbctl nubi interactive shell now supports handling followup questions and responses, making conversations more dynamic and interactive.
  • Refactored Metrics Query: The nbctl metrics query command has been refactored to use a new GraphQL query structure, improving its flexibility and output, and introducing an instant query flag.
  • Flexible Configuration Profiles: Added support for loading specific configuration profiles using the --profile flag, enhancing configurability and allowing users to easily switch between different environments or settings.
  • Go Type Modernization: Updated Go code across several files to use any instead of interface{} where appropriate, aligning with modern Go practices for improved readability and conciseness.
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.

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

Copy link
Copy Markdown

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 commands (logs list-log-groups, security list-image-cves, traces query) and enhances existing functionality, such as adding profile support via a --profile flag and improving the interactive nubi shell with conversation follow-ups. The code is also modernized by replacing interface{} with any.

My review focuses on correctness, security, and user experience. I've identified a security vulnerability in the new traces query command due to unsafe query string construction, a couple of functional bugs in logs list-log-groups related to incorrect metric calculation and an unused flag, and a broken test file for a removed command. I've also included suggestions to improve the command-line output for metrics query to make it more user-friendly.

Comment thread cmd/traces_list_test.go Outdated
Comment thread cmd/traces_query.go
Comment thread cmd/logs_list_log_groups.go Outdated
Comment thread cmd/logs_list_log_groups.go
Comment thread cmd/logs_list_log_groups_test.go Outdated
Comment thread cmd/metrics_query.go
@blue4209211 blue4209211 merged commit f5cbd33 into main Oct 27, 2025
1 check passed
blue4209211 added a commit that referenced this pull request Jun 7, 2026
Resolves all three open high-severity alerts against
github.com/modelcontextprotocol/go-sdk:
- Alert #2: Improper handling of null Unicode in JSON parsing
- Alert #3: Cross-Site Tool Execution for HTTP servers without auth
- Alert #4: DNS Rebinding Protection disabled by default on localhost

All three are fixed by v1.4.1 (minor bump from v1.3.1).

Transitive bumps via go mod tidy:
- github.com/segmentio/encoding v0.5.3 -> v0.5.4
- golang.org/x/oauth2 v0.30.0 -> v0.34.0
- golang.org/x/sys v0.36.0 -> v0.40.0

Verified locally: `make test` green, `nbctl mcp` registers all 44
tools and reports "MCP server started, waiting for requests..."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

2 participants