HomeMesosphereNo notifications. 4 unresolved issues.

remove redundant (and incorrect) constraint validation in app model
ClosedAll Users

Authored by jdef on Apr 3 2017, 4:16 PM.

Details

Summary

Constraint validation is handled at the RAML layer. AppDefinition defined a redundant set
of constraint validation rules that added no value and grew out of sync w/ the RAML layer.

This change set removes the constraint validation from AppDefinition and refactors some of
the related unit tests. As part of the test refactoring the constraint violation messages
were tweaked and turned into constants for easier testing.

Test Plan

sbt test

Diff Detail

Repository
rMARATHON marathon
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
jdef created this revision.Apr 3 2017, 4:16 PM
jdef added a comment.Apr 3 2017, 4:21 PM

blocking for D655

jenkins requested changes to this revision.Apr 3 2017, 4:23 PM
This revision now requires changes to proceed.Apr 3 2017, 4:23 PM
aquamatthias accepted this revision.Apr 3 2017, 4:41 PM

Thanks - Looks good to me.
I see the test cases are working. I wonder where we use the constraints validator for the raml app?

src/main/scala/mesosphere/marathon/state/AppDefinition.scala
563

I only see a reference to mesosphere/marathon/api/v2/validation/SchedulingValidation.scala:112 ??
Where do we use the constraints validator?

jenkins accepted this revision.Apr 3 2017, 4:56 PM

Ship it!

This revision is now accepted and ready to land.Apr 3 2017, 4:56 PM
jdef marked an inline comment as done.Apr 3 2017, 5:05 PM
jdef added inline comments.
timcharper accepted this revision.Apr 3 2017, 6:30 PM

Nice change. I'd feel a bit better if there was some manual testing on this to see if there's any coverage missing.

jdef marked an inline comment as done.Apr 3 2017, 6:38 PM
This revision was automatically updated to reflect the committed changes.