Skip to content

ETT-432 Incorrect FT Facet for CAA Users#186

Merged
moseshll merged 10 commits intomainfrom
ETT-432_incorrect_caa_ft_facet
Feb 25, 2026
Merged

ETT-432 Incorrect FT Facet for CAA Users#186
moseshll merged 10 commits intomainfrom
ETT-432_incorrect_caa_ft_facet

Conversation

@moseshll
Copy link
Contributor

@moseshll moseshll commented Feb 16, 2026

I believe the FT facets should be mostly right at this point. Worth several careful looks at the expected values in the Facets.t tests.

Available on dev-2.

Initial changes to make testing easier:

  • Auth::Auth::__get_scoped_affiliations checks allowed_affiliations for definedness before using it as a regex. Cuts down on warnings in the "not logged in" case.
  • Remove umall from RightsGlobals::g_access_requires_holdings_attribute_values since it shows up as a lone value in fq and is not needed. I think it's obsolete now? In any case, access does not depend on holdings.
  • Numerically sort the return value of Access::Rights::_get_final_access_status_attr_list (and hence its derivatives) so rights-related Solr queries show up in a canonical form.

The major highlights:

  • Test::User class in the spirit of mdp-lib access tests. It's not very pretty but I think we need something like this.
  • Restrict BRLM query for op rights to LIBRARY_IPADDR_USER (for other user types it's a simple "held")
  • Special-case HT_TOTAL_USER & HT_STAFF_USER along with existing SSD_PROXY_USER logic (none of them care about holdings)
  • Remove "New Year Hack" (ETT-433)

Initial changes to make testing easier:
  - `Auth::Auth::__get_scoped_affiliations` checks `allowed_affiliations` for definedness before using it as a regex.
  - Remove `umall` from `RightsGlobals::g_access_requires_holdings_attribute_values` since it shows up as a lone value in fq and is not needed.
  - Numerically sort the return value of `Access::Rights::_get_final_access_status_attr_list` (and hence its derivatives)
    so rights-related Solr queries show up in a canonical form.
…gs_attribute_value` which should only apply to

`LIBRARY_IPADDR_USER`. As a result there is only one case where we see `ht_heldby_brlm` and that is with said user
and `op` rights.
- Fix up tabs-spaces muddle in `...Facets::__get_holdings_qualified_string`
… checking holdings for some rights.

- Fix up tabs-spaces muddle in `...Facets::__HELPER_get_Solr_fulltext_filter_query_arg`
@moseshll moseshll marked this pull request as ready for review February 17, 2026 16:27
@moseshll moseshll requested a review from aelkiss February 17, 2026 16:27
Copy link
Member

@aelkiss aelkiss left a comment

Choose a reason for hiding this comment

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

I'm very happy to see the "new years hack" go; the actual change for CAA users is pleasantly straightforward. I think what the tests are testing is reasonable, but see comments inline especially around more clearly documenting expected behavior and handling of certain rights attributes.

Add non-US tests for most of the fulltext facet user types.
Document known bugs and expected results.
Add note on how to fix the geoip-related bugs.
Copy link
Member

@aelkiss aelkiss left a comment

Choose a reason for hiding this comment

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

The follow-ups you listed make sense; the additional comments in the expectations in the tests look good.

@moseshll moseshll merged commit 672c9a6 into main Feb 25, 2026
2 checks passed
@moseshll moseshll deleted the ETT-432_incorrect_caa_ft_facet branch February 25, 2026 19:35
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