-
Notifications
You must be signed in to change notification settings - Fork 77
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
Update handler: Ignore empty site field #1725
Conversation
2c95adb
to
377b3e5
Compare
There was a problem hiding this 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?
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.
377b3e5
to
bae6382
Compare
@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. |
There was a problem hiding this 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.
bae6382
to
a7e211f
Compare
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.
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.