-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix deep merge for existing env
on work-pools
#15325
Conversation
1a4f290
to
79ce13c
Compare
CodSpeed Performance ReportMerging #15325 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small request for a test tweak, otherwise this LGTM
01b7bc5
to
905e833
Compare
@pytest.mark.parametrize( | ||
"work_pool_env, deployment_env, flow_run_env, expected_env", | ||
[ | ||
( | ||
{}, | ||
{"test-var": "foo"}, | ||
{"another-var": "boo"}, | ||
{"test-var": "foo", "another-var": "boo"}, | ||
), | ||
( | ||
{"A": "1", "B": "2"}, | ||
{"C": "3", "D": "4"}, | ||
{}, | ||
{"A": "1", "B": "2", "C": "3", "D": "4"}, | ||
), | ||
( | ||
{"A": "1", "B": "2"}, | ||
{"C": "42"}, | ||
{"C": "3", "D": "4"}, | ||
{"A": "1", "B": "2", "C": "3", "D": "4"}, | ||
), | ||
( | ||
{"A": "1", "B": "2"}, | ||
{"B": ""}, # will be treated as unset and not apply | ||
{}, | ||
{"A": "1", "B": "2"}, | ||
), | ||
], | ||
ids=[ | ||
"flow_run_into_deployment", | ||
"deployment_into_work_pool", | ||
"flow_run_into_work_pool", | ||
"try_overwrite_with_empty_str", | ||
], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this.
Since this is a worker change, does this (and the previous change, probably) need to be written again for the base push pool worker so push pool behavior is consistent with this? |
yes, i would say that is likely. great callout |
currently on
main
, we correctly deep mergeenv
likedeployment | flow_run
, but this merged result totally overwrites any hardcodedenv
defined directly on the work pool.this PR makes sure we deep merge the result of
deployment | flow_run
with anyenv
that may be defined on the work pool itself