forked from broadinstitute/cromwell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HOG_GROUP field to WORKFLOW_STORE_ENTRY [BA-5752] (broadinstitute…
- Loading branch information
1 parent
1a5e4f2
commit bde3bf8
Showing
50 changed files
with
407 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cromwell.core | ||
|
||
import com.typesafe.config.ConfigFactory | ||
|
||
import scala.util.{Failure, Success} | ||
|
||
final case class HogGroup(value: String) extends AnyVal | ||
|
||
object HogGroup { | ||
|
||
type HogGroupDeciderFunction = (WorkflowOptions, WorkflowId) => HogGroup | ||
|
||
// NB: This is separated out from the apply so that we only have to load the config once: | ||
val HogGroupDeciderFunction: HogGroupDeciderFunction = { | ||
val config = ConfigFactory.load | ||
|
||
if (config.hasPath("system.hog-safety.workflow-option")) { | ||
val hogGroupField = config.getString("system.hog-safety.workflow-option") | ||
|
||
(options, workflowId) => { | ||
options.get(hogGroupField) match { | ||
case Success(hg) => HogGroup(hg) | ||
case Failure(_) => HogGroup(workflowId.shortString) | ||
} | ||
} | ||
} else { | ||
(_, workflowId) => HogGroup(workflowId.shortString) | ||
} | ||
} | ||
|
||
def decide(workflowOptions: WorkflowOptions, workflowId: WorkflowId): HogGroup = HogGroupDeciderFunction.apply(workflowOptions, workflowId) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
database/migration/src/main/resources/changesets/add_hog_group_in_workflow_store.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<databaseChangeLog objectQuotingStrategy="QUOTE_ALL_OBJECTS" | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.3.xsd"> | ||
|
||
<changeSet id="add_hog_group_in_workflow_store" author="cjllanwarne"> | ||
<addColumn tableName="WORKFLOW_STORE_ENTRY"> | ||
<column name="HOG_GROUP" type="VARCHAR(100)"> | ||
<constraints nullable="true" /> | ||
</column> | ||
</addColumn> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.