Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
3a88f15
refactor(FeedSource): WIP to handle more frequent feed fetch
landonreed Oct 12, 2020
65ae7af
refactor(Scheduler): refactor fetch project to use feed source fetch …
landonreed Nov 10, 2020
4a4dace
refactor(FeedSource): add fetchInterval field
landonreed Nov 10, 2020
d5a88f2
Merge branch 'dev' into fetch-feeds-frequently
Nov 11, 2020
1c87f12
fix(UserController): add perPage param to get users endpoint
landonreed Nov 11, 2020
51e8026
refactor(Auth0Users): rename per page constant; improve javadoc
landonreed Nov 12, 2020
2fe1662
Merge pull request #353 from ibi-group/add-per-page
landonreed Nov 12, 2020
9642143
refactor: Update to fetch feeds based on individual feed frequency
Nov 12, 2020
37358eb
Merge branch 'dev' into fetch-feeds-frequently
Nov 12, 2020
5bfc0ae
refactor(feed-fetch): refactor feed fetch frequency work
landonreed Nov 12, 2020
f18b636
Merge pull request #355 from ibi-group/fetch-feeds-frequently-ltr
Nov 13, 2020
6829065
refactor(Unit tests): Created unit tests to cover feed source auth fe…
Nov 25, 2020
1751601
refactor(Auth refactor): Update to disable auth without explicitly se…
Nov 30, 2020
da1e186
refactor(Auth management update): Fixed a few issues with the handlin…
Dec 1, 2020
622f5a0
refactor(Addressed PR feedback): Addressed PR feedback
Dec 2, 2020
51adaa6
fix(deps): bump google guava to 30.0-jre
landonreed Dec 3, 2020
b0a8fc9
refactor(Addressed PR feedback): Updated Auth0Connection and FeedSour…
Dec 3, 2020
5faca8f
Merge pull request #354 from ibi-group/fetch-feeds-frequently
Dec 3, 2020
fe939e7
fix(deps): bump gtfs-lib to v6.2.0
landonreed Dec 9, 2020
adb0d27
Merge pull request #358 from ibi-group/gtfs-lib@6.2.0
landonreed Dec 9, 2020
cf1fc17
build(deps): use jitpack for gtfs-lib
landonreed Jan 11, 2021
c4af983
ci(github): add github actions
landonreed Jan 11, 2021
16ac6c0
Merge pull request #356 from ibi-group/guava-30.0-jre
landonreed Jan 11, 2021
4658057
ci(github): run on PRs, remove commented e2e stuff
landonreed Jan 11, 2021
6ea006c
ci(github): move workflow into correct dir, change db name
landonreed Jan 11, 2021
d1fc9ba
ci(github): fix yml syntax
landonreed Jan 11, 2021
4903255
ci(github): fix git commit plugin
landonreed Jan 11, 2021
d07675f
build(pom.xml): fix bad comment in pom
landonreed Jan 11, 2021
8aac64f
build(deps): bump git-commit-id-plugin
landonreed Jan 11, 2021
9fa3c0c
build(pom.xml): set file encoding
landonreed Jan 11, 2021
a07900c
ci(test): set postgres user/pw for github actions
landonreed Jan 11, 2021
bde6b30
ci(github): add comment about postgres env
landonreed Jan 12, 2021
66be830
ci(github): add end-to-end tests 1/n
landonreed Jan 12, 2021
58fe6fc
ci: make script runnable
landonreed Jan 12, 2021
97e003e
ci(github): add release/deploy steps
landonreed Jan 12, 2021
bb470c5
ci(release): qualify semantic-release with yarn
landonreed Jan 12, 2021
1f05e0d
ci(github): fix use of ref slugs
landonreed Jan 12, 2021
33c611b
ci(release): remove yarn qualifier from semantic-release
landonreed Jan 12, 2021
38ce81f
ci(github): fix setting e2e env variable
landonreed Jan 12, 2021
4f6c2a7
ci(yarn): add yarn path to GITHUB_PATH
landonreed Jan 12, 2021
f0327b7
ci(yarn): add comment about github path
landonreed Jan 12, 2021
3c58cfd
ci: remove travis.yml
landonreed Jan 12, 2021
1739149
ci(deploy): use s3-sync-action to deploy builds
landonreed Jan 12, 2021
5c98a5d
ci: echo slugs/repo name
landonreed Jan 12, 2021
64f263d
ci: print all slug variables
landonreed Jan 12, 2021
5252968
ci: fix GITHUB_REF_SLUG variable name
landonreed Jan 12, 2021
f051478
ci: temporarily enable e2e on github-actions
landonreed Jan 12, 2021
2001a86
test(ci): replace mentions of Travis with CI
landonreed Jan 12, 2021
d03adce
ci: add secrets for e2e
landonreed Jan 12, 2021
6953427
ci: fix setting e2e env variable
landonreed Jan 12, 2021
8b2f1b4
ci: change e2e conditional syntax
landonreed Jan 12, 2021
2e6fc72
ci: change double to single quotes
landonreed Jan 12, 2021
1179dfe
ci: update node cache comment
landonreed Jan 12, 2021
29238f3
ci(e2e): move env variables to e2e step
landonreed Jan 12, 2021
92df0ad
ci: set env for aws credentials file
landonreed Jan 13, 2021
41fd80d
test: replace RUN_E2E checks with method
landonreed Jan 13, 2021
dbd474e
ci: temporarily disable e2e
landonreed Jan 19, 2021
4992d14
Merge pull request #360 from ibi-group/github-actions
landonreed Jan 21, 2021
bb23478
Merge branch 'dev' into jitpack-gtfs-lib
landonreed Jan 22, 2021
f0a3183
Merge pull request #359 from ibi-group/jitpack-gtfs-lib
landonreed Jan 28, 2021
472d4d6
refactor: update to allow for otp-runner OTP 2 compatibility
evansiroky Feb 2, 2021
0cedd13
refactor(Deployment): use enum for otp version; remove r5
landonreed Feb 4, 2021
32fd59c
refactor: set deployment default trip planner version
evansiroky Feb 8, 2021
b908d73
test: add OTP2 deploy job test
evansiroky Feb 8, 2021
205c12e
refactor: address various PR review comments.
evansiroky Feb 8, 2021
a48e6d0
refactor: remove remaining references to r5
evansiroky Feb 9, 2021
8e82763
feat: allow creating custom files for deployments
evansiroky Feb 12, 2021
d30a9ed
refactor: address PR review comments
evansiroky Feb 23, 2021
36e81b2
refactor: gracefully fail for customFile error
evansiroky Feb 23, 2021
90e2eb4
fix(deps): bump gtfs-lib to 6.2.2
landonreed Mar 8, 2021
8cb2ef0
ci(gh-actions): use GH_TOKEN for semantic-release step
landonreed Mar 8, 2021
732ded1
refactor: use correct URI terminology in comment
evansiroky Mar 8, 2021
ef3d5ec
Merge pull request #363 from ibi-group/otp-runner-otp-2
evansiroky Mar 9, 2021
20b28ab
Merge pull request #367 from ibi-group/gtfs-lib@6.2.2
landonreed Mar 9, 2021
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
164 changes: 164 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Java CI

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
services:
postgres:
image: postgres:10.8
# Set postgres env variables according to test env.yml config
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: catalogue
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# Install node 12 for running e2e tests (and for maven-semantic-release).
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: 4.2
- name: Setup Maven Cache
uses: actions/cache@v2
id: cache
with:
path: ~/.m2
key: maven-local-repo
- name: Inject slug/short variables # so that we can reference $GITHUB_HEAD_REF_SLUG for branch name
uses: rlespinasse/github-slug-action@v3.x
- name: Install maven-semantic-release
# FIXME: Enable cache for node packages (add package.json?)
run: |
yarn global add @conveyal/maven-semantic-release semantic-release
# Add yarn path to GITHUB_PATH so that global package is executable.
echo "$(yarn global bin)" >> $GITHUB_PATH
# run a script to see if the e2e tests should be ran. This script will set the environment variable SHOULD_RUN_E2E
# which is used in later CI commands.
- name: Check if end-to-end tests should run
run: ./scripts/check-if-e2e-tests-should-run-on-ci.sh
- name: Add profile credentials to ~/.aws/credentials
run: ./scripts/add-aws-credentials.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Setup GTFS+ directory (used during testing)
run: mkdir /tmp/gtfsplus
- name: Build with Maven (run unit tests)
run: mvn --no-transfer-progress package
- name: Restart MongoDB with fresh database (for e2e tests)
run: ./scripts/restart-mongo-with-fresh-db.sh
- name: Copy unit test coverage results into another folder # so the e2e tests don't overwrite them
run: cp -R target target-unit-test-results
- name: Run e2e tests
if: env.SHOULD_RUN_E2E == 'true'
run: mvn test
env:
AUTH0_API_CLIENT: ${{ secrets.AUTH0_API_CLIENT }}
AUTH0_API_SECRET: ${{ secrets.AUTH0_API_SECRET }}
AUTH0_CLIENT_ID: ${{ secrets.AUTH0_CLIENT_ID }}
AUTH0_DOMAIN: ${{ secrets.AUTH0_DOMAIN }}
AUTH0_SECRET: ${{ secrets.AUTH0_SECRET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
E2E_AUTH0_PASSWORD: ${{ secrets.E2E_AUTH0_PASSWORD }}
E2E_AUTH0_USERNAME: ${{ secrets.E2E_AUTH0_USERNAME }}
GRAPH_HOPPER_KEY: ${{ secrets.GRAPH_HOPPER_KEY }}
GTFS_DATABASE_PASSWORD: ${{ secrets.GTFS_DATABASE_PASSWORD }}
GTFS_DATABASE_URL: ${{ secrets.GTFS_DATABASE_URL }}
GTFS_DATABASE_USER: ${{ secrets.GTFS_DATABASE_USER }}
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
MONGO_DB_NAME: ${{ secrets.MONGO_DB_NAME }}
OSM_VEX: ${{ secrets.OSM_VEX }}
RUN_E2E: "true"
S3_BUCKET: ${{ secrets.S3_BUCKET }}
SPARKPOST_EMAIL: ${{ secrets.SPARKPOST_EMAIL }}
SPARKPOST_KEY: ${{ secrets.SPARKPOST_KEY }}
TRANSITFEEDS_KEY: ${{ secrets.TRANSITFEEDS_KEY }}
- name: Copy e2e coverage results into another folder # so the deployment results don't overwrite them
run: if [ "$SHOULD_RUN_E2E" = "true" ]; then cp -R target target-e2e-test-results; fi
# these first codecov runs will upload a report associated with the commit set through CI environment variables
# use codecov script flags to upload the coverage report for the unit tests
- name: Upload codecov for unit tests
run: bash <(curl -s https://codecov.io/bash) -s target-unit-test-results -F unit_tests
- name: Upload the coverage report for the e2e tests
run: |
if [ "$SHOULD_RUN_E2E" = "true" ]; then
bash <(curl -s https://codecov.io/bash) -s target-e2e-test-results -F end_to_end_tests;
fi

# Run maven-semantic-release to potentially create a new release of datatools-server. The flag --skip-maven-deploy is
# used to avoid deploying to maven central. So essentially, this just creates a release with a changelog on github.
#
# If maven-semantic-release finishes successfully and the current branch is master, upload coverage reports for the
# commits that maven-semantic-release generated. Since the above codecov run is associated with the commit that
# initiated the CI build, the report will not be associated with the commits that maven-semantic-release performed
# (if it ended up creating a release and the two commits that were a part of that workflow). Therefore, if on master
# codecov needs to be ran two more times to create codecov reports for the commits made by maven-semantic-release.
# See https://github.com/conveyal/gtfs-lib/issues/193. In order to create reports for both the unit and e2e tsts,
# the codecov scripts must be ran twice.
#
# The git commands get the commit hash of the HEAD commit and the commit just before HEAD.
- name: Run maven-semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
semantic-release --prepare @conveyal/maven-semantic-release --publish @semantic-release/github,@conveyal/maven-semantic-release --verify-conditions @semantic-release/github,@conveyal/maven-semantic-release --verify-release @conveyal/maven-semantic-release --use-conveyal-workflow --dev-branch=dev --skip-maven-deploy
if [[ "$GITHUB_REF_SLUG" = "master" ]]; then
bash <(curl -s https://codecov.io/bash) -C "$(git rev-parse HEAD)" -s target-unit-test-results -F unit_tests
bash <(curl -s https://codecov.io/bash) -C "$(git rev-parse HEAD^)" -s target-unit-test-results -F unit_tests
if [ "$SHOULD_RUN_E2E" = "true" ]; then
bash <(curl -s https://codecov.io/bash) -C "$(git rev-parse HEAD)" -s target-e2e-test-results -F end_to_end_tests;
bash <(curl -s https://codecov.io/bash) -C "$(git rev-parse HEAD^)" -s target-e2e-test-results -F end_to_end_tests;
fi
fi


- name: Prepare deploy artifacts
run: |
# get branch name of current branch for use in jar name
export BRANCH=$GITHUB_HEAD_REF_SLUG
# Replace forward slashes with underscores in branch name.
export BRANCH_CLEAN=${BRANCH//\//_}
# Create directory that will contain artifacts to deploy to s3.
mkdir deploy
# Display contents of target directory (for logging purposes only).
ls target/*.jar
# Copy packaged jar over to deploy dir.
cp target/dt-*.jar deploy/
# Get the first jar file and copy it into a new file that adds the current branch name. During a
# merge to master, there are multiple jar files produced, but they're each effectively the same
# code (there may be slight differences in the version shown in the `pom.xml`, but that's not
# important for the purposes of creating this "latest branch" jar).
ALL_JARS=(target/dt-*.jar)
FIRST_JAR="${ALL_JARS[0]}"
cp "$FIRST_JAR" "deploy/dt-latest-$BRANCH_CLEAN.jar"
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: datatools-builds
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: 'deploy'
110 changes: 0 additions & 110 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion configurations/default/server.yml.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ modules:
# Note: using a cloudfront URL for these download URLs will greatly
# increase download/deploy speed.
otp_download_url: https://optional-otp-repo.com
r5_download_url: https://optional-r5-repo.com
user_admin:
enabled: true
gtfsapi:
Expand Down
4 changes: 2 additions & 2 deletions configurations/test/env.yml.tmp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ OSM_VEX: http://localhost:1000
SPARKPOST_KEY: your-sparkpost-key
SPARKPOST_EMAIL: email@example.com
GTFS_DATABASE_URL: jdbc:postgresql://localhost/catalogue
# GTFS_DATABASE_USER:
# GTFS_DATABASE_PASSWORD:
GTFS_DATABASE_USER: postgres
GTFS_DATABASE_PASSWORD: postgres

# To configure a remote MongoDB service (such as MongoDB Atlas), provide all
# Mongo properties below. Otherwise, only a database name is needed (server
Expand Down
16 changes: 12 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
</scm>
<properties>
<jackson.version>2.10.1</jackson.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Using the latest version of geotools (e.g, 20) seems to cause issues with the shapefile
plugin where the_geom for each feature is null. -->
<geotools.version>17.5</geotools.version>
Expand Down Expand Up @@ -102,7 +103,7 @@
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>2.2.1</version>
<version>3.0.1</version>
<executions>
<execution>
<goals>
Expand All @@ -117,6 +118,13 @@
-->
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<injectAllReactorProjects>true</injectAllReactorProjects>
<!-- "git describe always" needed to keep GitHub actions from failing
See: https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/61#issuecomment-68037525
-->
<gitDescribe>
<skip>false</skip>
<always>true</always>
</gitDescribe>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -248,9 +256,9 @@
- AWS S3 SDK - putting/getting objects into/out of S3.
-->
<dependency>
<groupId>com.conveyal</groupId>
<groupId>com.github.conveyal</groupId>
<artifactId>gtfs-lib</artifactId>
<version>6.1.0</version>
<version>6.2.2</version>
<!-- Exclusions added in order to silence SLF4J warnings about multiple bindings:
http://www.slf4j.org/codes.html#multiple_bindings
-->
Expand All @@ -273,7 +281,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<version>30.0-jre</version>
</dependency>

<!-- Note: Unless we are explicit with the jackson dependencies listed below, other versions included in other
Expand Down
17 changes: 17 additions & 0 deletions scripts/add-aws-credentials.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# This script will create the AWS credentials file if it does not exist.
# It is only meant to be run on CI (to create the proper
# environment for E2E tests).
mkdir -p ~/.aws

# If credentials do not exist, create file setting values to
# environment variables (which must be defined in CI).
# This should avoid any accidental overwrite on your local dev machine :)
if [ ! -f ~/.aws/credentials ]; then
cat > ~/.aws/credentials << EOL
[default]
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
region = ${AWS_REGION}
EOL
fi
Loading