Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create model definitions and user associations for (#20426)
* Removes Sidekiq Enterprise and Pro dependencies Removes enterprise-specific Sidekiq gems and their dependencies (einhorn, gserver) to simplify the application's job processing infrastructure and reduce external dependencies. * Adds user action tracking models and specs Implements models to track user actions and events with: - Status tracking (initial, success, error) - IP address and user agent logging - Association between actions and events - Validation and dependency restrictions Provides comprehensive test coverage including factories * Restore original Gemfile.lock * Update CODEOWNERS: Add user_action.rb and remove Gemfile.lock * Update CODEOWNERS: Add user_action files with octo-identity ownership * Fix CODEOWNERS: Add user_action entries in correct alphabetical order * Fix CODEOWNERS: Update user_action entries to only use octo-identity team * Update CODEOWNERS: Add spec files and ensure alphabetical order * Removes trailing whitespace from model and spec files Cleans up code style by removing unnecessary trailing whitespace characters at the end of files in: - User action models - Factory definitions - Test specifications This maintains consistent code formatting and follows Ruby style conventions. * Update CODEOWNERS: Add factory files * Fix CODEOWNERS: Move factory entries to correct alphabetical order * Fix CODEOWNERS: Add parent directory entries and maintain alphabetical order * Fix CODEOWNERS: Move user_action entries to correct alphabetical order * Refactor UserAction and UserActionEvent specs - Remove prefix from UserAction status enum for cleaner method names - Update specs to use shoulda-matchers for associations - Remove redundant tests for Rails built-in functionality (factory traits and enum transitions) * Remove presence validations for IP and User Agent - Remove presence validations for acting_ip_address and acting_user_agent - Update tests to allow nil values for these fields - These fields can be nil for system-initiated actions * Use Faker gem in factories - Use Faker::Lorem.sentence for user_action_event details - Use Faker::Internet.ip_v4_address for IP addresses - Use Faker::Internet.user_agent for user agents * Update UserAction model to match new schema - Remove UserAccount associations - Add required SubjectUserVerification association - Add optional ActingUserVerification association - Keep IP address and user agent as optional fields - Update tests to verify new associations and validations * Add system_initiated trait for UserAction - Add trait for system-initiated actions without user verification - Set acting_user_verification, ip_address, and user_agent to nil - Add comprehensive tests to verify trait behavior - Ensure subject_user_verification remains required * Remove system_initiated trait and its tests as requested * Refactor UserAction specs to use let statements and contexts * Removes trailing whitespace from spec files * Refactor UserAction specs to use let statements and contexts * Removes trailing whitespace in user action spec * Update CODEOWNERS: Add user_action entries in alphabetical order * Adds code owners for user action files * Adds CODEOWNERS for UserActionEvent files * Updates CODEOWNERS for user action files * Assigns OCTO Identity team ownership for user actions Removed duplicate code ownership entries * Removes duplicate CODEOWNERS entries for user specs * Simplifies enum status validation in UserAction Reduces code duplication by leveraging Rails' built-in enum validation functionality instead of custom validation rules. Consolidates status validation tests to be more focused and maintainable. * Adds newline at end of files * Cleans up CODEOWNERS file redundancy and naming * Simplifies user action specs with focused test cases Removes unnecessary status predicate tests Improves status enum testing with invalid status case * Renames spec factory files to match plural convention: - user_action_event.rb -> user_action_events.rb - user_action.rb -> user_actions.rb * Simplifies user action model specs * Fix linting
- Loading branch information