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

feat: Issue 50 and 44 remove unnecessary info add parent id to events #54

Conversation

marcuss
Copy link
Contributor

@marcuss marcuss commented Feb 27, 2021

Contains changes from PR: #48

And changes to fix issue 50

@marcuss marcuss marked this pull request as ready for review March 5, 2021 03:22
@dustinbyrne
Copy link
Collaborator

@marcuss, the integrationTest task is failing. Any ideas?

@marcuss
Copy link
Contributor Author

marcuss commented Mar 9, 2021

@dustinbyrne I will try to reproduce it and check!

removed unnecessary path = null line.
@marcuss
Copy link
Contributor Author

marcuss commented Mar 9, 2021

@dustinbyrne integration test working now

@marcuss marcuss changed the title Issue 50 and 44 remove unnecessary info add parent id to events [READY TO MERGE] Issue 50 and 44 remove unnecessary info add parent id to events Mar 9, 2021
@marcuss
Copy link
Contributor Author

marcuss commented Mar 14, 2021

@dustinbyrne I didn't check this PR after fixing the last comment, but I found another issue and corrected it, please take a look

@dustinbyrne dustinbyrne force-pushed the master branch 2 times, most recently from 4cffa84 to 991680a Compare March 16, 2021 21:31
Copy link
Collaborator

@dustinbyrne dustinbyrne left a 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.

@dustinbyrne dustinbyrne force-pushed the master branch 3 times, most recently from f8202dc to ea9c595 Compare March 17, 2021 04:52
@marcuss marcuss closed this Apr 9, 2021
@dustinbyrne
Copy link
Collaborator

Hi @marcuss what happened with this PR?

@marcuss
Copy link
Contributor Author

marcuss commented Apr 18, 2021

@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.

@marcuss marcuss reopened this Apr 18, 2021
@marcuss marcuss changed the title [READY TO MERGE] Issue 50 and 44 remove unnecessary info add parent id to events feat: Issue 50 and 44 remove unnecessary info add parent id to events Apr 18, 2021
@marcuss
Copy link
Contributor Author

marcuss commented Apr 18, 2021

@dustinbyrne Please check out the updated PR.

@dustinbyrne
Copy link
Collaborator

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:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.util.NoSuchElementException: No value present
	at org.springframework.samples.petclinic.web.PetControllerTests.testProcessUpdateFormSuccess(PetControllerTests.java:99)

@marcuss
Copy link
Contributor Author

marcuss commented Apr 21, 2021

@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

@marcuss
Copy link
Contributor Author

marcuss commented Apr 22, 2021

@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:


[INFO] --- appmap-maven-plugin:1.1.1:prepare-agent (default) @ spring-petclinic ---
[INFO] Initializing AppLand AppMap Java Recorder. with agent 1.0.5
[INFO] argLine set to -Dappmap.event.valueSize=1024 -Dappmap.config.file=appmap.yml -Dappmap.output.directory=target\appmap -Dappmap.debug.file=target\appmap\agent.log -Dappmap.debug -javaagent:C:\Users\msanchez3\.m2\repository\org\jacoco\org.jacoco.agent\0.8.5\org.jacoco.agent-0.8.5-runtime.jar=destfile=C:\code\marcuss\spring-petclinic\target\jacoco.exec -javaagent:C:\Users\msanchez3\.m2\repository\com\appland\appmap-agent\1.0.5\appmap-agent-1.0.5.jar=com.appland.appmap.LoadJavaAppMapAgentMojo@6e847a7

@marcuss
Copy link
Contributor Author

marcuss commented Apr 22, 2021

@dustinbyrne I also checked using your way, and this command:

mvn -DargLine="-javaagent:C:\Users\marcuss\.m2\repository\com\appland\appmap-agent\1.0.5\appmap-agent-1.0.5.jar" test

And got again successful runs, check the generated files:
generated files

@marcuss
Copy link
Contributor Author

marcuss commented Apr 22, 2021

@dustinbyrne are you sure you are using the correct java agent version? and by that, I meant the version generated with this branch.

@marcuss
Copy link
Contributor Author

marcuss commented Apr 22, 2021

@dustinbyrne @ptrdvrk
btw the integration tests pass locally but the CI build says:

A problem occurred evaluating root project 'appmap-java'.
> Could not get unknown property 'ossrhPassword' for Credentials [username: appland.release] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated.

1 similar comment
@marcuss
Copy link
Contributor Author

marcuss commented Apr 22, 2021

@dustinbyrne @ptrdvrk
btw the integration tests pass locally but the CI build says:

A problem occurred evaluating root project 'appmap-java'.
> Could not get unknown property 'ossrhPassword' for Credentials [username: appland.release] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated.

Copy link
Collaborator

@dustinbyrne dustinbyrne left a 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.

Comment on lines 439 to 443
public boolean isParentEventOf(Event other) {
return this.definedClass.equals(other.definedClass)
&& this.methodId.equals(other.methodId)
&& this.lineNumber.equals(other.lineNumber);
}
Copy link
Collaborator

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.

Copy link
Contributor Author

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" ???

Comment on lines +17 to +22
if (event.parentId == null) {
this.classReferences.add(
event.definedClass +
":" + event.methodId +
":" + event.isStatic +
":" + event.lineNumber);
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@dustinbyrne
Copy link
Collaborator

@dustinbyrne @ptrdvrk
btw the integration tests pass locally but the CI build says:

A problem occurred evaluating root project 'appmap-java'.
> Could not get unknown property 'ossrhPassword' for Credentials [username: appland.release] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated.

I've added an issue to make sure we're not attempting to publish in a non-master branch.

@kgilpin
Copy link
Contributor

kgilpin commented Aug 4, 2021

Closed via #91

@kgilpin kgilpin closed this Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants