New Database Table: Credit Purchases Added
What developments have taken place today?
Today’s commits primarily focus on improving observability, dependency management, and data handling within various components of the system. Several tests were updated to reflect these changes.
- A test function was modified to correctly dereference a pointer variable when comparing timestamps, ensuring accurate test assertions.
- The
remote-daemon-client-typescript
project’s dependencies were updated to newer versions, including@types/node
andregjsparser
, addressing potential bug fixes and new features. The Git repository URL was also updated for consistency. - A new Go template file (
admin/website_detail.go.tmpl
) was added to facilitate the generation of HTML views for website details in the admin interface. - The
CheckerMessageGenerator
now includes logging statements to track constructed URLs and message generation, along with a check for debug settings. - Dependencies were updated for
http-cache-semantics
andremote-daemon-client-typescript
, alongside an update to the Git repository URL. - Error handling was enhanced in the
helper_url_downloader
package by adding specific checks for “no such host” and “server misbehaving” DNS errors, returning custom error types (ErrDNSLookupFailed
andErrDNSServerMisbehaving
) and logging these failures. - The
GenerateAll
function in cron jobs was modified to include tracing information usingtelemetry.StartSmartSpan
, improving observability and allowing for detailed analysis of execution paths. Error handling was also improved by checking for a nil context and adding database error handling. - The
WebsiteURLPingHistoryRepository
now supports saving data with nullable fields, accommodating cases where certain metrics (like TTFB) might not be available during a ping operation. - The
URLDownloader
has been significantly revamped to provide more detailed HTTP request statistics through a newRequestStats
struct. This includes capturing timing information for DNS lookup, connection establishment, TLS handshake, and other key stages of the download process. The downloader also now avoids consuming excessive memory when handling large response bodies and incorporates client-side tracing viahttptrace
. - Unit tests for the
URLDownloader
were comprehensively updated to cover various scenarios including successful downloads, redirects, invalid URLs, server unreachable conditions, empty response bodies, client timeouts, TLS handshake failures, and unexpected EOFs. These tests also verify timing metrics and status codes.
These changes collectively enhance system reliability through improved error handling, increase visibility through detailed tracing and logging, and provide richer data for monitoring and debugging. The updates to dependencies ensure the components are using current best practices and bug fixes while the updated unit tests improve code quality.
observability dependency management testing error handling tracing