Parameters Recall

./envman init demo --type development azriel91/web_app 0.1.1

# For good user experience, parameters
# should not have to be passed in on
# every command invocation

./envman status  # demo --type development azriel91/web_app 0.1.1
./envman deploy  # demo --type development azriel91/web_app 0.1.1

We need to store and load the parameters passed in previously.

%3cluster_acluster_a_paramscluster_bcluster_b_paramscluster_ccluster_c_paramsaaa_state .. bba->ba_text📥filedownloada_params_srcsrca_params_destdestc_params_file_pathfile_pathb_stateS3BucketState  nameccb->cb_text🪣s3bucketb_params_namenamec_params_bucket_namebucket_nameb_state->c_params_bucket_namec_state .. c_text📤s3objectc_params_object_keyobject_keyweb_app_urlweb_app_urlweb_app_url->a_params_srcweb_app_pathweb_app_pathweb_app_path->a_params_destweb_app_path->c_params_file_pathbucket_namebucket_namebucket_name->b_params_nameobject_keyobject_keyobject_key->c_params_object_key

First command invocation:

// examples/envman/src/cmds/profile_init_cmd.rs
// fn app_upload_flow_init
cmd_ctx_builder
    .with_profile_from_workspace_param(profile_key)
    .with_flow(flow)
    .with_item_params::<FileDownloadItem<WebApp>>(
        item_id!("app_download"),
        app_download_params_spec,
    )
    .with_item_params::<S3BucketItem<WebApp>>(
        item_id!("s3_bucket"),
        s3_bucket_params_spec,
    )
    .with_item_params::<S3ObjectItem<WebApp>>(
        item_id!("s3_object"),
        s3_object_params_spec,
    )
    .await?

Subsequent command invocations:

// examples/envman/src/cmds/app_upload_cmd.rs
cmd_ctx_builder
    .with_profile_from_workspace_param(&profile_key)
    .with_flow(&flow)
    // * file_download params spec not specified
    // * s3_bucket params spec not specified
    .with_item_params::<S3ObjectItem<WebApp>>(
        item_id!("s3_object"),
        s3_object_params_spec,
    )
    .await?
let s3_object_params_spec = S3ObjectParams::<WebApp>::field_wise_spec()
    // Note:
    //
    // * file_path not specified
    // * object key not specified
    // * Function logic cannot be deserialized,
    //   so needs to be provided
    .with_bucket_name_from_map(|s3_bucket_state: &S3BucketState| {
        match s3_bucket_state {
            S3BucketState::None => None,
            S3BucketState::Some {
                name,
                creation_date: _,
            } => Some(name.clone()),
        }
    })
    .build();