apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
https://www.apolloconfig.com
Apache License 2.0
28.94k stars 10.19k forks source link

Refine the description of the environment name #5082

Closed klboke closed 5 months ago

klboke commented 5 months ago

What's the purpose of this PR

This is an implicit logic within Apollo. If not described clearly, users will be very confused

  private static String getWellFormName(String envName) {
    if (StringUtils.isBlank(envName)) {
      return "";
    }

    String envWellFormName = envName.trim().toUpperCase();

    // special case for production in case of typo
    if ("PROD".equals(envWellFormName)) {
      return Env.PRO.name;
    }

    // special case that FAT & FWS should map to FAT
    if ("FWS".equals(envWellFormName)) {
      return Env.FAT.name;
    }

    return envWellFormName;
  }
codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (ff44245) 49.59% compared to head (b2caaff) 49.60%. Report is 1 commits behind head on master.

:exclamation: Current head b2caaff differs from pull request most recent head c8e190e. Consider uploading reports for the commit c8e190e to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #5082 +/- ## ========================================= Coverage 49.59% 49.60% - Complexity 1903 1904 +1 ========================================= Files 372 372 Lines 11564 11564 Branches 1127 1127 ========================================= + Hits 5735 5736 +1 Misses 5488 5488 + Partials 341 340 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.