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

[ISSUE #4052] Implement the functionality of EventMeshVersion class. #4055

Merged
merged 3 commits into from May 23, 2024

Conversation

pandaapo
Copy link
Contributor

Fixes #4052.

Motivation

Currently, EventMeshVersion.java does not provide any actual functionality. We should complete its work.

We can print version of EventMesh when it starts up.

Modifications

Make EventMeshVersion.java can get current version of EventMesh source code or jar.

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@codecov
Copy link

codecov bot commented Jun 5, 2023

Codecov Report

Merging #4055 (4c28834) into master (ae961bf) will increase coverage by 0.00%.
The diff coverage is 37.80%.

❗ Current head 4c28834 differs from pull request most recent head d5b7abd. Consider uploading reports for the commit d5b7abd to get more accurate results

@@            Coverage Diff            @@
##             master    #4055   +/-   ##
=========================================
  Coverage     14.25%   14.25%           
- Complexity     1320     1331   +11     
=========================================
  Files           579      580    +1     
  Lines         28945    28911   -34     
  Branches       2791     2801   +10     
=========================================
- Hits           4125     4121    -4     
+ Misses        24428    24392   -36     
- Partials        392      398    +6     
Impacted Files Coverage Δ
.../apache/eventmesh/common/config/ConfigService.java 41.37% <0.00%> (-3.07%) ⬇️
...rg/apache/eventmesh/common/utils/ReflectUtils.java 0.00% <0.00%> (ø)
...e/admin/handler/QueryWebHookConfigByIdHandler.java 26.66% <0.00%> (ø)
...ndler/QueryWebHookConfigByManufacturerHandler.java 28.57% <0.00%> (ø)
.../protocol/tcp/client/task/MessageTransferTask.java 0.00% <0.00%> (ø)
.../org/apache/eventmesh/runtime/util/BannerUtil.java 88.88% <0.00%> (-2.54%) ⬇️
...ache/eventmesh/trace/api/AbstractTraceService.java 0.00% <0.00%> (ø)
...mesh/trace/api/common/EventMeshTraceConstants.java 0.00% <ø> (ø)
...tmesh/trace/pinpoint/common/PinpointConstants.java 0.00% <ø> (ø)
...eventmesh/trace/zipkin/common/ZipkinConstants.java 0.00% <ø> (ø)
... and 8 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

It has been 60 days since the last activity on this pull request. I am reaching out here to gently remind you that the Apache EventMesh community values every pull request, and please feel free to get in touch with the reviewers at any time. They are available to assist you in advancing the progress of your pull request and offering the latest feedback.

If you encounter any challenges during development, seeking support within the community is encouraged. We sincerely appreciate your contributions to Apache EventMesh.

@github-actions github-actions bot added the Stale label Apr 12, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 12, 2024

Codecov Report

Attention: Patch coverage is 39.68254% with 38 lines in your changes are missing coverage. Please review.

Project coverage is 14.25%. Comparing base (378aa75) to head (4c28834).
Report is 65 commits behind head on master.

Current head 4c28834 differs from pull request most recent head 67036d9

Please upload reports for the commit 67036d9 to get more accurate results.

Files Patch % Lines
.../eventmesh/runtime/constants/EventMeshVersion.java 40.32% 30 Missing and 7 partials ⚠️
.../org/apache/eventmesh/runtime/util/BannerUtil.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4055      +/-   ##
============================================
- Coverage     17.62%   14.25%   -3.37%     
+ Complexity     1784     1331     -453     
============================================
  Files           805      580     -225     
  Lines         29924    28911    -1013     
  Branches       2580     2801     +221     
============================================
- Hits           5273     4121    -1152     
- Misses        24169    24392     +223     
+ Partials        482      398      -84     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pandaapo
Copy link
Contributor Author

pandaapo commented Apr 13, 2024

It has been 60 days since the last activity on this pull request.

A question unrelated to the PR content: from which point in time does this bot calculate the 60-day period for PRs and the 90-day period for issues?

Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

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

The steps to get the version number look good to me. Is it possible to add a static block of code so that this class automatically saves the version number at application startup for other classes to get? I would like to write a web endpoint for getting the version number.

@Pil0tXia
Copy link
Member

from which point in time does this bot calculate the 60/90-day period

From the last activity of a thread.

@pandaapo
Copy link
Contributor Author

from which point in time does this bot calculate the 60/90-day period

From the last activity of a thread.

I mean if the point in time is the last activity for this pr/issue then it won't get the 60/90-day result.

@pandaapo
Copy link
Contributor Author

Is it possible to add a static block of code so that this class automatically saves the version number at application startup for other classes to get?

I'm confused about this requirement. The static code block is executed during class loading, all the classes are not yet finished loading and the application is not yet finished starting, where is the need for the version number calculated at this point?

@Pil0tXia
Copy link
Member

I mean if the point in time is the last activity for this pr/issue then it won't get the 60/90-day result.

60/90 is a preset text. Since bot is recently enabled, it will actually detect threads >= 60/90 days old.

Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

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

where is the need for the version number calculated at this point?

This avoids the time-consuming version retrieval logic the first time the version number is fetched. However, since the cache is already warmed up in the banner drawing, the version number can also be considered to be saved at startup. Then plz forget about it.

image

Pil0tXia
Pil0tXia previously approved these changes Apr 13, 2024
Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

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

plz resolve conflicts~

@pandaapo
Copy link
Contributor Author

I mean if the point in time is the last activity for this pr/issue then it won't get the 60/90-day result.

60/90 is a preset text. Since bot is recently enabled, it will actually detect threads >= 60/90 days old.

So for all PRs/issues that are >= 60/90 days old, how does this bot selectively mark them as 'stale' instead of marking most of them at once?

@Pil0tXia
Copy link
Member

how does this bot selectively mark them as 'stale' instead of marking most of them at once?

The bot reads 30 threads one day and will skip issues tagged with excluded labels.

Copy link
Member

@pchengma pchengma left a comment

Choose a reason for hiding this comment

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

LGTM.

@Pil0tXia
Copy link
Member

@pchengma Thank you for reviewing! May you please help review #4867 ?

@pchengma
Copy link
Member

@Pil0tXia Done.

@Pil0tXia
Copy link
Member

@pandaapo I didn't find a button to re-run the CI, this PR may need a new commit to trigger the latest workflow.

@pandaapo pandaapo closed this May 23, 2024
@pandaapo pandaapo reopened this May 23, 2024
@Pil0tXia
Copy link
Member

@pandaapo Really smart.

@Pil0tXia Pil0tXia merged commit 9e4e87f into apache:master May 23, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review PR is waiting for reviewer's approval or opinion (used as a strong reminder)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Implement the functionality of EventMeshVersion class.
4 participants