Skip to content

Commit 52d1c40

Browse files
Merge branch 'dev' into add-gtfs-extended-route-types
2 parents 5509225 + 3d35a98 commit 52d1c40

File tree

112 files changed

+10005
-2993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+10005
-2993
lines changed

.github/issue_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
_**NOTE:** This issue system is intended for reporting bugs and tracking progress in software development. Although this software is licensed with an open-source license, any issue opened here may not be responded to in a timely manner. [Conveyal](https://www.conveyal.com) is unable to provide technical support for custom deployments of this software unless your company has a support contract with us. Please remove this note when creating the issue._
1+
_**NOTE:** This issue system is intended for reporting bugs and tracking progress in software development. Although this software is licensed with an open-source license, any issue opened here may not be dealt with in a timely manner. [IBI Group](https://www.ibigroup.com/) is able to provide technical support for custom deployments of this software. Please contact [Ritesh Warade](mailto:[email protected]?subject=Data%20Tools%20inquiry%20via%20GitHub&body=Name:%20%0D%0AAgency/Company:%20%0D%0ABest%20date/time%20for%20a%20demo/discussion:%20%0D%0ADescription%20of%20needs:%20) if your company or organization is interested in opening a support contract with us. Please remove this note when creating the issue._
22

33
## Observed behavior (please include a screenshot if possible)
44

.github/pull_request_template.md

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
- [ ] All tests and CI builds passing
88
- [ ] The description lists all relevant PRs included in this release _(remove this if not merging to master)_
99
- [ ] e2e tests are all passing _(remove this if not merging to master)_
10-
- [ ] Code coverage does not significantly worsen (ideally it improves) _(remove this if not merging to master)_
1110

1211
### Description
1312

.github/workflows/node-ci.yml

+6-13
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,8 @@ jobs:
5050
run: yarn lint-messages
5151
- name: Run flow check
5252
run: yarn flow
53-
- name: Run tests with coverage
54-
run: yarn cover-client
55-
# Upload coverage results from unit tests and then delete coverage reports to
56-
# avoid uploading the same coverage results twice.
57-
- name: Upload coverage results from unit tests
58-
run: bash <(curl -s https://codecov.io/bash) -c -F unit_tests
53+
- name: Run tests
54+
run: yarn test-client
5955
- name: Build with minification
6056
run: yarn run build -- --minify
6157
- name: Build docs
@@ -72,9 +68,12 @@ jobs:
7268
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
7369
AWS_REGION: ${{ secrets.AWS_REGION }}
7470
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
71+
- name: Install otp-runner
72+
if: env.SHOULD_RUN_E2E == 'true'
73+
run: yarn global add https://github.com/ibi-group/otp-runner.git
7574
- name: Run e2e tests
7675
if: env.SHOULD_RUN_E2E == 'true'
77-
run: yarn cover-end-to-end
76+
run: yarn test-end-to-end
7877
env:
7978
AUTH0_API_CLIENT: ${{ secrets.AUTH0_API_CLIENT }}
8079
AUTH0_API_SECRET: ${{ secrets.AUTH0_API_SECRET }}
@@ -101,12 +100,6 @@ jobs:
101100
SPARKPOST_KEY: ${{ secrets.SPARKPOST_KEY }}
102101
TRANSITFEEDS_KEY: ${{ secrets.TRANSITFEEDS_KEY }}
103102
# At this point, the build is successful.
104-
# Upload coverage results from e2e tests and then delete coverage reports to
105-
# avoid uploading the same coverage results twice.
106-
- name: Upload coverage results from e2e
107-
if: env.SHOULD_RUN_E2E == 'true'
108-
run: bash <(curl -s https://codecov.io/bash) -c -F end_to_end_tests
109-
continue-on-error: true
110103
- name: Semantic Release
111104
env:
112105
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

__tests__/end-to-end.js

+31-20
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,20 @@ async function expectSelectorToNotContainHtml (selector: string, html: string) {
259259
expect(innerHTML).not.toContain(html)
260260
}
261261

262+
/**
263+
* Checks that the expected feed version validity dates are displayed.
264+
*/
265+
async function expectFeedVersionValidityDates (startDate: string, endDate: string) {
266+
await expectSelectorToContainHtml(
267+
'[data-test-id="active-feed-version-validity-start"]',
268+
startDate
269+
)
270+
await expectSelectorToContainHtml(
271+
'[data-test-id="active-feed-version-validity-end"]',
272+
endDate
273+
)
274+
}
275+
262276
/**
263277
* Create a new project. Assumes that this is called while the browser is on
264278
* the home page.
@@ -301,6 +315,7 @@ async function deleteProject (projectId: string) {
301315
// verify deletion
302316
await goto(`http://localhost:9966/project/${projectId}`)
303317
await waitForSelector('.project-not-found')
318+
await wait(5000, 'for previously rendered project markup to be removed')
304319
await expectSelectorToContainHtml('.project-not-found', projectId)
305320
log.info(`confirmed successful deletion of project with id ${projectId}`)
306321
}
@@ -1085,13 +1100,10 @@ describe('end-to-end', () => {
10851100
await uploadGtfs()
10861101

10871102
// wait for main tab to show up with version validity info
1088-
await waitForSelector('[data-test-id="feed-version-validity"]')
1103+
await waitForSelector('[data-test-id="active-feed-version-validity-start"]')
10891104

10901105
// verify feed was uploaded
1091-
await expectSelectorToContainHtml(
1092-
'[data-test-id="feed-version-validity"]',
1093-
'Valid from Jan. 01, 2014 to Dec. 31, 2018'
1094-
)
1106+
await expectFeedVersionValidityDates('Jan 1, 2014', 'Dec 31, 2018')
10951107
}, defaultTestTimeout)
10961108

10971109
// this test also sets the feed source as deployable
@@ -1132,10 +1144,7 @@ describe('end-to-end', () => {
11321144
await wait(2000, 'for feed source to update')
11331145

11341146
// verify that feed was fetched and processed
1135-
await expectSelectorToContainHtml(
1136-
'[data-test-id="feed-version-validity"]',
1137-
'Valid from Apr. 08, 2018 to Jun. 30, 2018'
1138-
)
1147+
await expectFeedVersionValidityDates('Apr 8, 2018', 'Jun 30, 2018')
11391148
}, defaultTestTimeout)
11401149

11411150
if (doNonEssentialSteps) {
@@ -1245,10 +1254,7 @@ describe('end-to-end', () => {
12451254
await wait(2000, 'for data to refresh')
12461255
await waitForSelector('#feed-source-viewer-tabs')
12471256
// verify that the previous feed is now the displayed feed
1248-
await expectSelectorToContainHtml(
1249-
'[data-test-id="feed-version-validity"]',
1250-
'Valid from Apr. 08, 2018 to Jun. 30, 2018'
1251-
)
1257+
await expectFeedVersionValidityDates('Apr 8, 2018', 'Jun 30, 2018')
12521258
}, defaultTestTimeout)
12531259
}
12541260
})
@@ -2623,6 +2629,9 @@ describe('end-to-end', () => {
26232629
// wait for dialog to appear
26242630
await waitForSelector('[data-test-id="snapshot-dialog-name"]')
26252631

2632+
// confirm that we want to publish with unapproved routes
2633+
await click('[data-test-id="confirmPublishWithUnapproved"]')
2634+
26262635
// enter name
26272636
await type('[data-test-id="snapshot-dialog-name"]', 'test-snapshot')
26282637

@@ -2657,13 +2666,10 @@ describe('end-to-end', () => {
26572666
await click('#feed-source-viewer-tabs-tab-')
26582667

26592668
// wait for main tab to show up with version validity info
2660-
await waitForSelector('[data-test-id="feed-version-validity"]')
2669+
await waitForSelector('[data-test-id="active-feed-version-validity-start"]')
26612670

26622671
// verify that snapshot was made active version
2663-
await expectSelectorToContainHtml(
2664-
'[data-test-id="feed-version-validity"]',
2665-
'Valid from May. 29, 2018 to May. 29, 2028'
2666-
)
2672+
await expectFeedVersionValidityDates('May 29, 2018', 'May 29, 2028')
26672673
}, defaultTestTimeout, 'should create snapshot')
26682674

26692675
// TODO: download and validate gtfs??
@@ -2692,7 +2698,10 @@ describe('end-to-end', () => {
26922698
'[data-test-id="deployment-router-id"]'
26932699
)
26942700
// get rid of router id text and react tags
2695-
routerId = innerHTML.replace('Router ID: ', '')
2701+
// (remove any square brackets too)
2702+
routerId = innerHTML
2703+
.replace('Router ID: ', '')
2704+
.replace(/[[\]]/g, '')
26962705

26972706
// confirm deployment
26982707
await click('[data-test-id="confirm-deploy-server-button"]')
@@ -2702,9 +2711,11 @@ describe('end-to-end', () => {
27022711
}, defaultTestTimeout + 30000) // Add thirty seconds for deployment job
27032712

27042713
makeEditorEntityTest('should be able to do a trip plan on otp', async () => {
2714+
await wait(15000, 'for OTP to pick up the newly-built graph')
27052715
// hit the otp endpoint
2716+
const url = `${OTP_ROOT}${routerId}/plan?fromPlace=37.04532992924222%2C-122.07542181015015&toPlace=37.04899494106061%2C-122.07432746887208&time=00%3A32&date=2018-07-24&mode=TRANSIT%2CWALK&maxWalkDistance=804.672&arriveBy=false&wheelchair=false&locale=en`
27062717
const response = await fetch(
2707-
`${OTP_ROOT}${routerId}/plan?fromPlace=37.04532992924222%2C-122.07542181015015&toPlace=37.04899494106061%2C-122.07432746887208&time=12%3A32am&date=07-24-2018&mode=TRANSIT%2CWALK&maxWalkDistance=804.672&arriveBy=false&wheelchair=false&locale=en`,
2718+
url,
27082719
{
27092720
headers: {
27102721
'Content-Type': 'application/json; charset=utf-8'

__tests__/test-utils/mock-data/manager.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import clone from 'lodash/cloneDeep'
44

55
import UserPermissions from '../../../lib/common/user/UserPermissions'
66
import UserSubscriptions from '../../../lib/common/user/UserSubscriptions'
7-
87
import type {
98
Deployment,
109
FeedVersion,
@@ -55,8 +54,12 @@ export function makeMockDeployment (
5554
osmExtractUrl: null,
5655
otpCommit: null,
5756
otpVersion: null,
58-
projectId: project.id,
57+
peliasCsvFiles: [],
58+
peliasResetDb: null,
59+
peliasUpdate: null,
60+
pinnedfeedVersionIds: [],
5961
projectBounds: {east: 0, west: 0, north: 0, south: 0},
62+
projectId: project.id,
6063
routerId: null,
6164
skipOsmExtract: false,
6265
tripPlannerVersion: 'OTP_1',
@@ -69,6 +72,9 @@ export const mockProject = {
6972
autoFetchFeeds: true,
7073
autoFetchHour: 0,
7174
autoFetchMinute: 0,
75+
autoDeploy: false,
76+
autoDeployTypes: [],
77+
autoDeployWithCriticalErrors: false,
7278
bounds: null,
7379
buildConfig: {
7480
fares: null,
@@ -82,10 +88,12 @@ export const mockProject = {
8288
feedSources: [],
8389
id: 'mock-project-id',
8490
lastUpdated: 1553236399556,
91+
labels: [],
8592
name: 'mock-project',
8693
organizationId: null,
8794
otpServers: [],
8895
pinnedDeploymentId: null,
96+
peliasWebhookUrl: null,
8997
routerConfig: {
9098
carDropoffTime: null,
9199
numItineraries: null,
@@ -130,6 +138,7 @@ export const mockFeedWithVersion = {
130138
tripCount: 415
131139
},
132140
latestVersionId: 'mock-feed-version-id',
141+
labelIds: [],
133142
name: 'test feed with a version',
134143
noteCount: 0,
135144
organizationId: null,
@@ -140,7 +149,8 @@ export const mockFeedWithVersion = {
140149
snapshotVersion: null,
141150
transformRules: [],
142151
url: 'http://mdtrip.org/googletransit/AnnapolisTransit/google_transit.zip',
143-
user: null
152+
user: null,
153+
versionCount: 1
144154
}
145155

146156
// a mock feed with no versions
@@ -153,6 +163,7 @@ export const mockFeedWithoutVersion = {
153163
isPublic: false,
154164
lastFetched: null,
155165
name: 'test feed with no version',
166+
labelIds: [],
156167
noteCount: 0,
157168
organizationId: null,
158169
projectId: mockProject.id,
@@ -162,7 +173,8 @@ export const mockFeedWithoutVersion = {
162173
snapshotVersion: null,
163174
transformRules: [],
164175
url: null,
165-
user: null
176+
user: null,
177+
versionCount: 0
166178
}
167179

168180
// a mock feedversion that has validation data

__tests__/test-utils/setup-e2e.js

+7
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ async function startOtp () {
339339
)
340340

341341
console.log('starting otp')
342+
// Ensure default folder for graphs exists.
343+
// (OTP 1.4.0 autoscan() does a directory listing without checking directory existence.)
344+
const otpBasePath = '/tmp/otp'
345+
await fs.mkdirp(`${otpBasePath}/graphs`)
342346

343347
// start otp
344348
try {
@@ -349,6 +353,9 @@ async function startOtp () {
349353
'-jar',
350354
otpJarFilename,
351355
'--server',
356+
'--autoScan',
357+
'--basePath',
358+
otpBasePath,
352359
'--insecure',
353360
'--router',
354361
'default'

configurations/default/env.yml.tmp

+2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ MAPBOX_ATTRIBUTION: <a href="https://www.mapbox.com/about/maps/" target="_blank"
77
SLACK_CHANNEL: optional-slack-channel
88
SLACK_WEBHOOK: optional-slack-webhook
99
GRAPH_HOPPER_KEY: your-graph-hopper-key
10+
# Optional override to use a custom service instead of the graphhopper.com hosted service.
11+
# GRAPH_HOPPER_URL: http://localhost:8989/
1012
GOOGLE_ANALYTICS_TRACKING_ID: optional-ga-key
1113
# GRAPH_HOPPER_POINT_LIMIT: 10 # Defaults to 30

docs/user/deploying-feeds.md

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ To deploy or update GTFS feeds to OTP:
2222
7. If you select `Custom` under `Build configuration` or `Router configuration`, enter the desired configuration settings.
2323
8. Click the `Deploy` dropdown at the top of the main pane, then pick the server on which to perform the deployment. Existing deployments on that server will be discarded.
2424

25+
## Updating the Custom Places Index
26+
27+
A GTFS feed's stops can be sent to a Custom Places Index, should one be set up. You'll need the secret Webhook URL of your Custom Places Index server.
28+
29+
Only a pinned deployment's feed can be sent to a Custom Places Index. When opening a pinned deployment, a `Custom Geocoder Settings` pane appears below the `OTP Configuration` pane. In the text field, paste in the secret Webhook URL for your Custom Places Index server. Once it's entered, the `Update Custom Geocoder` checkbox will be clickable. If it is checked, your Custom Places Index will be updated when deploying the feed.
30+
31+
The pane also has an option to upload Custom POI CSV files. These files contain special landmarks and coordinates which are prioritized when returning geocoder results. You can upload as many custom CSV files as you like. They will all be added to the Custom Places Index.
32+
2533
## Watching deployments take place
2634

2735
After click Deploy, you can watch the deployment progress from the right-hand panel:

docs/user/managing-projects-feeds.md

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Once the Feed Transformations have all been configured, you can import a new GTF
8282

8383
![screenshot](../img/feed-transformation-summary.png)
8484

85+
A more in depth summary is available under the Transformation Results tab on the left sidebar. This panel will show you the modifications made to each file in the feed, along with how many rows were added, deleted, or modified.
8586

8687
## Viewing and Managing Feed Versions
8788

0 commit comments

Comments
 (0)