Skip to content
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

Support user consent flow #1293

Merged

Conversation

herdt-michael
Copy link
Contributor

Introduction:
This pull requests extends the action state machine to introduce a new update flow where the confirmation of an action is required first, before processing with the deployment. Therefore a new action state called "WAIT_FOR_CONFIRMATION" will be introduced. The consent flow can be activated in the system configuration. By default, the update process is executed as usual.
To confirm an action the DDI or DMF API can be used. For the DDI, a new "confirmationBase" resource is introduced to get information about pending confirmations. An API reference (for actions awaiting the confirmation) will also be added when polling against the DDI controllerBase.
For the DMF a new "CONFIRM" message was introduced, informing the device about open confirmations.

Additionally, an "auto-confirm" state can be set on the device, to automatically confirm actions. A use case would be if the operator decides to automatically confirm actions for a specific device (e.g. test device). From the end-user perspective (device layer), there could be a wish to be up to date with the latest software state and give the confirmation for every future update (until revoked again). The "auto-confirm" state can be set by using the DDI, DMF or one of the Management layers (UI&API).

Additionally the operator can decide if the confirmation is required for each deployment. Several layers were adapted to support this:

  • Deployment view and API (manual assignment) -> Confirmation required checkbox added when specifying the assignment properties.
  • Target filter view and API -> When activating auto-assignment.
  • Rollouts view and API -> When creating a Rollout the confirmation can be skipped for individual groups.

Commiter:
@dimitar-shterev
@stanislav-trailov
@ramannas
@herdt-michael

@hawkbit-bot
Copy link

Can one of the admins verify this patch?

Signed-off-by: Stanislav Trailov <[email protected]>
Signed-off-by: Michael Herdt <[email protected]>
Signed-off-by: Dimitar Shterev <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
@herdt-michael herdt-michael force-pushed the feature/user_consent_integration branch from 513d9a7 to 82f91e2 Compare November 21, 2022 11:15
herdt-michael and others added 13 commits November 21, 2022 12:22
…s when configuring auto-confirmation.

Signed-off-by: Michael Herdt <[email protected]>
Extend integration test cases for DMF and DDI
}

@Override
public AutoConfirmationStatus activateAutoConfirmation(final String controllerId, final String initiator,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't @Transactional missing here to override the class level annotation @Transactional(readOnly = true)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added here and in other relevant places

Copy link
Contributor

@floruschbaschan floruschbaschan Jan 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Transactional is only required for methods that do some write operations. getStatus, findActiveActionsWaitingConfirmation do not require it because they get @Transactional(readOnly = true) from the class JpaConfirmationManagement itself

…pdates on closed actions.

Signed-off-by: Michael Herdt <[email protected]>
herdt-michael and others added 9 commits January 10, 2023 15:56
Signed-off-by: Michael Herdt <[email protected]>
Signed-off-by: Michael Herdt <[email protected]>
Signed-off-by: Michael Herdt <[email protected]>
# Conflicts:
#	hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java
#	hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaDeploymentManagement.java
#	hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/model/JpaAction.java
#	hawkbit-repository/hawkbit-repository-jpa/src/test/java/org/eclipse/hawkbit/repository/jpa/RolloutManagementTest.java
#	hawkbit-rest/hawkbit-mgmt-api/src/main/java/org/eclipse/hawkbit/mgmt/json/model/target/MgmtTarget.java
#	hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResource.java
#	hawkbit-rest/hawkbit-mgmt-resource/src/main/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtTargetMapper.java
#	hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/documentation/AbstractApiRestDocumentation.java
#	hawkbit-rest/hawkbit-rest-docs/src/test/java/org/eclipse/hawkbit/rest/mgmt/documentation/TargetResourceDocumentationTest.java
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
# Conflicts:
#	hawkbit-rest/hawkbit-mgmt-resource/src/test/java/org/eclipse/hawkbit/mgmt/rest/resource/MgmtRolloutResourceTest.java
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Signed-off-by: Shruthi Manavalli Ramanna <[email protected]>
Copy link
Contributor

@floruschbaschan floruschbaschan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great work! Thank you!

@stefbehl stefbehl merged commit 21f1569 into eclipse-hawkbit:master Jan 25, 2023
@herdt-michael herdt-michael deleted the feature/user_consent_integration branch January 27, 2023 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants