豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

NU1608 warning for packages above dependency upper bounds#1678

Merged
emgarten merged 1 commit intodevfrom
dev-emgarten-upgradeWarning
Sep 7, 2017
Merged

NU1608 warning for packages above dependency upper bounds#1678
emgarten merged 1 commit intodevfrom
dev-emgarten-upgradeWarning

Conversation

@emgarten
Copy link
Copy Markdown
Member

@emgarten emgarten commented Aug 29, 2017

Warns when the flattened graph contains a version higher than an allowed upper bound version. This is essentially the reverse of a downgrade warning.

Example:

Detected package version outside of dependency constraint: x 1.0.0 requires y (= 1.0.0) but version y 2.0.0 was resolved.

Fixes NuGet/Home#2358

@davidfowl
Copy link
Copy Markdown
Member

@emgarten How is this ever allowed?

@emgarten
Copy link
Copy Markdown
Member Author

@davidfowl nearest wins, if the user has a direct dependency of y 2.0.0, but package x has an exact dependency on 1.0.0.

Do you think this will be too common?

Suggestions on the message text are welcome.

@emgarten
Copy link
Copy Markdown
Member Author

emgarten commented Aug 29, 2017

Note that an actual conflict does fail, this is only when that isn't happening due to nearest wins.
NuGet/Home#2358

@davidfowl
Copy link
Copy Markdown
Member

That's by design though. Nearest wins clips the dependency graph to allow this. A warning isn't bad though I guess you can always suppress it.

@emgarten
Copy link
Copy Markdown
Member Author

Agreed that it is by design, the current thinking is that now that warnings can be suppressed or turned into errors this will give users an option to deal with it as needed.

@emgarten emgarten force-pushed the dev-emgarten-upgradeWarning branch from 9da0d9b to 9ab7ecb Compare August 30, 2017 22:08
Package versions that exceed the upper bound of a dependency should warn with NU1608 to let the user know that a constraint is invalid.

Fixes NuGet/Home#2358
@emgarten emgarten force-pushed the dev-emgarten-upgradeWarning branch from 9ab7ecb to 4e3869a Compare August 30, 2017 22:37
@emgarten emgarten changed the title [WIP] NU1608 warning for packages above dependency upper bounds NU1608 warning for packages above dependency upper bounds Aug 30, 2017
Copy link
Copy Markdown

@jainaashish jainaashish left a comment

Choose a reason for hiding this comment

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

Looks good!

/// </summary>
public static IEnumerable<RestoreLogMessage> GetBumpedUpDependencies(
IEnumerable<IRestoreTargetGraph> graphs,
List<IndexedRestoreTargetGraph> graphs,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: change to IList

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.

Project.json restore should warn when top level packages violate constraints

6 participants