Skip to content

Conversation

@macrat
Copy link
Owner

@macrat macrat commented Dec 29, 2025

No description provided.

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 fixes multiple bugs throughout the codebase, including logic errors, missing error handling, incorrect API usage, and edge case handling issues.

Key Changes

  • Fixed critical comparison bug in timePattern.Less() method that was comparing p.Hour with itself
  • Added validation for empty SSH usernames and proper error handling for missing files
  • Improved error propagation in CSV writer and better edge case handling for empty/zero data

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/store/store.go Fixed file opening to use read-only mode without O_CREATE flag, properly handling non-existent files
internal/store/pattern.go Fixed comparison bug where p.Hour < p.Hour was changed to p.Hour < x.Hour
internal/scheme/ssh.go Added validation for empty username strings in SSH configuration
internal/scheme/probe_test.go Added test cases for empty username scenario (:@example.com)
internal/scheme/dns_test.go Updated DNS nameserver test expectations from iana-servers to cloudflare nameservers
internal/logconv/csv.go Changed to return CSV writer's error instead of always returning nil
internal/endpoint/writer.go Fixed flushWriter to use pointer receiver to properly maintain state
internal/endpoint/templates_test.go Added test cases for edge cases (zero latency, NaN values)
internal/endpoint/templates.go Added safety checks for zero max latency and empty slice access
internal/endpoint/metrics.go Fixed raw string literals in escape sequences for proper backslash handling
internal/endpoint/mcp.go Fixed variable scope by declaring query variable before conditional block
internal/endpoint/incidents.go Corrected error handler name from "log.json" to "incidents.json"
cmd/ayd/schedule_test.go Added test cases for interval schedule validation
cmd/ayd/schedule.go Added validation to reject zero or negative interval durations

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

@codecov
Copy link

codecov bot commented Dec 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v0.18@89f78e0). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             v0.18      #53   +/-   ##
========================================
  Coverage         ?   88.70%           
========================================
  Files            ?       75           
  Lines            ?     5720           
  Branches         ?        0           
========================================
  Hits             ?     5074           
  Misses           ?      500           
  Partials         ?      146           

☔ 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 changed the title Fix bugs Follow to example.com's hosting service Dec 29, 2025
@macrat macrat merged commit ef9a05f into v0.18 Dec 29, 2025
5 checks passed
@macrat macrat deleted the fix-bugs branch December 29, 2025 07:48
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