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

Update handler: Ignore empty site field #1725

Merged

Conversation

williamjallen
Copy link
Collaborator

The update handler currently fails when a submission with a blank <site> tag is present.

If a blank site tag is included in an update XML file, CDash will now ignore it gracefully.

Copy link
Member

@josephsnyder josephsnyder left a comment

Choose a reason for hiding this comment

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

@williamjallen, I'm having some trouble testing this one. I've updated the Update2.xml file to have an empty <Site> param:

diff --git a/app/cdash/tests/data/UpdateAppend/Update_2.xml b/app/cdash/tests/data/UpdateAppend/Update_2.xml
index 1fc65cca7..c9ab94811 100644
--- a/app/cdash/tests/data/UpdateAppend/Update_2.xml
+++ b/app/cdash/tests/data/UpdateAppend/Update_2.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Update mode="Client" Generator="ctest-3.3.20150717-ga541" Append="true">
-  <Site>Dash20.kitware</Site>
+  <Site></Site>

but the test still fails and an error appears in the CDash log after executing the updateappend test:

[2023-09-28 18:57:02] testing.WARNING: Failed to process EmailProjectExample_-__-_0c23095d-e35d-47e2-a3a7-3efd65d65916_-_.xml with message: Attempt to read property "id" on null

Did you modify a different test locally or do we think that error is somewhere further down the line?

github-merge-queue bot pushed a commit that referenced this pull request Sep 29, 2023
PHPStan provides a set of [rule
levels](https://phpstan.org/user-guide/rule-levels) which provide
increasingly strict code analysis. We currently use level 6.

PHPStan level 8 checks nullable types in greater detail, which will
prevent a few common types of bugs, including the one fixed in #1725. I
was forced to also turn on level 7. Level 7 checks union types, which
will significantly improve our error detection abilities, but comes with
the caveat that checking for all of the error cases for functions which
return false instead of throwing an exception will cause additional
developer overhead.

Eventually, we should turn on level 9, but it would be pointless to do
so without turning on `treatPhpDocTypesAsCertain`. PHPStan cannot
currently understand Laravel's type casting system, which means that
we'd have to rely upon the PHPDoc types for level 9 to be of any
practical use.
@williamjallen williamjallen force-pushed the update-handler-missing-site branch from 377b3e5 to bae6382 Compare September 30, 2023 15:20
@williamjallen
Copy link
Collaborator Author

@josephsnyder Fixed. I (again) made some edits after testing and forgot that builds must be associated with a site.

Eventually, we should probably loosen the non-null constraint and allow builds to have a null site, rather than associating builds with a dummy "unknown" site.

Copy link
Member

@josephsnyder josephsnyder left a comment

Choose a reason for hiding this comment

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

Great. Thanks @williamjallen. That makes a lot of sense.

@josephsnyder josephsnyder added this pull request to the merge queue Oct 2, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 2, 2023
@williamjallen williamjallen force-pushed the update-handler-missing-site branch from bae6382 to a7e211f Compare October 2, 2023 13:55
@williamjallen williamjallen added this pull request to the merge queue Oct 2, 2023
Merged via the queue into Kitware:master with commit e4f1e02 Oct 2, 2023
@williamjallen williamjallen deleted the update-handler-missing-site branch October 2, 2023 15:31
zackgalbreath pushed a commit that referenced this pull request Nov 6, 2023
The update handler currently fails when a submission with a blank
`<site>` tag is present.

If a blank site tag is included in an update XML file, CDash will now
ignore it gracefully.
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.

2 participants