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

fix: enclave manager passing in deprecated args object #2342

Merged
merged 4 commits into from
Mar 27, 2024
Merged

Conversation

tedim52
Copy link
Contributor

@tedim52 tedim52 commented Mar 27, 2024

Description

The enclave builder would fail to render packages that used def run(plan, args) where starlark in the package depended on values in args being set. This was because the enclave manager was passing args to interpretation using via an args. The use of args dict as sole input is deprecated.

While it's deprecated we still support it for backwards compatibility but everything in args is dropped - which caused the failure. This PR fixes it by unpacking the values in args so enclave builder passes them as unpacked kwargs to interpretation, as opposed to using the sole deprecated args dict.

I've also added a test to highlight this behavior.

def run(plan, args):
	all_arg_values = args["arg1"] + ":" + args["arg2"]
	return all_arg_values

will error when passing input with only args
{"args": {"arg1": "arg1-value", "arg2": "arg2-value"}}

Is this change user facing?

NO

@tedim52 tedim52 requested a review from leoporoli March 27, 2024 15:34
@tedim52 tedim52 added this pull request to the merge queue Mar 27, 2024
github-merge-queue bot pushed a commit that referenced this pull request Mar 27, 2024
## Description
The enclave builder would fail to render packages that used `def
run(plan, args)` where starlark in the package depended on values in
`args` being set. This was because the enclave manager was passing args
to interpretation using via an `args`. The use of `args` dict as sole
input is deprecated.

While it's deprecated we still support it for backwards compatibility
but everything in `args` is dropped - which caused the failure. This PR
fixes it by unpacking the values in `args` so enclave builder passes
them as unpacked `kwargs` to interpretation, as opposed to using the
sole deprecated `args` dict.

I've also added a test to highlight this behavior.

```
def run(plan, args):
	all_arg_values = args["arg1"] + ":" + args["arg2"]
	return all_arg_values
```
will error when passing input with only `args`
`{"args": {"arg1": "arg1-value", "arg2": "arg2-value"}}`


## Is this change user facing?
NO
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 27, 2024
@tedim52 tedim52 added this pull request to the merge queue Mar 27, 2024
Merged via the queue into main with commit 2bba1bc Mar 27, 2024
52 checks passed
@tedim52 tedim52 deleted the tedi/picassobug branch March 27, 2024 20:05
github-merge-queue bot pushed a commit that referenced this pull request Mar 29, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.88.12](0.88.11...0.88.12)
(2024-03-27)


### Bug Fixes

* enclave manager passing in deprecated args object
([#2342](#2342))
([2bba1bc](2bba1bc))
* starlark -> plan for validator
([#2343](#2343))
([0dca278](0dca278))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: kurtosisbot <[email protected]>
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.

2 participants