-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature/1693 api v3 disabled fails validation #2066
Feature/1693 api v3 disabled fails validation #2066
Conversation
…e contours, empty DatasetControllerV3 to test
- login allowed at /api/login & /api-v3/login - v2/v3 BaseRestApiTest distinquished
…der and no content -> IT updated
…version, includes a sample CR)
…st and post-import + IT to prove correct behavior
…mport + IT to prove correct behavior - fix with common location processing with segment stripping (+normalization)
… GET datasets/{name}/{version}
…/audit-trail added
…ion} now works for # or 'latest' (IT = regression test)
…{name}/{version} and /{name}/latest - improved
…- supports latest for as version-expression, impl for datasets improved by actual existence checking + IT test cases for non-existing/non-latest queries
…properties - supports latest for as version-expression; get impl is unvalidated, put impl checks validity - login is now common, under /api/login for both v2 and v3 (did not work previously)
…properties - supports latest for as version-expression; get impl is unvalidated, put impl checks validity - extended for different validation cases - login is now common, under /api/login for both v2 and v3 (did not work previously)
…ture -> CompletableFuture (mistake reverted)
… added. IT mostly adjusted, but there are todos - DatasetServiceV3 introduced to carry difference in behavior to DatasetService. original entity validation has been divided into create-validation and regular-entity validation. - buildfix for VersionedModelServiceTest
…sion}` in proper validations
…asets/dsName/version/rules, GET datasets/dsName/version/rules/# + IT
- v2 ignores this added information - needs
…api-v3-schema-etc
…api-v3-schema-etc
…api-v3-disabled-fails-validation
rest-api/src/main/scala/za/co/absa/enceladus/rest_api/services/RunService.scala
Show resolved
Hide resolved
} | ||
|
||
// v3 has internal validation on importItem (because it is based on update), v2 only had it on import | ||
override def importSingleItem(item: C, username: String, metadata: Map[String, String]): Future[Option[(C, Validation)]] = { |
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.
Why is the metadata passed here?
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.
Thanks for noticing and making me realizing the problem! 🙇♂️
The metadata is passed there, because it should have been checked, too, but this implementation failed to do so.
Should be fixed now, I have updated the code and added test cases for both V2 and V3 import API to hold this together.
…s-validation % Conflicts: % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/controllers/v3/VersionedModelControllerV3.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/exceptions/EndpointDisabled.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/exceptions/EndpointDisabledException.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/exceptions/EntityDisabledException.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/services/DatasetService.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/services/PropertyDefinitionService.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/services/VersionedModelService.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/services/v3/DatasetServiceV3.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/services/v3/MappingTableServiceV3.scala % rest-api/src/main/scala/za/co/absa/enceladus/rest_api/services/v3/PropertyDefinitionServiceV3.scala % rest-api/src/test/scala/za/co/absa/enceladus/rest_api/integration/controllers/v3/DatasetControllerV3IntegrationSuite.scala % rest-api/src/test/scala/za/co/absa/enceladus/rest_api/integration/controllers/v3/MappingTableControllerV3IntegrationSuite.scala
…:1}` to be present on imports. + IT
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.
Looks good, code review
rest-api/src/main/scala/za/co/absa/enceladus/rest_api/services/v3/VersionedModelServiceV3.scala
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
LGTM
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.
I was testing the API and I think DatasetControllerV3 should also have this validation on updating the properties: PUT on"/{name}/{version}/properties"
What do you mean? |
When I tested this endpoint on a disabled dataset, I didn't see the disabled validation
|
I can see this covered in the (passing) integTests: |
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.
Build, run, code review
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.
Tested locally as well
Implementation of PR review #2055 (comment), specifically:
It has its own PR, because there are a lot of changes in the end (introducing
VersionedModelServiceV3
- and changing some abstract classes to traits in order to multi-inherit in specific services both fromVersionedModelServiceV3
(API V3 backing) and from V2 services that already hold a lot of reusable implementation.Partial for #1693