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 #481] Use YAML file to store configuration #3988

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

Conversation

pandaapo
Copy link
Contributor

@pandaapo pandaapo commented May 21, 2023

Fixes #481.

Motivation

See "Enhancement Request" in issue.

Modifications

The default config file format keeps eventmesh.properties. When user set only config file in yaml / yml format, EventMesh will find it and load it.

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

@mxsm
Copy link
Member

mxsm commented May 21, 2023

Hi @pandaapo This feature has been implemented. You can refer to the specific class org.apache.eventmesh.common.config.FileLoad.

@pandaapo
Copy link
Contributor Author

pandaapo commented May 21, 2023

Hi @pandaapo This feature has been implemented. You can refer to the specific class org.apache.eventmesh.common.config.FileLoad.

Thanks for your comment.

  • You can try its method FileLoad.YamlFileLoad#getConfig(ConfigInfo). Then you will get properties like aaa ->, bbb -> , ccc -> 3 when the yml content is
aaa
  bbb
    ccc: 3
  • Current code will never load eventmesh.yaml whether eventmesh.yaml exists or not. Because the call stack logic in starting up with standalone mode always use PropertiesFileLoad.

If eventmesh.yaml can be loaded in some way currently, please tell me and I will verify if it will be affected by my modifications.

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #3988 (2bb30ef) into master (fb144bb) will decrease coverage by 0.01%.
The diff coverage is 30.66%.

❗ Current head 2bb30ef differs from pull request most recent head 83fb56e. Consider uploading reports for the commit 83fb56e to get more accurate results

@@             Coverage Diff              @@
##             master    #3988      +/-   ##
============================================
- Coverage     14.22%   14.22%   -0.01%     
  Complexity     1328     1328              
============================================
  Files           580      583       +3     
  Lines         28856    29013     +157     
  Branches       2792     2810      +18     
============================================
+ Hits           4105     4127      +22     
- Misses        24361    24494     +133     
- Partials        390      392       +2     
Impacted Files Coverage Δ
...a/org/apache/eventmesh/common/utils/FileUtils.java 0.00% <0.00%> (ø)
...org/apache/eventmesh/common/file/YamlFileLoad.java 4.54% <4.54%> (ø)
.../apache/eventmesh/common/config/ConfigService.java 42.35% <16.66%> (+0.97%) ⬆️
...ava/org/apache/eventmesh/common/file/FileLoad.java 44.44% <44.44%> (ø)
...org/apache/eventmesh/common/file/BaseFileLoad.java 100.00% <100.00%> (ø)
...ache/eventmesh/common/file/PropertiesFileLoad.java 100.00% <100.00%> (ø)

... and 16 files with indirect coverage changes

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

@Pil0tXia
Copy link
Member

I think we should only use one configuration file, either eventmesh.yml or eventmesh.properties. Having both concurrently would pose difficulties in maintenance.

Considering that connectors all use YAML configuration files, the presence of eventmesh.properties feels inconsistent, since it is one of the few properties files in EventMesh. Therefore, my preference would be to standardize the use of YAML files.

In our project, we currently have both .yml and .yaml files, and both file extensions are valid. However, it would be necessary to choose one for consistency. Although .yaml is a more standard and compliant file extension compared to .yml, the majority of our project uses .yml. Hence, I recommend standardizing on the .yml extension (except for .asf.yaml).

@pandaapo
Copy link
Contributor Author

I think we should only use one configuration file, either eventmesh.yml or eventmesh.properties. Having both concurrently would pose difficulties in maintenance.

Considering that connectors all use YAML configuration files, the presence of eventmesh.properties feels inconsistent, since it is one of the few properties files in EventMesh. Therefore, my preference would be to standardize the use of YAML files.

In our project, we currently have both .yml and .yaml files, and both file extensions are valid. However, it would be necessary to choose one for consistency. Although .yaml is a more standard and compliant file extension compared to .yml, the majority of our project uses .yml. Hence, I recommend standardizing on the .yml extension (except for .asf.yaml).

Thanks for your review. But sorry, many of your points I couldn't agree with, and they were even a bit strange to me. No offense, I'm willing to wait for more members of the community to express their views on these points of yours. If there are no objections, I will revise.

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 20, 2024
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 14.22%. Comparing base (fb144bb) to head (2bb30ef).
Report is 409 commits behind head on master.

❗ Current head 2bb30ef differs from pull request most recent head 83fb56e. Consider uploading reports for the commit 83fb56e to get more accurate results

Files Patch % Lines
...org/apache/eventmesh/common/file/YamlFileLoad.java 4.54% 21 Missing ⚠️
...a/org/apache/eventmesh/common/utils/FileUtils.java 0.00% 21 Missing ⚠️
.../apache/eventmesh/common/config/ConfigService.java 16.66% 5 Missing ⚠️
...ava/org/apache/eventmesh/common/file/FileLoad.java 44.44% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3988      +/-   ##
============================================
- Coverage     14.22%   14.22%   -0.01%     
  Complexity     1328     1328              
============================================
  Files           580      583       +3     
  Lines         28856    29013     +157     
  Branches       2792     2810      +18     
============================================
+ Hits           4105     4127      +22     
- Misses        24361    24494     +133     
- Partials        390      392       +2     

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

@github-actions github-actions bot removed the Stale label Apr 21, 2024
@Pil0tXia Pil0tXia changed the title [ISSUE #481]Use YAML file to store configuration [ISSUE #481] Use YAML file to store configuration Apr 24, 2024
@Pil0tXia
Copy link
Member

Any progress we can make here?

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.

Use YAML file to store configuration
4 participants