hammerlab / ketrew

Keep Track of Experimental Workflows
http://www.hammerlab.org/docs/ketrew/master/index.html
Apache License 2.0
77 stars 10 forks source link

Add the `~safe_ids` option for workflow submission #539

Closed smondet closed 7 years ago

smondet commented 7 years ago

This fixes #538.

For the record, I was trying to add an extra layer of checks:

let check_ids node_list =
  let compare ta tb = String.compare (Target.id ta) (Target.id tb) in
  match  node_list |> List.find_a_dup ~compare with
  | None -> node_list
  | Some trgt ->
    Log.(s "Check-IDs-error: " % n
         % s "There are duplicate IDs within the workflow, \
              consider making your workflow generation not rely \
              on constants." % n
         % s "Example: " %n
         % Target.log trgt
         @ error);
    failwith (fmt  "Duplicate ID found: %s" (Target.id trgt))

But it's actually impossible to trigger, since the flatten_to_pure_targets already removes “internal duplicates.”