fix: CodeRabbit auto-fixes for PR #102#104
Open
coderabbitai[bot] wants to merge 15 commits into
Open
Conversation
Add support for including a hidden _id column in table rows for wrapped entities (entityWithID). The _id column is automatically added to the Columns() output and included in Row() and PrettyRow() data, but marked as hidden so it doesn't appear as a visible column in the UI. This allows the _id metadata to be available in row data while keeping the table display clean. Updates the HTML React formatter to handle cells that exist in row data but not in the column definitions. Adds comprehensive test coverage for all entity types (TableProvider, PrettyRow, and plain structs) to verify the _id column is properly included in the output data but hidden from the visible columns. Refs: entity wrapping, table formatting
Introduce comprehensive stack trace support with language-agnostic parsing, styled rendering, and extensible source resolution. Adds StackTrace, StackFrame types and ParseJavaStackTrace parser to api package, with public convenience wrappers in clicky root. Includes support for frame filtering, context lines, and max frame truncation. Also adds MultiFilter type for comma-separated flag values with include/exclude semantics, and fixes field value assignment to support type conversion in flags package. Updates cache debug output to use task.GatedStderr() instead of os.Stderr to prevent log lines from breaking interactive renderer frame accounting. Fixes recursive struct handling in OpenAPI schema generation by tracking visited types. Refs: stack trace rendering, source context, Java exception parsing
…port Add shiki syntax highlighter and transformers to webapp dependencies for code block rendering. Implement comprehensive stack trace parsing and display with source resolution for Java exceptions. Add new demo showcases for code samples, label badges, documentation links, and parsed stack traces with configurable context and filtering. Update import paths and module resolution to use published clicky-ui distribution. Reorganize webapp navigation with semantic HTML and icon support. Breaking changes: - Update TypeScript path aliases to reference dist files instead of src - Change clicky-ui import to use published api-explorer module - Update CSS import to use distributed styles.css Refs: Stack trace rendering feature, syntax highlighting integration
Introduce a Builder pattern for configuring MCP servers with a fluent API (NewMcpServer, WithExclude, WithInclude, AutoExpose, IgnoreParams, WithFormat, Build, Command). Add a built-in 'discover-tools' MCP tool that returns a formatted catalogue of all registered tools with their parameters, defaults, and constraints. Supports multiple output formats (markdown, ansi, plain) via FormatOptions. Add IgnoredParamRule and IgnoredParams config to strip parameters from MCP tool schemas (MCP-only, does not affect OpenAPI). Add Format config to apply server-wide format/color overrides to tool execution. Refactor config path functions to be per-application (GetConfigPathFor, GetPromptsPathFor) so multiple clicky-based MCP servers don't share config files. Maintain backward compatibility with legacy GetConfigPath/GetPromptsPath. Remove the special 'discover-tools' prompt and its inline handling from prompts.go and command.go, replacing it with the dedicated MCP tool. Remove Verbose flag from CommandOptions (use clicky's existing --loglevel/-v instead). Includes comprehensive tests for Builder, IgnoredParams application, discover-tools rendering, and registry builtins.
… support Implement Server-Sent Events (SSE) transport alongside stdio for MCP servers, enabling Claude Desktop and other clients to connect via HTTP. Add `mcp tools` subcommand to preview tool catalogue with format options. Expand `mcp install` to support Claude, Codex, Gemini, Copilot, and Cursor clients with per-client config writers (JSON for most, TOML for Codex). Refactor config merging into reusable `loadCommandConfig` and `mergeInitialConfig` helpers to support both serve and tools commands. Remove built-in discover-tools tool in favor of dedicated `mcp tools` command for cleaner separation of concerns. Add comprehensive tests for SSE round-trip, install permutations across clients/transports, and config merging logic.
Remove unused module entries from go.sum that are no longer referenced in the project. This reduces dependency bloat and improves build clarity. Also add examples/enitity/enitity to .gitignore to exclude the compiled binary from version control.
Add Diff type to api package supporting multiple output formats (plain, ANSI, HTML, Markdown) for rendering unified diffs between strings. Implement grouped flag help output in flags package with category-based organization (Logging, Tasks, Format) via FlagCategoryAnnotation. Add BindAllFlagsToCommand helper to bind flags and install grouped usage template. Update cobra_command.go error logging to use %w format and adjust skip level. Move fatih/color and go-difflib from indirect to direct dependencies in go.mod.
Add GIT_COMMIT and BUILD_DATE variables to Makefile that are injected into the binary at build time using ldflags. This allows the binary to report its commit hash and build timestamp. Also reorganize imports in example webapp to consolidate EntityExplorerApp import and remove unused path aliases from tsconfig and vite config.
…nization Extract repeated logic into reusable helper functions across multiple modules: - api/diff.go: Replace color library calls with ansiStyle() helper for ANSI formatting - api/stacktrace.go: Extract frameHasSource() and frameSourceLineNumber() to reduce duplication in source line handling - mcp/command.go: Improve tools command format handling to respect configured defaults - mcp/server.go: Extract flag manipulation helpers (setCommandFlag, lookupCommandFlag, resetCommandState) and add origin validation for SSE endpoints - mcp/install.go: Improve port handling and symlink resolution error handling - flags_test.go: Replace sectionAfter() with more robust flagSection() that stops at next heading - rpc/openapi_serve_integration_test.go: Use dynamic port allocation instead of fixed port Also includes: - Security: Add CORS origin validation and request size limits to SSE server - Accessibility: Replace role="tab" with aria-current in webapp navigation - Test coverage: Add tests for explicit source line numbers and configured format handling - Code quality: Improve error handling and reduce code duplication
Custom entity actions previously always required a positional <id> argument (cobra.ExactArgs(1)), even when the action's target is supplied entirely through flags. WithOptionalID() relaxes the generated command to cobra.MaximumNArgs(1), shows [id] instead of <id> in usage, and skips the "id is required" check in the action DataFunc. get/delete commands are unaffected.
…ter paths Add renderableError to detect and render errors implementing clicky interfaces (Pretty/Textable/Tree*) through the format pipeline instead of collapsing to Error(). This allows rich error formatting to honor --format flags. Add GenerateFromCobraWithConfig to support custom converter configs (path prefix, default method) when generating OpenAPI specs, ensuring generated paths match registered routes. Store converterCfg in SwaggerServer to reuse the same config for executor initialization and spec regeneration. Export handler methods (HandleOpenAPIJSON, HandleOpenAPIYAML, HandleEntities, HandleHealth, RegisterExecutionRoutes) and ConverterConfig() to allow callers to compose custom mux patterns and merge multiple OpenAPI specs. Fix entity-root command handling: skip duplicate list subcommands when parent is runnable, and infer GET method for entity-root commands (no verb, has entity annotation). Refs: improved error UX and OpenAPI spec consistency with executor routes
StatusWarning should be a terminal status that freezes the task's endTime and cancels its context, preventing the duration from continuing to tick after the task completes. Before this fix, Warning() left endTime zero, causing getDuration() to keep returning time.Now()-startTime on every render, producing an ever-growing elapsed counter even after the task's goroutine had returned. Adds regression test to verify all terminal states (Success, Failed, Warning) properly freeze endTime and cancel the task context.
Update Go module dependencies including: - flanksource packages (commons, gomplate, is-healthy, captain) - AWS SDK v2 packages - Kubernetes packages (api, client-go, apimachinery, apiextensions-apiserver, klog) - golang.org packages (crypto, sync, sys, term, text, tools, mod, net, oauth2, exp) - OpenTelemetry packages - Various other indirect dependencies These updates include bug fixes, security patches, and feature improvements across the dependency tree.
Update Go module dependencies including: - AWS SDK v2 components (ini → v4a) - charmbracelet packages (golden, xpty, conpty) - aymanbagabas/go-udiff (0.3.1 → 0.4.1) - Various other transitive dependencies - Remove unused flanksource/captain dependency These updates bring in bug fixes, performance improvements, and security patches from upstream projects.
Fixed 8 file(s) based on 9 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Contributor
Author
|
Important Review skippedThis PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This stacked PR contains CodeRabbit auto-fixes for #102.
Files modified:
cobra_command.goexamples/uber_demo/main.goformatters/html_formatter.gomcp/command.gomcp/discover_tools.gomcp/install.gomcp/server.gorpc/openapi_serve_integration_test.go