Skip to content
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

Account for non-xml submission objects #2663

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

josephsnyder
Copy link
Member

When given a non-xml submission file, catch the exception of the bad submission and only reject the submission of the Validate setting is enabled.

Fixes: #2662

@josephsnyder josephsnyder force-pushed the catch_nonxml_submission_issues branch 2 times, most recently from 7101072 to 0f93331 Compare January 15, 2025 20:36
When given a non-xml submission file, catch the exception of the bad
submission and only reject the submission of the Validate setting is enabled.

Fixes: #2662
@josephsnyder josephsnyder force-pushed the catch_nonxml_submission_issues branch from 0f93331 to ab9abfd Compare January 15, 2025 20:52
@josephsnyder josephsnyder marked this pull request as ready for review January 16, 2025 14:47
Copy link
Collaborator

@williamjallen williamjallen left a comment

Choose a reason for hiding this comment

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

The code here looks pretty reasonable overall. Can you add a test to ensure that no error is returned with a non-XML file is submitted, as well as a test to ensure that the error message added in this PR is displayed when submission validation is turned on?

@josephsnyder
Copy link
Member Author

@williamjallen, to summarize our F2F, The CMake tests "pass" the uploaded non-xml files when the async parsing is used for CDash. This MR has the same functionality when the validation of files is turned off.

Total Test time (real) =  11.23 sec
277: Memory check project /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin
277: Memory checker (MemoryCheckCommand) not set, or cannot find the specified program.
277: Performing coverage
277:  Cannot find any coverage files. Ignoring Coverage request.
277: 	Add file: /home/softhat/Work/cmake-build/Tests/CTestTest2/test.cmake
277: Submit files
277:    SubmitURL: http://localhost:8080/submit.php?project=PublicDashboard
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1934/Configure.xml
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1934/Build.xml
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1934/Test.xml
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1934/Test_1.xml
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1934/Test_2.xml
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1934/Test_3.xml
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1934/Notes.xml
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1934/Done.xml
277:    Submission successful
277: 	Add file: /home/softhat/Work/cmake-build/Tests/CTestTest2/test.cmake
277: Submit files
277:    SubmitURL: http://localhost:8080/submit.php?project=PublicDashboard
277:    Uploaded: /home/softhat/Work/cmake-build/Tests/CTestTest2/test.cmake
277:    Submission successful

Turning the validation on properly rejected the arbitrary file in addition to voicing a few other issues:

SubmitURL: http://localhost:8080/submit.php?project=PublicDashboard
277:    Server Response:
277: {"status":1,"description":"XML validation failed: rejected file PublicDashboard_-__-_c08bf28a-08d9-40d9-b002-519afd64a8b4_-_b15d6cd0415683329dcb734d27311c3b.xml:\nERROR: Element 'Site', attribute 'ModelName': The attribute 'ModelName' is not allowed.\n in \/cdash\/storage\/app\/inbox\/PublicDashboard_-__-_c08bf28a-08d9-40d9-b002-519afd64a8b4_-_b15d6cd0415683329dcb734d27311c3b.xml, line: 26, column: 0"}
277:    Error when uploading file: /home/softhat/Work/cmake-build/Tests/CTestTest2/kwsysBin/Testing/20250123-1935/Configure.xml
277:    Error message was: 
277: CURL output: [{"status":1,"description":"XML validation failed: rejected file PublicDashboard_-__-_c08bf28a-08d9-40d9-b002-519afd64a8b4_-_b15d6cd0415683329dcb734d27311c3b.xml:\nERROR: Element 'Site', attribute 'ModelName': The attribute 'ModelName' is not allowed.\n in \/cdash\/storage\/app\/inbox\/PublicDashboard_-__-_c08bf28a-08d9-40d9-b002-519afd64a8b4_-_b15d6cd0415683329dcb734d27311c3b.xml, line: 26, column: 0"}]
277:    Problems when submitting via HTTP
277: 	Add file: /home/softhat/Work/cmake-build/Tests/CTestTest2/test.cmake
277: Submit files
277:    SubmitURL: http://localhost:8080/submit.php?project=PublicDashboard
277:    Error when uploading file: /home/softhat/Work/cmake-build/Tests/CTestTest2/test.cmake
277:    Error message was: 
277: CURL output: [{"status":1,"description":"Could not determine submission file type for: 'inbox\/PublicDashboard_-__-_5bd11016-9664-4873-913a-4229e952d726_-_8b8ce96df486775039e62d4c86596101.xml'"}]
277:    Problems when submitting via HTTP

I think this submission is again ready for merge.

Copy link
Collaborator

@williamjallen williamjallen left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me. Thanks for fixing this!

@williamjallen williamjallen added this to the v3.8 milestone Jan 24, 2025
@williamjallen williamjallen added this pull request to the merge queue Jan 24, 2025
Merged via the queue into master with commit cc91be3 Jan 24, 2025
6 checks passed
@williamjallen williamjallen deleted the catch_nonxml_submission_issues branch January 24, 2025 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Submission of "extra" files no longer works
2 participants