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 deprecating scoped SubsystemDependencies #6961

Merged

Conversation

stuhood
Copy link
Member

@stuhood stuhood commented Dec 20, 2018

Problem

In order for a v2 Goal (in #6880) to replace a goal that was previously implemented as a collection of v1 Tasks, we need the ability to declare a deprecated dependency on a Subsystem (concretely: CacheSetup, in that case).

As explained in the patch, this is different from Optionable.deprecated_scope in one fundamental way: with deprecated_scope options live in two locations simultaneously (one of which is deprecated), while with a deprecated dependency they live in one location (which is deprecated). This split plays out in the unit tests, which verify that Optionable.deprecated_scope allows for splitting of a deprecated scope between two new destinations.

Solution

Add a removal_version to SubsystemDependency and ScopeInfo, and consume it in Options in order to render a warning for a deprecated ScopeInfo.

The ability to deprecate a scoped dependency is exposed via Subsystem.scoped(cls, removal_version=.., removal_hint=..).

Result

Callers can use Subsystem.scoped(cls, removal_version=.., removal_hint=..) to deprecate a scoped Subsystem dependency. #6880 will be unblocked to introduce a deprecated dependency on CacheSetup for v2 goals.

Copy link
Contributor

@illicitonion illicitonion left a comment

Choose a reason for hiding this comment

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

Looks reasonable.

When will this actually show up? When you run a goal which depends on a deprecated subsystem scope? Or only when you explicitly pass a flag from a deprecated subsystem scope?

@stuhood
Copy link
Member Author

stuhood commented Dec 20, 2018

Or only when you explicitly pass a flag from a deprecated subsystem scope?

Only in this case.

@stuhood stuhood merged commit 59304ef into pantsbuild:master Dec 21, 2018
@stuhood stuhood deleted the stuhood/allow-deprecating-subsystem-deps branch December 21, 2018 04:06
@benjyw
Copy link
Contributor

benjyw commented Dec 21, 2018

Sorry for the delayed review - was on a plane. This all LGTM.

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.

3 participants