-
Notifications
You must be signed in to change notification settings - Fork 52
Additional feed summary params #634
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
Open
br648
wants to merge
24
commits into
dev
Choose a base branch
from
feature/DT-530-additional-feed-source-summary-fields
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
a82bed7
feat(Additional feed summary params):
br648 af7ec62
improvement(Update to include gtfs plus validation): Gen gtfs plus va…
br648 075cdc7
improvement(Store gtfs plus validation in feed version): Update to fe…
br648 a9fb58d
improvement(Updates param name): Name is more inline with usage
br648 a1a056f
improvement(Updated feed source summary): Added published version id
br648 7a5ce48
improvement(GtfsPlusController): Update to save validation to related…
br648 43756e8
improvement(maven.yml): Bumped node version from 20.x to 22.x
br648 dde3bc4
Merge branch 'dev' into feature/DT-530-additional-feed-source-summary…
br648 fcdbd93
improvement(Added new params): Now includes published feed version an…
br648 21c3b53
Merge branch 'dev' into feature/DT-530-additional-feed-source-summary…
br648 fed3371
improvement(Update to include error counts): Feed source summary now …
br648 a437f5d
improvement(Code refactor): Move feed version extraction into FeedVer…
br648 50455b9
improvement(FeedSourceSummary): Update to mongo query to return resul…
br648 e02a53f
improvement(Addressed bug with extracting feed source summaries): Upd…
br648 70eef64
improvement(FeedSourceSummary): Updated query to get latest feed vers…
br648 2b6cc83
improvement(Feed source error count retrieval): New separate class to…
br648 308de2f
improvement(Fixed merge conflicts): Addressed conflicts in class Feed…
br648 ec3a329
feat(Exclude editor schemas from deletion): Data sanitizer update to …
br648 0572b6a
improvement(Restored to previous commit to remove data sanitizer upda…
br648 3ea77c1
Merge branch 'dev' into feature/DT-530-additional-feed-source-summary…
br648 4310c1b
improvement(Refactor to provide publish state and address PR feedback):
br648 cb06d5f
improvement(pom.xml): Restored gtfs-lib library reference
br648 259d4c3
Merge branch 'dev' into feature/DT-530-additional-feed-source-summary…
br648 ac2f2c7
improvement(Addressed PR feedback):
br648 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/main/java/com/conveyal/datatools/manager/jobs/ValidateGtfsPlusFeedJob.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| package com.conveyal.datatools.manager.jobs; | ||
|
|
||
| import com.conveyal.datatools.common.status.FeedVersionJob; | ||
| import com.conveyal.datatools.manager.auth.Auth0UserProfile; | ||
| import com.conveyal.datatools.manager.models.FeedVersion; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| /** | ||
| * This job handles the GTFS+ validation of a given feed version. If the version is not new, it will simply | ||
| * replace the existing version with the version object that has updated validation info. | ||
| */ | ||
| public class ValidateGtfsPlusFeedJob extends FeedVersionJob { | ||
| public static final Logger LOG = LoggerFactory.getLogger(ValidateGtfsPlusFeedJob.class); | ||
|
|
||
| private final FeedVersion feedVersion; | ||
| private final boolean isNewVersion; | ||
|
|
||
| public ValidateGtfsPlusFeedJob(FeedVersion version, Auth0UserProfile owner, boolean isNewVersion) { | ||
| super(owner, "Validating GTFS+", JobType.VALIDATE_FEED); | ||
| feedVersion = version; | ||
| this.isNewVersion = isNewVersion; | ||
| status.update("Waiting to begin GTFS+ validation...", 0); | ||
| } | ||
|
|
||
| @Override | ||
| public void jobLogic () { | ||
| LOG.info("Running ValidateGtfsPlusFeedJob for {}", feedVersion.id); | ||
| feedVersion.validateGtfsPlus(status); | ||
| } | ||
|
|
||
| @Override | ||
| public void jobFinished () { | ||
| if (!status.error) { | ||
| if (parentJobId != null && JobType.PROCESS_FEED.equals(parentJobType)) { | ||
| // Validate stage is happening as part of an overall process feed job. | ||
| // At this point all GTFS data has been loaded and validated, so we record | ||
| // the FeedVersion into mongo. | ||
| // This happens here because otherwise we would have to wait for other jobs, | ||
| // such as BuildTransportNetwork, to finish. If those subsequent jobs fail, | ||
| // the version won't get loaded into MongoDB (even though it exists in postgres). | ||
| feedVersion.persistFeedVersionAfterValidation(isNewVersion); | ||
| } | ||
| status.completeSuccessfully("GTFS+ validation finished!"); | ||
| } else { | ||
| // If the version was not stored successfully, call FeedVersion#delete to reset things to before the version | ||
| // was uploaded/fetched. Note: delete calls made to MongoDB on the version ID will not succeed, but that is | ||
| // expected. | ||
| feedVersion.delete(); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Getter that allows a client to know the ID of the feed version that will be created as soon as the upload is | ||
| * initiated; however, we will not store the FeedVersion in the mongo application database until the upload and | ||
| * processing is completed. This prevents clients from manipulating GTFS data before it is entirely imported. | ||
| */ | ||
| @JsonProperty | ||
| public String getFeedVersionId () { | ||
| return feedVersion.id; | ||
| } | ||
|
|
||
| @JsonProperty | ||
| public String getFeedSourceId () { | ||
| return feedVersion.parentFeedSource().id; | ||
| } | ||
|
|
||
|
|
||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.