Skip to content

Enforce allowWrites for GTFS files #2036: - #2038

Closed
gcheval wants to merge 2 commits into
graphhopper:masterfrom
gcheval:2036-enforce-allowWrites-for-GTFS-files
Closed

gcheval wants to merge 2 commits into
graphhopper:masterfrom
gcheval:2036-enforce-allowWrites-for-GTFS-files

Conversation

@gcheval

@gcheval gcheval commented May 14, 2020

Copy link
Copy Markdown
Contributor
  • Attempt to create GTFS storage ONLY if allowWrites == true
  • Load GTFS feeds as readOnly if dbFile already exists
  • Validate dbFile exists when allowWrites is false

@michaz michaz self-assigned this May 17, 2020
@michaz

michaz commented May 17, 2020 •

Copy link
Copy Markdown
Member

I even think loading a previously imported DB should never require write access.
So should we try to

  • do without the new parameter on loadExisting()
  • always load previously-imported DBs in read-only mode
  • .. and only check the allowWrites-flag once, namely before trying to import a DB that does not exist? Compare ensureWriteAccess() in GraphHopper.importData

@michaz

michaz commented May 17, 2020 •

Copy link
Copy Markdown
Member

(I have a vague memory that this may not work due to something I did for the GtfsRealtime-part. Maybe I modify the DB there, for technical reasons.... :-/)

Existing tests should catch it if that's the case.

@michaz michaz linked an issue May 17, 2020 that may be closed by this pull request
- Load GTFS feeds DBs as readOnly if they already exists. A runtime exception will be thrown if the mapping in transit_schedule DB is not reflected in the folder.
- Validate write access (ensureWriteAccess()) before creating GTFS DBs.
@gcheval
gcheval force-pushed the 2036-enforce-allowWrites-for-GTFS-files branch from 59dfc59 to d985f03 Compare May 19, 2020 12:23
@gcheval

gcheval commented May 19, 2020

Copy link
Copy Markdown
Contributor Author

Hi Michaz,

Applied your comments on the PR. Thanks for your assistance!

  • When we find a transit_schedule file, we will attempt to load mapped files and throw a RuntimeException if the files do not reflect the transit_schedule mapping.
  • If there's no transit_schedule file, we now validate the write access before attempting to create.

@gcheval

gcheval commented May 20, 2020

Copy link
Copy Markdown
Contributor Author

Hey @michaz, What's the remaining actions before getting that PR into a release? Thanks!

@michaz

michaz commented May 21, 2020 •

Copy link
Copy Markdown
Member

None. Thank you for your help, will get to this shortly.

@michaz michaz closed this May 21, 2020
@gcheval
gcheval deleted the 2036-enforce-allowWrites-for-GTFS-files branch July 21, 2020 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce allowWrites for GTFS files

2 participants