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

Making the correct Parsing #890

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

Sangyoon21
Copy link
Contributor

@Sangyoon21 Sangyoon21 commented Jul 13, 2024

Fix #888
I changed it to parse the right jdk date but however i couldn't make the right jdk date showing in the graph.

Copy link

netlify bot commented Jul 13, 2024

Deploy Preview for eclipsefdn-adoptium-trss canceled.

Name Link
🔨 Latest commit 686bec8
🔍 Latest deploy log https://app.netlify.com/sites/eclipsefdn-adoptium-trss/deploys/66a01a15b8177600088391c6

Update the parsing depending on the jdk implementation is used
@Sangyoon21 Sangyoon21 marked this pull request as ready for review July 17, 2024 22:54
Copy link
Contributor

@karianna karianna left a comment

Choose a reason for hiding this comment

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

Would be good to add tests for this.

@Sangyoon21
Copy link
Contributor Author

i had added a test case file could you check it and give me some feedbacks?

@karianna
Copy link
Contributor

@Sangyoon21 Thanks for the test coverage, that's a great start! It probably would be good to add a few more output variants for our common LTS's. e.g., For Java 8

openjdk version "1.8.0_412"
OpenJDK Runtime Environment (Temurin)(build 1.8.0_412-b08)
OpenJDK 64-Bit Server VM (Temurin)(build 25.412-b08, mixed mode)

I think there are some more examples in https://github.com/adoptium/api.adoptium.net/blob/main/adoptium-models-parent/adoptium-api-v3-models/src/test/kotlin/api/VersionParserTest.kt

@Sangyoon21
Copy link
Contributor Author

i had added some more test cases but i am not sure what should be the date for those different version. Could you clarify it please?

Copy link
Contributor

@karianna karianna left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

@karianna karianna requested a review from smlambert July 21, 2024 21:35
@karianna
Copy link
Contributor

@Sangyoon21 You mentioned the dates still look incorrect in the UI though?

@Sangyoon21
Copy link
Contributor Author

i am not sure about it, i cannot check it on my side right now.

@karianna
Copy link
Contributor

i am not sure about it, i cannot check it on my side right now.

Are you not able to build locally?

@Sangyoon21
Copy link
Contributor Author

No, i am working locally but in the localhost3000(when i run ui version) the latest data point that is showing is only 2024-04-26. I cannot see further informations beyond that point.
Screenshot 2024-07-22 at 10 48 15 AM

@karianna
Copy link
Contributor

@llxia - Is that something you can help with?

if ((curRegexResult = javaVersionRegex.exec(output)) !== null) {
javaVersion = removeTimestamp(curRegexResult[1]);
} else {
javaVersion = output; // Use the entire output if markers are missing
Copy link
Contributor

Choose a reason for hiding this comment

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

If there is no javaVersionRegex match, we have no idea where the java -version is from and we should not handle the case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in this case than should i use return null instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, in this case, there is no java -version output.

`;

const result = parser.exactJavaVersion(java8Output);
expect(result.jdkDate).toBe('2024-06-27'); // Adjust the expected date based on your requirements
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we get 2024-06-27?

Copy link
Contributor Author

@Sangyoon21 Sangyoon21 Jul 22, 2024

Choose a reason for hiding this comment

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

but i am not sure what should be the date for those different version. Could you clarify it please?

This was the part where i was not sure and had asked in the previous comment, so i had just added an random date.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, there is no jdk build date in java -version output.

TestResultSummaryService/parsers/Parser.js Outdated Show resolved Hide resolved
@llxia
Copy link
Contributor

llxia commented Jul 22, 2024

To clarify, there could be 2 dates in java -version. For example:

16:38:54  =JAVA VERSION OUTPUT BEGIN=
16:38:54  openjdk version "21.0.4-beta" 2024-07-16
16:38:54  OpenJDK Runtime Environment Temurin-21.0.4+6-202406261902 (build 21.0.4-beta+6-ea)
16:38:54  OpenJDK 64-Bit Server VM Temurin-21.0.4+6-202406261902 (build 21.0.4-beta+6-ea, mixed mode, sharing)
16:38:54  =JAVA VERSION OUTPUT END=
  • 2024-07-16 - release date
  • 202406261902 - build date

The original issue is asking for getting the build date (not the release date). If there is no such a date, set null. We should not set a random date.

@Sangyoon21
Copy link
Contributor Author

I had fixed the changes. Please tell me if i have more things to change or update!!

Comment on lines 59 to 62
// Return null if no jdkDate is found
if (!jdkDate) {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead, add else at line 56

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean line 59?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, at line 56 add eles block

Comment on lines 36 to 38
} else if ((curRegexResult = javaBuildDateRegex.exec(output)) !== null) {
jdkDate = curRegexResult[0];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be removed

@llxia
Copy link
Contributor

llxia commented Jul 23, 2024

@Sangyoon21 could you rerun your test? Thanks

@Sangyoon21
Copy link
Contributor Author

I fixed it and here is the result of the test cases. I think it works now!
Screenshot 2024-07-24 at 12 02 15 AM

@karianna karianna requested a review from llxia July 23, 2024 23:47
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.

Check if we are setting jdkDate correctly for both types of JDK implementations
3 participants