feat(commit,ui,lint,config): Add multi-commit splitting, linter enablement config, and UI improvements - Add CommitAll (-A) flag to split staged changes into multiple AI-planned commits with optional max limit - Add linter enablement configuration to allow opt-in/opt-out of specific linters like jscpd - Implement IsLinterEnabled() helper and MergeLintConfig() support for linter settings - Fix LintIgnoreRule to match violations by file path alone - Update UI serve command to accept positional arguments for multiple result files instead of --results-file flag - Update documentation with new commit and UI serve examples - Clean up unused go.sum dependencies - #30
Merged
Conversation
Remove .gavel.yaml configuration file as it is no longer needed. Also remove the negation rule for dist/ directory from testrunner/ui/.gitignore to simplify the ignore patterns.
Update the post-receive hook script generation to include the --ui flag when running gavel test commands. This enables the UI output for test results in both the hook script template and the rendered hook script. Refs: hook script generation for git repositories
Add --addr flag to gavel test, lint, bench compare, and ui serve commands to allow binding the HTTP server to a custom interface instead of hardcoded localhost. When set to 0.0.0.0 or ::, the UI banner prints the first non-loopback IPv4 address for accessibility from other hosts. Defaults to localhost for backward compatibility. This enables exposing the UI on the LAN in CI/CD environments and local development scenarios where the server needs to be accessible from other machines.
Implement a new diagnostics system that captures and displays process tree information including CPU usage, memory metrics, and goroutine stack traces. Adds a new Diagnostics tab to the UI with real-time process monitoring and on-demand stack capture for the root process. Changes: - New DiagnosticsManager to collect and cache process snapshots - HTTP endpoints for /api/diagnostics and /api/diagnostics/collect - Frontend components DiagnosticsView and DiagnosticsDetailPanel - Process tree visualization with expandable hierarchy - Stack trace collection via pprof for the main gavel process - Metrics display: CPU%, RSS, VMS, open file descriptors Refs gopsutil/v3 dependency moved from indirect to direct requirement.
…run metadata and goroutine analysis Enable running tests across multiple git repositories by partitioning starting paths by their git root and orchestrating separate test runs per root. Merge results into a single output tree. Enhance test UI with: - Run metadata tracking (sequence, kind, timestamps) for initial runs and reruns - Goroutine stack trace parsing and filtering with state-based visualization - Three-state filter system (include/exclude/neutral) for test status, framework, linter, and severity - Process state indicators with icons and colors - Improved detail panels with progress bars and run information - Better handling of rerun state and stream token management Refactor test streamer to prevent sends after Done() and improve synchronization. Update GoTest detection to respect .gitignore. Add comprehensive tests for multi-root grouping and filter state management. Breaks: Filter state now uses Map<string, FilterMode> instead of Set<string> for include/exclude support.
…tion Add support for discovering and running tests in nested Go modules and git repositories. When discovering from a root directory, nested modules are automatically detected and run as separate groups with their own WorkDir. This enables proper test isolation and execution context for monorepos with multiple Go modules. Key changes: - Refactor groupPathsByGitRoot to return error and handle nested modules - Add executionRootForPath to determine the correct execution root (git root or go.mod) - Add expandNestedModuleGroups to discover nested modules when discovering from root - Add findNestedGoModuleRoots and findNearestGoModRoot helpers - Add WorkDir field to Test struct for tracking execution context - Update test runners (Ginkgo, GoTest) to skip detection without go.mod - Add WalkGitIgnoredBounded to limit walks to module boundaries - Update UI to support multi-root lint operations and display work_dir - Add NewSharedTestStreamer for multi-root runs to keep updates channel open - Annotate tests with their WorkDir for proper result tracking BREAKING CHANGE: groupPathsByGitRoot now returns ([]testGroup, error) instead of []testGroup
…le commits Implement a new --commit-all flag that uses AI to intelligently group staged changes into multiple cohesive commits. This includes: - New planCommitGroups function that uses an AI agent to analyze staged changes and propose logical grouping - commitGroup and related types to represent grouped changes - validateCommitPlan to ensure all files are covered exactly once - mergeGroupsToMax to enforce maximum commit count limits - Enhanced stagedChange parsing to extract file status, additions/deletions, and patch content - New runCommitAll function to execute the multi-commit workflow - Dry-run preview rendering with ANSI formatting for visual feedback - Comprehensive test suite covering validation, parsing, and execution scenarios The feature respects existing hooks, enforces that --commit-all cannot be used with --message, and stages files automatically if none are already staged.
Extract linter selection and discovery logic into separate functions to improve code reusability and testability. This enables the same selection logic to be used across lint execution, dry-run display, and UI rerun functionality. Key changes: - Create `shouldRunLinter()` to centralize linter enablement checks - Create `shouldSelectLinter()` to handle linter discovery and selection - Create `lint_discovery.go` with linter config pattern definitions - Add comprehensive test coverage for linter selection scenarios - Simplify `groupFilesByGitRoot()` to use workDir directly for implicit runs - Fix betterleaks report directory creation to prevent failures - Update ESLint DefaultIncludes to recognize eslint config files This refactoring enables UI rerun functionality and improves maintainability by centralizing selection logic.
…ounded directory walking Implement detached UI server handoff with comprehensive test run snapshots including metadata, git info, and diagnostics. Add --detach flag to control UI server lifecycle independently from test runner. Key changes: - Create testui.Snapshot type to serialize complete test run state (metadata, git info, tests, lint results, diagnostics) - Add snapshotGitInfo() and snapshotArgs() helpers to capture run context - Implement captureFinalDiagnostics() for optional diagnostics embedding - Add --detach flag with sensible defaults (30m auto-stop, 5m idle-timeout) - Support lint reruns in detached UI via executeLintRerun() - Add WorkDir override support in rerun requests - Implement WalkGitIgnoredBounded() to skip nested project roots during traversal - Add FindNearestGoModRoot() utility for module discovery - Update handoffDetachedUI() signature to accept Snapshot instead of separate tests/lint arrays - Print detached UI URL to stderr instead of stdout - Add Diagnostics flag to RunOptions for final snapshot embedding BREAKING CHANGE: handoffDetachedUI() now accepts testui.Snapshot parameter instead of separate tests and lint results arrays. UI serve command now accepts results file as positional argument instead of --results-file flag.
BREAKING CHANGE: Changed CLI flag from `--results-file` to positional arguments, and `--auto-stop` to `--detach`. Refactor snapshot handling to support loading and merging multiple JSON snapshot files. Introduce new Snapshot type in testrunner/ui package with SnapshotMetadata, SnapshotGit, and SnapshotStatus structures to replace the previous RunMetadata and inline fields. Key changes: - UIServeOptions.ResultsFile (string) → ResultsFiles ([]string) with positional args - Implement mergeSnapshots() to combine multiple snapshots with proper metadata/git/status merging - Add LoadSnapshot() method to Server for bulk snapshot loading - Update snapshot JSON schema: move `run` → `metadata`, add `git` and `status` objects, replace `done` with `status.running` - Remove snapshotPayload type; use public Snapshot type instead - Update CLI help text and comments to reflect new flag names - Add comprehensive tests for multi-snapshot merging and embedded diagnostics fallback This enables replaying multiple test runs in a single UI session while maintaining proper sequencing and metadata.
…ement config, and UI improvements - Add CommitAll (-A) flag to split staged changes into multiple AI-planned commits with optional max limit - Add linter enablement configuration to allow opt-in/opt-out of specific linters like jscpd - Implement IsLinterEnabled() helper and MergeLintConfig() support for linter settings - Fix LintIgnoreRule to match violations by file path alone - Update UI serve command to accept positional arguments for multiple result files instead of --results-file flag - Update documentation with new commit and UI serve examples - Clean up unused go.sum dependencies
Contributor
Gavel summary
Totals: 1412 passed · 7 failed · 11 skipped · 1m18s Failing testsgithub.com/flanksource/gavel/cmd/gavel — TestWriteSnapshotJSON_ReadByLoadResultsgithub.com/flanksource/gavel/cmd/gavel — TestLoadResults_MergesMultipleSnapshotsgithub.com/flanksource/gavel/cmd/gavel — TestLoadResults_PopulatesServergithub.com/flanksource/gavel/cmd/gavel — TestRunUIServe_ReplaysSnapshotAndExitsgithub.com/flanksource/gavel/testrunner — TestRegistryDetectAll... and 2 more failing tests — see the full gavel-results artifact. |
…mary files Remove separate HTML and summary file outputs. Instead, generate the summary on-demand in the job summary and PR comment steps using `gavel summary` command. This reduces artifact complexity while maintaining the same user-facing functionality. Remove inputs: html-file, summary-file Remove outputs: html-path, summary-path Update artifact upload to only include JSON and log files Generate summaries dynamically in downstream steps with fallback handling BREAKING CHANGE: html-file and summary-file inputs are removed; html-path and summary-path outputs are removed
…n PR detail
Implement artifact download functionality to fetch gavel test results from GitHub Actions and display them in the PR detail view. This includes:
- New github/artifacts.go module with ParseArtifactURL, FindGavelArtifact, and DownloadArtifact functions
- New pr/ui/gavel_results.go module to compute and display gavel results summary
- Progressive streaming of PR details via Server-Sent Events (SSE) for better UX
- Gavel results section in PR detail showing test counts, lint violations, and bench regressions
- Dedicated results page at /results/{repo}/{artifactId} with back navigation
- Support for both array and object JSON formats from gavel
- Testrunner UI now supports being embedded under a path prefix
- Add --show-passed flag to gavel command in action.yml
The PR detail endpoint now streams data progressively: PR metadata first, then workflow runs and gavel results in parallel, improving perceived performance.
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.
No description provided.