Skip to content

GET request for multiple score sets#683

Merged
bencap merged 2 commits intorelease-2026.1.2from
score-set-batch-request
Mar 22, 2026
Merged

GET request for multiple score sets#683
bencap merged 2 commits intorelease-2026.1.2from
score-set-batch-request

Conversation

@jstone-dev
Copy link
Collaborator

This pull request introduces a new API endpoint for fetching multiple score sets by a comma-separated list of URNs, along with comprehensive tests to verify its behavior. The changes enhance the flexibility of the score set retrieval functionality and improve validation and error handling.

New API endpoint for batch score set retrieval:

  • Added show_score_sets endpoint to score_sets.py that allows fetching multiple score sets via a comma-separated urns query parameter. The endpoint validates input, enriches experiment data, and returns a list of score sets.

Testing enhancements for new functionality:

  • Added tests to verify successful retrieval of multiple score sets by URN, input validation requiring at least one URN, and correct handling of mixed valid and invalid URNs (returns 404 for missing URNs).
  • Included tests to ensure whitespace around URNs is handled correctly and does not affect validation or error reporting.

@jstone-dev jstone-dev requested a review from bencap March 18, 2026 17:44
Copy link
Collaborator

@bencap bencap left a comment

Choose a reason for hiding this comment

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

Thanks @jstone-dev, looks good. Although I know it's covered by existing tests for fetch_score_set_by_urn, I think guaranteeing permission checks are working at the level of each endpoint is important enough to warrant the duplication. Could you please be able to add a few auth tests?

  • anonymous users can fetch public score sets
  • anonymous users cannot fetch private score sets
  • authenticated users can fetch private score sets
  • mixed private/public requests fail w/ 404

Just don't want us to refactor the endpoint away from the auth safety of fetch_score_set_by_urn at some point and not have the tests in place to catch it.

@jstone-dev
Copy link
Collaborator Author

Thanks; I added five new API-level authorization unit tests.

Copy link
Collaborator

@bencap bencap left a comment

Choose a reason for hiding this comment

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

Looks great, save one test that was probably copy/pasted. We can merge this in once we either remove it or alter the logic to test the contributor logic of this endpoint.

@bencap bencap merged commit 230df86 into release-2026.1.2 Mar 22, 2026
6 checks passed
@bencap bencap deleted the score-set-batch-request branch March 22, 2026 06:41
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