Skip to content

fix(comms): refactor the wsLogaccess GetLogs filter creation#4546

Open
jeclrsg wants to merge 1 commit intohpcc-systems:mainfrom
jeclrsg:fix-refactor-wsLogaccess-filters
Open

fix(comms): refactor the wsLogaccess GetLogs filter creation#4546
jeclrsg wants to merge 1 commit intohpcc-systems:mainfrom
jeclrsg:fix-refactor-wsLogaccess-filters

Conversation

@jeclrsg
Copy link
Contributor

@jeclrsg jeclrsg commented Mar 18, 2026

  • refactored the WsLogaccessService filter creation
  • added basic tests and a mocked response fixture for the ELK stack

Checklist:

  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit message includes a "fixes" reference if appropriate.
    • The commit is signed.
  • The change has been fully tested:
    • I have viewed all related gallery items
    • I have viewed all related dermatology items
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised new issues to address them separately

Testing:

@jeclrsg jeclrsg requested a review from Copilot March 18, 2026 23:03
Copy link

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

Refactors LogaccessService.GetLogsEx filter construction for more predictable AND/OR grouping, and adds Vitest coverage with an ELK fixture to validate parsing + field mapping.

Changes:

  • Introduces helper functions to build filter trees deterministically (OR within same field, AND across fields).
  • Adds ELK stack response fixtures and Vitest cases for mapping, totals, and filter generation.
  • Refactors log line conversion and log-manager-type handling.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/comms/src/services/wsLogaccess.ts Replaces inline filter-building with reusable helpers and updates date range + log parsing.
packages/comms/tests/wsLogaccess.spec.ts Adds unit tests for ELK parsing/mapping and filter-tree construction.
packages/comms/tests/fixtures/logaccess.ts Adds mocked GetLogAccessInfo/GetLogs payloads used by the new tests.

* refactored the WsLogaccessService filter creation
* added basic tests and a mocked response fixture for the ELK stack

Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com>
@jeclrsg jeclrsg force-pushed the fix-refactor-wsLogaccess-filters branch from a358aba to a57a684 Compare March 19, 2026 13:37
@jeclrsg jeclrsg requested a review from GordonSmith March 19, 2026 13:38
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