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

Call caching endpoint #306

Merged
merged 1 commit into from
Dec 7, 2015
Merged

Call caching endpoint #306

merged 1 commit into from
Dec 7, 2015

Conversation

mcovarr
Copy link
Contributor

@mcovarr mcovarr commented Nov 25, 2015

No description provided.

* 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>
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

open for discussion. 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

I like the idea

Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do

@scottfrazer
Copy link
Contributor

👍

\. # 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.
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

@cjllanwarne
Copy link
Contributor

👍 after changes. The wheel has chosen @kshakir as the second reviewer.

@cjllanwarne cjllanwarne assigned kshakir and unassigned cjllanwarne Dec 4, 2015
type: string
in: path
- name: call
description: Call FQN
Copy link
Contributor

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.

Copy link
Contributor Author

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}':
Copy link
Contributor Author

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:

OAI/OpenAPI-Specification#93

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.

@mcovarr
Copy link
Contributor Author

mcovarr commented Dec 4, 2015

@cjllanwarne @kshakir I've tried to address all of your comments, please let me know if this looks okay. Thanks!

@cjllanwarne
Copy link
Contributor

👍

@kshakir
Copy link
Contributor

kshakir commented Dec 7, 2015

👍

@kshakir kshakir assigned mcovarr and unassigned kshakir Dec 7, 2015
mcovarr added a commit that referenced this pull request Dec 7, 2015
@mcovarr mcovarr merged commit 6392852 into job_avoidance Dec 7, 2015
@mcovarr mcovarr deleted the mlc_call_caching branch December 7, 2015 16:34
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