-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add dotnet implementation of the htmlformatter #352
base: main
Are you sure you want to change the base?
Conversation
Added Unreleased note about the addition of the .NET impl
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Cucumber.Messages" Version="27.0.2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use a version range here? The html formatter is fairly backwards compatible with older messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put in a range to go back to R26. That was when I updated the Messages code generation approach to use the current system (retiring the old protobuf method). Assuming there was a risk that I broke something there, that is as far back as I'm comfortable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to correct that to only r27.0 as the minimum. R27 introduced a new enumeration type (HookType) and the serializer needs to know about all such enumerations for proper conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, on first quick review I don't see anything too surprising.
Do you need help setting up automated tests on Github? The messages and or Gherkins repos might provide inspiration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a question, but the root of the .NET impl here is dotnet/htmlformatter
, where with Gherkin for example it's just under dotnet
(basing this on where the .sln
file is in each one). Could/should we squash this up to match Gherkin's structure?
Hmm, there are some inconsistencies then across the Cucumber/dotnet landscape. In Messages, the source and .sln are in ./dotnet/Cucumber.Messages (that is, not directly under the dotnet folder). Which would you prefer? The Gherkin structure is much older. I created the Messages one. So I don't mind changing both. |
Corrected .gitignore files and CHANGELOG.md Reference to Messages nuget package updated to use a range specifier (going back to r26)
Not sure I'm following that one. There is
So I would expect there to be something like |
Oh, I see. I thought you were commenting the directory structure per se; not merely the location of the .sln file. I'll fix that. |
Removed the intermediary htmlformatter folder in order to match other Cucumber project's structures. Corrected nuget dependency range on Messages to [27.0,28.0).
Fixed. Intermediary folder removed. |
Updated the .csproj file to include information for Nuget publication of the htmlformatter assembly.
Added CI build files in .github/workflows, based upon what was used in Messages. Does the github build system invoke the Make before invoking each of the individual platform github build/test yml workflows? (just want to ensure the generated assets are in place...) |
dotnet/html-formatter.sln
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly a question: What are the .net standards for file names? The gherkin and messages projects seem to be using pascal case for these files and .
in place of non-az characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a convention than a standard, yes. I will change them.
In terms of project naming, do you want me to follow the lead of the java implementation and simply call it Htmlformatter? Or should I follow the lead of Messages and call it Cucumber.Htmlformatter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That depends!
For Java the full name is io.cucumber:html-formatter
.
Looks like NuGet doesn't have namespaces. So the produced artifact should be Cucumber.HtmlFormatter
.
Then I would expect the project files to follow the artifact name. Unless there is a strong convention in the .Net world that recommends otherwise. In which case the files in our other projects should be renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Changed to Cucumber.Htmlformatter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not in Pascal case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Done.
I get the impression we are following this advice:
But I'm not sure, I can't read the |
Changed capitalization of names of files to match convention used in other projects. Added a .snk file for the nuget publishing.
Talked to Gaspar, and checked in a .snk file. |
Further correction based upon feedback
Again; to make it Pascal cased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test-dotnet is failing with a pathing problem. Would you have time to take a look?
The project file "/home/runner/work/html-formatter/html-formatter/dotnet/HtmlFormatter/Cucumber.HtmlFormatter.csproj" was not found.
@charlierudolph are you using a case insensitive file system? |
Well that sucks. That doesn't match what is in my local repo. I'm on Windows if that matters. |
Then your filesystem is case insensitive by default. https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity I'm going to modify the files. Then you'll probably want to delete your repo and clone it again. |
Now it works. Just some warnings and complaints in the output.
|
EDIT: I've addressed the compilation warnings. |
Added README.md and included it in the nuget package definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with it generally. I have made a few minor code-style related comments.
<None Remove="Resources\index.mustache.html" /> | ||
<None Remove="Resources\main.css" /> | ||
<None Remove="Resources\main.js" /> | ||
<None Remove="Resources\main.js.LICENSE.txt" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, you don't have to remove the items from the None
group (because it is not doing anything anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if anything is still open from the others, but from my perspective this is good to go, thx!
Port of the Java implementation to .NET.
🤔 What's changed?
Added .NET implementation of htmlformatter and test suite, based port of the Java implementation.
Added lines to the global Make file to push the javascript build artifacts to the dotnet Resources folder.
⚡️ What's your motivation?
Intended for inclusion with Reqnroll reporting.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Will need assistance in getting the Nuget package publishing set-up.
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.