Skip to content

Allow OTP to start when unexpected enum values is encountered in config.#4983

Merged
t2gran merged 4 commits into
opentripplanner:dev-2.xfrom
entur:otp2_config_error
Mar 29, 2023
Merged

Allow OTP to start when unexpected enum values is encountered in config.#4983
t2gran merged 4 commits into
opentripplanner:dev-2.xfrom
entur:otp2_config_error

Conversation

@t2gran

@t2gran t2gran commented Mar 20, 2023

Copy link
Copy Markdown
Member

Summary

Enum values can be added or deleted; Hence to allow OTP to be forward and backward compatible unknown values must be logged(WARNING) and ignored. The Server should not terminate.

The new log items look like this:

13:45:56.208 WARN (NodeAdapter.java:172) The enum value 'Fake' is not legal. Expected one of [APIBikeRental, APIServerInfo, APIGraphInspectorTile, APIUpdaterStatus, ConsiderPatternsForDirectTransfers, DebugClient, FloatingBike, MinimumTransferTimeIsDefinitive, OptimizeTransfers, ParallelRouting, TransferConstraints, ActuatorAPI, AsyncGraphQLFetchers, DataOverlay, FaresV2, FlexRouting, GoogleCloudStorage, RealtimeResolver, ReportApi, SandboxAPIGeocoder, SandboxAPILegacyGraphQLApi, SandboxAPIMapboxVectorTilesApi, SandboxAPIParkAndRideApi, SandboxAPITransmodelApi, SandboxAPITravelTime, TransferAnalyzer, VehicleToStopHeuristics]. Parameter: otpFeatures. Source: otp-config.json.
13:45:56.208 WARN (NodeAdapter.java:169) Unexpected config parameter: 'otpFeatures.Fake:true' in 'otp-config.json'

In this case I started OTP with a "Fake" feature.

Issue

Partially fixes #4980

Unit tests

Updated

Documentation

Updated

@t2gran t2gran added the !Bug Apply to issues describing a bug and PRs witch fixes it. label Mar 20, 2023
@t2gran t2gran added this to the 2.3 milestone Mar 20, 2023
@t2gran t2gran requested a review from a team as a code owner March 20, 2023 13:10
@t2gran t2gran force-pushed the otp2_config_error branch from dfc4fe7 to 52405ad Compare March 20, 2023 15:16
Enum values can be added or deleted; Hence to allow OTP to be forward and backward
compatible unknown values must be logged(WARNING) and ignored. The Server should
not terminate.
@t2gran t2gran force-pushed the otp2_config_error branch from 52405ad to f38676a Compare March 21, 2023 11:22
@codecov

codecov Bot commented Mar 21, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (11d0094) 63.90% compared to head (f38676a) 63.92%.

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

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #4983      +/-   ##
=============================================
+ Coverage      63.90%   63.92%   +0.01%     
- Complexity     13501    13513      +12     
=============================================
  Files           1674     1674              
  Lines          66152    66196      +44     
  Branches        7155     7158       +3     
=============================================
+ Hits           42274    42314      +40     
- Misses         21492    21497       +5     
+ Partials        2386     2385       -1     
Impacted Files Coverage Δ
...opentripplanner/standalone/config/BuildConfig.java 98.46% <100.00%> (ø)
...g/opentripplanner/standalone/config/OtpConfig.java 94.11% <100.00%> (+1.26%) ⬆️
...pentripplanner/standalone/config/RouterConfig.java 87.03% <100.00%> (ø)
.../standalone/config/framework/json/NodeAdapter.java 94.56% <100.00%> (+0.51%) ⬆️
...dalone/config/framework/json/ParameterBuilder.java 90.45% <100.00%> (-0.85%) ⬇️
...lone/config/routerconfig/TransitRoutingConfig.java 96.19% <100.00%> (ø)

... and 9 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@leonardehrenfried leonardehrenfried left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a couple of requests.

@t2gran t2gran force-pushed the otp2_config_error branch from e25e51d to 822a8d6 Compare March 24, 2023 17:57
@t2gran t2gran merged commit 8095c57 into opentripplanner:dev-2.x Mar 29, 2023
@t2gran t2gran deleted the otp2_config_error branch March 29, 2023 07:34
t2gran pushed a commit that referenced this pull request Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config is not backward compatible

3 participants