-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
chore: Simplified the Env
class in apollo-portal that links to Env
enum in apollo-core
#4011
chore: Simplified the Env
class in apollo-portal that links to Env
enum in apollo-core
#4011
Conversation
Since the Env class in portal/environment is a class representation of the enum Env in the apollo core project I linked them better together. This means if important changes happen in the enum it is automatically reflected to the class representation. Additionall I simplified the `transformEnv` method inside the Env class. The switch will be never reached since all those values are already matched in the `Env.valueOf(envName)`. Further more I added more javadoc and tests to boost up the coverage
Codecov Report
@@ Coverage Diff @@
## master #4011 +/- ##
============================================
+ Coverage 51.46% 51.55% +0.08%
- Complexity 2524 2529 +5
============================================
Files 484 484
Lines 14798 14806 +8
Branches 1532 1533 +1
============================================
+ Hits 7616 7633 +17
+ Misses 6652 6646 -6
+ Partials 530 527 -3
Continue to review full report at Codecov.
|
Quick question: why does my pull request effect CC: |
@DiegoKrupitza might be a bug of the coverage tool, because when you click the class, it just jumps to |
@kezhenxu94 Ok good to know! For a sec I thought I broke smth 😰 |
Thanks the pull request! This is the reason of why exists a Env in apollo-portal module #2827 (comment) Code will be review later soon. |
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/environment/EnvTest.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/test/java/com/ctrip/framework/apollo/portal/environment/EnvTest.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java
Outdated
Show resolved
Hide resolved
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/environment/Env.java
Outdated
Show resolved
Hide resolved
Env
class that links to Env
enumEnv
class in apollo-portal that links to Env
enum in apollo-core
Every suggestion made by @Anilople should now be implemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Since the Env class in portal/environment is a class representation of
the enum Env in the apollo core project I linked them better together.
This means if important changes happen in the enum it is automatically
reflected to the class representation.
Additionall I simplified the
transformEnv
method inside the Env class.The switch will be never reached since all those values are already
matched in the
Env.valueOf(envName)
.Further more I added more javadoc and tests to boost up the coverage
What's the purpose of this PR
Make the link between the class representation and the enum stronger, simplify the code and boost the test covergae
Which issue(s) this PR fixes:
None
Brief changelog
XXXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
mvn clean test
to make sure this pull request doesn't break anything.CHANGES
log.