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

IconUrl deprecation message. #7556

Merged
merged 3 commits into from
Sep 24, 2019
Merged

IconUrl deprecation message. #7556

merged 3 commits into from
Sep 24, 2019

Conversation

agr
Copy link
Contributor

@agr agr commented Sep 13, 2019

Addresses #7478

Browser:
iconUrlDepr

Command line:
iconUrlDeprCL

namespace NuGetGallery
{
/// <summary>
/// IconUrl element deprecation message.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Not a very useful comment, as it just restates the name of the class. I would prefer either getting rid of this comment or saying more about IconUrl and its deprecation.

Assert.Null(result.Message);
var warning = Assert.Single(result.Warnings);
Assert.IsType<IconUrlDeprecationValidationMessage>(warning);
Assert.StartsWith("<iconUrl> element will be deprecated, please consider switching to specifying the icon in the package.", warning.PlainTextMessage);
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks easy to break this test if we use the hard coded string. Maybe directly using the "Strings.UploadPackage_IconUrlDeprecated" is better for future maintenances.
I find some other examples in this facts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the point of this check. To break if text changes. Using Strings.UploadPackage_IconUrlDeprecated directly will hide such changes.

Choose a reason for hiding this comment

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

Like that?
image

Saying that element is deprecated when we didn't release a "stable" version of the client supporting it sounds a bit weird though.

@agr Do you need to update your tests?

@karann-msft
Copy link
Contributor

karann-msft commented Sep 17, 2019

Can I see a mock with all possible warnings? I am afraid we may have one link for every warning and then another read more at the end which might be few too many links. We can choose to not fix this right now in which case the warning message looks fine. I'd just make sure the language aligns with what I'd see on nuget pack.

@dominoFire thoughts on the warning message?

@agr
Copy link
Contributor Author

agr commented Sep 17, 2019

@karann-msft , this is the second warning message with the link (the other one is about license URL deprecation). All other warnings don't have links. And all other messages with link are errors (which we don't display at the same time as warnings).
image

@@ -1150,4 +1150,7 @@ The {1} Team</value>
<data name="SiteAdminNotLoggedInWithRequiredTenant" xml:space="preserve">
<value>The site admins are required to sign in with the '{0}' tenant only.</value>
</data>
<data name="UploadPackage_IconUrlDeprecated" xml:space="preserve">
<value>&lt;iconUrl&gt; element will be deprecated, please consider switching to specifying the icon in the package.</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering that we're warning on icon URLs already, isn't it already deprecated? What do you think of this messaging?

Suggested change
<value>&lt;iconUrl&gt; element will be deprecated, please consider switching to specifying the icon in the package.</value>
<value>The &lt;iconUrl&gt; element is deprecated, please use the icon element instead.</value>

This is message doesn't mirror the client's message, but I would prefer a clearer message if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The message that client currently produces is:

WARNING: NU5048: The 'PackageIconUrl'/'iconUrl' element is deprecated. Consider using the 'PackageIcon'/'icon' element instead. Learn more at https://aka.ms/deprecateIconUrl

And for licenseUrl:

WARNING: NU5125: The 'licenseUrl' element will be deprecated. Consider using the 'license' element instead.

@karann-msft
Copy link
Contributor

Let's update both messages to say "is deprecated". Rest looks good for now.

@agr
Copy link
Contributor Author

agr commented Sep 19, 2019

Like that?
image

Saying that element is deprecated when we didn't release a "stable" version of the client supporting it sounds a bit weird though.

@loic-sharma
Copy link
Contributor

Saying that element is deprecated when we didn't release a "stable" version of the client supporting it sounds a bit weird though.

Does the client in .NET Core 3 warn? If so, that ships on the 23rd

@agr agr merged commit efce758 into dev Sep 24, 2019
@agr agr deleted the agr-icon-depr branch September 24, 2019 01:33
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.

7 participants