MobilityData / gtfs-realtime-validator

Java-based tool that validates General Transit Feed Specification (GTFS)-realtime feeds
Other
41 stars 10 forks source link

ci: Test and build project #85

Closed lionel-nj closed 2 years ago

lionel-nj commented 2 years ago

Summary:

This PR provides support to:

Expected behavior:

The project's unit tests should be run on each commit, and push on the master branch. The project should also be packaged on each commit, and push on the master branch.

The artifacts should be persisted.

Screenshots:

test_package_action_gtfs_realtime_validator

download_jar_gtfs_realtime_validator

Please make sure these boxes are checked before submitting your pull request - thanks!

barbeau commented 2 years ago

Should have the same workflow in the gtfs-realtime-validator-lib/README.md?

Yes, good catch - looks like I missed changing this link to a TODO when I removed the related link from the main README.

maximearmstrong commented 2 years ago

Look at that @barbeau & @isabelle-dr!

✨ The library package and the webapp package

The package pages are already there because I tested the deployment and also needed the URLs to update the documentation, but the workflow is now set so that the deployment is only done when we push - merge - to master.

I suggest adding the stable URL to the JAR (on GCP?) in another issue/PR if necessary. We don't have a release yet, so maybe we'll want to make the stable URL for our first one. From what I understand, redirecting users to the package pages might do the trick, but maybe something else would be more useful for the user flow. Let me know if you think something is missing or should be changed in the documentation.

barbeau commented 2 years ago

@maximearmstrong When I run mvn clean, I get this error:

PS C:\git-projects\gtfs-realtime-validator> mvn clean
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'version' contains an expression but should be a constant. @ line 14, column 14
[WARNING] 'version' contains an expression but should be a constant. @ edu.usf.cutr:gtfs-realtime-validator:${versionTag
}, C:\git-projects\gtfs-realtime-validator\pom.xml, line 12, column 14
[FATAL] Non-resolvable parent POM for edu.usf.cutr:gtfs-realtime-validator-lib:${parent.version}: edu.usf.cutr:gtfs-real
time-validator:pom:${env.versionTag} was not found in https://repo.maven.apache.org/maven2 during a previous attempt. Th
is failure was cached in the local repository and resolution is not reattempted until the update interval of central has
 elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 7, column 13
[WARNING] 'version' contains an expression but should be a constant. @ line 14, column 14
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: edu.usf.cutr:gtfs-realtime-vali
dator-lib:jar -> duplicate declaration of version ${parent.version} @ line 150, column 21
[WARNING] 'version' contains an expression but should be a constant. @ edu.usf.cutr:gtfs-realtime-validator:${versionTag
}, C:\git-projects\gtfs-realtime-validator\pom.xml, line 12, column 14
[FATAL] Non-resolvable parent POM for edu.usf.cutr:gtfs-realtime-validator-webapp:${parent.version}: edu.usf.cutr:gtfs-r
ealtime-validator:pom:${env.versionTag} was not found in http://build.staging.obanyc.com/archiva/repository/releases/ du
ring a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the upd
ate interval of conveyal-releases-mvn-repo-mirror has elapsed or updates are forced and 'parent.relativePath' points at 
wrong local POM @ line 7, column 10
[WARNING] 'version' contains an expression but should be a constant. @ edu.usf.cutr:gtfs-realtime-validator:${versionTag
}, C:\git-projects\gtfs-realtime-validator\pom.xml, line 12, column 14
 @
[ERROR] The build could not read 2 projects -> [Help 1]
[ERROR]
[ERROR]   The project edu.usf.cutr:gtfs-realtime-validator-lib:${parent.version} (C:\git-projects\gtfs-realtime-validato
r\gtfs-realtime-validator-lib\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for edu.usf.cutr:gtfs-realtime-validator-lib:${parent.version}: edu.usf.cutr:gtfs-
realtime-validator:pom:${env.versionTag} was not found in https://repo.maven.apache.org/maven2 during a previous attempt
. This failure was cached in the local repository and resolution is not reattempted until the update interval of central
 has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 7, column 13 -> [Help 2]  
[ERROR]
[ERROR]   The project edu.usf.cutr:gtfs-realtime-validator-webapp:${parent.version} (C:\git-projects\gtfs-realtime-validator\gtfs-realtime-validator-webapp\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for edu.usf.cutr:gtfs-realtime-validator-webapp:${parent.version}: edu.usf.cutr:gtfs-realtime-validator:pom:${env.versionTag} was not found in http://build.staging.obanyc.com/archiva/repository/releases/ during
 a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of conveyal-releases-mvn-repo-mirror has elapsed or updates are forced and 'parent.relativePath' points at wrong local 
POM @ line 7, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Do you see the same?

maximearmstrong commented 2 years ago

@barbeau is it possible that you forgot to pull the latest modifications? We don't use ${parent.version} and ${env.versionTag} anymore, but I see edu.usf.cutr:gtfs-realtime-validator-lib:${parent.version} and edu.usf.cutr:gtfs-realtime-validator:pom:${env.versionTag} in your error logs.

On my side, running mvn clean gives this output:

Capture d’écran, le 2022-03-08 à 10 35 46
barbeau commented 2 years ago

@maximearmstrong Thanks! Yes, looks like something strange happened in my local repo. I ended up just deleting and re-cloning and it seems like it's working now. I'll submit a review shortly.

maximearmstrong commented 2 years ago

Thanks for the review @barbeau ! The items have been resolved, PTAL.

isabelle-dr commented 2 years ago

Merging this PR, the conditions are met! If we see users are having trouble downloading the JAR files, we will prioritize implementing #105. Thank you @maximearmstrong for taking this PR to the finish line, and thank you Sean for your help & for the great reviews! 🎉 🎉 🎉