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

Generalized patch function (plus a motivating example) #209

Open
crich011 opened this issue Sep 3, 2019 · 3 comments
Open

Generalized patch function (plus a motivating example) #209

crich011 opened this issue Sep 3, 2019 · 3 comments
Milestone

Comments

@crich011
Copy link

crich011 commented Sep 3, 2019

I believe that it was my update_success_email function that got us (@patr1ckm and me) talking about a generalized patch, so depending on whether we wanted to implement both a function to help users customize their success emails or just add a generalized patch, this issue might map to two additional functions.

update_success_email is a specific function with the goal of customizing a success email, which can neatly be pointed to either a workflow (using workflows_patch) or a script (using scripts_patch), and it might be a useful utility function.

A (proposed) patch function would make use of both workflows_patch and scripts_patch to allow the user to patch a generalized platform object. In the minute of brainstorming we gave it, @patr1ckm and I weren't able to immediately think of a safe way to type-check the platform object given only an ID, but by asking for the object type (e.g. patch(id = 1234, type = "script", ...)) we can avert the need.

@patr1ckm
Copy link
Contributor

patr1ckm commented Sep 4, 2019

Having update_email(id, type = 'script', body = '', address ='', subject = '', on_success=TRUE) could be really nice. The docs could give nice additional examples too.

As I was thinking about it, a generic patch really only abstracts away a single function call. I don't think it's worth it.

@crich011
Copy link
Author

crich011 commented Sep 4, 2019

Oh, I really like that structure! Are you envisioning on_success here determining whether it modifies the success vs. failure emails? Because that's really nice; I like it!

And your take on a generalized patch makes sense to me; workflows_patch and scripts_patch have already done the hard work and probably trying to abstract further doesn't add much value for a user.

@patr1ckm
Copy link
Contributor

patr1ckm commented Sep 4, 2019

Yep, that's exactly what I was thinking.

@patr1ckm patr1ckm added this to the 2.2 milestone Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants