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 2024-09-04 #221

Merged
merged 119 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
ffa6e10
doc: Architectural Decision Records
t2gran Sep 15, 2023
37ac87d
Apply suggestions from code review
t2gran Oct 5, 2023
247ec7d
Rewording in ARCHITECTURE.md
abyrd Jan 25, 2024
254657f
add ADR for dependency injection
abyrd Jan 25, 2024
868582b
Small stylistic changes
leonardehrenfried Jul 2, 2024
4253f32
Revert changes made to StopModel
t2gran Jul 3, 2024
c1bcfdd
doc: Update ADR-11
t2gran Jul 3, 2024
6b8da31
doc: Add link to ADR.md in ARCHITECTURE.md
t2gran Jul 3, 2024
5a0da59
doc: Title Case
t2gran Jul 3, 2024
27eb36c
Cleanup decision records based on reviews.
t2gran Jul 5, 2024
376bee1
Merge remote-tracking branch 'otp/dev-2.x' into otp2_adr
t2gran Jul 5, 2024
b04d71e
Remove codestyle the published OTP user doc
t2gran Jul 5, 2024
42a2f80
Fix merrge errors
t2gran Jul 5, 2024
a3fdb4b
Update doc/dev/decisionrecords/_TEMPLATE.md
t2gran Jul 5, 2024
4c9a814
Rename from DECISION_RECORDS to DEVELOPMENT_DECISION_RECORDS
t2gran Jul 24, 2024
7709343
Fix relative links to external developer doc in user doc
t2gran Jul 24, 2024
564d9b0
Move /docs to /doc/user
t2gran Jul 24, 2024
eb5bbae
Move /doc-templates to /doc/templates
t2gran Jul 24, 2024
4029858
Merge remote-tracking branch 'otp/dev-2.x' into otp2_adr
t2gran Jul 24, 2024
3d37531
Set user-doc directory in mkdocs.yml
t2gran Jul 24, 2024
759e184
Update doc/dev/decisionrecords/RecordsPOJOsBuilders.md
t2gran Jul 25, 2024
90fd6a4
Apply suggestions from code review
t2gran Jul 26, 2024
6e00364
Merge remote-tracking branch 'otp/dev-2.x' into otp2_adr
t2gran Jul 26, 2024
faa7dfa
fix(deps): update dependency net.logstash.logback:logstash-logback-en…
renovate[bot] Jul 27, 2024
9f5aa46
Remove unused field in TransitModel
leonardehrenfried Aug 2, 2024
4613383
First implementation of SIRI-FM updater
leonardehrenfried Jul 17, 2024
67c97e9
Flesh out Siri importer
leonardehrenfried Jul 17, 2024
84cd9be
Implement Siri code
leonardehrenfried Jul 17, 2024
e80ec16
Make code more robust
leonardehrenfried Jul 17, 2024
ad8b74d
Add test for Siri-FM parking updater
leonardehrenfried Jul 17, 2024
c228692
Simplify Siri updater
leonardehrenfried Jul 17, 2024
64f6fc6
Add test for SIRI parking updater
leonardehrenfried Jul 19, 2024
cbddcc4
Improve test
leonardehrenfried Jul 19, 2024
b70dc74
Add documentation
leonardehrenfried Jul 19, 2024
7363899
Mention SIRI 2.1
leonardehrenfried Aug 2, 2024
3a76485
Update doc-templates/VehicleParking.md
leonardehrenfried Aug 2, 2024
fbca53d
Update jersey monorepo to v3.1.8
renovate[bot] Aug 2, 2024
1ba10c0
Compile docs
leonardehrenfried Aug 5, 2024
a2214eb
Rename class
leonardehrenfried Aug 5, 2024
1837b79
Apply review suggestions
leonardehrenfried Aug 5, 2024
f2ba2c8
Lower frequency
leonardehrenfried Aug 5, 2024
42e45e1
Use original realtime pattern as key
leonardehrenfried Jul 25, 2024
e81aa53
Add Javadoc
leonardehrenfried Aug 6, 2024
f24256f
Merge pull request #5991 from leonardehrenfried/remove-zone-id
leonardehrenfried Aug 6, 2024
af7eb9c
Merge pull request #5987 from opentripplanner/renovate/net.logstash.l…
leonardehrenfried Aug 6, 2024
661e736
Merge pull request #5992 from opentripplanner/renovate/jersey-monorepo
leonardehrenfried Aug 6, 2024
e5044fd
Update dependency @graphql-codegen/add to v5.0.3
renovate[bot] Aug 7, 2024
14e7b3a
Update slf4j monorepo to v2.0.14
renovate[bot] Aug 6, 2024
2dcee77
Add test case
leonardehrenfried Aug 6, 2024
1a641dd
Flesh out tests
leonardehrenfried Aug 6, 2024
9c60311
Add test for ampersand ngram
leonardehrenfried Aug 6, 2024
e61d1c1
Finetune fuzzyness of lucene indexing
leonardehrenfried Aug 6, 2024
2c13785
Add more test instances
leonardehrenfried Aug 6, 2024
e7ec0f7
Simplify test setup
leonardehrenfried Aug 6, 2024
5b8cdc5
Move back the debug line
leonardehrenfried Aug 6, 2024
d8c31db
Add more test cases
leonardehrenfried Aug 7, 2024
edea05e
Tokenize number suffixes
leonardehrenfried Aug 7, 2024
25808af
Update Debug UI dependencies (non-major)
renovate[bot] Aug 7, 2024
3db93c5
Merge pull request #5999 from opentripplanner/renovate/graphqlcodegen…
optionsome Aug 8, 2024
998df59
Group some renovate updates together [ci skip]
leonardehrenfried Aug 8, 2024
d4a95db
Group code generation deps together [ci skip]
leonardehrenfried Aug 8, 2024
3eab736
Slow down automerging of logging dependencies [ci skip]
leonardehrenfried Aug 8, 2024
2236213
Merge pull request #5993 from opentripplanner/renovate/debug-ui-depen…
leonardehrenfried Aug 8, 2024
15a5bd2
Upgrade debug client to version 2024/08/2024-08-08T10:11
Aug 8, 2024
e4199f1
Apply review feedback
leonardehrenfried Aug 8, 2024
2e71dd6
Fix spelling
leonardehrenfried Aug 8, 2024
81985cd
Don't synchronize anymore
leonardehrenfried Aug 8, 2024
93205da
Use volatile in parking service and document its use
leonardehrenfried Aug 8, 2024
1935ba0
Update docs
leonardehrenfried Aug 8, 2024
bcdd0b4
Update dependency com.google.cloud:libraries-bom to v26.44.0
renovate[bot] Aug 9, 2024
52db57e
Merge pull request #6000 from opentripplanner/renovate/com.google.clo…
leonardehrenfried Aug 9, 2024
f0a2c6c
Improve regexes and test names
leonardehrenfried Aug 9, 2024
eeea1ce
Merge pull request #5979 from leonardehrenfried/siri-parking-updates
leonardehrenfried Aug 9, 2024
2f4b2d4
Add changelog entry for #5979 [ci skip]
Aug 9, 2024
bf02dae
Apply review comments
leonardehrenfried Aug 9, 2024
ebdb572
Merge pull request #5997 from ibi-group/th-geocoder
leonardehrenfried Aug 9, 2024
957206f
Update dependency graphql to v16.9.0
renovate[bot] Aug 10, 2024
2eb5842
Update dependency com.graphql-java:graphql-java to v22.2
renovate[bot] Aug 12, 2024
0614429
Update google.dagger.version to v2.52
renovate[bot] Aug 12, 2024
00df8f2
Merge pull request #6006 from opentripplanner/renovate/google.dagger.…
habrahamsson-skanetrafiken Aug 14, 2024
176e5f5
Merge pull request #6005 from opentripplanner/renovate/com.graphql-ja…
habrahamsson-skanetrafiken Aug 14, 2024
15e960c
Update Debug UI dependencies (non-major)
renovate[bot] Aug 16, 2024
5b6fa5a
Update Test dependencies
renovate[bot] Aug 16, 2024
b5b1f2c
Merge pull request #6010 from opentripplanner/renovate/debug-ui-depen…
testower Aug 17, 2024
c3d1843
Upgrade debug client to version 2024/08/2024-08-17T06:09
Aug 17, 2024
ff838eb
Make itinerary list more compact
a-limyr Aug 19, 2024
b93901e
Merge pull request #5994 from ibi-group/realtime-vehicle-pattern
leonardehrenfried Aug 19, 2024
eb94184
Add changelog entry for #5994 [ci skip]
Aug 19, 2024
5137512
Make itinerary list more compact
a-limyr Aug 20, 2024
cd9e973
Update doc/dev/decisionrecords/RecordsPOJOsBuilders.md
t2gran Aug 21, 2024
f676b1a
Merge pull request #6012 from entur/style-improvments
testower Aug 22, 2024
f6d702d
Upgrade debug client to version 2024/08/2024-08-22T08:35
Aug 22, 2024
d93d231
Add changelog entry for #6012 [ci skip]
Aug 22, 2024
8164d41
Update dependency org.apache.maven.plugins:maven-gpg-plugin to v3.2.5
renovate[bot] Aug 22, 2024
b7922d4
Update dependency jsdom to v25
renovate[bot] Aug 25, 2024
1f611b1
return allowpickup value for rentalVehicles to avoid showing disabled…
sharhio Aug 26, 2024
aed76c7
naming
sharhio Aug 26, 2024
3947581
test
sharhio Aug 26, 2024
05a057b
Merge pull request #6004 from opentripplanner/renovate/update-gtfs-ap…
leonardehrenfried Aug 27, 2024
688b7bd
Merge remote-tracking branch 'otp/dev-2.x' into otp2_adr
t2gran Aug 28, 2024
99998b8
Merge pull request #5932 from opentripplanner/otp2_adr
t2gran Aug 28, 2024
aed7fd2
Add changelog entry for #5932 [ci skip]
Aug 28, 2024
7ff692c
doc: Fix broken links in doc.
t2gran Aug 28, 2024
2ea9a87
Merge pull request #6019 from opentripplanner/renovate/jsdom-25.x
testower Aug 28, 2024
d2f4b2d
Upgrade debug client to version 2024/08/2024-08-28T18:23
Aug 28, 2024
e6622b8
Update Data-Sources.md
BredeD Sep 1, 2024
e29d926
Merge pull request #6020 from HSLdevcom/rentalvehiclemap
optionsome Sep 2, 2024
8014570
Only compute the accessibility score for walking legs
leonardehrenfried Sep 1, 2024
8928178
Improve test
leonardehrenfried Sep 2, 2024
f3fe10c
Update group name [ci skip]
leonardehrenfried Sep 2, 2024
eae7163
Update Debug UI dependencies (non-major)
renovate[bot] Sep 3, 2024
f2076f5
Merge pull request #6038 from opentripplanner/renovate/debug-ui-depen…
testower Sep 3, 2024
690c8ec
Upgrade debug client to version 2024/09/2024-09-03T08:18
Sep 3, 2024
6925c6a
Merge pull request #6027 from entur/fix_doc
t2gran Sep 3, 2024
228e2c8
Merge pull request #6034 from opentripplanner/BredeD-patch-1
leonardehrenfried Sep 3, 2024
f64b949
Merge pull request #6035 from ibi-group/remove-non-walking-accessibil…
leonardehrenfried Sep 3, 2024
c2b3d2c
fix(deps): update logging dependencies
renovate[bot] Sep 3, 2024
f2d8a1e
Finetune renovate config [ci skip]
leonardehrenfried Sep 4, 2024
470ba17
Merge remote-tracking branch 'upstream/dev-2.x' into upstream-merge-2…
leonardehrenfried Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Write a few words on how the new code is tested.
- Was the code designed so it is unit testable?
- Were any tests applied to the smallest appropriate unit?
- Do all tests
pass [the continuous integration service](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/docs/Developers-Guide.md#continuous-integration)
pass [the continuous integration service](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/doc/user/Developers-Guide.md#continuous-integration)
?

### Documentation
Expand All @@ -59,7 +59,7 @@ Write a few words on how the new code is tested.

### Changelog

The [changelog file](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/docs/Changelog.md)
The [changelog file](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/doc/user/Changelog.md)
is generated from the pull-request title, make sure the title describe the feature or issue fixed.
To exclude the PR from the changelog add the label `skip changelog` to the PR.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
if: github.event_name == 'pull_request'

- name: Install Python dependencies
run: pip install -r docs/requirements.txt
run: pip install -r doc/user/requirements.txt


- name: Build main documentation
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ jobs:
run: |
# add a line above the one which contains AUTOMATIC_CHANGELOG_PLACEHOLDER
ITEM="${TITLE} [#${NUMBER}](${URL})"
TEMP_FILE=docs/Changelog.generated.md
FILE=docs/Changelog.md
TEMP_FILE=doc/user/Changelog.generated.md
FILE=doc/user/Changelog.md
awk "/CHANGELOG_PLACEHOLDER/{print \"- $ITEM\"}1" $FILE > $TEMP_FILE
mv $TEMP_FILE $FILE
git add $FILE
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ o_o_standalone_config_IncludeFileDirectiveTest_part.json
_site/
build/
dist/
docs/_build/
doc/user/_build/
gen-java/
gen-javabean/
gen-py/
Expand Down
18 changes: 9 additions & 9 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,36 @@
# OTP Architecture

OTP is developed over more than 10 years, and most of the design documentation is in the code as
OTP has been developed for more than 15 years, and most of the design documentation is in the code as
comments and JavaDoc. Over the years the complexity have increased, and the natural developer
turnover creates a demand for more architecture and design documentation. The new OTP2 documentation
is put together with the source; hopefully making it easier to maintain. Instead of documenting
modules in old style _package-info.java_ files we use _package.md_ files. This document should serve
as an index to all existing top-level documented components.

This document is far from complete - hopefully it can evolve over time and become a good
This document is far from complete. Hopefully it can evolve over time and become a good
introduction to OTP architecture. The OTP project GitHub issues are a good place to look for
detailed discussions on many design decisions.

Be sure to also read the [developer documentation](docs/Developers-Guide.md).
We document [Decision Records](DEVELOPMENT_DECISION_RECORDS.md) in a log. Make sure you as a developer are familiar
with the decisions and follow them. Reviewers should use them actively when reviewing code and may
use them to ask for changes.

Be sure to also read the [developer documentation](doc/user/Developers-Guide.md).

## Modules/Components

The diagram shows a simplified/generic version on how we want to model the OTP components with 2
examples. The Transit model is more complex than the VehiclePosition model.

![MainModelOverview](docs/images/ServiceModelOverview.png)
![MainModelOverview](doc/dev/images/ServiceModelOverview.png)

- `Use Case Service` A service which combine the functionality in many `Domain Services` to fulfill
a use-case or set of features. It may have an api with request/response classes. These are
usually stateless; Hence the `Use Case Service` does normally not have a model. The implementing
class has the same name as the interface with prefix `Default`.
- `Domain Model` A model which encapsulate a business area. In the drawing two examples are shown,
the `transit` and `vhicleposition` domain model. The transit model is more complex so the
implementation have a separate `Service` and `Repository`. Almost all http endpoints are ,
implementation has a separate `Service` and `Repository`. Almost all http endpoints are,
read-only so the `Service` can focus on serving the http API endpoints, while the repository
is used to maintain the model by the updaters.

Expand All @@ -41,10 +45,6 @@ but this is a start and we would like to expand this list in the future.
The Configuration module is responsible for loading and parsing OTP configuration files and map them
into Plan Old Java Objects (POJOs). These POJOs are injected into the other components.

### [REST API](src/main/java/org/opentripplanner/api/package.md)

Short introduction to the REST API.

### [GTFS import module](src/main/java/org/opentripplanner/gtfs/package.md)

Used to import GTFS transit data files.
Expand Down
106 changes: 106 additions & 0 deletions DEVELOPMENT_DECISION_RECORDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Development Decision Records


## Use-Decision-Records

We will [use decision-records](doc/dev/decisionrecords/UseDecisionRecords.md) to document OTP
development relevant decision. Use the [template](doc/dev/decisionrecords/_TEMPLATE.md) to describe
new decision records.


## Scout-Rule

Leave things BETTER than you found them, clean up code you visit or/and add unit
tests. Expect to include some code cleanup as part of all PRs.

## Follow-Naming-Conventions

Use established terminology from GTFS, NeTEx or the existing OTP code. Make sure the code is easy
to read and understand. [Follow naming conventions](CODE_CONVENTIONS.md#naming-conventions) .


## Write-Code-Documentation - Use JavaDoc

Document the business intention and decisions in the relevant code. Do not repeat the logic
expressed in the code. Use JavaDoc, you may have to refactor part of your code to encapsulate the
business logic into a method or class to do this.

Document all `public` types, methods and fields with JavaDoc. It is ok to document implementation
notes on `private` members and as inline comments.

> If you decide to NOT follow these decision records, then you must document why.

**See also**
- [Developers-Guide > Code comments](doc/user/Developers-Guide.md#code-comments).
- [Codestyle > Javadoc Guidlines](doc/dev/decisionrecords/Codestyle.md#javadoc-guidlines) - JavaDoc checklist


## Document-Config-and-APIs

Document API and configuration parameters.


## Respect-Codestyle

OTP uses prettier to format code. For more information on code style see the
[Codestyle](doc/dev/decisionrecords/Codestyle.md) document.


## Use-Object-Oriented-Principals

Respect Object-Oriented principals
- Honor encapsulation & Single-responsibility principle
- Abstraction - Use interfaces when a module needs "someone" to play a role
- Inheritance - Inheritances expresses “is-a” and/or “has-a” relationship, do not use it "just"
to share data/functionality.
- Use polymorphism and not `instanceof`.


## Use-Dependency-Injection

Use dependency injection to wire components. You can use manual DI or Dagger. Put the
wiring code in `<module-name>/configure/<Module-name>Module.java`.

OTP will use a dependency injection library or framework to handle object lifecycles (particularly
request-scoped vs. singleton scoped) and ensure selective availability of components, services,
context, and configuration at their site of use. Systems that operate via imperative Java code
(whether hand-written or generated) will be preferred over those operating through reflection or
external markup files. See [additional background](https://github.com/opentripplanner/OpenTripPlanner/pull/5360#issuecomment-1910134299).

## Use-Module-Encapsulation

Keep modules clean. Consider adding an `api`, `spi` and mapping code to
isolate the module from the rest of the code. Avoid circular dependencies between modules.


## DRY - Do not repeat yourself

Keep the code [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) - Do not
repeat yourself. Avoid implementing the same business rule in two places -> refactor.


## Avoid-Feature-Envy

[Feature envy](https://refactoring.guru/smells/feature-envy)


## Test-Coverage

All _business_ logic should have unit tests. Keep integration/system tests to a minimum. Add test at
the lowest level practical to test the business feature. Prefer unit tests on a method over a class,
over a module, over the system. On all non-trivial code, full _branch_ test coverage is preferable.
Tests should be designed to genuinely demonstrate correctness or adherence to specifications, not
simply inflate line coverage numbers.


## Use-Immutable-Types

Prefer immutable types over mutable. Use builders where appropriate. See
[Records, POJOs and Builders](doc/dev/decisionrecords/RecordsPOJOsBuilders.md#records-pojos-and-builders)


## Be-Careful-With-Records

[Avoid using records if you cannot encapsulate it properly](doc/dev/decisionrecords/RecordsPOJOsBuilders.md#records)


Loading
Loading