-
Notifications
You must be signed in to change notification settings - Fork 1
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
Consumer API: Execute lock statement on the variable updated in the critical area #551
Consumer API: Execute lock statement on the variable updated in the critical area #551
Conversation
* wip * fear: CancelDeletionProcessDuringGracePeriod * feature: add new domain error * feat: add method to check if device that starts deletion process actually belongs to identity * refactor: adapt tests to newly implement feature (check if device belongs to identity) * test: add new test start deletion process as owner from another device * feat: wip handler * test: add handler tests for cancellation of a deletion process during grace period handler * feat: add handler for cancellation of a deletion process during grace period * chore: fix formatting issues * fear: add migration for CancelledAt & CancelledByDevice * chore: fix formatting issues * chore: move command creation into arrange section * chore: rename property * chore: remove unused directives * refactor: get device id from _userContext * chore: rename files, folders, methods & classes so they do not contain "DuringGracePeriod" * feat: add properties to CancelDeletionProcessResponse * refactor: fix test * refactor: fix test * chore: no action could lead to 400BadRequest * chore: fix formatting issues * refactor: change logic * chore: rename id to deletionProcessId * chore: remove redundant using * fix: handler didn't have IRequestHandler<> and now properly returns response * fix: CancelDeletionProcess return IdentityDeletionProcess * chore: typo * refactor: change to hardcoded datetime * chore: change to hardcoded datetime * refactor: change domain error * fix: set TieridBeforeDeletion to null * chore: rename tests * refactor: get deletionProcess from StartDeletionProcessAsOwner * refactor: fix tests * refactor: change logic * refactor: fix handler * refactor: add assertion on database * refactor: modify test * fix: add check for ensure identity owns device * refactor: rename & create optimized CreateHandler method * refactor: change status check * chore: remove unused error * chore: fix nullable issue * refactor: fix naming & optinal parameter * chore: rename * refactor: fix wrong method usage * refactor: remove private Cancel method * feat: add new error chore: remove unused error * refactor: change error message * refactor: rely on the deletionProcess.Cancel method * test: add new test when deletion process is in wrong status * refactor: extract method & add more assertions * test: add auditLog assertions * refactor: set optional parameter * fix: remove unused assertion * chore: remove unused using * refactor: assert DeletionProcessStatus * refactor: add assertion * chore: fix formatting issues * chore: remove unused domain error * refactor * refactor: add missing assertions * refactor: move CreateIdentity methods into TestDataGenerator * chore: remove unused using * refactor: acting only once --------- Co-authored-by: Timo Notheisen <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Timo Notheisen <[email protected]>
* ci: test * test: let test fail * ci: add missing quote * ci: correct path * chore: install logger in all test projects * chore: set default formatter for xml * ci: use logger in all dotnet test calls * ci: remove test pipeline * test: install logger in remaining projects * test: install logger in remaining projects * test: remove duplicated references to GitHubActionsTestLogger * ci: convert test script to sh * ci: convert checkFormatting script to sh * ci: fix checkFormatting script name * test: remove intentionally failing test * ci: try to not use logger for postgres integration tests * ci: try to not include passed and skipped tests for sql server integration tests * ci: make scripts executable * chore: try to remove everything regarding SpecflowCucumberExporter * chore: remove redundant backtick * Revert "ci: try to not include passed and skipped tests for sql server integration tests" This reverts commit 85dadf7. * Revert "ci: try to not use logger for postgres integration tests" This reverts commit 5b350c5. * ci: set DOTNET_CONSOLE_ANSI_COLOR for all dotnet test actions * ci: use github action to run transport tests * chore: add "--no-build" flag to `dotnet publish` command in AdminCli's Dockerfile * chore: remove "/property:WarningLevel=0" from all commands * ci: let test fail * chore: remove publish stage from Admin CLI Dockerfile * chore: remove dotnet build from Admin CLI Dockerfile * chore: fix compiler warnings * Revert "ci: let test fail" This reverts commit b25a129. * Revert "ci: use github action to run transport tests" This reverts commit fae8312. * chore: remove unnecessary using directive
* feat: implement rejection of deletion process before approval * chore: fix a typo * feat: add reject identity deletion endpoint * feat: add RejectedAt and RejectedByDevice properties * chore: fix formatting * chore: remove IdentityAddress from RejectDeletionProcessResponse * chore: remove unused directives * chore: line endings * chore: remove unused directives * refactor: use SystemTime.UtcNow * refactor: use SystemTime * refactor: extract into separate method * chore: rename variable * chore: rename variable * refactor: remove ctor input parameter * chore: remove redundant status update * chore: rename input parameter * chore: change the method order in code * feat: add EnsureIdentityOwnsDevice method * test: check CreatedAt value * chore: reorganize lines * test: update condition * chore: reorganize lines * refactor: remove redundant date variable * chore: renamed mock repository variable to fake * test: use identity's own device in test * chore: rename class to plural * test: add reject deletion process test case when device is not owned by identity * test: use own device in test * test: update acting to start deletion process with own device * test: simplify method call * refactor: use hardcoded date * chore: rename variable * refactor: attempt to start deletion process with own device * test: change assertion * refactor: remove redundant handler tests as they are covered by the domain ones * chore: remove unused directives * refactor: reorganize class so that ctors are on top and private methods below their public ones * refactor: remove redundant assertion * feat: ensure deletion process is approved by device owned by identity * chore: move private Approve method beneath its first use * refactor: use device owned by identity and make code uniform in similar tests * refactor: use own device to approve deletion process * test: update assertions * test: add test when process is started by "not owned" device * refactor: remove handler tests covered by domain tests * feat: use RejectedAt instead of CreatedAt in dto * refactor: rename method and update exception thrown * test: update tests * chore: remove redundant call * test: add additional assertion * test: update tests with additional assertions * test: update assertions * refactor: extract method * test: update assertions * fix: fix missing usings * test: avoid having two acting statements * chore: change error code, method name and error message * feat: bring back RejectedAt and RejectedBy properties * refactor: remove two actings * Merge branch 'main' into nmshdb-44-rejection-of-deletion-process * test: fix broken test * chore: formatting * test: fix tests * test: fix tests --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Pull request created by mistake. |
Readiness checklist
Description
As stated in the example given in the official documentation, the lock used to protect the variable cannot be the variable itself, instead it has to be a dedicated object defined on class level.