Return available_fields in patron blocking rule validation response (PP-3866)#3179
Merged
dbernstein merged 2 commits intomainfrom Apr 6, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3179 +/- ##
==========================================
- Coverage 93.28% 93.27% -0.01%
==========================================
Files 496 496
Lines 46011 46012 +1
Branches 6302 6302
==========================================
- Hits 42920 42919 -1
- Misses 2004 2005 +1
- Partials 1087 1088 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5424590 to
fbb71fe
Compare
jonathangreen
approved these changes
Apr 6, 2026
Member
jonathangreen
left a comment
There was a problem hiding this comment.
Looks good, one minor comment.
|
|
||
| return Response(status=200) | ||
| return Response( | ||
| json.dumps({"available_fields": live_values}), |
Member
There was a problem hiding this comment.
Minor: since you are changing the response shape, you should probably assert that available_fields is returned in the tests as well.
…P-3866) Changes the 200 response from process_validate_patron_blocking_rule to include the live patron data dictionary as {"available_fields": ...}, enabling the admin UI to display template variable names and sample values in the help modal without an additional round-trip. Also removes SIP-specific language from docs/FUNCTIONS.md in favour of the protocol-agnostic "remote patron information call".
fbb71fe to
9a840c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Returns the live patron data dictionary from the patron blocking rule
validation endpoint, and removes SIP-specific language from the
allowed-functions documentation. These changes are made in conjunction with
circulation-admin changes here.
process_validate_patron_blocking_rulenow returns a JSON body{"available_fields": live_values}on a successful 200 response,in addition to the existing error behaviour on 4xx. Previously the
body was empty.
docs/FUNCTIONS.md— replaced all references to "SIP2" and "SIP2server" with the protocol-agnostic "remote patron information call",
since patron blocking rules are not exclusively a SIP2 feature.
Motivation and Context
The circulation-admin help modal (PP-3866) needs the live patron data
dictionary to display available template variable names and sample
values to administrators building blocking rules. Previously the
validation endpoint discarded this data after evaluating the rule
expression. Exposing it in the response body requires no additional
server round-trip.
The documentation update ensures that
FUNCTIONS.md— which issurfaced directly in the admin UI — does not mislead administrators
using non-SIP authentication providers that also support patron
blocking rules.
How Has This Been Tested?
returns the expected
available_fieldsdictionary for a configuredSIP2 service with test credentials.
tox -e py312-docker -- --no-cov).with the related changes in circulation-admin
Checklist