-
Notifications
You must be signed in to change notification settings - Fork 31
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
Remove event specifier string syntax #486
Remove event specifier string syntax #486
Conversation
This is a good start, although this particular issue is deeper than just |
There are a lot of unrelated changes in this patch at the moment - lots of changes from Otherwise, the main relevant portion of the patch is looking good - nice work! Some unit tests will need to be updated to suit, which will also fix the failing CI build status. Once the above are addressed then go ahead and unmark this PR as a draft. I'm not sure if I get notified when that happens so to be sure you can also leave a comment to ensure I see it. |
Thanks for the advice, it's much appreciated! Everything was going fine until I rebased onto main and pushed to my remote branch, but forgot to squash my commits, so I did an interactive rebase immediately after. This resulted in my local and remote branches diverging, which I accidentally merged together. After that I did a series of reverts with a final rebase onto main, which ended up with the final commit you see above. Unfortunately, this somehow brought in the unrelated file changes you mentioned. My understanding of Git is still fairly fuzzy so I'm not sure how to fix this. |
Hmm. Now that the changes are all squashed down into a single commit you'll probably need to temporarily back out of the commit locally, fix the unintentional changes, and create a new commit containing only the changes you want to include. |
Looks like it worked, thanks for the help! Would you like me to take a stab at changing the test suite functionality from event strings to templates before I unmark this PR as a draft? |
Cool, the patch looks much better now.
Yes, please do. Let me know if you're unsure about any of the changes required to the unit tests, but I think the CI build logs already pointed you to where the test failure occurs, so it should hopefully be fairly straightforward to update the tests to match the new expected behaviour. |
Sounds good, I'll be sure to let you know if I need help. |
So the PR looks like it's ready to go in terms of anything related to moving from strings to templates but there's an issue (inside the same test class) with this unit test: It seems the test uses a The weird thing is that this test failure goes unnoticed by the overall testing suite (i.e. mvn test/verify, Github CI checks etc.). I only see the test failure when I run the individual test inside VSCode (which could mean it's just a "me" problem?). I tried to get past this by using an anonymous sublass to replace the Even if this solution had fully worked it seems that it can result in some bad side effects as outlined here: https://stackoverflow.com/a/6802502, although I don't know if these concern us. Is there a better way to go about this in Java? Or should I just delete the |
That is weird. It could be a Java version difference, perhaps? Check which JDK version you have installed/configured on your system and if VSCode is following that or has its own setting.
I wouldn't worry about these concerns. This is inside of a test class, so the additional memory/storage resources used by the anonymous class are insignificant (this just very, very slightly increases the requirements for dev/testing on our local machines), and similarly for the class holding a reference to its context and blocking GC - this would only be for the duration of the test run anyway. The
Right, it sounds like in this case the test is over-specifying some constraints which may never occur in practice. If that's true then it's safe to remove those cases from the test. ie we don't need to test what the handler does if it gets a null form value, if the form value can never be null to begin with. To check what actually happens you could run through this case manually and insert some logging statements (or figure out how to attach a debugger inside a container) in the handler to print out the form attributes map, then make requests to this API handler and see what the form attributes map actually contains. curl/HTTPie would be useful for this. The behaviour is probably that the form attribute is either not in the map at all, or if the attribute does become a key in the map then the corresponding value is always a String (possibly empty but non-null). |
Thanks for the tips and suggestions. I'm busy with other onboarding tasks for the rest of the day so I'll try to run through the case manually like you suggested on Monday. Based on the result, I'll decide whether or not it's fine to delete the null testing, update my branch accordingly and notify you that the PR is ready to review. |
@andrewazores PR is ready for review, please and thanks. |
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.
Patch looks good, however I will refrain from approving/merging this until the corresponding -web side change is made (cryostatio/cryostat-web#224).
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.
Good catch on the command channel implementation side - I honestly forget we still have that. It is slated for removal eventually, but in the meantime this kind of feature parity change is still a good idea.
What exactly is the command channel? In this example, the What's also interesting is that I looked at some of the other classes in the command folder and there doesn't seem to be a pattern in their usage as far as I can see. |
The command channel is the predecessor to the current notifications channel. ContainerJFR was initially implemented as an interactive-mode utility with Commands implementing various actions a user could perform. The direct shell interface was then extended with remote network (TCP and later WebSocket) access, creating the Command Channel. Later, more of the Commands' functionalities were ported over to the HTTP API, deprecating the Commands. Most of the Commands were then fully removed, including any of the ones that performed actions to do with recordings, all of which extended the AbstractRecordingCommand. The only Command implementations left are small remnants of the original Command Channel, and are due for removal some time before the V2 release. |
Makes sense, thanks for the explanation! |
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 corresponding -web PR has been merged, so this backend change can now be merged as well. Please add a commit here that updates the web-client
submodule to that commit hash:
…ng event specifier strings
Remove all event specifier string syntax. Eliminates user confusion and encourages use of event templates which are a better alternative because of the reasons stated in #480.