Commit graph

17 commits

Author SHA1 Message Date
Anthony Alaribe
e212df0b96
Tests in prs. And fix hlint warnings and failing UI tests (#230)
* Enable tests and hlint in pull request workflow

- Add hlint job to run on all PRs

- Make test jobs run even if build fails (using if: always())

- Fix shadowing binding in Table.hs colAttrs function

- Fix LLM.hs type error by using langchain-hs standard pattern

- Fix TypeScript error in log-worker-functions.ts with optional chaining

This ensures CI checks run independently and provide feedback even when some jobs fail.

* Convert PR workflow from stack to cabal

- Replace stack with cabal commands throughout

- Update caching to use dist-newstyle and ~/.cabal/store

- Use awalsh128/cache-apt-pkgs-action for system deps

- Set OpenSSL env vars properly for GitHub Actions

- Add fail-fast: false to test matrix

- Add ::group:: annotations for better log organization

* Revert LLM.hs changes - they were stack-related, not actual bugs

* minor linting error

* run hlint refactor in prs

* Apply hlint fixes across codebase

Fixed 239 hlint warnings: use toText, simplify encoding chains, replace fromMaybe with maybe, use ordNub, convert to guards, use unless, eta reduction, list comprehensions, newtype conversions, and remove unused imports. Updated .hlint.yaml to allow flexible imports for Data.List and Data.Aeson.

* Auto-format code with fourmolu

* Fix UI test failures in GitHub Actions

Update Node.js version from 18 to 20 to satisfy happy-dom requirement

Add CSS.escape mock for Monaco Editor theme initialization

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-17 00:34:01 +01:00
Anthony Alaribe
e9f828e866
Attempt at a versatile table component (#229)
* attempt at a versatile table component

* Auto-format code with fourmolu

* pr updates based on feedback

* Auto-format code with fourmolu

* refactor

* fix ui differences in the tables

* Auto-format code with fourmolu

* remove redundancies

* Auto-format code with fourmolu

* remove redundancies

* Auto-format code with fourmolu

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-16 22:38:46 +01:00
Anthony Alaribe
ba651f5040 Fix GHC 9.12 TypeAbstractions errors in test files
Replace type synonym Projects.ProjectId with UUIDId constructor
in all test files to fix "Illegal term-level use of type constructor"
errors that occur with GHC 9.12's TypeAbstractions extension.
2025-11-27 23:29:55 +01:00
Anthony Alaribe
4fe33fac2e Consolidate Telemetry, Anomalies, and Monitors modules
- Merged Pages/Telemetry/Metrics.hs and Trace.hs into Pages/Telemetry.hs
- Moved Pages/Anomalies/AnomalyList.hs to Pages/Anomalies.hs
- Moved Pages/Monitors/Alerts.hs to Pages/Monitors.hs
- Fixed FromRow type errors in several files (Only wrapper)
- Fixed import issues in Pages/Projects.hs
2025-11-27 23:29:54 +01:00
Anthony Alaribe
4b0e92659b Fix integration test compilation errors after testServant refactoring
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
2025-11-17 11:30:07 +01:00
Anthony Alaribe
f10795b158 Refactor integration tests to use simplified testServant helper
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
2025-11-17 09:04:28 +01:00
Anthony Alaribe
8477228369 Update integration tests to pass logger to logging helper
Pass logger parameter to logBackgroundJobsInfo calls to support
the new structured logging interface.
2025-11-15 21:48:42 +00:00
Anthony Alaribe
5ab5c35edd improve background job handling and make tests more precise in job handling 2025-11-15 05:54:10 +00:00
Anthony Alaribe
09e67ab30c fix api catalog related failing tests especally for anomaly 2025-09-05 02:59:16 +02:00
Anthony Alaribe
0dd323ac90 disable refreshing non existent materialize views 2025-09-05 01:28:56 +02:00
Anthony Alaribe
bae911eea1 fix some issues that made some tests not compile 2025-08-30 15:39:04 +02:00
Anthony Alaribe
152be7e8fd fix some issues that made tests not compile 2025-08-30 15:08:53 +02:00
Anthony Alaribe
55f74c2dfb cleanup test suite for now. so it passes. 2025-07-07 00:21:05 +02:00
Anthony Alaribe
8b033fac28 improve api catalog logic and make tests pass well. also remove the time duration between when anomalies are found and when the issues are processed 2025-07-07 00:21:04 +02:00
Anthony Alaribe
de40579274 checkpoint. iterating on the api catalog logic and testing it 2025-07-07 00:21:04 +02:00
Anthony Alaribe
a7434075a7 checkpoint towards passing integration tests. only 10 tests are now failing and would need abstracting of email and slack for tests 2025-07-03 15:15:11 +02:00
Anthony Alaribe
4dd34754ff move unit tests and integration tests to their own project s they run quickly 2025-07-02 01:41:15 +02:00