- Convert all text colors to oklch with blue saturation for consistent theming
- Update DaisyUI theme colors to use solid oklch values for better visibility
- Fix progress bar transparency issues in both light and dark modes
- Add missing SVG sprite icons: alert-circle, activity, route, routes
- Update base colors to use oklch with proper blue tint
The workflow was using an unsupported 'mode' parameter, causing fourmolu
to run in check mode instead of formatting files. Changed to use extra-args
to pass --mode inplace directly to fourmolu.
Change email back to test@apitoolkit.io so Auth.authorizeUserAndPersist
creates a new user (ID ...001) instead of reusing the nil user, matching
the project_members insert.
- Add refreshSession and runTestEffect helpers to eliminate duplication
- Skip session cache for ONBOARDING projects (actively being updated)
- Use pattern guards in sessionAndProject for cleaner control flow
- Simplify test setup: UPDATE sudo status instead of INSERT with conflict handling
- Restructure BusinessFlowsSpec with TestContext and withTestProject
- Rename projectOnboarding to projectOnboardingH for consistency
- Fix LemonSqueezy payment plan enum (FREE vs Free)
Update all integration tests to properly unpack tuple response from testServant helper, which now returns (RespHeaders a, a).
Key changes:
- Add servant and servant-htmx to integration test dependencies
- Fix tuple unpacking in all test specs (AnomalyList, Log, Alerts, ManageMembers, Projects, BusinessFlows, Reports, Api, ApiCatalog, GrpcIngestion)
- Fix BusinessFlowsSpec imports to use ResponseHeader data constructor
- Fix type-level string usage for header lookups
- Fix ProjectId to Text conversions using .toText
- Add missing pattern match cases to avoid incomplete pattern warnings
Simplified test code by:
- Replacing verbose toServantResponse pattern with concise testServant helper
- Changed test lambdas from \tr@TestResources{..} to \tr for cleaner syntax
- Updated field access to use dot notation (tr.trPool, tr.trATCtx, etc.)
This reduces boilerplate and improves test readability across all integration
test suites while maintaining the same functionality.
Affected test suites:
- Pages (ApiSpec, LogExplorer, Anomalies, Projects, Endpoints, Reports,
Monitors, BusinessFlows, Share)
- MonitoringSpec
- ProcessMessageSpec
Add comprehensive integration tests for business-critical workflows:
- Onboarding flow: Test all steps (Info, Survey, NotifChannel,
Integration) through handlers, verifying data persistence via
GET endpoints
- LemonSqueezy billing: Table-driven tests for webhook events
(subscription_created, cancelled, resumed, expired)
- Replay session recording: Test event ingestion and retrieval
- S3 configuration: Validation and removal tests (pending Minio setup)
Tests use the new structured response types to verify handler behavior
without HTML parsing. Includes table-driven testing patterns for
webhook scenarios and helper functions for creating test payloads.
Replace raw Html responses with typed response wrappers for better
type safety and testability:
- Onboarding handlers now return OnboardingGet, OnboardingInfoPost,
OnboardingConfPost, and OnboardingPhoneEmailsPost types
- Refactor onboardingGetH to build OnboardingStepData (InfoStep,
SurveyStep, NotifChannelStep, IntegrationStep, PricingStep,
CompleteStep) with ToHtml instance for rendering
- Add NotificationsUpdatePost type for notification channel updates
- Add Data.Default import to LemonSqueezy module
- Update Replay module imports for cleaner structure
- Update route type signatures to use new response types
This enables testing handlers through their return values rather than
parsing rendered HTML.
Move test helper functions for creating API keys and ingesting
telemetry data (logs, traces, metrics) from GrpcIngestionSpec into
the shared TestUtils module. This includes:
- createTestAPIKey: Create API keys via handler
- ingestLog/Trace/Metric: Ingest via resource attributes
- ingestLogWithHeader/TraceWithHeader/MetricWithHeader: Ingest via gRPC Authorization header
- toBaseServantResponse: Run base context handlers in tests
Add necessary imports (Proto, OTLP modules, Api module) and derive
Generic for AuthContext to support the new test infrastructure.
Load environment config in test setup to respect LOG_LEVEL setting.
Update logBackgroundJobsInfo to use structured logging and accept logger parameter.
Add LOG_LEVEL environment variable to control application logging verbosity.
Supports trace, info, and attention levels with trace as the default.
Update all logging call sites to use the configured log level.
Remove duplicate callOpenAIAPI implementation from Pkg.AI and use the
version from Data.Effectful.LLM instead. Export callOpenAIAPI from the
effect module and re-export it in Pkg.AI for backward compatibility.
Also clean up unused imports in both modules.
Metadata authentication:
- Add OtlpRequestMetadata type to parse Authorization header from gRPC metadata
- Support both 'Bearer <token>' and raw token formats
- Update processTraceRequest, processLogsRequest, processMetricsRequest to accept
metadata API key parameter
- Add RPC handlers that extract API key from gRPC metadata
- Combine metadata API key with resource attribute keys for authentication
- Add test helpers for ingesting telemetry with gRPC headers
Grapesy API compatibility (for upgraded library):
- Replace NoMethods with NoMoreMethods constructor
- Update sendFinalOutput calls to pass tuple (defMessage, NoMetadata)
- Add type instance declarations for response metadata
- Add openai package dependency
- Update LLM effect to use OpenAI V1 chat completion parameters
- Pass model name and messages via proper parameter structure
- Fix error handling to use show instead of toText
Update expectLogsJson helper to use fail instead of expectationFailure
for proper IO type compatibility, add handling for LogsPatternList
constructor, and fix Test 3.2 to properly expect GrpcUnauthenticated
exception when API key is missing.
- Add Data.Aeson qualified import
- Fix queryLogs return type: LogsResp -> LogsGet
- Make expectLogsJson type more specific
- Add LogsQueryLibrary case to expectLogsJson pattern match
- Add GrpcIngestionSpec to test suite in package.yaml and cabal
- Add required dependencies: lens, proto-lens, grapesy
- Update Makefile timescaledb-docker-tmp to use faketime for frozen test time
- Export gRPC handlers and process functions from OtlpServer for testing
- Add runQueryEffect helper in TestUtils for chart query testing
- Fix ProjectsSpec test to verify updates in list instead of relying on index
- Add testTimeRange constant for common time range setup
- Add helper functions: ingestLog, ingestTrace, ingestMetric
- Add queryLogs helper to replace repetitive 22-parameter apiLogH calls
- Add expectLogsJson helper for unified response extraction
- Use traverse and zip/zip3 for cleaner iteration patterns
- Reduced from 447 lines to 176 lines (60% reduction)
- All tests still target complete handler chains
Add cached LLM responses for integration tests to enable deterministic
testing without making actual OpenAI API calls.
Files cached:
- Issue classification prompts
- Title generation prompts
- Description generation prompts
These golden files will be reused across test runs to ensure consistency
and avoid unnecessary API costs during testing.
Update integration tests to use the new TestResources pattern for better
test organization and consistency.
Changes:
- Replace withSetup callback with withTestResources
- Use runTestBg helper instead of runTestBackground
- Access test resources via TestResources record fields
- Remove redundant imports (execute from DBT)
- Simplify test setup code
This refactoring improves test readability and reduces boilerplate.
Add structured logging for notifications in test mode to show notification
type, receiver, and template information. Also add trace-level logging for
full notification payloads to aid debugging.
The previous unique constraint was too restrictive, preventing multiple
query alert issues for the same project and preventing new api_change
issues after acknowledging old ones.
Changes:
- Add migration to drop overly restrictive table-level constraint
- Update insertIssue to use partial unique index instead
- Partial index only applies to open api_change issues per endpoint
The partial unique index unique_open_api_change_issue_per_endpoint
already enforces the correct business logic: only one open (unacknowledged,
unarchived) api_change issue per (project_id, endpoint_hash).