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

Should package metadata element names be case-insensitive? #8838

Closed
joelverhagen opened this issue Nov 19, 2019 · 6 comments
Closed

Should package metadata element names be case-insensitive? #8838

joelverhagen opened this issue Nov 19, 2019 · 6 comments
Labels
Area:PackageDefinition Functionality:Pack Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:DCR Design Change Request WaitingForCustomer Applied when a NuGet triage person needs more info from the OP

Comments

@joelverhagen
Copy link
Member

Consider the case of the hand-edited .nuspec file (because no one ever does that, right?) where someone mistypes the metadata name and provides and incorrect case. Should this be supported officially?

Example. The BlogML.Core 1,0.0 package on nuget.org has <ProjectUrl> in the .nuspec instead of <projectUrl> which is the official element name.

image

XML is case sensitive right? Well, yes, but the majority of cases in the official NuGet experiences accept this funky metadata element without blinking an eye:

1st Party

  • ✔️ nuget.org: link
  • ✔️ V2 non-hijacked: link
  • ✔️ V2 hijacked: link
    • This is the thing ready by VS package manager UI on the V2 feed URL
  • ❌ Package metadata resource, a.k.a. registration: link
    • This is the thing read by VS package manager UI on the V3 feed URL
    • Note this will likely change with my Catalog2Registration rebuild due to Newtonsoft.Json#815
  • ✔️ Search: link
  • ✔️ Package manager UI on local feed
    • image

3rd Party

  • ❌ NuGet Package Explorer UI
  • ❌ NuGet Package Explorer > Edit > Edit Metadata Source (???)

This is a good idea right?

My vote is NO, no, No, nO! We should not support this officially.

In fact I think we should explicitly state it is not supported and any implementation that treats metadata names as case-insensitive strings is doing so at it's own peril. For example, what's the defined behavior when there are two metadata fields with the same name but different case (e.g. <id> and <ID>). Life's too short!

Fortunately, nuget.org rejects packages with multiple ID and version casings defined so I think we're out of scary land -- just living in crazy land. NBD.

Okay, who's guilty of this cardinal sin?

No shame, we all hack around with .nupkgs. But the ones I've found on nuget.org are:

🍻

@xavierdecoster
Copy link
Member

My vote is NO, no, No, nO! We should not support this officially.

🥇

@nkolev92 nkolev92 added Area:PackageDefinition Type:DCR Design Change Request Functionality:Pack Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. labels May 18, 2020
@nkolev92
Copy link
Member

@joelverhagen

Do you have a list of all the packages with bad metadata?

@nkolev92 nkolev92 added the WaitingForCustomer Applied when a NuGet triage person needs more info from the OP label May 18, 2020
@joelverhagen
Copy link
Member Author

See the end of the issue. There is a list of package IDs, versions, and specific metadata properties that are bad.

@nkolev92
Copy link
Member

@joelverhagen

I should've asked a better question.

Are those packages samples or all packages?

@joelverhagen
Copy link
Member Author

All, at the time of filing the issue.

@nkolev92
Copy link
Member

I think it makes sense to say that package metadata is case sensitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:PackageDefinition Functionality:Pack Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:DCR Design Change Request WaitingForCustomer Applied when a NuGet triage person needs more info from the OP
Projects
None yet
Development

No branches or pull requests

4 participants