Skip to content

Conversation

@Knerio
Copy link
Member

@Knerio Knerio commented Nov 22, 2025

close #693

@Knerio Knerio self-assigned this Nov 22, 2025
Copilot finished reviewing on behalf of Knerio November 22, 2025 21:52
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 a GraphQL mutation for admin users to create new user accounts in the system. The implementation includes service layer logic with proper authorization, validation, and audit logging.

  • Implements usersCreate mutation with password confirmation validation
  • Adds service layer with admin-only authorization and comprehensive error handling
  • Introduces audit event logging for user creation actions

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/graphql/mutations/users/create.rb Defines the GraphQL mutation with input validation and password repeat check
app/services/users/create_service.rb Service layer implementation with authorization, user creation, and audit logging
app/graphql/types/mutation_type.rb Registers the new mutation in the GraphQL schema
app/policies/global_policy.rb Adds create_user permission for admin users
app/models/audit_event.rb Adds user_created action type to audit event enum
spec/graphql/mutation/users/create_spec.rb GraphQL mutation tests covering admin/non-admin scenarios and validation
spec/services/users/create_service_spec.rb Service layer tests covering authentication and validation scenarios
docs/graphql/mutation/userscreate.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 693-add-mutation-for-admins-to-create-a-user branch from f2934d4 to 61321fd Compare November 22, 2025 21:55
@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/2173862387

Status: Passed
Duration: 3 minutes

Job summaries

rspec: [ee]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183960616/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173862387/test_report
Finished in 19.79 seconds (files took 11.76 seconds to load)
1232 examples, 0 failures
Line Coverage: 91.42% (4154 / 4544)
[TEST PROF INFO] Time spent in factories: 00:10.975 (40.42% of total time)

rspec: [ce]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/12183960615/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2173862387/test_report
Finished in 19.82 seconds (files took 11.11 seconds to load)
1185 examples, 0 failures
Line Coverage: 90.82% (3986 / 4389)
[TEST PROF INFO] Time spent in factories: 00:10.705 (40.32% of total time)

rubocop

687 files inspected, no offenses detected

@Knerio Knerio force-pushed the 693-add-mutation-for-admins-to-create-a-user branch from 61321fd to 49dcb2b Compare November 22, 2025 21:57
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 for admins to create a user

2 participants