Administrator Tooling - FaqiangMei/MHA-Survey-Portal GitHub Wiki

Administrator Tooling

Objectives

  • Give program leadership and developer-operators full control of surveys, cohorts, authentication, and system configuration.
  • Provide auditable workflows for every destructive action (survey deletion, membership changes, environment updates).
  • Offer dashboards that summarize portal health (queues, notifications, and background jobs) before each term launches.

Entry Points

  1. Administrators authenticate either through TAMU Google SSO or via the ENABLE_ROLE_SWITCH flag for QA accounts.
  2. DashboardsController#admin loads cards for survey status, queue health, and outstanding tasks.
  3. Most admin CRUD flows mount under /admin/* namespaces (see config/routes.rb).

Core Modules

Module Description Key Implementation
Survey Builder Create/edit surveys, attach question banks, manage track visibility, and publish/unpublish windows. Admin::SurveysController, Survey, SurveyQuestion
Membership Management Assign students/advisors to cohorts, graduate or archive users, and sync advisor/client ratios. Admin::MembershipsController, Admin::StudentsController, StudentProfile
Role & Access Control Promote/demote user roles, toggle feature flags, and manage impersonation settings. Admin::RolesController, RoleGrant, FeatureFlag
Evidence & File Policy Configure storage backends, Google Drive scopes, and attachment expiration. EvidencePolicy, EvidenceController, config/storage.yml
System Status Surface queue backlogs, recent failures, audit logs, and background job health. Admin::SystemController, ActiveJob::Status, lograge dashboards

Automation & Auditing

  • Every admin action writes to AuditLog with actor, subject, and payload diff for FERPA compliance.
  • Background jobs (survey assignment, notification fan-out, report generation) are tagged; the admin dashboard links directly to their job IDs for reruns.
  • Environment configuration lives in config/credentials/*.yml.enc with instructions in the System Administration page.

Deployment & Maintenance Checklist

  1. Review Admin → System Status before and after deployments to confirm queues drain and no jobs retry unexpectedly.
  2. Run docker compose run --rm web bundle exec rubocop && docker compose run --rm web bundle exec rails test for release branches.
  3. Rotate OAuth secrets and storage credentials each semester; update the wiki’s Local Environment Variables page when values change.
  4. Export composite reports via CompositeReportGenerator before schema migrations touching survey/question tables.

Related Documents