Skip to content

Conversation

@wquintal
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @wquintal, 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 delivers a significant enhancement to the logviewer application by introducing a fully interactive Terminal User Interface (TUI). This new TUI provides a dynamic and user-friendly way to browse, filter, and analyze logs directly within the terminal, moving beyond static command-line output. The implementation leverages the charmbracelet/bubbletea framework and includes robust state management for search parameters, tab navigation, and sidebar details. Accompanying these changes are necessary updates to core search logic to ensure data integrity and compatibility with the interactive environment, as well as general dependency maintenance.

Highlights

  • New Terminal User Interface (TUI): Introduced a comprehensive TUI for interactive log viewing and filtering, accessible via the logviewer tui command. This TUI supports tab-based navigation, real-time log streaming, Vim-style navigation, full-text search, and detailed JSON field inspection.
  • TUI Command and Flag Integration: Added a new tui Cobra command with aliases live and ui, and integrated query-compatible flags (context IDs, time ranges, native query, fields, variables, refresh) with completion functions to provide a familiar command-line experience for TUI launch.
  • Deep Copy for Search Contexts: Implemented deep copying for LogSearch and Filter structures within search contexts to prevent unintended mutation of configuration maps when applying inherited searches or modifying search parameters in the TUI.
  • Enhanced HTTP Debug Logging: Modified HTTP debug logging to activate not only via a dedicated flag but also automatically when the global logging level is set to DEBUG or TRACE.
  • Dependency Updates: Updated the Go version to 1.24.0 and refreshed several charmbracelet libraries (bubbles, bubbletea, huh, x/ansi) and golang.org/x/sys to their latest versions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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
Contributor

@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 a new Text-based User Interface (TUI) for interactively viewing logs, which is a major new feature. The implementation uses the bubbletea library and adds a new tui command. The changes include the core TUI model, components like a chip-based search bar, and integration with the existing command structure.

My review focuses on several key areas. I've identified a critical race condition in the log streaming logic that needs to be addressed to prevent panics and data corruption. I've also pointed out significant code duplication in the command flag setup and a redundant, buggy deep-copy function, both of which should be refactored to improve maintainability and correctness. Additionally, there are a few minor cleanups for unused code.

Overall, this is a great addition, and with these fixes, it will be a robust and valuable feature.

@github-actions
Copy link

Code Coverage

Package Line Rate Health
github.com/bascanada/logviewer/cmd 22%
github.com/bascanada/logviewer/integration/benchmark 0%
github.com/bascanada/logviewer 0%
github.com/bascanada/logviewer/pkg/adapter/hl 71%
github.com/bascanada/logviewer/pkg/http 17%
github.com/bascanada/logviewer/pkg/log/client/config 50%
github.com/bascanada/logviewer/pkg/log/client 56%
github.com/bascanada/logviewer/pkg/log/factory 0%
github.com/bascanada/logviewer/pkg/log/impl/cloudwatch 56%
github.com/bascanada/logviewer/pkg/log/impl/docker 0%
github.com/bascanada/logviewer/pkg/log/impl/elk/kibana 0%
github.com/bascanada/logviewer/pkg/log/impl/elk/opensearch 45%
github.com/bascanada/logviewer/pkg/log/impl/elk 52%
github.com/bascanada/logviewer/pkg/log/impl/k8s 15%
github.com/bascanada/logviewer/pkg/log/impl/local 17%
github.com/bascanada/logviewer/pkg/log/impl/splunk/logclient 65%
github.com/bascanada/logviewer/pkg/log/impl/splunk/restapi 29%
github.com/bascanada/logviewer/pkg/log/impl/ssh 6%
github.com/bascanada/logviewer/pkg/log 0%
github.com/bascanada/logviewer/pkg/log/printer 68%
github.com/bascanada/logviewer/pkg/log/reader 83%
github.com/bascanada/logviewer/pkg/query 82%
github.com/bascanada/logviewer/pkg/server 44%
github.com/bascanada/logviewer/pkg/tui 18%
github.com/bascanada/logviewer/pkg/ty 27%
Summary 34% (3625 / 10661)

Minimum allowed line rate is 20%

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