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

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

Open
azriel91 opened this issue Jun 27, 2023 · 0 comments
Open

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

azriel91 opened this issue Jun 27, 2023 · 0 comments

Comments

@azriel91
Copy link
Owner

azriel91 commented Jun 27, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant