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 support for passing multiple input params to a @rule Get #16668

Merged
merged 7 commits into from
Aug 26, 2022

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Aug 26, 2022

In order to support differentiating @rule subgraphs for different "environments" as described in the design doc for #13682, @rules need to be able inject more than one parameter into any particular subgraph.

As a concrete example: the test @rules need to be able to request "a TestResult for this FieldSet in this Environment". This change adds support for multiple parameters to a Get, such that that use case would be spelled out as:

test_result = await Get(TestResult, {field_set: FieldSet, environment: Environment})

Fixes #7490.

[ci skip-build-wheels]

[ci skip-build-wheels]

[ci skip-rust]
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@stuhood stuhood force-pushed the stuhood/get-multiple-provided-params branch from d100c7b to 84c13b0 Compare August 26, 2022 19:54
@stuhood stuhood marked this pull request as ready for review August 26, 2022 20:30
[ci skip-build-wheels]
… they are not yet parsed.

[ci skip-rust]
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@stuhood stuhood force-pushed the stuhood/get-multiple-provided-params branch from 84c13b0 to 4854d1e Compare August 26, 2022 20:49
@stuhood
Copy link
Member Author

stuhood commented Aug 26, 2022

Commits are useful to review independently.

@stuhood stuhood enabled auto-merge (squash) August 26, 2022 21:59
@stuhood stuhood merged commit 1bdd165 into pantsbuild:main Aug 26, 2022
@stuhood stuhood deleted the stuhood/get-multiple-provided-params branch August 26, 2022 22:08
stuhood added a commit to stuhood/pants that referenced this pull request Aug 27, 2022
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
stuhood added a commit that referenced this pull request Aug 27, 2022
[ci skip-build-wheels]
cczona pushed a commit to cczona/pants that referenced this pull request Sep 1, 2022
…tsbuild#16668)

In order to support differentiating `@rule` subgraphs for different "environments" as described in the design doc for pantsbuild#13682, `@rules` need to be able inject more than one parameter into any particular subgraph.

As a concrete example: the `test` `@rules` need to be able to request "a `TestResult` for this `FieldSet` in this `Environment`". This change adds support for multiple parameters to a `Get`, such that that use case would be spelled out as:
```python
test_result = await Get(TestResult, {field_set: FieldSet, environment: Environment})
``` 

Fixes pantsbuild#7490.

[ci skip-build-wheels]
cczona pushed a commit to cczona/pants that referenced this pull request Sep 1, 2022
Eric-Arellano added a commit that referenced this pull request Sep 12, 2022
kaos added a commit to kaos/pants that referenced this pull request Dec 6, 2022
stuhood pushed a commit that referenced this pull request Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow specifying multiple Params to a Get()
2 participants