-
Notifications
You must be signed in to change notification settings - Fork 360
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
Call caching endpoint #306
Conversation
* Assertions on call FQN and index: | ||
* <ul> | ||
* <li>Call with this name must exist in the workflow</li> | ||
* <li>Call must not correspond to a collector</li> |
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.
Wouldn't this be fine? If you try to disable a call that was a scatter, disable all shards?
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.
open for discussion. 😄
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.
I like the idea
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.
👍
|
||
private [webservice] def validateCallName(callName: Option[String]): ValidationNel[String, Option[ExecutionDatabaseKey]] = { | ||
callName map { name => | ||
val CallNamePattern = "((?:[a-zA-Z][a-zA-Z0-9_]*)\\.(?:[a-zA-Z][a-zA-Z0-9_]*))(?:\\.(\\d+))?".r |
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.
This might be worth extracting to put at the object level so we only declare it once.
Also, even if the regexp is relatively easy to read, I think a simple comment with an example above the declaration is helpful for regexps.
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.
will do
👍 |
\. # Literal dot. | ||
(\d+) # Captured shard digits. | ||
)? # End outer optional noncapturing group for shard. | ||
""".trim.r // The trim is necessary as (?x) must be at the beginning of the regex. |
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 that's not thorough documentation I don't know what is ! :D
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.
It'd be a shame if this was only ever used as a private val in the CallCaching endpoint. Can we generalise and extract this regex somewhere more widely useable?
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.
sure I can put it in an appropriate package.scala
👍 after changes. The wheel has chosen @kshakir as the second reviewer. |
type: string | ||
in: path | ||
- name: call | ||
description: Call FQN |
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.
This name
and description
don't match the same parameter in other endpoints, which seem to (mostly) be callFqn
and Call fully qualified name
.
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.
ok
security: | ||
- google_oauth: | ||
- openid | ||
'/workflows/{version}/{id}/call-caching/{callFqn}': |
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.
I collapsed the Spray endpoints per @cjllanwarne's suggestion, but unfortunately optional path parameters are not currently allowed in Swagger:
So while this Swagger YAML and the README.md document two endpoints, in reality Cromwell only implements one endpoint which can handle both the whole workflow and individual call use cases. If a future version of Swagger adds support for optional path parameters we can change these docs to more closely match the underlying reality.
88275c9
to
6783d72
Compare
@cjllanwarne @kshakir I've tried to address all of your comments, please let me know if this looks okay. Thanks! |
👍 |
👍 |
54e531c
to
2c354e8
Compare
No description provided.