-
-
Notifications
You must be signed in to change notification settings - Fork 1
Add Dotnet Implementation #81
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
base: main
Are you sure you want to change the base?
Conversation
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 need a review of the QueryTest suite to ensure that I have all the tests included.
If you use the data from the testdata folder, that should be guaranteed.
Will be using this to implement/enhance the conformation testing of the Reqnroll implementation of Messages.
I'm not sure if the query library is the right tool for that. It doesn't provide a systematic list of operations on messages yet. Rather it is driven by the needs of the various report generators that we're migrating to messages. So I'm afraid we might end up with rather disjoint libraries if it used by one implementation for conformance testing and for reporting in another.
The implementation looks good over all. A few remarks:
-
The access modifiers seem to be a bit to open. I'd like to keep the public API of these libraries small and well defined. This makes it easier to create new versions without breaking changes and if we do make breaking changes, communicate those through the version number.
-
There is a little bit of technical debt that I think would be good to clean up from Java first before we duplicate it to .Net.
…er than embedded resources).
- Updated `Lineage` class to implement `IEquatable<Lineage>`, adding a specific `Equals` method and `GetHashCode`. - Simplified timestamp conversion in `Query` class using `ToDateTimeOffset()` extension method. - Changed `TimestampComparer` visibility from public to internal. - Added `TimestampExtensions` class for converting `Timestamp` to `DateTimeOffset`. - Minor fix in `QueryAcceptanceTest.cs` to default null names to empty strings.
My intent is to use it within our Messages conformance test suite, but to use it to confirm the integrity (internal consistency) of the generated messages. Things such as a TestStepStarted points to a valid TestCaseStarted, etc. |
|
@mpkorstanje @davidjgoss Let me know if there is anything else you'd like to see changed. |
That sounds reasonable. |
Cheers! Appreciate the patience. This PR made me realize this library needed some cleanup. Otherwise we implemt composite operations multiple times. |
|
@clrudolphi I noticed that the .Net implementation of the Gherkin parser isn't using messages yet. Gaspar said he'd tackle that somewhere in Autumn. While waiting for this PR, perhaps that is something you can work on. |
To clarify the ask, my understanding is that
Please confirm this scope and correct anywhere I'm mistaken. |
|
Yes to those points with the following remarks. Please do also communicate with Gaspar to ensure the timing is convenient.
Not fundamentally. There might be changes related to changing Gherkin.Cucumber.Messages.Types to Cucumber/Messages.
Only the unit test, if any. Unless I'm mistaken the Gherkin .Net implementation is already using the repositories acceptance tests, so the acceptance tests would not have to be changed. And this is all on the assumption that the Cucumber/Messages and Gherkin.Cucumber.Messages.Types both serialize to the same json. But that assumption is of course not validated and may not hold. In that case, there might be a change needed to messages. |
… lineage derived methods).
|
@charlierudolph I think we're at point now where we are relatively stable. More methods might be added, but the tests are setup such that we won't block each other when that happens. |
|
Ok. I'll take another look. |
mpkorstanje
left a comment
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.
LGTM. I'm going to leave this open until Monday as a reminder to release it.
Could you hold off for a few days? I'd like to reconfirm package naming(re comments made by Gaspar wrt Tag-Expressions)? |
|
Not a problem! Please re-request a review when done. |
dotnet/Query/ILineageReducer.cs
Outdated
| @@ -0,0 +1,30 @@ | |||
| using Io.Cucumber.Messages.Types; | |||
|
|
|||
| namespace Io.Cucumber.Query | |||
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.
Await review from Gaspar on cucumber/tag-expressions#219
…s of Cucumber libraries. Enabled nullable.
|
@clrudolphi I saw you did 4fd7cd9, but didn't ask for a re-review where are we at right now? |
Sorry about that. This had fallen down the list of priorities. |
gasparnagy
left a comment
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 think this is good in general, but please change the namespace to Cucumber.Query and also make sure that file-scoped namespaces are used in all classes (so that it will be easier to maintain that long term).
| | `List<T>` | `ReadonlyArray<T>` | `List<T>` | | ||
| | `Map<K, V>` | `Map<K, V>` | `Dictionary<K, V>` | | ||
| | `Map<K, V>` | `Record<K, V>` | `Dictionary<K, V>` | | ||
| | `List<Entry<T, V>>` | `ReadonlyArray<[T, V]>` | `List<Entry<T, V>>` | |
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.
What does Entry mean here?
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 took that as an example of a kvp. Perhaps the .NET example should be List<KeyValuePair<T, V>>?
@mpkorstanje, would you mind adding some context?
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 see. Yes, I would mention KeyValuePair or a tuple. I would use KeyValuePair on external interfaces and tuple for internal ones. But I haven't seen in the code where any of these are used.
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.
Note to self: Remove this one.
gasparnagy
left a comment
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.
Did a bit more detailed check and found some smallish things. Could you please check?
gasparnagy
left a comment
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.
Two further comments
|
Note to self: Following #81 (comment) update |
Saved solution as SLNX. Updated github workflows to use .net 10 only. (Added global.json to enable .net10 MTP testing)
gasparnagy
left a comment
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.
LGTM
| jobs: | ||
| publish-nuget: | ||
| name: Publish package to NuGet.org | ||
| # Failing on `ubuntu-24.04` (https://github.com/cucumber/gherkin/issues/349) |
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.
Note to self: Upgrade and remove comment.
mpkorstanje
left a comment
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.
Leaving this open as a reminder to merge and release it.
🤔 What's changed?
Adding a dotnet implementation. This is more or less a direct port of the Java source.
⚡️ What's your motivation?
Will be using this to implement/enhance the conformation testing of the Reqnroll implementation of Messages.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
I need a review of the QueryTest suite to ensure that I have all the tests included.
This needs integration into the CI pipeline.
This will need a nuget push as well.
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.