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

Add proposal for flexible process types #321

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Jan 7, 2025

@buildpack-bot
Copy link
Member

Maintainers,

As you review this RFC please queue up issues to be created using the following commands:

/queue-issue <repo> "<title>" [labels]...
/unqueue-issue <uid>

Issues

(none)

@joeybrown-sf
Copy link
Contributor

I don't see anything in here about chaining transformations. Would we want to support that? If so, perhaps we could consider changing the names of the variables to something like $SOURCE_CMD instead of $ORIGINAL_CMD or something to that effect.

@joeybrown-sf
Copy link
Contributor

What do you think about adding an optional reason field to the transform section? Since we're going to be logging the transformation, it might be good for user experience.

@dmikusa
Copy link
Contributor Author

dmikusa commented Jan 10, 2025

I don't see anything in here about chaining transformations. Would we want to support that? If so, perhaps we could consider changing the names of the variables to something like $SOURCE_CMD instead of $ORIGINAL_CMD or something to that effect.

Not sure I follow, do you have an example of what you mean by chaining?

@dmikusa
Copy link
Contributor Author

dmikusa commented Jan 10, 2025

What do you think about adding an optional reason field to the transform section? Since we're going to be logging the transformation, it might be good for user experience.

Sounds good to me. I'll add it.

Signed-off-by: Daniel Mikusa <[email protected]>
@joeybrown-sf
Copy link
Contributor

I don't see anything in here about chaining transformations. Would we want to support that? If so, perhaps we could consider changing the names of the variables to something like $SOURCE_CMD instead of $ORIGINAL_CMD or something to that effect.

Not sure I follow, do you have an example of what you mean by chaining?

Kind of like what @jabrown85 mentioned in the slack thread. "time wraps secretmanager wraps some-cmd".

I could see multiple buildpacks that do this transforming, so if you're the 3rd transformation buildpack, $ORIGINAL_CMD might not be accurate because it might not be the original per se, because it's already transformed. I think calling it something like $source helps to make it more apparent that we're transforming the process that may not be in its original state.

@dmikusa
Copy link
Contributor Author

dmikusa commented Jan 10, 2025

I don't see anything in here about chaining transformations. Would we want to support that? If so, perhaps we could consider changing the names of the variables to something like $SOURCE_CMD instead of $ORIGINAL_CMD or something to that effect.

Not sure I follow, do you have an example of what you mean by chaining?

Kind of like what @jabrown85 mentioned in the slack thread. "time wraps secretmanager wraps some-cmd".

I could see multiple buildpacks that do this transforming, so if you're the 3rd transformation buildpack, $ORIGINAL_CMD might not be accurate because it might not be the original per se, because it's already transformed. I think calling it something like $source helps to make it more apparent that we're transforming the process that may not be in its original state.

Ohh, ok. I understand. Yes, I can see how that might get confusing, and a rename sounds reasonable. How about PREVIOUS_ or CURRENT_? I'm not necessarily opposed to SOURCE_ but it is kind of a synonym to ORIGINAL. Or we could just take off the prefix? or use a generic prefix like LAUNCH_? Thoughts?

@joeybrown-sf
Copy link
Contributor

Yeah I think dropping the prefix altogether is the right approach. It should be clear in context what those placeholders are.

Signed-off-by: Daniel Mikusa <[email protected]>
@dmikusa
Copy link
Contributor Author

dmikusa commented Jan 10, 2025

Yeah I think dropping the prefix altogether is the right approach. It should be clear in context what those placeholders are.

Done.

@dmikusa
Copy link
Contributor Author

dmikusa commented Jan 10, 2025

@joeybrown-sf Any thoughts on the alternatives section? or the format of the toml in the spec changes section? Even if it's just to say you prefer it the way it is now. Lot of ways to do this, just hoping to get a little feedback on that. thanks!

@joeybrown-sf
Copy link
Contributor

sure thing!

I do prefer the single transform block, but that's just my personal preference. I like it because it's a bit more terse, less nested, and self-explanatory. That being said, I like "transformations" better than "transforms" because the former is always a noun where the latter could be a verb.

In my opinion, the following format would is my favorite.

[[transformations]]
type = "task"
command = ["time", $CMD]
args = ["more", "args"]
working-dir = "/somewhere-else"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants