-
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Mask the environment name in graph
and specs_rules
#17179
Mask the environment name in graph
and specs_rules
#17179
Conversation
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
… a `@rule`'s identity. [ci skip-rust] [ci skip-build-wheels]
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
[ci skip-rust] [ci skip-build-wheels]
[ci skip-build-wheels] [ci skip-rust]
…ly adding an `EnvironmentName` to all product requests and test `QueryRule`s. [ci skip-rust] [ci skip-build-wheels]
[ci skip-build-wheels]
Commits are useful to review independently! |
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.
At first glance, this doesn't look like anything is missing. 👍
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.
Thanks. I think that you want to apply this to more places, like build_files.py
. A lot of engine/
should be using this, and probably some of core/
too
#[test] | ||
fn masked_params() { |
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.
It'd be good to test when masking works
@@ -304,6 +304,31 @@ fn in_scope_computed() { | |||
graph.find_root_edges(vec![], "a").unwrap(); | |||
} | |||
|
|||
#[test] | |||
fn in_scope_provided() { |
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.
Should this be cherry-picked?
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.
in_scope_types
is only on main
so far.
Some of it, yea. We'll almost certainly expose other things that we want masked as part of #17155. |
As described in #17129: we would like `@goal_rule`s to eventually make their own decisions about which environments to use, generally by consuming targets to do so, but possibly also by pinning themselves to other environments via configuration. This change builds on #17179, and introduces a migration from `Goal.environment_migrated = {False => True}`. All graph-introspection goals consume only the APIs which are pinned to the local environment by #17179, and so are trivially migrated here. Other goals trigger a deprecation warning like the following: ``` DEPRECATED: Not setting `Goal.environment_migrated=True` for `Goal` `generate-lockfiles` is scheduled to be removed in version 2.17.0.dev0. See https://www.pantsbuild.org/v2.15/docs/plugin-upgrade-guide ``` Before calling #17129 done, we will migrate all internal goals to `Goal.environment_migrated=True`. [ci skip-rust] [ci skip-build-wheels]
As a first step toward #17129, this change "masks" the
EnvironmentName
for relevant APIs ingraph.py
andspecs_rules.py
, and pins them to the__local__
environment.The
@rule(.., _mask_types=[..])
argument triggers an assertion if the given type(s) are used in the identity of the@rule
(i.e.: if the@rule
"consumes" them from its scope). The impact of masking a type at an API boundary is an assertion that that type is not consumed by that API.As described in #17129: we're pinning graph computations to the
__local__
environment for now, although we may eventually allow graph computations to execute in a configurable environment.[ci skip-build-wheels]