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

Upstream merge 2022-09-23 #128

Merged
merged 814 commits into from
Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
814 commits
Select commit Hold shift + click to select a range
89aa0fa
refactor: Move logFrequency, maxSnapshotFrequency, purgeExpiredData t…
t2gran Aug 25, 2022
a8fd652
Update src/client/js/otp/modules/planner/Itinerary.js
leonardehrenfried Aug 25, 2022
96b7f34
Remove unused/duplicated methods
hannesj Aug 25, 2022
817ab5a
Clean up instantiation of StateEditor
hannesj Aug 25, 2022
c5f4b84
remove duplicated check of canTraverse
hannesj Aug 25, 2022
867050f
Use Collections.emptyList to remove iterator initialization
hannesj Aug 25, 2022
2fb32f0
Round elevation data only if required in APIs
hannesj Aug 25, 2022
4f5c143
Add todo
hannesj Aug 25, 2022
a51f549
Fix pattern parsing with null default value
vpaturet Aug 25, 2022
6d82f12
Code clean-up
vpaturet Aug 25, 2022
ee919be
doc: Document why unused parameters in Raptor API should NOT be deleted.
t2gran Aug 25, 2022
01f3cf3
Startswith helper method with I18NString param
Antiik91 Aug 25, 2022
fd5c8aa
Use static iterator for no results
hannesj Aug 25, 2022
1bad6f0
Encapsulate transfers in RaptorTransferIndex
hannesj Aug 25, 2022
f89f02d
Do not create ConstrainedBoardingSearch with no transfers
hannesj Aug 25, 2022
c626511
Fix errors due to merge
viljaminurminen-cgi Aug 25, 2022
bd11632
Reformat code
t2gran Aug 25, 2022
285192f
Override GTFS feedID with feed-specific configuration
vpaturet Aug 25, 2022
158627f
Fix formatting
vesameskanen Aug 25, 2022
c019eb0
Merge pull request #4402 from entur/otp2_fare_perf_fixes
hannesj Aug 25, 2022
268354b
Add changelog entry for #4402 [ci skip]
Aug 25, 2022
2274e2b
Merge pull request #4413 from entur/otp2_raptor_api_clean_code
hannesj Aug 25, 2022
4ab00d4
Update src/main/java/org/opentripplanner/graph_builder/module/Validat…
hannesj Aug 25, 2022
d5579c4
Merge pull request #4406 from entur/otp2_netex_verify_stoptimes
hannesj Aug 25, 2022
d64ae0c
Merge pull request #4397 from entur/otp2_fix_invalid_mapper
hannesj Aug 25, 2022
0b9919f
Update German speed test expected results
leonardehrenfried Aug 25, 2022
6c61f02
Fix formatting in ValidateAndInterpolateStopTimesForEachTrip
leonardehrenfried Aug 25, 2022
923da2d
refactor: Move Updater setup content into constructor.
t2gran Aug 25, 2022
3fa1c94
Added I18NStringMapper to api/mapping/RouteMapper -> ApiRouteShort
Antiik91 Aug 26, 2022
8d819ed
Added optional Locale for getName in RouteBuilder and Route
Antiik91 Aug 26, 2022
27bc21d
prettier fix
Antiik91 Aug 26, 2022
64b4580
Update heuristic profile name in performanceTimers
hannesj Aug 26, 2022
ea93811
Update src/main/java/org/opentripplanner/standalone/config/feed/OsmEx…
vpaturet Aug 26, 2022
10abf09
Update src/main/java/org/opentripplanner/standalone/config/feed/OsmEx…
vpaturet Aug 26, 2022
b7d3fdb
nullcheck for startsWith method
Antiik91 Aug 26, 2022
deb9e4b
Apply suggestions from code review
hannesj Aug 25, 2022
0efea3b
Merge pull request #4356 from HSLdevcom/DT-5398
optionsome Aug 26, 2022
0dc5f32
Bump serialization version id for #4356
Aug 26, 2022
3cea9aa
Apply review feedback
hannesj Aug 26, 2022
13b106e
Fix logging of unused parameters
vpaturet Aug 26, 2022
d219d87
Cleanup Javadoc
vpaturet Aug 26, 2022
39eb81f
Merge pull request #4412 from entur/otp2_cleanup_edges
hannesj Aug 26, 2022
ae10043
Remove result from Baden-Württemberg speed test
leonardehrenfried Aug 26, 2022
917ea7c
Resolve source URI relative to the base directory
vpaturet Aug 26, 2022
a0ff3c3
test: Fix TimetableSnapshotSourceTest#testPurgeExpiredData
t2gran Aug 26, 2022
860e9b9
Configure OSM feeds individually
vpaturet Aug 29, 2022
683afc5
Merge branch 'dev-2.x' into otp2_override_osm_configuration
vpaturet Aug 29, 2022
33d1a47
Merge branch 'dev-2.x' into otp2_per_feed_configuration
vpaturet Aug 29, 2022
38d1908
Update way property set documentation
optionsome Aug 29, 2022
c68e612
Update router configuration documentation
optionsome Aug 29, 2022
4d6abe4
Merge pull request #4416 from entur/otp2_fix_heuristic_profile_name
hannesj Aug 29, 2022
9de0b7c
Update src/ext/java/org/opentripplanner/ext/siri/SiriFuzzyTripMatcher…
t2gran Aug 29, 2022
855e595
Merge pull request #4411 from entur/otp2_fix_updater_config
t2gran Aug 29, 2022
d03881f
Configure DEM feeds individually
vpaturet Aug 29, 2022
02fe8d5
Add OTPFeature to disable pattern filtering for direct transfers gene…
flaktack Aug 22, 2022
1c9d5b9
Account for boarding restrictions when generating path transfers
flaktack Aug 22, 2022
4d6a3f9
Formatting
optionsome Aug 30, 2022
3d639eb
More formatting
optionsome Aug 30, 2022
356be37
Fix exception route handling
viljaminurminen-cgi Aug 30, 2022
7070cc0
Merge pull request #4420 from HSLdevcom/config-doc-update
optionsome Aug 30, 2022
65d689f
Add documentation to addRouteOriginDestination
viljaminurminen-cgi Aug 30, 2022
be1b992
Merge pull request #4415 from entur/otp2_raptor_speedup
hannesj Aug 30, 2022
7916690
Move TicketType to LegacyGraphQL API sandbox
viljaminurminen-cgi Aug 30, 2022
dd4fe63
Make T3 into a record
viljaminurminen-cgi Aug 30, 2022
85b5bc5
Fix formatting and remove old license header
viljaminurminen-cgi Aug 30, 2022
66baf0b
Rename osmWayPropertySet to osmTagMapping for custom feed config
vpaturet Aug 30, 2022
6e2eaa2
Update documentation
vpaturet Aug 30, 2022
5783f0b
Update documentation
vpaturet Aug 31, 2022
ba214bf
Use default values for OSM time zone and tag mapping
vpaturet Aug 31, 2022
0d84e33
Update speed test configuration
vpaturet Aug 31, 2022
6f0aa70
Rename osmWayPropertySet in speed test configuration
vpaturet Aug 31, 2022
5798be8
Update documentation
vpaturet Aug 31, 2022
a9a5fd1
Fix documentation on addRouteOriginDestination
nurmAV Sep 1, 2022
21b89e9
Merge pull request #4338 from leonardehrenfried/fares-v2
leonardehrenfried Sep 1, 2022
16e6a04
Add changelog entry for #4338 [ci skip]
Sep 1, 2022
465958d
Bump serialization version id for #4338
Sep 1, 2022
3030595
Convert P3 into RouteOriginDestination record
viljaminurminen-cgi Sep 1, 2022
b8c848c
Update Fares.md
nurmAV Sep 1, 2022
12b296b
Update docs/sandbox/Fares.md
nurmAV Sep 1, 2022
ae84f24
Update src/main/java/org/opentripplanner/routing/core/FareRuleSet.java
nurmAV Sep 1, 2022
4279fb2
Change LegacyGraphQLTicketTypeImpl to operate on FareRuleSet and fix …
viljaminurminen-cgi Sep 1, 2022
7d63633
Fix formatting
viljaminurminen-cgi Sep 1, 2022
5b7dd97
Remove breaking typo and unnecessary type conversion
viljaminurminen-cgi Sep 1, 2022
6e3f76b
Merge pull request #4399 from entur/otp2_per_feed_configuration
vpaturet Sep 1, 2022
f906353
Add changelog entry for #4399 [ci skip]
Sep 1, 2022
4830566
Bump serialization version id for #4399
Sep 1, 2022
00e710e
Merge pull request #4421 from realCity/feature/direct-transfer
hannesj Sep 1, 2022
3847702
Add changelog entry for #4421 [ci skip]
Sep 1, 2022
67c9024
Merge branch 'otp2_per_feed_configuration' into otp2_override_osm_con…
vpaturet Sep 1, 2022
0b9db98
Add timeZone parameter to hsl and parkapi vehicle parking updaters
optionsome Sep 1, 2022
756c060
Update changelog
optionsome Sep 1, 2022
5d9f942
Resolve merge conflict
vpaturet Sep 2, 2022
fa2436c
Update documentation
vpaturet Sep 2, 2022
c293483
Fix markdown
vpaturet Sep 2, 2022
143cc84
Fix markdown
vpaturet Sep 2, 2022
2cf040c
Merge branch 'dev-2.x' into otp2_override_osm_configuration
vpaturet Sep 2, 2022
ca53352
Merge branch 'otp2_override_osm_configuration' into otp2_override_dem…
vpaturet Sep 2, 2022
9323efd
Fix merge conflict
vpaturet Sep 2, 2022
f851590
Return null OH if no timezone for hsl park and add tests
optionsome Sep 2, 2022
d1be48e
Add typed realtime errors
leonardehrenfried Aug 29, 2022
447a9f2
Update timetable tests
leonardehrenfried Aug 29, 2022
8a0ae5b
Lower log level
leonardehrenfried Aug 29, 2022
cbacb42
Print summary of updates
leonardehrenfried Aug 29, 2022
83c227e
Clean up tests
leonardehrenfried Aug 30, 2022
db3830a
Rename ApplicationResult to Result
leonardehrenfried Aug 30, 2022
62c462c
Remove casts from Result class
leonardehrenfried Aug 30, 2022
a0e71c3
Add tests
leonardehrenfried Aug 30, 2022
b3f1d4a
Return proper type for DUPLICATED
leonardehrenfried Aug 30, 2022
8d33afc
Return raw value in tests
leonardehrenfried Aug 30, 2022
69a5115
Change type parameter names
leonardehrenfried Aug 30, 2022
2371746
Update Javadoc
leonardehrenfried Aug 30, 2022
21efd00
Rename log method
leonardehrenfried Aug 31, 2022
f86fd22
Add return statements
leonardehrenfried Sep 2, 2022
9d943f0
Introduce more errors
leonardehrenfried Sep 2, 2022
158e795
Use more precise errors
leonardehrenfried Sep 2, 2022
e44c9a7
Use INVALID_INPUT_STRUCTURE
leonardehrenfried Sep 2, 2022
a6b494a
Use more precise error types
leonardehrenfried Sep 2, 2022
f5b29f4
Update src/main/java/org/opentripplanner/updater/stoptime/TimetableSn…
leonardehrenfried Sep 2, 2022
fa0b128
Add errors for unimplemented relationships
leonardehrenfried Sep 2, 2022
7e465f1
Return Result instead of Optional
leonardehrenfried Sep 2, 2022
5f5f19b
Return more Result instances
leonardehrenfried Sep 2, 2022
8e24059
Use more Result types
leonardehrenfried Sep 2, 2022
98b6513
Merge pull request #4419 from entur/otp2_override_osm_configuration
vpaturet Sep 2, 2022
4ce8b60
Add changelog entry for #4419 [ci skip]
Sep 2, 2022
7a0616a
Bump serialization version id for #4419
Sep 2, 2022
0907953
Merge branch 'dev-2.x' into otp2_override_dem_configuration
vpaturet Sep 2, 2022
24288a9
Improve logging and error types
leonardehrenfried Sep 2, 2022
c11a6d9
Only index instances of RegularStop
leonardehrenfried Sep 2, 2022
7b0e7af
Merge pull request #4423 from entur/otp2_override_dem_configuration
vpaturet Sep 2, 2022
365d736
Add changelog entry for #4423 [ci skip]
Sep 2, 2022
ab9c0fb
Bump serialization version id for #4423
Sep 2, 2022
a75f09c
Fix Norwegian speed test configuration
vpaturet Sep 2, 2022
b23dcbc
Merge pull request #4430 from entur/fix_norwegian_speed_test_configur…
vpaturet Sep 2, 2022
ad76407
Use more Result instances
leonardehrenfried Sep 2, 2022
17d7a07
Remove showIntermediateStops from RoutingRequest
hannesj Aug 31, 2022
cbe7871
Remove unused RoutingRequest from IntersectionTraversalCostModel
hannesj Aug 31, 2022
2ac519d
refactor: Rename RoutingRequest to RouteRequest
vpaturet Aug 31, 2022
784a479
refactor: Encapsulate fields in RouteRequest + cleanup
t2gran Sep 2, 2022
7919ca9
refactor: extract routing preferences
hannesj Sep 4, 2022
ac12afb
refactor: Add duration to ValueObjectToStringBuilder
t2gran Sep 5, 2022
da92ca3
refactor: Move WheelchairAccessibility(Feature|Request) to preferences
t2gran Sep 5, 2022
c94cfa0
refactor: Rename WheelchairAccessibilityRequest to Preferences
t2gran Sep 5, 2022
c067fa9
refactor: Rename TransferOptimizationRequest to Preferences
t2gran Sep 5, 2022
ea61216
refactor: Move TransferOptimizationPreferences to preferences
t2gran Sep 5, 2022
d9cf0c0
refactor: Cleanup preferences JavaDoc
t2gran Sep 5, 2022
935d7ce
refactor: Turn TransferOptimizationPreferences into a record and add …
t2gran Sep 5, 2022
8a37742
refactor: Cleanup StreetPreferences, JavaDoc+DurationForEnum
t2gran Sep 5, 2022
5bbbeda
refactor: rename defaultRoutingRequest
hannesj Sep 5, 2022
567e848
Merge pull request #4427 from HSLdevcom/parking-updater-timezone
optionsome Sep 6, 2022
2cdc76e
Merge remote-tracking branch 'otp/dev-2.x' into hsl_fares
viljaminurminen-cgi Sep 6, 2022
99842ae
Merge pull request #4429 from leonardehrenfried/regular-stop-index
hannesj Sep 6, 2022
c76337c
Update src/ext/java/org/opentripplanner/ext/legacygraphqlapi/datafetc…
nurmAV Sep 6, 2022
3121cc3
Move RouteOriginDestination and FareRuleSet into ext/fares/model
viljaminurminen-cgi Sep 6, 2022
9b9933f
Add missing formatting type
hannesj Sep 6, 2022
a55aeb0
Fix output type for leg duration
hannesj Sep 6, 2022
4e4ec40
refactor: Remove DurationForEnum#copyOf() (class is immutable)
t2gran Sep 5, 2022
7ca2b59
fix+refactor: Cleanup alightSlack and boardSlack
t2gran Sep 6, 2022
727f1aa
refactor: Cleanup time/slope/safety bike factors
t2gran Sep 6, 2022
fca0630
Refactored wheelchair model
Sep 6, 2022
78bf8da
Added missing documentation for wheelchair accessibility preferences
Sep 7, 2022
273a7da
Removed pathComparator from request
Sep 7, 2022
c04bfec
Add mapping for predictionInaccurate on RecordedCall
Sep 7, 2022
d4d4869
Fix ClassCastException in LegacyGraphQLfareImpl
viljaminurminen-cgi Sep 8, 2022
d5a1e35
Solve bug in RoutingRequestMapper
Sep 8, 2022
a4557ce
Merge pull request #4433 from entur/otp2_fix_transmodel
hannesj Sep 8, 2022
dc974fb
Add changelog entry for #4433 [ci skip]
Sep 8, 2022
a46bf1d
Merge pull request #4424 from leonardehrenfried/typed-realtime-errors
leonardehrenfried Sep 8, 2022
c9c94ef
Add changelog entry for #4424 [ci skip]
Sep 8, 2022
f2e6acd
Merge pull request #4435 from Skanetrafiken/predictionInaccurate
hannesj Sep 8, 2022
d1e95a5
Add changelog entry for #4435 [ci skip]
Sep 8, 2022
a7bbf77
Merge branch 'dev-2.x' into dev-2.x-via-search
hannesj Sep 8, 2022
55762dc
Merge pull request #4426 from opentripplanner/dev-2.x-via-search
t2gran Sep 9, 2022
0265f08
Add changelog entry for #4426 [ci skip]
Sep 9, 2022
b1ae2bb
refactor: Rename McCostParams to GeneralizedCostParameters
t2gran Sep 9, 2022
1cf9688
refactor: Rename accessibilityRequirements to wheelchairAccessibility…
t2gran Sep 9, 2022
ff63967
refactor: Cleanup wheelchair naming.
t2gran Sep 9, 2022
98c45d1
refactor: Rename WheelchairAccessibilityFeature to AccessibilityPrefe…
t2gran Sep 9, 2022
a703e7f
refactor: Rename WheelchairAccessibility to Accessibility.
t2gran Sep 9, 2022
5f95236
refactor: Cleanup walk preferences
t2gran Sep 11, 2022
f53940e
refactor: Cleanup walk preferences
t2gran Sep 11, 2022
ee5d435
refactor: Order fields and methods in BikePreferences
t2gran Sep 11, 2022
7197ff3
refactor: Cleanup BikePreferences
t2gran Sep 12, 2022
807734a
Merge pull request #4414 from HSLdevcom/hsl_fares
vesameskanen Sep 12, 2022
8233f41
Bump serialization version id for #4414
Sep 12, 2022
36726e1
Rename itinerariesSortOrder
hannesj Sep 6, 2022
a8cc178
Remove unused starting transit stop/trip id
hannesj Sep 6, 2022
33ba468
refactor: extract TransitRequest
hannesj Sep 5, 2022
9df5f12
refactor: move modes into Street/Transit request
hannesj Sep 6, 2022
ed47939
Add vehicle parking/rental request
hannesj Sep 7, 2022
2828d60
Routing request refactor - VIA search part A (#4392)
hannesj Sep 7, 2022
efda68f
Add missing documentation to TransitRequest, VehicleParkingRequest an…
Sep 9, 2022
b399f9e
Extract AbstractRaptorTransfer to improve performance
hannesj Sep 12, 2022
aff0726
Merge pull request #4447 from entur/otp2_abstract_raptor_transfer
hannesj Sep 13, 2022
f0c56fd
Rename IntersectionTraversalCostModel IntersectionTraversalCalculator
hannesj Sep 13, 2022
e6b806a
Move IntersectionTraversalCalculator into StreetPreferences
hannesj Sep 13, 2022
5cb7850
fix: TransmodelAPI fails to downcast board- and alight-slack
t2gran Sep 13, 2022
ca1fb65
refactor: Remove utility methods in StreetPreferences - they are only…
t2gran Sep 13, 2022
62d092a
refactor: Extract LegMode
hannesj Sep 5, 2022
9bd8ea5
refactor: Drop LegMode, and used domain TransitMode and TraverseMode
t2gran Sep 13, 2022
5d11ce6
test: Make FeedId required in SpeedTest config, prevent NPE later
t2gran Sep 13, 2022
119f34a
refactor: Remove unused field skipCost in ItineraryResultMapper
t2gran Sep 13, 2022
c6c9342
refactor: Rename RequestModes copy() to copyOf()
t2gran Sep 14, 2022
bb36319
refactor: Use RequestModes.of() not RequestModes.defaultRequestModes(…
t2gran Sep 14, 2022
485e32b
Merge pull request #4443 from entur/otp2_leg_mode
hannesj Sep 14, 2022
56b8200
Merge remote-tracking branch 'origin/dev-2.x' into otp2_journey_request
hannesj Sep 14, 2022
0c9bf26
Merge pull request #4449 from entur/otp_bug_fix_slack
t2gran Sep 14, 2022
4ee6ab6
review: Cleanup naming and config for IntersectionTraversalCostModel …
t2gran Sep 15, 2022
c35043c
Merge remote-tracking branch 'origin/dev-2.x' into otp2_journey_request
hannesj Sep 15, 2022
120d568
review: Rename IntersectionTraversalCostModel to IntersectionTraversa…
t2gran Sep 15, 2022
607a936
refactor: Rename DrivingDirection enum values to short concise values.
t2gran Sep 15, 2022
8370272
Merge pull request #4446 from entur/otp2_journey_request
t2gran Sep 15, 2022
98ce547
Add changelog entry for #4446 [ci skip]
Sep 15, 2022
44093e6
Merge remote-tracking branch 'origin/dev-2.x' into otp2_move_intersec…
hannesj Sep 15, 2022
3bc00fc
Update migration guide
hannesj Sep 15, 2022
9f87779
Merge remote-tracking branch 'otp/dev-2.x' into otp2_cleanup_preferences
t2gran Sep 15, 2022
06b3d92
doc: Update CODE_CONVENTIONS.md with builder pattern
t2gran Sep 15, 2022
ca66bc0
hard code initial capacities
hannesj Sep 14, 2022
593a600
Merge pull request #4445 from entur/otp2_move_pq_initial_size
hannesj Sep 15, 2022
4d4ef9d
Merge pull request #4444 from entur/otp2_move_intersection_cost_model
hannesj Sep 16, 2022
e4c6dff
Add changelog entry for #4444 [ci skip]
Sep 16, 2022
4447bb4
Bump serialization version id for #4444
Sep 16, 2022
dcdf303
review: Update CODE_CONVENTIONS.md
t2gran Sep 16, 2022
066cc4d
Merge remote-tracking branch 'origin/dev-2.x' into otp2_cleanup_prefe…
hannesj Sep 16, 2022
1a57c80
Catch exceptions from updater configuration
hannesj Sep 17, 2022
e17c450
doc: Review
t2gran Sep 20, 2022
295791d
doc: Remove TODO - Updaters run with a context
t2gran Sep 20, 2022
70bc197
Update Atlanta example build config [ci skip]
leonardehrenfried Sep 20, 2022
5134aba
Take into account null values for fare details
leonardehrenfried Sep 20, 2022
33f22ca
Improve tests
leonardehrenfried Sep 20, 2022
7240f36
Merge pull request #4454 from entur/otp2_fix_updater_initialization
leonardehrenfried Sep 20, 2022
08c4080
Configuration for turning off fuzzy trip matching feature in SiriAzur…
Bartosz-Kruba Aug 16, 2022
72a5096
Return empty list instead of null
leonardehrenfried Sep 20, 2022
b59d660
Merge pull request #4441 from entur/otp2_cleanup_preferences
t2gran Sep 20, 2022
995d561
Bump serialization version id for #4441
Sep 20, 2022
5813e2f
Merge pull request #4347 from Skanetrafiken/17632_match_on_stops
hannesj Sep 20, 2022
919de11
Add changelog entry for #4347 [ci skip]
Sep 20, 2022
7585444
Allow specifying allowed/banned rental networks in Transmodel API
hannesj Sep 20, 2022
94b5c7d
Add changelog entry
hannesj Sep 20, 2022
94a84ff
Use placeholders in logger messages
vpaturet Sep 21, 2022
4ae6097
Add list of time zones to exception
leonardehrenfried Sep 22, 2022
828a75f
Also output contrained transfers
leonardehrenfried Sep 22, 2022
a1276f2
Merge pull request #4451 from entur/add_dev_doc_builders
t2gran Sep 22, 2022
21cb59d
Merge pull request #4458 from ibi-group/houston-fare-mapper
leonardehrenfried Sep 22, 2022
7d23cfb
Merge pull request #4459 from entur/otp2_allowed_banned_networks
t2gran Sep 22, 2022
98bff82
Merge pull request #4461 from entur/otp2_fix_log_concatenation
vpaturet Sep 22, 2022
1fb4d2f
Merge pull request #4463 from ibi-group/add-timezones
leonardehrenfried Sep 22, 2022
e7aa8a8
Remove duplicated log output
leonardehrenfried Sep 22, 2022
07d33f5
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
leonardehrenfried Sep 23, 2022
8564bd5
Adjust smoke test to new package structure
leonardehrenfried Sep 23, 2022
47a3e6f
Add vehicle positions updater to denver smoke test config
leonardehrenfried Sep 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/close_stale_pr_and_issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days'
days-before-stale: 90
days-before-close: 30
operations-per-run: 240
operations-per-run: 260
exempt-issue-labels: 'Roadmap'
ascending: true
46 changes: 31 additions & 15 deletions .github/workflows/performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,31 @@ on:

jobs:
perf-test:
if: github.repository_owner == 'opentripplanner'
if: github.repository_owner == 'opentripplanner' && !startsWith(github.event.head_commit.message ,'Bump serialization version id for')
runs-on: performance-test
strategy:
max-parallel: 1
matrix:
include:

- location: baden-wuerttemberg # German state of Baden-Württemberg: https://en.wikipedia.org/wiki/Baden-W%C3%BCrttemberg
osm-url: https://download.geofabrik.de/europe/germany/baden-wuerttemberg-220101.osm.pbf
transit-url: https://leonard.io/otp/baden-wuerttemberg-2022-07-25.gtfs.tidy.zip
transit-filename: baden-wuerttemberg.gtfs.zip
- location: germany # all of Germany (500k stops, 200k patterns) but no OSM
transit-url: https://leonard.io/otp/germany-2022-08-23.tidy.gtfs.zip
transit-filename: germany.gtfs.zip
iterations: 1
jfr-delay: "50s"

- location: norway
osm-url: https://download.geofabrik.de/europe/norway-210101.osm.pbf
transit-url: https://leonard.io/otp/rb_norway-aggregated-netex-2021-12-11.zip
transit-filename: rb_norway-aggregated-netex.zip
iterations: 4
jfr-delay: "35s"

- location: baden-wuerttemberg # German state of Baden-Württemberg: https://en.wikipedia.org/wiki/Baden-W%C3%BCrttemberg
osm-url: https://download.geofabrik.de/europe/germany/baden-wuerttemberg-220101.osm.pbf
transit-url: https://leonard.io/otp/baden-wuerttemberg-2022-07-25.gtfs.tidy.zip
transit-filename: baden-wuerttemberg.gtfs.zip
iterations: 4
jfr-delay: "50s"

steps:
- uses: actions/[email protected]
Expand All @@ -44,24 +53,27 @@ jobs:
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven

- name: Cache graph input files
uses: actions/cache@v2
with:
path: |
graph/*.pbf
graph/*.zip
key: graph-${{ matrix.location }}
key: graph-${{ matrix.transit-url}}-${{ matrix.osm-url}}

- name: Build jar
run: mvn -DskipTests --batch-mode package -P prettierSkip

- name: Download OSM & Netex data
run: |
mkdir -p graph
wget ${{ matrix.osm-url }} -O graph/osm.pbf --no-clobber -q --show-progress --progress=bar:force || true
if [ "${{ matrix.osm-url }}" = "" ];
then
echo "No OSM download specified. Skipping..."
else
wget ${{ matrix.osm-url }} -O graph/osm.pbf --no-clobber -q --show-progress --progress=bar:force || true
fi
wget ${{ matrix.transit-url }} -O graph/${{ matrix.transit-filename }} --no-clobber -q --show-progress --progress=bar:force || true

- name: Build graph
Expand All @@ -75,14 +87,18 @@ jobs:
PERFORMANCE_INFLUX_DB_PASSWORD: ${{ secrets.PERFORMANCE_INFLUX_DB_PASSWORD }}
MEASUREMENT_ENVIRONMENT: CI
SPEEDTEST_LOCATION: ${{ matrix.location }}
MAVEN_OPTS: "-Xmx50g -XX:StartFlightRecording=delay=${{ matrix.jfr-delay }},duration=30m,filename=${{ matrix.location}}-speed-test.jfr"
run: |
mv graph/graph.obj test/performance/${{ matrix.location }}
mvn exec:java -Dexec.mainClass="org.opentripplanner.transit.raptor.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n 4 -i 3 -0"

mvn exec:java -Dexec.mainClass="org.opentripplanner.transit.raptor.speed_test.SpeedTest" -Dexec.classpathScope=test -Dexec.args="--dir=test/performance/${{ matrix.location }} -p md -n ${{ matrix.iterations }} -i 3 -0" -P prettierSkip
- name: Archive travel results file
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.location }}-travelSearch-results.csv
path: |
test/performance/${{ matrix.location }}/travelSearch-results.csv
path: test/performance/${{ matrix.location }}/travelSearch-results.csv

- name: Archive Flight Recorder instrumentation file
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.location }}-flight-recorder
path: ${{ matrix.location}}-speed-test.jfr
205 changes: 205 additions & 0 deletions CODE_CONVENTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# Code Conventions

We try to follow these conventions or best practices. The goal is to get cleaner code and make the
review process easier:

- the developer knows what to expect
- the reviewer knows what to look for
- discussions and personal preferences can be avoided saving time
- new topics should be documented here

These conventions are not "hard" rules, and often there might be other forces which pull a
decision in another direction, in that case documenting your choice is often enough to pass the
review.

## Best practices - in focus

- [ ] Document `public` interfaces, classes and methods - especially those part of a module api.
- [ ] Leave Things BETTER than you found them - clean up code you visit or/and add unit tests.
- [ ] [Feature envy](https://refactoring.guru/smells/feature-envy)
- [ ] Make types immutable if possible. References to other Entities might need to be mutable, if
so try to init them once, and throw an exception if set again.
Example:

```java
Builder initStop(Stop stop) {
this.stop = requireNotInitialized(this.stop, stop);
}
```

## Naming Conventions

### Packages

Try to arrange code by domain functionality, not technology. The main structure of a package should
be `org.opentripplanner.<domain>.<component>.<sub-component>`.

| Package | Description |
| ------------------------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `o.o.<domain>` | At the top level we should divide OTP into "domain"s like `apis`, `framework`, `transit`, `street`, `astar`, `raptor`, `feeds`, `updaters`, and `application`. |
| `component` and `sub-component` | A group of packages/classes witch naturally belong together, think aggregate as in Domain Driven Design. |
| `component.api` | Used for components to define the programing interface for the component. If present, (see Raptor) all outside dependencies to the component should be through the `api`. |
| `component.model` | Used to create a model of a Entites, ValueObjects, ++. If exposed outside the component you should include an entry point like `xyz.model.XyzModel` and/or a Service (in api or component root package). |
| `component.service` | Implementation of the service like `DefaultTransitService`, may also contain use-case specific code. Note, the Service interface goes into the component root or `api`, not in the service package. |
| `component.configure` | Component creation/orchestration. Put Dependency Injection code here, like the Dagger Module. |
| `support` | Sometimes domain logic get complicated, then extracting/isolating it helps. `support` is used internally in a component, not outside. |
| `framework` | (Abstract) building blocks internal to a domain/parent package. In some cases accessed outside the component, e.g. `OptAppException`, `TransitEntity`. |
| `mapping` | Map between two domains/components. |
| `util` | General "util" functionality, often characterized by `static` methods. Dependencies to other OTP packages is NOT allowed, only 3rd party utils libs. |
| `o.o.apis` | OTP external endpoints. Note! Many apis are in the Sandbox where they are in the `o.o.ext` package. |

> **Note!** The above is the goal, the current package structure needs cleanup.

> **Note!** Util methods depending on an OTP type/component should go into that type/component, not in the
utils class. E.g. static factory methods. Warning the "pure" utilities right now are placed into
sub-packages of `o.o.util`, the root package needs cleanup.


### Methods

Here are a list of common prefixes used, and what to expect.

| Good method prefixes | Description |
|-------------------------------------------------------|-----------------------------------------------------------------------------|
| `stop() : Stop` | Field accessor, equivalent to `getStop` as in the Java Bean standard |
| `getStop(ID id) : Stop` | Get Stop by ID, throws exception if not found |
| `getStops(Collection<ID> id) : List/Collection<Stop>` | Get ALL Stops by set of IDs, throws exception if not found |
| `findStop(Criteria criteria) : Optional<Stop>` | Find one or zero stops, return `Optional` |
| `findStops(Criteria criteria) : List/Stream<Stop>` | Find 0, 1 or many stops, return a collection or stream(List is preferred) |
| `listStops() : List/Stream<Stop>` | List ALL stops in context, return a collection or stream(List is preferred) |
| `withStop(Stop stop) : Builder` | Set stop in builder, replacing existing value and return `this` builder |
| `initStop(Stop stop) : void` | Set property ONCE, a second call throws an exception |
| `addStop(Stop stop) : void/Builder` | Add a stop to a collection of stops. |
| `addStops(Collection<Stop> stops) : void/Builder` | Add set of stops to existing set. |
| `withBike(Consumer<BikePref.Builder> body) : Builder` | For nested builders use lambdas. |

These prefixes are also "allowed", but not preferred - they have some kind of negative "force" to them.

| Ok method prefixes, but ... | Description |
| ------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `withStops(Collection<Stop> stops) : this`) | Replace all stops in builder with new set, consider using `addStops(...)` instead |
| `setStop(Stop stop)` | Set a mutable stop reference. Avoid if not part of natural lifecycle. Use `initStop(...)` if possible |
| `getStop() : Stop` | Old style accessor, use the shorter form `stop() : Stop` |

### Services, Models, Editors and Builders

Naming convention for builders with and without a context.

##### Graph Build and tests run without a context

```Java
// Create a new Stop
trip = Trip.of(id).withName("The Express").build();

// Modify and existing stop
stop = stop.copyOf().withPrivateCode("TEX").build();
```


## Records, POJOs and Builders

We prefer immutable typesafe types over flexibility and "short" class definitions. This make
the code more robust and less error-prune.

### Records

You may use records, but avoid using records if you can not encapsulate it properly. Be especially
aware of arrays fields (can not be protected) and collections (remember to make a defensive copy).
If you need to override `equals` and `hashCode`, then it is probably not worth it.
Be aware that `equals` compare references, not the value of a field. Consider overriding `toString`.

### Builders

OTP used a simple builder pattern in many places, especially when creating immutable types.

#### Builder conventions
- Use factory methods to create builder, either `of()` or `copyOf()`. The _copyOf_ uses an existing
instance as its base. The `of()` creates a builder with all default values set. All constructors
should be private (or package local) to enforce the use of the factory methods.
- If the class have more than 5 fields avoid using an inner class builder, instead create a builder
in the same package.
- Make all fields in the main class final to enforce immutability.
- Consider using utility methods for parameter checking, like `Objects#requireNonNull` and
`ObjectUtils.ifNotNull`.
- Validate all fields in the main type constructor(i.e. not in the builder), especially null checks.
Prefer default values over null-checks. All business logic using the type can rely on its validity.
- You may keep the original instance in the builder to avoid creating a new object if nothing
changed. This prevents polluting the heap for long-lived objects and make comparison very fast.
- There is no need to provide all get accessors in the Builder if not needed.
- Unit-test builders and verify all fields are copied over.
- For nested builders see the field `nested` in the example.

<details>
<summary><b>Builder example</b></summary>

```Java
/**
* THIS CLASS IS IMMUTABLE AND THREAD-SAFE
*/
public class A {
public static final A DEFAULT = new A();
private final List<String> names;
private final int age;
private final B nested;

private A() {
this.names = List.of("default");
this.age = 7;
this.nested = B.of();
}

private A(Builder builder) {
this.names = List.copyOf(builder.names);
this.age = builder.age;
this.nested = builder.nested();

if(age < 0 || age > 150) {
throw new IllegalArgumentException("Age is out of range[0..150]: " + age);
}
}

public static A.Builder of() { return DEFAULT.copyOf(); }
public A.Builder copyOf() { return new Builder(this); }

public List<String> listNames() { return names; }
public int age() { return age; }

public boolean equals(Object other) { ... }
public int hashCode() { ... }
public String toString() { return ToStringBuilder.of(A.class)...; }

public static class Builder {
private final A original;
private final List<String> names;
private int age;
private B.Builder nested = null;

public Builder(A original) {
this.original = original;
this.names = new ArrayList<>(original.names);
this.age = original.age;
}

public Builder withName(String name) { this.names.add(name); return this; }

public int age() { return age; }
public Builder withAge(int age) { this.age = age; return this; }

private B nested() { return nested==null ? original.nested() : nested.build(); }
public Builder withB(Consumer<B.Builder> body) {
if(nested == null) { nested = original.nested.copyOf(); }
body.accept(nested);
return this;
}
public A build() {
A value = new A(this);
return original.equals(value) ? original : value;
}
}
}
```

</details>



Loading