Skip to content

Basic pack functionality for Embedded Readmes#3575

Merged
advay26-zz merged 27 commits intodev-feature-readmefrom
dev-advay26-readme
Aug 21, 2020
Merged

Basic pack functionality for Embedded Readmes#3575
advay26-zz merged 27 commits intodev-feature-readmefrom
dev-advay26-readme

Conversation

@advay26-zz
Copy link
Copy Markdown
Contributor

@advay26-zz advay26-zz commented Aug 12, 2020

Bug

Fixes: NuGet/Home#9833
Regression: No

Fix

Details: This implements basic embedded Readme functionality through nuget pack, dotnet pack and msbuild /t:pack, and does the Client-side validation for the packed Readme files.

Testing/Validation

Tests Added: Yes

advay26 and others added 23 commits August 12, 2020 14:43
Copy link
Copy Markdown
Contributor

@zkat zkat left a comment

Choose a reason for hiding this comment

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

I love all the tests, and everything looks good so far! I spotted something that brought up a question for me but the rest looks good. Great work!

@advay26-zz advay26-zz marked this pull request as ready for review August 14, 2020 21:45
bool Serviceable { get; }
string Copyright { get; }
string Icon { get; }
string Readme { get; }
Copy link
Copy Markdown
Contributor

@loic-sharma loic-sharma Aug 15, 2020

Choose a reason for hiding this comment

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

A concern I have is that one could easily mistake Readme as the readme content instead of a path - especially for undocumented members. What do you think of renaming properties to ReadmePath and methods to GetReadmePath()?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would this change apply to the actual nuspec element name <readme> as well, making it something like <readmePath>, or would it only apply to the names of properties and methods in the code?

Copy link
Copy Markdown
Contributor

@loic-sharma loic-sharma Aug 17, 2020

Choose a reason for hiding this comment

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

Up to you. Personally I'd be fine with renaming just the properties and methods in code so that we can keep the nuspec element <readme> consistent with the <license type="file"> element.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree on not changing the nuspec element name. However, I'm personally unsure about how we should weigh the concerns about the Readme property name not being clear on readme contents vs path, against possible concerns about consistency between:

  1. the nuspec <readme> element and other nuspec elements (we seem to agree that we shouldn't change this)
  2. the nuspec <readme> element and the corresponding Readme properties in the code

Would ReadmePath properties in the code cause confusion because of the fact that the corresponding nuspec element is named <readme> and not <readmePath>? I don't necessarily have an answer to this, and I'm happy to leave this conversation open for others to weigh in too.

@advay26-zz advay26-zz changed the title Basic functionality for Embedded Readmes Basic pack functionality for Embedded Readmes Aug 17, 2020
Copy link
Copy Markdown
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

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

@advay26-zz
Copy link
Copy Markdown
Contributor Author

You are missing dotnet pack tests though.

@nkolev92 Done! I've added new tests for dotnet pack now. Thanks for pointing it out.

@advay26-zz advay26-zz merged commit d03c785 into dev-feature-readme Aug 21, 2020
@advay26-zz advay26-zz deleted the dev-advay26-readme branch August 21, 2020 21:18
zkat pushed a commit that referenced this pull request Sep 3, 2020
* Made basic changes to classes to allow for a Readme element in the nuspec file

* More changes for readme functionality

* Adding the readme property if 'readme.md' is present in the base directory

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Removed commented code

* Added a summary for the CheckForReadme method

* Added support for dotnet pack for .csproj files

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Updated PublicAPI.Unshipped.txt files

* Changed some spacing

* Wrote tests for packing embedded readmes

* Removed automatic packing of readmes from base directory

* Used platform independent directory separating chars for testing

* Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs

Co-authored-by: donnie-msft <[email protected]>

* Updated PublicAPI files after file structure was modified

* Reverted to 'Readme == string.Empty' so that the Readme element remains optional

* Removed 1 MB file size check on pack

* Updated Public API files

* Updated Public API files again, builds fine locally

* Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out

* Changed var name in one of the tests

* Changed tests that were constructed incorrectly for non-Windows platforms

* Added dotnet pack tests

Co-authored-by: donnie-msft <[email protected]>
zkat pushed a commit that referenced this pull request Mar 2, 2021
* Made basic changes to classes to allow for a Readme element in the nuspec file

* More changes for readme functionality

* Adding the readme property if 'readme.md' is present in the base directory

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Removed commented code

* Added a summary for the CheckForReadme method

* Added support for dotnet pack for .csproj files

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Updated PublicAPI.Unshipped.txt files

* Changed some spacing

* Wrote tests for packing embedded readmes

* Removed automatic packing of readmes from base directory

* Used platform independent directory separating chars for testing

* Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs

Co-authored-by: donnie-msft <[email protected]>

* Updated PublicAPI files after file structure was modified

* Reverted to 'Readme == string.Empty' so that the Readme element remains optional

* Removed 1 MB file size check on pack

* Updated Public API files

* Updated Public API files again, builds fine locally

* Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out

* Changed var name in one of the tests

* Changed tests that were constructed incorrectly for non-Windows platforms

* Added dotnet pack tests

Co-authored-by: donnie-msft <[email protected]>
zkat pushed a commit that referenced this pull request Mar 12, 2021
* Made basic changes to classes to allow for a Readme element in the nuspec file

* More changes for readme functionality

* Adding the readme property if 'readme.md' is present in the base directory

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Removed commented code

* Added a summary for the CheckForReadme method

* Added support for dotnet pack for .csproj files

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Updated PublicAPI.Unshipped.txt files

* Changed some spacing

* Wrote tests for packing embedded readmes

* Removed automatic packing of readmes from base directory

* Used platform independent directory separating chars for testing

* Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs

Co-authored-by: donnie-msft <[email protected]>

* Updated PublicAPI files after file structure was modified

* Reverted to 'Readme == string.Empty' so that the Readme element remains optional

* Removed 1 MB file size check on pack

* Updated Public API files

* Updated Public API files again, builds fine locally

* Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out

* Changed var name in one of the tests

* Changed tests that were constructed incorrectly for non-Windows platforms

* Added dotnet pack tests

Co-authored-by: donnie-msft <[email protected]>
zkat pushed a commit that referenced this pull request Mar 15, 2021
* Made basic changes to classes to allow for a Readme element in the nuspec file

* More changes for readme functionality

* Adding the readme property if 'readme.md' is present in the base directory

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Removed commented code

* Added a summary for the CheckForReadme method

* Added support for dotnet pack for .csproj files

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Updated PublicAPI.Unshipped.txt files

* Changed some spacing

* Wrote tests for packing embedded readmes

* Removed automatic packing of readmes from base directory

* Used platform independent directory separating chars for testing

* Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs

Co-authored-by: donnie-msft <[email protected]>

* Updated PublicAPI files after file structure was modified

* Reverted to 'Readme == string.Empty' so that the Readme element remains optional

* Removed 1 MB file size check on pack

* Updated Public API files

* Updated Public API files again, builds fine locally

* Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out

* Changed var name in one of the tests

* Changed tests that were constructed incorrectly for non-Windows platforms

* Added dotnet pack tests

Co-authored-by: donnie-msft <[email protected]>
zkat added a commit that referenced this pull request Mar 15, 2021
* Basic pack functionality for Embedded Readmes (#3575)

* Made basic changes to classes to allow for a Readme element in the nuspec file

* More changes for readme functionality

* Adding the readme property if 'readme.md' is present in the base directory

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Removed commented code

* Added a summary for the CheckForReadme method

* Added support for dotnet pack for .csproj files

* Added support for dotnet pack for .csproj files

* Added validation for Readmes when packing, brought dotnet pack up to speed with nuget pack

* Changed variable names, changed error message for empty Readme

* Updated PublicAPI.Unshipped.txt files

* Changed some spacing

* Wrote tests for packing embedded readmes

* Removed automatic packing of readmes from base directory

* Used platform independent directory separating chars for testing

* Update src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/ManifestMetadata.cs

Co-authored-by: donnie-msft <[email protected]>

* Updated PublicAPI files after file structure was modified

* Reverted to 'Readme == string.Empty' so that the Readme element remains optional

* Removed 1 MB file size check on pack

* Updated Public API files

* Updated Public API files again, builds fine locally

* Fixed a bug with dir. separating chars (which seemed to affect /* searches exclusively?), added some tests to catch it out

* Changed var name in one of the tests

* Changed tests that were constructed incorrectly for non-Windows platforms

* Added dotnet pack tests

Co-authored-by: donnie-msft <[email protected]>

* PM UI surfaces a 'View README' link to the Embedded Readme file (#3583)

* Made initial changes for PM UI work for Readmes

* Added ReadmeUrl element to all the relevant places, still using ProjectUrl to see an an actual link for now

* URL now shows when user hovers over the link's text

* Removed the placeholder URL value that used the ProjectUrl

Co-authored-by: Advay Tandon <[email protected]>
Co-authored-by: donnie-msft <[email protected]>
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.

5 participants