Page MenuHomeSoftware Heritage

deposit_check: Improve details in failing checks
ClosedPublic

Authored by ardumont on Jul 9 2018, 4:46 PM.

Details

Summary

Close T1010

Test Plan

Tests ok

Diff Detail

Repository
rDDEP Push deposit
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1302
Build 1646: arc lint + arc unit

Event Timeline

This looks good ! are the error messages returned to the client as is?

swh/deposit/api/private/deposit_check.py
187

I have a hard time with the error message. Maybe something like this:

"the url must be compatible with the client's domain name, its verification has failed"

swh/deposit/tests/api/test_deposit_check.py
97

I have a fail because the list of fields is not in the same order.
The assertCountEqual verifies lists without order, but here with dicts and lists entangled it might not help...
maybe we should sort first the result and only afterwards do the assertEqual..

swh/deposit/api/private/deposit_check.py
187

We don't have a fixed url field key, that's what the 'no url field' tries to convey.

What do you think of:
'At least one url field must be compatible with the client's domain name. The following url fields did not match.'?

swh/deposit/tests/api/test_deposit_check.py
97

The order is not important so i'll change the way this is tested.

I'll also take care of the FIXM (line 76).

swh/deposit/api/private/deposit_check.py
187

Better 'At least one url field must be compatible with the client's domain name. The following url fields failed the check'.

@moranegg Grrrr, i have pushed rather too fast (my fingers are faster than my shadow :)

So the diff is closed... (and not updated with the adaptations... T_T)

Here is the commit with the proposed changes though [1].

Please, tell me if you want me to adapt some things.

[1] https://forge.softwareheritage.org/rDDEP95a7aaa0e71ff8990d1d29e0519951b23e04d58f

Cheers,

No worries, I'm good with the changes.
Also all tests pass on my machine.
When are you deploying?

This revision is now accepted and ready to land.Jul 10 2018, 8:55 AM