fix: upload timeout UX, rate limit, specimen warning, deploy pipeline & struts config#37
Open
fix: upload timeout UX, rate limit, specimen warning, deploy pipeline & struts config#37
Conversation
…data validation The missing `ant deploy` step in GitHub Actions was causing JSP and web file changes to be pushed to GitHub but never reflected on the live site. Tomcat serves from /usr/local/antweb/ inside the container — files only land there when ant deploy runs. This commit ensures that can never be missed again, and bundles several related upload reliability improvements discovered during investigation. Deployment Pipeline: - Add ant deploy to GitHub Actions so every push to master automatically compiles and deploys to the running Tomcat container via SSH - Switch git pull --no-edit to git pull --rebase to eliminate stray merge commits on the production server (fixes orphaned commit 6b126f56) - Add -T flag to docker compose exec for non-TTY GitHub Actions environment with v1/v2 fallback (docker compose || docker-compose) Upload Reliability: - Correct Cloudflare timeout guidance from "go back to homepage" to "check your Upload Report" — Tomcat continues processing after Cloudflare closes the browser connection, data is never lost - Add JS loading overlay on upload submit with 85s auto-redirect to Upload Report before Cloudflare's 100s origin timeout fires - Exempt /upload.do from Caddy rate limiter so upload retries after a Cloudflare timeout are never blocked by the 10 req/min per IP limit Data Validation: - Surface warning in upload report when spaces are auto-stripped from specimen codes (MessageMgr + SpecimenUploadParse) so curators can fix source data instead of silently receiving corrected but unexplained results Bug Fix: - Restore struts-configDb.xml and struts-configDbAnt.xml which were checked out as 22-byte symlink placeholder files on Windows, causing Struts ActionServlet to fail on startup and every .do action to return 404 All changes verified with a full local E2E test suite — 7/7 tests passing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Was committed as a git symlink (mode 120000) causing CI checkout to fail on Linux with 'unable to create symlink: File name too long'. Re-added as a regular file (mode 100644) with the correct XML content.
Tests workflow was running docker build from docker/api/ subdirectory, making COPY instructions fail with 'not found' since the Dockerfile expects repo root as build context. Fixed to match docker-compose.yml which correctly uses context: . with explicit -f Dockerfile path. Also fixed Antweb build step which was pointing at docker/api instead of docker/antweb.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What & Why
This PR fixes 7 issues reported by Brian Fisher covering upload reliability, deploy automation, and a critical Struts startup bug.
Fixes
1. Upload page — Cloudflare 524 timeout UX
Cloudflare cuts the browser connection after 100s but Tomcat keeps processing in the background — data is never lost. Users had no feedback and saw a confusing go back to homepage message.
2. Rate limiter exemption for uploads
The Caddy rate limiter (10 req/min per IP) was blocking upload retries after a timeout. /upload.do is now fully exempt from rate limiting.
3. Specimen code space warning
Spaces were silently stripped from specimen codes with no feedback to curators. Upload Report now shows a warning: Spaces removed from specimen code (auto-corrected — please fix your source data)
4. Deploy pipeline fix
5. Tomcat port conflict
Port 8080 was occupied by another Java process on the host. Changed mapping to 8081:8080.
6. Struts config symlink fix
On Windows, struts-configDb.xml was checked out as a 22-byte placeholder file instead of real XML. This caused Struts ActionServlet to fail on startup — making every .do route return 404. Restored the correct XML.
7. Specimen warning implementation
MessageMgr.java defines the specimenIdSpacesRemoved constant and SpecimenUploadParse.java triggers it during upload parsing when spaces are detected in specimen codes.