Skip to content

Conversation

@macrat
Copy link
Owner

@macrat macrat commented Nov 17, 2025

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 88.80866% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.70%. Comparing base (a33e450) to head (2790e21).
⚠️ Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
internal/testutil/store.go 0.00% 26 Missing ⚠️
cmd/ayd/server.go 38.88% 9 Missing and 2 partials ⚠️
internal/store/scanner.go 16.66% 4 Missing and 1 partial ⚠️
internal/store/store.go 88.37% 2 Missing and 3 partials ⚠️
lib-ayd/record.go 37.50% 3 Missing and 2 partials ⚠️
lib-ayd/time.go 97.10% 3 Missing and 2 partials ⚠️
internal/endpoint/mcp.go 98.68% 2 Missing and 1 partial ⚠️
internal/testutil/endpoint.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #46      +/-   ##
==========================================
+ Coverage   88.47%   88.70%   +0.22%     
==========================================
  Files          74       75       +1     
  Lines        5337     5720     +383     
==========================================
+ Hits         4722     5074     +352     
- Misses        476      500      +24     
- Partials      139      146       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@macrat macrat linked an issue Dec 1, 2025 that may be closed by this pull request
@macrat macrat marked this pull request as ready for review January 23, 2026 03:10
Copilot AI review requested due to automatic review settings January 23, 2026 03:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements version 0.18 of Ayd with three major changes: adding an Instance Name feature that displays throughout the UI and MCP tools, implementing a remote MCP (Model Context Protocol) server for AI tool integration, and various bug fixes and performance improvements.

Changes:

  • Added Instance Name feature that appears in page titles, status pages, and MCP tool descriptions
  • Implemented comprehensive MCP server endpoint at /mcp with three tools (query_status, query_incidents, query_logs) supporting jq queries for flexible data extraction
  • Refactored time parsing from string-based to optimized byte-level operations for better performance
  • Fixed critical bugs including pattern comparison bug, SSH username validation, and CSV error handling

Reviewed changes

Copilot reviewed 56 out of 57 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib-ayd/time.go, lib-ayd/time_test.go, lib-ayd/time_internal_test.go Major refactor of time parsing from string templates to optimized byte-level parsing with comprehensive test coverage
lib-ayd/record.go, lib-ayd/record_test.go, lib-ayd/record_fuzz_test.go Improved UTF-8 validation and JSON encoding to handle invalid UTF-8 strings safely
internal/store/store.go, internal/store/store_test.go Added instance name field and implemented file handle caching (100ms timeout) for better performance
internal/store/scanner.go, internal/store/scanner_test.go Fixed buffer overflow handling in log scanner using ReadSlice + ReadBytes fallback
internal/store/pattern.go Fixed critical bug in timePattern.Less where Hour comparison was incorrectly comparing p.Hour < p.Hour instead of p.Hour < x.Hour
internal/endpoint/mcp.go, internal/endpoint/mcp_test.go New comprehensive MCP server with three query tools supporting jq filtering with extensive test coverage (1000+ lines)
internal/endpoint/templates.go, internal/endpoint/templates_test.go, internal/endpoint/templates/base.html Added instance name to page titles and fixed latency_graph and extra2jsons to handle empty arrays
internal/endpoint/writer.go Fixed flushWriter to use pointer receiver instead of value receiver
internal/endpoint/log.go, internal/endpoint/incidents.go Added instance name support and fixed error scope in incidents.json endpoint
internal/scheme/ssh.go, internal/scheme/probe_test.go Fixed SSH username validation to reject empty usernames (e.g., ":@example.com")
internal/scheme/http.go Updated HTTP user agent to include version from meta package
internal/scheme/dns_test.go Updated DNS test expectations for cloudflare nameservers
internal/query/valuematcher.go, internal/query/tokenizer.go, internal/query/query_test.go Optimized time value matching and tokenization with byte-level operations and pre-allocation
internal/logconv/csv.go Fixed CSV writer to return flush errors instead of ignoring them
internal/testutil/store.go, internal/testutil/endpoint.go Refactored to use functional options pattern for better flexibility
internal/meta/version.go New package for version and commit information, extracted from main
cmd/ayd/main.go, cmd/ayd/server.go, cmd/ayd/schedule.go Added instance name flag (-n), version info refactoring, and interval validation
go.mod, go.sum Added MCP SDK and gojq dependencies, updated various dependencies
Makefile, Dockerfile, .goreleaser.yml Updated build scripts to inject version into new meta package location
README.md Added documentation for MCP server endpoint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@macrat macrat merged commit bfca03b into main Jan 23, 2026
11 checks passed
@macrat macrat deleted the v0.18 branch January 23, 2026 03:21
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.

Support remote MCP Server

2 participants