Skip to content

Fix intermittent 404 error for HL7 lab upload#2051

Draft
yingbull with Copilot wants to merge 11 commits into
developfrom
copilot/fix-hl7-lab-upload-404-error
Draft

Fix intermittent 404 error for HL7 lab upload#2051
yingbull with Copilot wants to merge 11 commits into
developfrom
copilot/fix-hl7-lab-upload-404-error

Conversation

Copilot AI commented May 3, 2026

Copy link
Copy Markdown
Contributor
  • Inspect the HL7 upload gate/test diff and identify the duplicated new-code block Sonar is flagging
  • Make the smallest safe refactor to reduce new-code duplication without changing the view-gate behavior
  • Run targeted tests/quality checks for the changed files
  • Run final validation and reply to the Sonar quality-gate comment

Copilot AI requested review from Copilot and removed request for Copilot May 3, 2026 03:42
Copilot AI linked an issue May 3, 2026 that may be closed by this pull request
4 tasks
Agent-Logs-Url: https://github.com/carlos-emr/carlos/sessions/a928dd25-618e-4553-a502-c49db8b1b3d5

Co-authored-by: yingbull <8680161+yingbull@users.noreply.github.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @yingbull, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@yingbull yingbull changed the title [WIP] Fix intermittent 404 error for HL7 lab upload Fix intermittent 404 error for HL7 lab upload May 4, 2026
@penify-dev

penify-dev Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Introduces a dedicated Struts “view gate” action for the HL7 Lab Upload page so that plain GET page loads no longer execute the multipart upload handler, addressing an intermittent 404/error pattern seen when rendering the upload form.

Changes:

  • Added ViewInsideLabUpload2Action to gate GET/HEAD access to the HL7 upload JSP behind _lab w.
  • Mapped new route lab/CA/ALL/ViewInsideLabUpload in struts-lab.xml and updated multiple navigation links to use it.
  • Added a focused unit test covering privilege enforcement and HTTP method gating behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/java/io/github/carlos_emr/carlos/lab/gate/ViewInsideLabUpload2Action.java New GET/HEAD-only gate action enforcing _lab w and blocking non-GET methods.
src/main/webapp/WEB-INF/classes/struts-lab.xml Adds a new Struts action mapping for the view gate forwarding to testUploader.jsp.
src/main/webapp/WEB-INF/jsp/admin/admin.jsp Updates HL7 Lab Upload popup link to the new view route.
src/main/webapp/WEB-INF/jsp/administration/leftNav.jspf Updates admin left-nav HL7 Lab Upload link to the new view route.
src/main/webapp/WEB-INF/jsp/oscarMDS/Index.jsp Updates HL7 Lab Upload link to open the new view route.
src/main/webapp/WEB-INF/jsp/web/inboxhub/InboxhubTopbar.jsp Updates topbar HL7 Lab Upload link to the new view route.
src/test/java/io/github/carlos_emr/carlos/lab/gate/ViewInsideLabUpload2ActionTest.java Adds unit tests for auth/privilege enforcement and 405 handling on POST.

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@yingbull

yingbull commented May 5, 2026

Copy link
Copy Markdown
Collaborator

@copilot apply changes based on the comments in this thread also do your own review on these changes and this issue, is the actual likely cause of the reported behavior fixed, and if not, what else is the cause?

Agent-Logs-Url: https://github.com/carlos-emr/carlos/sessions/c89af910-d17f-47d1-8e6c-6a1d8c6b5702

Co-authored-by: yingbull <8680161+yingbull@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 5, 2026 20:00
@yingbull

yingbull commented May 5, 2026

Copy link
Copy Markdown
Collaborator

@copilot adjust the code to meet the quality gate without causing breaking changes. Quality Gate Failed Quality Gate failed

Failed conditions
12.9% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube Cloud

Agent-Logs-Url: https://github.com/carlos-emr/carlos/sessions/1928b955-1f70-4dc2-acb4-4ba35cef21c8

Co-authored-by: yingbull <8680161+yingbull@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 5, 2026 23:55
Agent-Logs-Url: https://github.com/carlos-emr/carlos/sessions/1928b955-1f70-4dc2-acb4-4ba35cef21c8

Co-authored-by: yingbull <8680161+yingbull@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 5, 2026 23:56
Agent-Logs-Url: https://github.com/carlos-emr/carlos/sessions/1928b955-1f70-4dc2-acb4-4ba35cef21c8

Co-authored-by: yingbull <8680161+yingbull@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 5, 2026 23:57
Agent-Logs-Url: https://github.com/carlos-emr/carlos/sessions/1928b955-1f70-4dc2-acb4-4ba35cef21c8

Co-authored-by: yingbull <8680161+yingbull@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 5, 2026 23:57
Agent-Logs-Url: https://github.com/carlos-emr/carlos/sessions/1928b955-1f70-4dc2-acb4-4ba35cef21c8

Co-authored-by: yingbull <8680161+yingbull@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 5, 2026 23:58

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot adjust the code to meet the quality gate without causing breaking changes. Quality Gate Failed Quality Gate failed

Failed conditions
...

Adjusted the HL7 upload gate and focused unit test to reduce new-code duplication while preserving the route behavior. Core fix is in 05c402b, with final cleanup in 2815a80. Local lightweight checks passed; Maven test execution is still blocked in the sandbox by external dependency resolution for jitpack.io artifacts.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • build.shibboleth.net
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/carlos/carlos org.codehaus.plexus.classworlds.launcher.Launcher test -Dtest=ViewInsideLabUpload2ActionTest (dns block)
  • jitpack.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.14/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.14/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.14 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.14/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/carlos/carlos org.codehaus.plexus.classworlds.launcher.Launcher test -Dtest=ViewInsideLabUpload2ActionTest (dns block)
  • sonarcloud.io
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from yingbull May 6, 2026 00:00
@sonarqubecloud

sonarqubecloud Bot commented May 6, 2026

Copy link
Copy Markdown

@yingbull yingbull added this to the may-2026-release milestone May 19, 2026
@yingbull

Copy link
Copy Markdown
Collaborator

@phc007 at your leisure, if you can test this that would be great. If you have a fake hl7 we can get into the test harness or you can send to Ben (Ben@ma.. same as mine) so he can try and run repeated tests with claude or codex on the failure that would be great too. @Ben-Heerema

@yingbull yingbull marked this pull request as draft May 20, 2026 16:19
@phc007

phc007 commented May 20, 2026 via email

Copy link
Copy Markdown
Collaborator

@phc007

phc007 commented May 20, 2026 via email

Copy link
Copy Markdown
Collaborator

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.

[Bug]: 404 for HL7 lab upload *intermittant*

4 participants