-
Notifications
You must be signed in to change notification settings - Fork 0
(fix): Handle resource_paths without content after slash ('/') #40
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
base: master
Are you sure you want to change the base?
Conversation
|
The style in this PR agrees with This formatting comment was generated automatically by a script in uc-cdis/wool. |
| for p in data["resource_paths"]: | ||
| if not p.split("/")[1:]: | ||
| msg = f"Request creation failed. Resource path '{p}' does not have content after a forward slash ('/')." | ||
| raise_error(logger, msg, body) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the validity of resource paths should be Arborist's concern, not Requestor's. It looks like Requestor would work fine no matter the format of the resource path. What error/issue are we actually trying to fix here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requestor returns a 500 when receiving a request with a bad resource_path (without a slash), after receiving a 400 from Arborist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is when creating a new request, it sounds to me like we should catch that 400 from arborist, and return a 400 to the user after getting one from arborist. We shouldn't duplicate the input validation from the server into the client. Arborist probably returns a nice error message that Requestor can forward to the user
if the error happens later, during the automatic call to arborist when requests are approved, then it's a bit more tricky
Jira Ticket: None
New Features
Breaking Changes
Bug Fixes
Improvements
Dependency updates
Deployment changes