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

feat: add support for parsing comma-separated list environment variables #2765

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

fnesveda
Copy link
Member

@fnesveda fnesveda commented Dec 5, 2024

We're planning to add a new environment variable, ACTOR_BUILD_TAGS, to the Actor runtime, which will contain the list of build tags of the currently running Actor build. The environment variable will be a comma-separated list, but I think it would be easier to work with if it was already parsed to an array in the Configuration instance.

This adds support for parsing comma-separated list environment variables to arrays. In the SDK, I'll then just override the COMMA_SEPARATED_LIST_VARS list to include the environment variable I want to have parsed.

@fnesveda fnesveda added adhoc Ad-hoc unplanned task added during the sprint. t-platform Issues with this label are in the ownership of the platform team. labels Dec 5, 2024
@fnesveda fnesveda added this to the 104th sprint - Platform team milestone Dec 5, 2024
@fnesveda fnesveda requested review from janbuchar and B4nan December 5, 2024 15:05
@fnesveda fnesveda self-assigned this Dec 5, 2024
@janbuchar
Copy link
Contributor

Just my curiosity, but how will ACTOR_BUILD_TAGS be useful to Actor code?

@fnesveda
Copy link
Member Author

fnesveda commented Dec 5, 2024

@janbuchar It's being requested every now and then, last time here: https://apify.slack.com/archives/C010Q0FBYG3/p1730272256106699

I have a project including several Actors that have some mutual interaction and need to be developed and tested together as the changes usually affects all the implementations. I usually do testing builds for multiple actors with the same tag, and just a simple

await Actor.call('another-actor', input, { build: Actor.getEnv().buildTag })

would save a lot of code writing and rewriting back during testing and releasing to production.

@janbuchar
Copy link
Contributor

@janbuchar It's being requested every now and then, last time here: https://apify.slack.com/archives/C010Q0FBYG3/p1730272256106699

I have a project including several Actors that have some mutual interaction and need to be developed and tested together as the changes usually affects all the implementations. I usually do testing builds for multiple actors with the same tag, and just a simple

await Actor.call('another-actor', input, { build: Actor.getEnv().buildTag })

would save a lot of code writing and rewriting back during testing and releasing to production.

Right, so they have a bunch of Actors that call each other and follow the same versioning. Makes sense, I guess. Thanks!

Copy link
Contributor

@janbuchar janbuchar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fnesveda fnesveda merged commit 4e50c47 into master Dec 11, 2024
9 checks passed
@fnesveda fnesveda deleted the feat/list-env-vars branch December 11, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adhoc Ad-hoc unplanned task added during the sprint. t-platform Issues with this label are in the ownership of the platform team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants