Skip to content

Commit

Permalink
Merge remote-tracking branch 'otp/dev-2.x' into gtfsgraphql-cancelled…
Browse files Browse the repository at this point in the history
…-trips
  • Loading branch information
vesameskanen committed Dec 28, 2023
2 parents 3388c15 + 3c93bb0 commit 45aacde
Show file tree
Hide file tree
Showing 1,063 changed files with 51,106 additions and 26,963 deletions.
15 changes: 11 additions & 4 deletions ISSUE_TEMPLATE → .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
---
name: Bug report
about: Report a bug or issue
title: ''
labels: ''
assignees: ''

---

**NOTE:** this issue system is intended for reporting bugs and tracking progress in software
development. For all other usage and software development questions or discussion, please write to
the user mailing list(https://groups.google.com/forum/#!forum/opentripplanner-users) or post a
question in the developer chat: https://gitter.im/opentripplanner/OpenTripPlanner.
development. For all other usage and software development questions or discussion, please post a
question in our chat room: https://gitter.im/opentripplanner/OpenTripPlanner.


## Expected behavior
Expand All @@ -17,4 +25,3 @@ question in the developer chat: https://gitter.im/opentripplanner/OpenTripPlanne
## Router config and graph build config JSON

## Steps to reproduce the problem

24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest a feature or improvement for OTP
title: ''
labels: new feature
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Goal / high level use-case**
<!-- Describe the the goal, high level use-case or epic this is is part of. Link to roadmap epic -->
<!-- Roadmap: #1234 -->

**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/roadmap_epic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Roadmap Epic
about: Suggest an idea for the Roadmap
title: ''
labels: Roadmap
assignees: ''

---

### Describe expected behavior
- What: <!-- Clearly state what the desired changes or new features could look like. -->
- Why: <!-- Clearly state the effect/outcome of this change. -->
- When: <!-- Provide a timeline or timeframe for when these changes should be implemented, preferably on a quarterly basis (e.g., Y24 Q3). -->

### Linked issue(s)
<!-- Add a checkbox by typing “- [ ] ”. Then, link to an issue by typing “#” and searching for the issue by text or issue number, or create a new issue. -->

### OTP PO Discussion meeting details
- Date: <!-- Specify the date when the discussion meeting took place. -->
- Link(s): <!-- Provide a link or location where the discussion notes or details can be found. This could be a meeting link or another document. -->

### Extra Comments (Optional)
30 changes: 22 additions & 8 deletions .github/workflows/cibuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,19 @@ jobs:
node-version: 18

# Java setup step completes very fast, no need to run in a preconfigured docker container
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven

- name: Build debug client
working-directory: ./client-next
run: |
npm install
npm run build
- name: Prepare coverage agent, build and test
# these are split into two steps because otherwise maven keeps long-running HTTP connections
# to Maven Central open which then hang during the package phase because the Azure (Github Actions)
Expand Down Expand Up @@ -66,10 +72,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven
# on windows there are frequent failures caused by page files being too small
Expand Down Expand Up @@ -183,10 +189,10 @@ jobs:
run: |
yarn install
yarn generate
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven
- name: Compile Java code
Expand All @@ -202,12 +208,20 @@ jobs:
- uses: actions/[email protected]
with:
fetch-depth: 0
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 21
distribution: temurin
cache: maven
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Build debug client
working-directory: ./client-next
run: |
npm install
npm run build
- name: Build container image with Jib, push to Dockerhub
env:
CONTAINER_REPO: docker.io/opentripplanner/opentripplanner
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 17
- name: Set up JDK
if: matrix.profile == 'core' || github.ref == 'refs/heads/dev-2.x'
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 21
distribution: temurin
timeout-minutes: 5

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/prune-container-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Prune container images'

on:
schedule:
- cron: '0 12 * * 1'
workflow_dispatch:

jobs:
container-image:
if: github.repository_owner == 'opentripplanner'
runs-on: ubuntu-latest
steps:
- name: Delete unused container images
env:
CONTAINER_REPO: opentripplanner/opentripplanner
CONTAINER_REGISTRY_USER: otpbot
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
run: |
# remove all snapshot container images that have not been pulled for over a year
# --keep-semver makes sure that any image with a x.y.z version scheme is unaffected by this
pip install prune-container-repo==0.0.4
prune-container-repo -u ${CONTAINER_REGISTRY_USER} -r ${CONTAINER_REPO} --days=365 --keep-semver --activate
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ gen-py/
node_modules/
target/
/graphs
/src/client/debug-client-preview/

# for local dev only
/src/test/resources/speedtest/travelSearch-results-*.csv
Expand Down
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ examples. The Transit model is more complex than the VehiclePosition model.
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 witch encapsulate a business area. In the drawing two examples are shown,
- `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 ,
read-only so the `Service` can focus on serving the http API endpoints, while the repository
Expand Down
8 changes: 7 additions & 1 deletion CODE_CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ Builder initStop(Stop stop) {

## Naming Conventions

In general, we use American English. We use the GTFS terminology inside OTP as the transit domain
specific language. In cases where GTFS does not provide an alternative we use NeTEx. The naming
should follow the Java standard naming conventions. For example a "real-time updater" class
is named `RealTimeUpdater`. If in doubt check the Oxford Dictionary(American).


### Packages

Try to arrange code by domain functionality, not technology. The main structure of a package should
Expand All @@ -38,7 +44,7 @@ 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` and `sub-component` | A group of packages/classes which 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. |
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Any message posted there will be seen by most of the contributors, some of whom
time. It will also create a record of the discussion that will be useful to the larger community and
often leads to issues being discussed at the twice-weekly development meetings.

## Developer meetings

OTP development meetings usually occur twice a week. These meetings are open to anyone who wants to
join, even if you simply want to observe the process or ask a few questions. The most effective way
to advance pull requests and collaborate is to participate directly in these meetings. The meeting
Expand Down
1 change: 1 addition & 0 deletions client-next/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=/otp/routers/default/transmodel/index/graphql
1 change: 1 addition & 0 deletions client-next/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_URL=http://localhost:8080/otp/routers/default/transmodel/index/graphql
42 changes: 42 additions & 0 deletions client-next/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:import/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/recommended',
'eslint-config-prettier',
],
ignorePatterns: ['node_modules', 'dist', '.prettierrc.js', '.eslintrc.cjs', 'src/gql/**/*'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
settings: {
react: {
// Tells eslint-plugin-react to automatically detect the version of React to use.
version: 'detect',
},
// Tells eslint how to resolve imports
'import/resolver': {
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
'@typescript-eslint/ban-ts-comment': "off",

// TODO: this is a temporary fix for
// https://github.com/typescript-eslint/typescript-eslint/issues/154
"import/named": "off"
},
}
30 changes: 30 additions & 0 deletions client-next/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# generated code
src/gql/

# Vite cache folder
.vite/
3 changes: 3 additions & 0 deletions client-next/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
dist/
src/gql/
8 changes: 8 additions & 0 deletions client-next/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"printWidth": 120,
"bracketSpacing": true
}
27 changes: 27 additions & 0 deletions client-next/README-vite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
Loading

0 comments on commit 45aacde

Please sign in to comment.