Skip to content

[SYNPY-1760] Add ability to link Grid to CurationTask#1383

Open
andrewelamb wants to merge 79 commits into
developfrom
SYNPY-1760
Open

[SYNPY-1760] Add ability to link Grid to CurationTask#1383
andrewelamb wants to merge 79 commits into
developfrom
SYNPY-1760

Conversation

@andrewelamb
Copy link
Copy Markdown
Contributor

@andrewelamb andrewelamb commented May 18, 2026

Problem:

  • Python Client users could not link a Grid session to a CurationTask
  • Curator Extension Docs were out of date

Solution:

Added these methods to CurationTask:

  • get_status
  • update_status
  • set_active_grid_session
  • set_task_state_async
  • create_grid_session_async

Added owner_principal_id to Grid

Separated Curator docs into one for data managers and one for contributors

Testing:

All new methods have unit and integration tests

Copy link
Copy Markdown
Contributor

@linglp linglp left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fixes!


if not self.task_properties:
await self.get_async(synapse_client=synapse_client)

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.

Should this always do get_async to ensure the CurationTask exists?

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.

always get task

Comment thread synapseclient/models/curation.py
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.

For christina to review

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.

For christina to review

Comment thread synapseclient/models/curation.py Outdated
Comment on lines +1089 to +1091
"taskProperties was not found in the Synapse response for this CurationTask. "
"This means it is likely an older CurationTask from before taskProperties was added. "
"It is recommended that this task be deleted: task.delete(delete_source=False)"
Copy link
Copy Markdown
Member

@thomasyu888 thomasyu888 May 29, 2026

Choose a reason for hiding this comment

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

Add to the message to recreate the task with the existing source entity

await self.set_active_grid_session_async(
active_session_id=grid.session_id, synapse_client=synapse_client
)
except Exception:
Copy link
Copy Markdown
Member

@thomasyu888 thomasyu888 May 29, 2026

Choose a reason for hiding this comment

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

This should probably be the one that catches the 412 error. Should we have a "finally" clause to delete the grid sesison for all other errors on this active grid session command?

Comment on lines +1754 to +1767
try:
await self.set_active_grid_session_async(
active_session_id=grid.session_id, synapse_client=synapse_client
)
except Exception:
try:
await grid.delete_async(synapse_client=synapse_client)
except Exception:
Synapse.get_client(synapse_client=synapse_client).logger.warning(
"Failed to delete orphan grid session %s after status "
"update failure; manual cleanup may be required.",
grid.session_id,
)
raise
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.

Add a comment

  1. There can only be one grid session that is active, but there can be multiple grid sessions. So multiple users running this command may run into the 412 error.

Copy link
Copy Markdown
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

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

🔥 LGTM! just some minor comments, and will defer to @BryanFauble for a final pass next sprint for the code and @cconrad8 on the documentation.

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.

4 participants