Skip to content

ParamsSpecs, {Workflow,Profile,Flow}Params: Refine error handling #150

@azriel91

Description

@azriel91

Enables better user experience for automation software upgrades.

Currently:

  • ParamsSpecs returns Error::ParamsMismatchError for all mismatches, and CmdCtx fails to be built, so *Cmds would not be able to be run. For unused stored specs, it would be better to warn / automatically upgrade.

  • {Workflow,Profile,Flow}Params discards unknown parameters, instead of notifying the user. We should notify the user to help them recognize:

    • Potential typos
    • Param additions / removals / modifications

Everywhere that uses the following snippet, needs to be reviewed for what should be surfaced to the user:

storage
    .serialized_typemap_read_opt(/* .. */)
    .await
    .map(|type_map_opt| {
        type_map_opt
            .map(TypeMapOpt::into_type_map)
            .map(_::from)
    })

All of those places are to do with some kind of "upgrade":

  • Addition of a data type -- States, ParamsSpec, Params, {Workflow,Profile,Flow}Params.
  • Modification of a data type: Adding / removing / changing fields
  • Removal of a data type

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions