Skip to content

Conversation

@Knerio
Copy link
Member

@Knerio Knerio commented Nov 22, 2025

close #694

@Knerio Knerio self-assigned this Nov 22, 2025
Copilot finished reviewing on behalf of Knerio November 22, 2025 21:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the ability to delete users through a new GraphQL mutation. The implementation follows the established patterns in the codebase for delete operations, including permission checks, audit logging, and proper error handling.

  • Implements usersDelete GraphQL mutation with proper authorization (admin-only)
  • Creates Users::DeleteService to handle the deletion business logic
  • Adds comprehensive test coverage for both service and GraphQL layers

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/graphql/mutations/users/delete.rb New GraphQL mutation for deleting users with validation and error handling
app/services/users/delete_service.rb Service class implementing user deletion logic with permission checks and audit logging
app/policies/user_policy.rb Adds :delete_user permission to admin policy
app/models/audit_event.rb Registers :user_deleted audit event type
app/graphql/types/mutation_type.rb Mounts the new Mutations::Users::Delete mutation
spec/services/users/delete_service_spec.rb Service-level tests for user deletion with permission checks
spec/graphql/mutations/users/delete_spec.rb Unit tests for GraphQL mutation naming
spec/requests/graphql/mutation/users/delete_spec.rb Integration tests for the mutation endpoint
docs/graphql/mutation/usersdelete.md API documentation for the new mutation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Knerio Knerio force-pushed the 694-add-mutation-to-delete-a-user branch from cf7a5f9 to 20cebaa Compare November 22, 2025 21:24
@Knerio Knerio requested a review from Copilot November 22, 2025 21:24
@github-actions
Copy link

github-actions bot commented Nov 22, 2025

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173850855

Status: Passed
Duration: 3 minutes

Job summaries

rspec: [ee]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183907460/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173850855/test_report
Finished in 18.84 seconds (files took 13.55 seconds to load)
1222 examples, 0 failures
Line Coverage: 91.34% (4146 / 4539)
[TEST PROF INFO] Time spent in factories: 00:10.755 (41.54% of total time)

rspec: [ce]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183907459/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173850855/test_report
Finished in 18.81 seconds (files took 11.76 seconds to load)
1175 examples, 0 failures
Line Coverage: 90.74% (3978 / 4384)
[TEST PROF INFO] Time spent in factories: 00:10.635 (41.51% of total time)

rubocop

688 files inspected, no offenses detected

Copilot finished reviewing on behalf of Knerio November 22, 2025 21:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Add mutation to delete a user

2 participants