-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: Issue 50 and 44 remove unnecessary info add parent id to events #54
feat: Issue 50 and 44 remove unnecessary info add parent id to events #54
Conversation
…this prevent using custom serialization and it's the start of a bigger refactor to an Event hierarchy.
feat: AppMap Maven plugin (getappmap#46)
…this prevent using custom serialization and it's the start of a bigger refactor to an Event hierarchy.
…uss/appmap-java into issue-44-duplicate-event-properties
Added proper unit test for both. Minor code clean up.
src/main/java/com/appland/appmap/record/RecordingSessionGeneric.java
Outdated
Show resolved
Hide resolved
@marcuss, the |
@dustinbyrne I will try to reproduce it and check! |
removed unnecessary path = null line.
@dustinbyrne integration test working now |
…ck to select parent ids of events.
…ck to select parent ids of events.
@dustinbyrne I didn't check this PR after fixing the last comment, but I found another issue and corrected it, please take a look |
4cffa84
to
991680a
Compare
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.
Could you give this a try with the Spring Pet Clinic?
I'm running with the following command and getting errors:
mvn -DargLine="-javaagent:~/dev/appmap-java/build/libs/appmap-0.5.2.jar" test
I believe they're all related to HTTP server requests.
java.lang.IllegalArgumentException: Missing parent Event.
src/main/java/com/appland/appmap/record/RecordingSessionGeneric.java
Outdated
Show resolved
Hide resolved
f8202dc
to
ea9c595
Compare
Hi @marcuss what happened with this PR? |
@dustinbyrne now that I look closely I think I close the wrong one, I remember you fixed an issue while I was working on it, and I though it was this one, let me take a look a reopened if this is still needed. |
…ecessary-info-add-parent_id-to-events
@dustinbyrne Please check out the updated PR. |
There's still a few failure cases in Spring Pet Clinic. Unfortunately, I don't have the time to dig in to this deeper atm. The error is pretty vague, so it'll likely require a debugger:
|
@dustinbyrne I haven't check the spring pet clinic error actually, I think this was the original mishap that made me overlook this PR, I will check this today to see if I can reproduce it |
@dustinbyrne I checked using the maven plugin, and there is no error, I even created locally a 1.0.5 version of the plugin and the agent just to be 100% sure the maven plugin was using the new version and verified too, reading the argument line generated, and yes it is using the version from this branch:
|
@dustinbyrne I also checked using your way, and this command:
And got again successful runs, check the generated files: |
@dustinbyrne are you sure you are using the correct java agent version? and by that, I meant the version generated with this branch. |
@dustinbyrne @ptrdvrk
|
1 similar comment
@dustinbyrne @ptrdvrk
|
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.
Looking good! I've added a couple of small items to check out.
Additionally, would you mind running Checkstyle over these changes? We use the default Google style. I'll have to find out how we can better integrate Checkstyle into the project moving forward.
public boolean isParentEventOf(Event other) { | ||
return this.definedClass.equals(other.definedClass) | ||
&& this.methodId.equals(other.methodId) | ||
&& this.lineNumber.equals(other.lineNumber); | ||
} |
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.
isSameMethod
may be a more apt name. isParentEventOf
can be misleading because it doesn't actually check the parent id.
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.
by the moment this is used, the parent id property is null in the child, so we can not check for it, but if the defined class, the method id and the line number are the same Bingo!
could it be named: "isSameCodeAs" ???
src/main/java/com/appland/appmap/record/RecordingSessionGeneric.java
Outdated
Show resolved
Hide resolved
if (event.parentId == null) { | ||
this.classReferences.add( | ||
event.definedClass + | ||
":" + event.methodId + | ||
":" + event.isStatic + | ||
":" + event.lineNumber); |
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.
Since these properties may now be null
, maybe the condition should instead check for presence of methodId
/isStatic
/lineNumber
for better future-proofing. This is also fine as it is currently.
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.
If it is fine at it is I'll rather keep it since right now the intent is clearer, we are checking if the event does not have a parent, the other way could be misleading.
I've added an issue to make sure we're not attempting to publish in a non-master branch. |
Closed via #91 |
Contains changes from PR: #48
And changes to fix issue 50