Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stopped errors for requests to create an existing tasks. #69

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

mgcam
Copy link
Member

@mgcam mgcam commented Jun 26, 2024

Status 200 is returned instead of previously returned 409.

Status 200 is returned instead of previously returned 409.
Copy link
Contributor

@nerdstrike nerdstrike left a comment

Choose a reason for hiding this comment

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

Just a typo.

Once a task has been submitted, and a 201 CREATED response has been received, the npg_porch server assigns a timestamp to the task, gives it a status of `PENDING` and assigns a unique ID to it. The response from the server contains this extra information.

A 200 OK response means that this particular task for this pipeline has already been registered. The current representation of the task is returned, the status of teh task might be differ from `PENDING`. Note that if there are many tasks to register, some of which were submitted previously, further work is required to make the process efficient - such as to ask the npg_porch server for a list of previously registered tasks for this pipeline.
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny teh typo

change='Created'
)
t.events.append(event)
nested = await session.begin_nested()
Copy link
Contributor

Choose a reason for hiding this comment

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

huh, I expected the subsession to be in the exception handling, but it if it works it's fine.

from npg_porch.auth.token import validate
from npg_porch.db.connection import get_DbAccessor
from npg_porch.models.permission import RolesEnum
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we're gradually homogenising the code module by module. It's a good thing

@mgcam mgcam force-pushed the ok_to_register_repeatedly branch from 28639f5 to 04f1a0c Compare June 27, 2024 16:03
@nerdstrike nerdstrike merged commit ea576dd into wtsi-npg:devel Jun 27, 2024
1 check passed
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