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

Include JaCoCo version in instrumentation/analysis exception messages #1217

Merged
merged 4 commits into from Feb 3, 2022

Conversation

marchof
Copy link
Member

@marchof marchof commented Sep 5, 2021

This should help in situations where users cannot see which version is actually used, like in AGP builds.

@Godin
Copy link
Member

Godin commented Sep 23, 2021

Another very convincing example - #1224 (comment)

@Godin Godin changed the title Include JaCoCo version in instrumentation/analysis exception messaged Include JaCoCo version in instrumentation/analysis exception messages Sep 23, 2021
@Godin Godin added this to Implementation in Current work items via automation Oct 5, 2021
@Godin Godin moved this from Implementation to Review in Current work items Oct 5, 2021
This will hopefully help people to understand which JaCoCo version they
are actually using in their build setups.
@@ -19,9 +19,17 @@
*/
public final class JaCoCo {

/** Qualified build version of the JaCoCo core library. */
/** Version of JaCoCo core. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marchof this is indeed qualified version, i.e. in https://repo1.maven.org/maven2/org/jacoco/org.jacoco.core/0.8.7/org.jacoco.core-0.8.7.jar

VERSION=0.8.7.202105040129

So I'm wondering whether change of javadoc here implies that you expect(ed) to see

Error while analyzing Example.class with JaCoCo 0.8.8/95a2b3e2.

instead of

Error while analyzing Example.class with JaCoCo 0.8.8.202202010859/95a2b3e2.

?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups my bad. I was wrongly assuming we have the plain version here. From my point of view the plain version would be enough here. What do you think, can we change this to project.version?

If we don't want to change this in this PR the qualified version is also good for me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think, can we change this to project.version?

Well I have mixed feelings:

Maybe not a big deal to change it, however strictly speaking it is part of our public API on it's own and a return value of Agent API org.jacoco.agent.rt.IAgent.getVersion, also it is shown by version command in CLI and always displayed in footer (right-bottom corner) of html reports.

And on one side, since qualifier is build timestamp, maybe nice that people will see how old version they are using. On the other side, since their configuration files use unqualified version, presence of qualifier might be confusing.

We can introduce VERSION_SHORT by analogy with COMMITID_SHORT, but maybe this is an overkill.

If we don't want to change this in this PR the qualified version is also good for me.

So let's keep it as is for now.

I was wrongly assuming we have the plain version here.

I'll add back word "Qualified" so that it can again remind us next time 😉

@@ -1,3 +1,4 @@
VERSION=${qualified.bundle.version}
COMMITID=${buildNumber}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marchof hope people won't be faking this value in forks 😉

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well ... 🤷‍♂️

@Godin Godin added this to the 0.8.8 milestone Feb 1, 2022
Co-authored-by: Evgeny Mandrikov <138671+Godin@users.noreply.github.com>
Comment on lines +44 to 46
COMMITID_SHORT = COMMITID.substring(0, 7);
HOMEURL = bundle.getString("HOMEURL");
RUNTIMEPACKAGE = bundle.getString("RUNTIMEPACKAGE");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marchof BTW fun fact:
COMMITID_SHORT is the first 7 digits of COMMITID computed at runtime,
RUNTIMEPACKAGE is the last 7 digits of COMMITID computed at build time
😆

@@ -19,9 +19,17 @@
*/
public final class JaCoCo {

/** Qualified build version of the JaCoCo core library. */
/** Version of JaCoCo core. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think, can we change this to project.version?

Well I have mixed feelings:

Maybe not a big deal to change it, however strictly speaking it is part of our public API on it's own and a return value of Agent API org.jacoco.agent.rt.IAgent.getVersion, also it is shown by version command in CLI and always displayed in footer (right-bottom corner) of html reports.

And on one side, since qualifier is build timestamp, maybe nice that people will see how old version they are using. On the other side, since their configuration files use unqualified version, presence of qualifier might be confusing.

We can introduce VERSION_SHORT by analogy with COMMITID_SHORT, but maybe this is an overkill.

If we don't want to change this in this PR the qualified version is also good for me.

So let's keep it as is for now.

I was wrongly assuming we have the plain version here.

I'll add back word "Qualified" so that it can again remind us next time 😉

@Godin Godin merged commit c54fa8a into master Feb 3, 2022
Current work items automation moved this from Review to Done Feb 3, 2022
@Godin Godin deleted the error-with-version branch February 3, 2022 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants