Auto Assignment Migration Phase 4 - #3225
Conversation
|
Thanks @kaloyanam for taking the time to contribute to hawkBit! We really appreciate this. Make yourself comfortable while I'm looking for a committer to help you with your contribution. |
ee46175 to
5b44f4f
Compare
| TARGET_ADMIN + IMPLIES + SpPermission.APPROVE_AUTO_ASSIGNMENT + LINE_BREAK + | ||
| TARGET_ADMIN + IMPLIES + SpPermission.HANDLE_AUTO_ASSIGNMENT + LINE_BREAK; | ||
| TARGET_ADMIN + IMPLIES + SpPermission.HANDLE_AUTO_ASSIGNMENT + LINE_BREAK + | ||
| TARGET_ADMIN + IMPLIES + SpPermission.CREATE_AUTO_ASSIGNMENT + LINE_BREAK + |
There was a problem hiding this comment.
maybe, TARGET_UPDATE shall imply CRUD AUTO_ASSIGNMENT permissions in order to keep current behavior.
Then no need for TARGET_ADMIN imply - it already imply TARGET_UPDATE
| "A sort criteria consists of the name of a field and the sort direction (ASC for ascending and DESC descending)." + | ||
| "The sequence of the sort criteria (multiple can be used) defines the sort order of the entities in the result.") | ||
| String sortParam | ||
| @RequestParam(value = MgmtRestConstants.REQUEST_PARAMETER_SEARCH, required = false) @Schema(description = "Query fields based on the Feed Item Query Language (FIQL). See Entity Definitions for available fields.") String rsqlParam, |
There was a problem hiding this comment.
Return back formatting of API classes:
- easily readable
- compatible with rest of the class formattings
|
|
||
| body.add(linkTo(methodOn(MgmtAutoAssignmentRestApi.class).getAutoAssignment(body.getId())).withSelfRel().expand()); | ||
| if (targetFilterQuery.getAutoAssignStatus() == WAITING_FOR_APPROVAL) { | ||
| if (autoAssignment.getStatus() == WAITING_FOR_APPROVAL) { |
There was a problem hiding this comment.
use switch - easily readable, one getStatus
|
|
||
| final DistributionSet distributionSet = filter.getAutoAssignDistributionSet(); | ||
| final DistributionSet distributionSet = autoAssignment == null ? null : autoAssignment.getDistributionSet(); | ||
| if (distributionSet != null) { |
There was a problem hiding this comment.
it since autoAssignment == null <=> distributionSet == null better understandable would be if (authAssignment != null) { .. and then assume ds != null }
| /** | ||
| * @return RSQL query | ||
| */ | ||
| String getQuery(); |
There was a problem hiding this comment.
getTargetFilterQuery as in Rollout and in REST api,
check if the rest of the methods are in sync with Rollout interface
| @Getter | ||
| public enum AutoAssignmentFields implements QueryField { | ||
|
|
||
| ID("id"), NAME("name"), CREATEDAT("createdAt"), CREATEDBY("createdBy"), LASTMODIFIEDAT("lastModifiedAt"), LASTMODIFIEDBY("lastModifiedBy"), |
There was a problem hiding this comment.
follow the ordering (entry per line) of the rest Fields
| LASTMODIFIEDAT("lastModifiedAt"), | ||
| LASTMODIFIEDBY("lastModifiedBy"), | ||
| AUTOASSIGNDISTRIBUTIONSET("autoAssignDistributionSet", "name", "version"); | ||
| ID("id"), NAME("name"), CREATEDAT("createdAt"), CREATEDBY("createdBy"), LASTMODIFIEDAT("lastModifiedAt"), LASTMODIFIEDBY("lastModifiedBy"); |
There was a problem hiding this comment.
Return ordering.
AUTOASSIGNDISTRIBUTIONSET removal shall be explicitly pointed out in commend - it is backward incompatible change - we shall check if we could keep the support.
| new AutoAssignDistributionSetUpdate(targetFilter.getId()).ds(ds2Type2.getId())); | ||
| }); | ||
| final AutoAssignment autoAssignment = callAs(withAuthorities( | ||
| CREATE_AUTO_ASSIGNMENT, |
There was a problem hiding this comment.
UPDATE_TARGET shall be sufficient?
| }); | ||
| } | ||
|
|
||
| private AutoAssignment findAutoAssignment(final TargetFilterQuery filter) { |
There was a problem hiding this comment.
this method shall be removed and replaced by findLinkedAutoAssignment everywhere? we dont link just by name?
16cbed0 to
480aac5
Compare
480aac5 to
d30294c
Compare
…et filter query, migrate to a separate table in the database, fixed tests - Added a new `sp_auto_assignment` table and removed the auto-assignment fields from the `sp_target_filter_query` table - Updated the 1.20.3 Flyway migration to create `sp_auto_assignment` and drop the auto-assign columns from `sp_target_filter_query`. - Created a new `AutoAssignment` interface and a new `JpaAutoAssignment` - Created a new `AutoAssignmentManagement` and `JpaAutoAssignmentManagement` - Created an `AutoAssignmentRepository` - Added CRUD permissions for auto assignments - Auto assignments now can be updated - Auto assignment tests now separated in their own classes - Tests updated to match the new entity UI has been untouched, so it will not represent auto-assignments properly Signed-off-by: Marinov Kaloyan <kaloyan.marinov@bosch.com>
d30294c to
1530b90
Compare
What
Separate auto-assignments as a separate entity, independent from target filter query, migrate to a separate table in the database, fixed tests
Changes
sp_auto_assignmenttable and removed the auto-assignment fields from thesp_target_filter_querytablesp_auto_assignmentand drop the auto-assign columns fromsp_target_filter_query.AutoAssignmentinterface and a newJpaAutoAssignmentAutoAssignmentManagementandJpaAutoAssignmentManagementAutoAssignmentRepositoryNotes
UI has been untouched, so it will not represent auto-assignments properly