Skip to content

[SYNPY-1861] remove submissionInstructionsMessage and submissionReceiptMessage from required attributes#1401

Merged
jaymedina merged 14 commits into
developfrom
synpy-1861-remove-required-attributes
Jun 26, 2026
Merged

[SYNPY-1861] remove submissionInstructionsMessage and submissionReceiptMessage from required attributes#1401
jaymedina merged 14 commits into
developfrom
synpy-1861-remove-required-attributes

Conversation

@jaymedina

@jaymedina jaymedina commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem:

The Evaluation OOP model's store() method incorrectly required submission_instructions_message and
submission_receipt_message to be set before creating or updating an evaluation. These are optional display messages
shown to submitters. The Synapse REST API accepts PUT requests without them.

Solution:

  • Remove submission_instructions_message and submission_receipt_message from the required attributes validated in to_synapse_request().
  • Updated field and class-level docstrings to clearly mark name, description, and content_source as the true required-to-store attributes.
  • Added unit test coverage verifying the request body is built correctly without the message fields
  • Added integration tests for creating and updating evaluations without them, including a test confirming that submissions can be stored and retrieved against an evaluation that was created without these fields.

Testing:

Tests are passing locally:

image

…m required attributes for Evaluation creation PUT request body. add test coverage. update documentation.
Copilot AI review requested due to automatic review settings June 11, 2026 14:21
@jaymedina jaymedina requested a review from a team as a code owner June 11, 2026 14:21
@jaymedina jaymedina changed the title remove submissionInstructionsMessage and submissionReceiptMessage fro… [SYNPY-1861] remove submissionInstructionsMessage and submissionReceiptMessage fro… Jun 11, 2026
@jaymedina jaymedina changed the title [SYNPY-1861] remove submissionInstructionsMessage and submissionReceiptMessage fro… [SYNPY-1861] remove submissionInstructionsMessage and submissionReceiptMessage from required attributes Jun 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates the Evaluation OOP model so that submission_instructions_message and submission_receipt_message are treated as truly optional when building the REST request body for create/update operations, aligning client-side validation with the Synapse REST API’s accepted payloads.

Changes:

  • Removed submission_instructions_message and submission_receipt_message from the set of attributes required by Evaluation.to_synapse_request().
  • Updated to_synapse_request() to omit submission message fields from the request body when they are None.
  • Added/updated unit and integration tests to verify evaluations (and submissions against them) can be created/updated without these optional message fields.

Reviewed changes

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

File Description
synapseclient/models/evaluation.py Makes submission message fields optional in request validation and omits them from request bodies when unset.
tests/unit/synapseclient/models/unit_test_evaluation.py Updates required-field tests and adds a unit test asserting request bodies omit optional message keys when absent.
tests/integration/synapseclient/models/async/test_evaluation_async.py Adds integration coverage for creating and updating evaluations without optional message fields.
tests/integration/synapseclient/models/async/test_submission_async.py Adds integration coverage for creating/retrieving submissions against an evaluation created without optional message fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jaymedina jaymedina left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: This comment has been generated with AI assistance and reviewed by me ✍️

Reviewed evaluation.py, unit_test_evaluation.py, test_evaluation_async.py, and test_submission_async.py. The core logic change is correct — the two message fields are properly removed from the required list and are now conditionally included in the request body only when non-None. Docstrings and examples are updated consistently. Two minor findings left as inline comments.

Comment thread tests/integration/synapseclient/models/async/test_evaluation_async.py Outdated
Comment thread tests/unit/synapseclient/models/unit_test_evaluation.py

@linglp linglp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jaymedina Hi Jenny! It looks good overall. I found some issues in the tests and docstring that should probably be fixed before merging.

Comment thread tests/integration/synapseclient/models/async/test_evaluation_async.py Outdated
Comment thread synapseclient/models/evaluation.py
Comment thread synapseclient/models/evaluation.py
Comment thread synapseclient/models/evaluation.py
Comment thread synapseclient/models/evaluation.py
jaymedina and others added 2 commits June 12, 2026 10:15
…valuationCreation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thomasyu888 thomasyu888 requested a review from BryanFauble June 22, 2026 23:02
Comment thread tests/integration/synapseclient/models/async/test_evaluation_async.py Outdated
Comment thread tests/integration/synapseclient/models/async/test_evaluation_async.py Outdated
Comment thread tests/integration/synapseclient/models/async/test_evaluation_async.py Outdated

@BryanFauble BryanFauble left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few items in the testing structure to take a look at, otherwise LGTM!

@jaymedina jaymedina requested a review from linglp June 24, 2026 19:45
@jaymedina

Copy link
Copy Markdown
Contributor Author

Thanks all for the reviews~

@linglp can I get your eyes on those last unresolved threads before your approval so I can merge? Thanks in advance!

@linglp linglp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thanks!

@jaymedina jaymedina merged commit f37193d into develop Jun 26, 2026
26 of 32 checks passed
@jaymedina jaymedina deleted the synpy-1861-remove-required-attributes branch June 26, 2026 18:45
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.

6 participants