Skip to content

Local web UI#421

Merged
29 commits merged intomasterfrom
test-reimplementation
Oct 21, 2020
Merged

Local web UI#421
29 commits merged intomasterfrom
test-reimplementation

Conversation

@lionel-nj
Copy link
Copy Markdown
Contributor

@lionel-nj lionel-nj commented Oct 13, 2020

Summary:

This PR provides support to develop a local web ui based on the existing gtfs validator using spring boot, and react/

Expected behavior:

  1. Run the SpringBoot application:
    ./gradlew bootRun -> will start by default on server port 8080,

To run the web app :

  1. go to react-client directory
  2. yarn start

image

Additional information:
This PR takes content from #365 and #413
This PR comes as replacement to the two aforementioned PRs. This PR was created in an attempt to solve a packaging bug. Therefore all changes from #365 were repatriated here in order to provide working code.

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

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Format the title like "Fix #<issue_number> - " (for example - "Fix Bug: Running using documented Docker documentation fails #1111 - Check for null value before using field")
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@lionel-nj lionel-nj changed the title touch Test to reimplement local web ui from scratch Oct 13, 2020
@barbeau
Copy link
Copy Markdown
Member

barbeau commented Oct 19, 2020

I enabled the --debug flag for Gradle on the Github Action in 8445b03, and it looks like Gradle is running an endless loop unlocking and locking on files. Here's the build:
https://github.com/MobilityData/gtfs-validator/runs/1277249238

...so it seems like either a thread is hung somewhere or it's having an issue trying to unlock files.

Here's the bottom of the log:

2020-10-19T19:51:11.165+0000 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :application:web-app:react-client:webjar (Thread[Daemon worker,5,main]) started.
2020-10-19T19:51:11.165+0000 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] 
2020-10-19T19:51:11.165+0000 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :application:web-app:react-client:webjar
2020-10-19T19:51:11.165+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :application:web-app:react-client:webjar' started
2020-10-19T19:51:11.165+0000 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Putting task artifact state for task ':application:web-app:react-client:webjar' into context took 0.0 secs.
2020-10-19T19:51:11.171+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot inputs and outputs before executing task ':application:web-app:react-client:webjar'' started
2020-10-19T19:51:11.171+0000 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Implementation for task ':application:web-app:react-client:webjar': org.gradle.api.tasks.bundling.Jar_Decorated@8e28b204de16ecca00cd5a2efbb38bcd
2020-10-19T19:51:11.171+0000 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Additional implementations for task ':application:web-app:react-client:webjar': [org.gradle.api.tasks.bundling.Jar_Decorated@598ad6e7c8ffdbbd0c437f2f7691cfee]
2020-10-19T19:51:11.171+0000 [DEBUG] [org.gradle.api.internal.tasks.execution.DefaultTaskSnapshotter] Snapshotting property archiveFile (Output) for task ':application:web-app:react-client:webjar'
2020-10-19T19:51:11.172+0000 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Fingerprinting property rootSpec$1 for task ':application:web-app:react-client:webjar'
2020-10-19T19:51:11.172+0000 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Fingerprinting property rootSpec$1$1 for task ':application:web-app:react-client:webjar'
2020-10-19T19:51:11.184+0000 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Fingerprinting property rootSpec$2 for task ':application:web-app:react-client:webjar'
2020-10-19T19:51:11.184+0000 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Fingerprinting property rootSpec$2$1 for task ':application:web-app:react-client:webjar'
2020-10-19T19:51:11.185+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Snapshot inputs and outputs before executing task ':application:web-app:react-client:webjar''
2020-10-19T19:51:11.185+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot inputs and outputs before executing task ':application:web-app:react-client:webjar'' completed
2020-10-19T19:51:11.185+0000 [INFO] [org.gradle.internal.execution.steps.ResolveCachingStateStep] Caching disabled for task ':application:web-app:react-client:webjar' because:
  Build cache is disabled
2020-10-19T19:51:11.185+0000 [DEBUG] [org.gradle.internal.execution.steps.SkipUpToDateStep] Determining if task ':application:web-app:react-client:webjar' is up-to-date
2020-10-19T19:51:11.185+0000 [INFO] [org.gradle.internal.execution.steps.SkipUpToDateStep] Task ':application:web-app:react-client:webjar' is not up-to-date because:
  No history is available.
2020-10-19T19:51:11.186+0000 [DEBUG] [org.gradle.internal.execution.steps.CreateOutputsStep] Ensuring parent directory exists for property archiveFile at /home/runner/work/gtfs-validator/gtfs-validator/application/web-app/react-client/build/libs/react-client.jar
2020-10-19T19:51:11.186+0000 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':application:web-app:react-client:webjar'.
2020-10-19T19:51:11.186+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute copy for :application:web-app:react-client:webjar' started
2020-10-19T19:51:19.445+0000 [LIFECYCLE] [org.gradle.cache.internal.DefaultFileLockManager] 
2020-10-19T19:51:19.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2020-10-19T19:51:19.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2020-10-19T19:51:19.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2020-10-19T19:51:19.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2020-10-19T19:51:19.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2020-10-19T19:51:19.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2020-10-19T19:51:29.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2020-10-19T19:51:29.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2020-10-19T19:51:29.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2020-10-19T19:51:29.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2020-10-19T19:51:29.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2020-10-19T19:51:29.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2020-10-19T19:51:39.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2020-10-19T19:51:39.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2020-10-19T19:51:39.445+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
...

@barbeau
Copy link
Copy Markdown
Member

barbeau commented Oct 19, 2020

It looks like this is the last command to execute:

2020-10-19T19:51:11.186+0000 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute copy for :application:web-app:react-client:webjar' started

Here's that task in build.gradle:

task webjar(type: Jar) {
    from(fileTree("build")) {
        into "META-INF/resources"
    }
}

So I assume this is where the problem is...

@barbeau
Copy link
Copy Markdown
Member

barbeau commented Oct 19, 2020

I've noticed that if I run locally with the --debug option, I see this:

2020-10-19T17:44:33.445-0400 [DEBUG] [org.gradle.api.internal.changedetection.state.ZipHasher] Malformed archive 'react-client.jar'. Falling back to full content hash instead of entry hashing.
org.gradle.api.UncheckedIOException: java.io.EOFException: Unexpected end of ZLIB input stream
        at org.gradle.api.internal.changedetection.state.StreamZipInput$1.computeNext(StreamZipInput.java:45)
        at org.gradle.api.internal.changedetection.state.StreamZipInput$1.computeNext(StreamZipInput.java:38)
        at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)
        at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)
        at org.gradle.api.internal.changedetection.state.ZipHasher.fingerprintZipEntries(ZipHasher.java:106)
        at org.gradle.api.internal.changedetection.state.ZipHasher.fingerprintZipEntries(ZipHasher.java:113)
        at org.gradle.api.internal.changedetection.state.ZipHasher.fingerprintZipEntries(ZipHasher.java:97)
        at org.gradle.api.internal.changedetection.state.ZipHasher.hashZipContents(ZipHasher.java:80)
        at org.gradle.api.internal.changedetection.state.ZipHasher.hash(ZipHasher.java:67)
        at org.gradle.api.internal.changedetection.state.DefaultResourceSnapshotterCacheService.hashFile(DefaultResourceSnapshotterCacheService.java:45)
        at org.gradle.api.internal.changedetection.state.SplitResourceSnapshotterCacheService.hashFile(SplitResourceSnapshotterCacheService.java:43)
        at org.gradle.internal.fingerprint.classpath.impl.ClasspathFingerprintingStrategy.fingerprintZipContents(ClasspathFingerprintingStrategy.java:196)
        at org.gradle.internal.fingerprint.classpath.impl.ClasspathFingerprintingStrategy.fingerprintRootFile(ClasspathFingerprintingStrategy.java:189)
        at org.gradle.internal.fingerprint.classpath.impl.ClasspathFingerprintingStrategy.access$200(ClasspathFingerprintingStrategy.java:65)
        at org.gradle.internal.fingerprint.classpath.impl.ClasspathFingerprintingStrategy$ClasspathContentFingerprintingVisitor.fingerprintFile(ClasspathFingerprintingStrategy.java:165)
        at org.gradle.internal.fingerprint.classpath.impl.ClasspathFingerprintingStrategy$ClasspathContentFingerprintingVisitor.visitFile(ClasspathFingerprintingStrategy.java:154)
        at org.gradle.internal.snapshot.RegularFileSnapshot.accept(RegularFileSnapshot.java:66)
        at org.gradle.internal.fingerprint.classpath.impl.ClasspathFingerprintingStrategy.collectFingerprints(ClasspathFingerprintingStrategy.java:107)
        at org.gradle.internal.fingerprint.impl.DefaultCurrentFileCollectionFingerprint.from(DefaultCurrentFileCollectionFingerprint.java:48)
        at org.gradle.internal.fingerprint.impl.AbstractFileCollectionFingerprinter.fingerprint(AbstractFileCollectionFingerprinter.java:48)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.lambda$visitInputFileProperties$1(ExecuteActionsTaskExecuter.java:324)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$fingerprintInputFiles$3(CaptureStateBeforeExecutionStep.java:192)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.visitInputFileProperties(ExecuteActionsTaskExecuter.java:322)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.fingerprintInputFiles(CaptureStateBeforeExecutionStep.java:188)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionState(CaptureStateBeforeExecutionStep.java:150)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$captureExecutionStateOp$1(CaptureStateBeforeExecutionStep.java:104)
        at org.gradle.internal.execution.steps.BuildOperationStep$1.call(BuildOperationStep.java:40)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.internal.execution.steps.BuildOperationStep.operation(BuildOperationStep.java:37)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.captureExecutionStateOp(CaptureStateBeforeExecutionStep.java:103)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.lambda$execute$0(CaptureStateBeforeExecutionStep.java:78)
        at java.base/java.util.Optional.map(Optional.java:258)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:78)
        at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
        at java.base/java.util.Optional.orElseGet(Optional.java:362)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
        at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
        at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:192)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:184)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:114)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
        at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
        at java.base/java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:244)
        at java.base/java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
        at java.base/java.util.zip.ZipInputStream.read(ZipInputStream.java:196)
        at java.base/java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:142)
        at java.base/java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:120)
        at org.gradle.api.internal.changedetection.state.StreamZipInput$1.computeNext(StreamZipInput.java:43)
        ... 82 more

...even though I get a BUILD SUCCESSFUL message. Maybe it's related?

@barbeau
Copy link
Copy Markdown
Member

barbeau commented Oct 19, 2020

When running the build locally with --debug, here's the part of the log for execution that happens right after CI freezes:

2020-10-19T17:50:38.409-0400 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :application:web-app:react-client:webjar
2020-10-19T17:50:38.409-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :application:web-app:react-client:webjar' started
2020-10-19T17:50:38.410-0400 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Putting task artifact state for task ':application:web-app:react-client:webjar' into context took 0.0 secs.
2020-10-19T17:50:38.411-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot inputs and outputs before executing task ':application:web-app:react-client:webjar'' started
2020-10-19T17:50:38.411-0400 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Implementation for task ':application:web-app:react-client:webjar': org.gradle.api.tasks.bundling.Jar_Decorated@8e28b204de16ecca00cd5a2efbb38bcd
2020-10-19T17:50:38.411-0400 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Additional implementations for task ':application:web-app:react-client:webjar': [org.gradle.api.tasks.bundling.Jar_Decorated@598ad6e7c8ffdbbd0c437f2f7691cfee]
2020-10-19T17:50:38.411-0400 [DEBUG] [org.gradle.api.internal.tasks.execution.DefaultTaskSnapshotter] Snapshotting property archiveFile (Output) for task ':application:web-app:react-client:webjar'
2020-10-19T17:50:38.411-0400 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Fingerprinting property rootSpec$1 for task ':application:web-app:react-client:webjar'
2020-10-19T17:50:38.411-0400 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Fingerprinting property rootSpec$1$1 for task ':application:web-app:react-client:webjar'
2020-10-19T17:50:38.417-0400 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Fingerprinting property rootSpec$2 for task ':application:web-app:react-client:webjar'
2020-10-19T17:50:38.417-0400 [DEBUG] [org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep] Fingerprinting property rootSpec$2$1 for task ':application:web-app:react-client:webjar'
2020-10-19T17:50:38.419-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Snapshot inputs and outputs before executing task ':application:web-app:react-client:webjar''
2020-10-19T17:50:38.419-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot inputs and outputs before executing task ':application:web-app:react-client:webjar'' completed
2020-10-19T17:50:38.419-0400 [INFO] [org.gradle.internal.execution.steps.ResolveCachingStateStep] Caching disabled for task ':application:web-app:react-client:webjar' because:
  Build cache is disabled
2020-10-19T17:50:38.419-0400 [DEBUG] [org.gradle.internal.execution.steps.SkipUpToDateStep] Determining if task ':application:web-app:react-client:webjar' is up-to-date
2020-10-19T17:50:38.419-0400 [INFO] [org.gradle.internal.execution.steps.SkipUpToDateStep] Task ':application:web-app:react-client:webjar' is not up-to-date because:
  Output property 'archiveFile' file C:\git-projects\gtfs-validator\application\web-app\react-client\build\libs\react-client.jar has changed.
2020-10-19T17:50:38.419-0400 [DEBUG] [org.gradle.internal.execution.steps.CreateOutputsStep] Ensuring parent directory exists for property archiveFile at C:\git-projects\gtfs-validator\application\web-app\react-client\build\libs\react-client.jar
2020-10-19T17:50:38.420-0400 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter] Executing actions for task ':application:web-app:react-client:webjar'.
2020-10-19T17:50:38.420-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute copy for :application:web-app:react-client:webjar' started
2020-10-19T17:50:38.474-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Execute copy for :application:web-app:react-client:webjar'
2020-10-19T17:50:38.474-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Execute copy for :application:web-app:react-client:webjar' completed
2020-10-19T17:50:38.475-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot outputs after executing task ':application:web-app:react-client:webjar'' started
2020-10-19T17:50:38.475-0400 [DEBUG] [org.gradle.api.internal.tasks.execution.DefaultTaskSnapshotter] Snapshotting property archiveFile (Output) for task ':application:web-app:react-client:webjar'
2020-10-19T17:50:38.476-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Snapshot outputs after executing task ':application:web-app:react-client:webjar''
2020-10-19T17:50:38.476-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Snapshot outputs after executing task ':application:web-app:react-client:webjar'' completed
2020-10-19T17:50:38.477-0400 [DEBUG] [org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter] Removed task artifact state for task ':application:web-app:react-client:webjar' from context.
2020-10-19T17:50:38.477-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Task :application:web-app:react-client:webjar'
2020-10-19T17:50:38.477-0400 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Task :application:web-app:react-client:webjar' completed
2020-10-19T17:50:38.477-0400 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :application:web-app:react-client:webjar (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 0.067 secs.
2020-10-19T17:50:38.477-0400 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :application:web-app:react-client:webjar finished executing
2020-10-19T17:50:38.477-0400 [DEBUG] [org.gradle.execution.plan.DefaultExecutionPlan] Node :application:web-app:react-client:webjar completed, executed: true
2020-10-19T17:50:38.477-0400 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: released lock on :
2020-10-19T17:50:38.477-0400 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.45 completed (1 worker(s) in use)
2020-10-19T17:50:38.477-0400 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: released lock on root.1.45
2020-10-19T17:50:38.478-0400 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: acquired lock on :
2020-10-19T17:50:38.478-0400 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1.45 started (1 worker(s) in use).
2020-10-19T17:50:38.479-0400 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker for ':' Thread 5: acquired lock on root.1.45
2020-10-19T17:50:38.479-0400 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :application:web-app:spring-server:compileJava (Thread[Execution worker for ':' Thread 5,5,main]) started.

The exception I mentioned happens below this part of the log.

@ghost
Copy link
Copy Markdown

ghost commented Oct 19, 2020

Thks, lots of possibilities with adding Gradle debug option!

@lionel-nj
Copy link
Copy Markdown
Contributor Author

The last line 2020-10-19T17:50:38.479-0400 [INFO] [org.gradle.execution.plan.DefaultPlanExecutor] :application:web-app:spring-server:compileJava (Thread[Execution worker for ':' Thread 5,5,main]) started. tends to confirm the endless loop "theory". There might be some way to prevent this, thanks @barbeau!

@barbeau
Copy link
Copy Markdown
Member

barbeau commented Oct 20, 2020

Looks like:

task webjar(type: Jar) {
    from(fileTree("build")) {
        into "META-INF/resources"
    }
}

...is definitely the problem - I opened a PR on my own repo to do further testing, and if I comment out the above task (in CUTR-at-USF@dcf971e) then the build passes on GitHub Actions:
https://github.com/CUTR-at-USF/gtfs-validator-1/runs/1281508472

I'm guessing file deadlock when trying to copy into META-INF/resources, or permission issues?

@barbeau
Copy link
Copy Markdown
Member

barbeau commented Oct 20, 2020

Alright, I think the issue here is that it was trying to copy the application\web-app\react-client\build\libs\react-client.jar into the META-INF/resources folder, and
React/Gradle didn't like that.

I found a similar issue discussed here with Gradle and React:
https://medium.com/@tgpski/android-react-native-fastlane-working-with-multiple-build-types-a9a6641c5704

...which says:

After building sourcemap exports into our automated build flows, we started to see infinite hangs during the bundleReleaseJSAndAssets step for Android builds.

After lots of digging through open GH issues and a bit of debugging, I realized that the new bundle export step in the build flow was confusing the packager on subsequent builds.

There are a few different types of files that can cause the packager to hang during this step. I have seen reports of Realm.js database files, Jest test artifacts, and code bundles causing issues with this step.

Related React issue is facebook/react-native#11696.

I'm guessing .jar is one of these types of files. And, AFAIK, a JAR shouldn't be bundled into META-INF/resources - @lionel-nj Could you confirm this, and that it still works after removing the JAR copy?

So, I've filtered out JAR files in this bundling in 7585983.

task webjar(type: Jar) {
    from(fileTree(dir: "build", exclude: "**/*.jar")) {
        into "META-INF/resources"
    }
}

And, now the build passes on GitHub and Circle CI 🎉 :

Additional references:

@lionel-nj
Copy link
Copy Markdown
Contributor Author

lionel-nj commented Oct 20, 2020

Thanks @barbeau (that was tricky..). I confirm, locally this works. Updating the github workflow to collect the artifacts.

@lionel-nj
Copy link
Copy Markdown
Contributor Author

I also confirm that running the generated artifact produces the expected result.

@lionel-nj
Copy link
Copy Markdown
Contributor Author

lionel-nj commented Oct 20, 2020

Todos:

  • explicit the link between this branch and buil-local-web-ui
  • fix NoSuchFileException due to hard coded path to validation report
  • improve "start message", port is 8090 not 8080
  • verify consistency between react-client method names and arguments
  • package as .war instead of .jar
  • add circle-ci step to package war and collect artifact

@ghost
Copy link
Copy Markdown

ghost commented Oct 21, 2020

And, now the build passes on GitHub and Circle CI 🎉 :

Thks a lot!!

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some adjustments non code related

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thks for the super good work, this is a great MVP/v0 of packaging the code in two different ways.
I will take it over from here

@lionel-nj lionel-nj mentioned this pull request Oct 21, 2020
4 tasks
@lionel-nj lionel-nj mentioned this pull request Oct 21, 2020
4 tasks
@lionel-nj lionel-nj marked this pull request as ready for review October 21, 2020 19:05
@ghost ghost changed the title Test to reimplement local web ui from scratch Local web UI Oct 21, 2020
@ghost ghost merged commit e639357 into master Oct 21, 2020
@ghost ghost deleted the test-reimplementation branch October 21, 2020 19:26
This pull request was closed.
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.

2 participants