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

Document changes in DotNetTool Module starting with Cake 1.1.0 #1739

Closed
augustoproiete opened this issue Mar 6, 2021 · 11 comments · Fixed by #2221
Closed

Document changes in DotNetTool Module starting with Cake 1.1.0 #1739

augustoproiete opened this issue Mar 6, 2021 · 11 comments · Fixed by #2221
Assignees
Milestone

Comments

@augustoproiete
Copy link
Member

augustoproiete commented Mar 6, 2021

Recommendation

  • If you use Cake.DotNetTool.Module already on your builds, you should either:

  • (1) Upgrade Cake to version 1.1.0, and remove the Cake.DotNetTool.Module from your build script (as it's no longer needed)

or

  • (2) Pin Cake.DotNetTool.Module to a version compatible with the Cake version that you use. Cake.DotNetTool.Module version 1.0.1 is the last version compatible with Cake 1.0.0. Starting with this release, Cake.DotNetTool.Module will always be released together with Cake and will only be compatible with the current release.

image

https://cakebuild.net/extensions/cake-dotnettool-module/


Relates to:

@TomerPacific
Copy link
Contributor

Hi @augustoproiete, I'd like to help out. What are the changes you would like done exactly?

@augustoproiete
Copy link
Member Author

Hi @TomerPacific thanks for your interest in this one.

The intent is to add the recommendation above to this page here: https://cakebuild.net/extensions/cake-dotnettool-module/

@TomerPacific
Copy link
Contributor

@augustoproiete, I've taken a look inside the project to see how I can add what you have written and am coming up short.
I found inside extensions folder the file for the DotNetToolModule, but that is a yml file and I don't think I am supposed to add that there (based on looking at other extensions as well).

I've been looking at the 7zip extension as a go to guide to follow, but have yet to find out how the Aliases text has been added there. From a brief search I found out the config.wyam file, but I am not sure how it all fits in together. I would appreciate it if you could declutter some of this.

@augustoproiete
Copy link
Member Author

@TomerPacific Thanks for looking deeper into this one.

We discussed this a while ago, and I believe the easiest path forward is to add a hard-coded alert in the page for now (e.g. if (extensionName == "Cake.DotNetTool.Module") @Html.Partial("_DotNetToolModuleDescription"); ... given that we don't yet have a feature that allows us to add custom notes about a specific extension.

image

As part of this change, we should also rollback the last changes that were made to AnalyzedPackageVersion and AnalyzedPackagePublishDate to reflect the latest "valid" version of this extension, as per @pascalberger's comments here:

-AnalyzedPackageVersion: 1.1.0
+AnalyzedPackageVersion: 1.0.1
AnalyzedPackageIsPrerelease: false
-AnalyzedPackagePublishDate: 2021-03-06T06:37:35.9600000Z
+AnalyzedPackagePublishDate: 2021-02-22T20:53:19.0970000Z

The description you see at the top is coming from the description field inside the Cake.DotNetTool.Module.yml which normally would be automatically updated from the NuGet package description metadata through a tool we use that keeps these .yml files in sync (AddinDiscoverer). However we disabled automatic updates when we shipped Cake v1.1.0 so updating the description field in the .yml would be a possible route, but that only supports simple/raw text i.e. Doesn't allow us to add HTML or Markdown (for the alert).

@TomerPacific
Copy link
Contributor

thanks for the lengthy explanation, @augustoproiete. So, if I understand correctly, since the documentation field in the yml file does not support markup, adding the required text inside of an alert will take place inside the _ExtensionsPage.cshtml?

@augustoproiete
Copy link
Member Author

adding the required text inside of an alert will take place inside the _ExtensionsPage.cshtml?

@TomerPacific Yes , except that to make it a little cleaner, lets store the alert text on a separate file e.g. _ExtensionDotNetToolModule.cshtml and modify _ExtensionsPage.cshtml to render this file/partial view only for the Cake.DotNetTool.Module

@TomerPacific
Copy link
Contributor

TomerPacific commented Oct 6, 2021

@augustoproiete, I have started working on this and would like to get your input on what I am doing.

  • Looking over _ExtensionsPage.cshtml, I see that it is using _ExtensionsList.cshtml to render all the extensions. Shouldn't I add the condition inside of _ExtensionsList when the anchor tag is clicked? I am having trouble understanding where the data is rendered.
  • I have reverted back the version and publish date of the dotnet module
  • I have created a new file, _ExtensionDotNetToolModule.cshtml
  • To add the alert, I looked at _AddinAlert.cshtml as an example
  • Is there a source I could look at to better understand the syntax and code you are using? I looked a bit inside the Wyam website, but am looking for more concrete examples

@augustoproiete
Copy link
Member Author

@TomerPacific The description of the extension that you see on the individual page of each extension is rendered in _ExtensionsLayout.cshtml. This is where you would add the condition to render the partial view with the alert.

Is there a source I could look at to better understand the syntax and code you are using?

I'm not sure what kind of syntax you're referring to, but all .cshtml files are using the Razor syntax and the alerts are from Bootstrap v3.3, if that helps.

@TomerPacific
Copy link
Contributor

@augustoproiete, I just wanted to update that I am having some issues setting up a local environment so I can check things locally. I have opened a discussion to try and overcome these problems. I'll let you know if I get stuck.

@TomerPacific
Copy link
Contributor

@augustoproiete, how's it looking so far?

Cake

@augustoproiete
Copy link
Member Author

Looks like it's almost there 🎉 . I'd only suggest bringing it below the title to make it more clear that the warning is about the Cake.DotNetTool.Module itself and not a general warning of the website

image

/cc @pascalberger Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants