Skip to content

Comments

Use IsaacSearchInstructionBuilder for events search endpoints#756

Merged
jsharkey13 merged 28 commits intomainfrom
hotfix/events-es-methods
Feb 16, 2026
Merged

Use IsaacSearchInstructionBuilder for events search endpoints#756
jsharkey13 merged 28 commits intomainfrom
hotfix/events-es-methods

Conversation

@axlewin
Copy link
Contributor

@axlewin axlewin commented Feb 10, 2026

Causes "nofilter" events to be hidden from non-staff users.

Also requires frontend and test content updates (the latter to fix the test that's failing on this branch).

Copy link
Member

@jsharkey13 jsharkey13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of the logic added to the EventsFacade doesn't really belong in a Facade class.

I think part of the problem is there's no good example of how to do this right, at present. Throwing more methods into the GitContentManager has been used before, but isn't right either.

I think that we should make a new Manager class, EventsManager (with the other event-related managers in isaac.api.managers) to hold the business logic, and leave the Facade to do auth/caching and coercion of user-provided params into our Enums.
For that to work, I think the GCM needs a new method to provide a new IsaacSearchInstructionBuilder initialised with the default arguments (make nofilter content hidden by default here, and add a new method to ISIB like searchFor like includeHiddenContent(boolean) and I think avoid using nofilter on the public method name so we can finally move away from the silly tag). You can then customise this in the EventsManager without needing all the properties to be configured in multiple places.

Start by moving the logic for just the three methods you've refactored here down to a manager; don't worry about the rest for now. It may be that three methods in the manager, one per Facace method, is fine. But you may find some repeated logic can be grouped up into private manager methods too!

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 24.01747% with 174 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.95%. Comparing base (aba8cbf) to head (8c55244).
⚠️ Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
...c/cam/cl/dtg/isaac/api/managers/EventsManager.java 14.66% 118 Missing and 10 partials ⚠️
.../java/uk/ac/cam/cl/dtg/isaac/api/EventsFacade.java 28.57% 34 Missing and 1 partial ⚠️
...tg/segue/search/IsaacSearchInstructionBuilder.java 35.71% 6 Missing and 3 partials ⚠️
...am/cl/dtg/segue/dao/content/GitContentManager.java 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #756      +/-   ##
==========================================
+ Coverage   39.92%   39.95%   +0.02%     
==========================================
  Files         545      546       +1     
  Lines       23892    23887       -5     
  Branches     2873     2873              
==========================================
+ Hits         9538     9543       +5     
+ Misses      13444    13436       -8     
+ Partials      910      908       -2     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

These methods all use the deprecated BooleanSearchClause under the hood,
and to ensure we don't continue using them or use them for new things,
mark them as @deprecated.
Inadvertently falling through these if statements led to a null response
being sent to the client rather than an error.
For some reason we always sorted in descending order, but then sometimes
also requested ascending order.
ElasticSearch seemed to cope with this, but it was confusing!
@jsharkey13 jsharkey13 merged commit 9feabf8 into main Feb 16, 2026
5 checks passed
@jsharkey13 jsharkey13 deleted the hotfix/events-es-methods branch February 16, 2026 15:15
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