|
| 1 | +#!/bin/bash |
| 2 | +set -e |
| 3 | + |
| 4 | +BASE="6a73071c" |
| 5 | + |
| 6 | +echo "Resetting to $BASE..." |
| 7 | +git reset --hard "$BASE" |
| 8 | + |
| 9 | +echo "" |
| 10 | +echo "=== Commit 1: feat(invitations): add invitation_logs migration and models ===" |
| 11 | + |
| 12 | +# Migration |
| 13 | +git checkout 3a4f2dbf -- db/migrate/20260330193245_create_invitation_logs.rb |
| 14 | + |
| 15 | +# Models (minimal from d8863478 - no scopes/utility methods yet) |
| 16 | +git checkout d8863478 -- app/models/invitation_log.rb |
| 17 | +git checkout d8863478 -- app/models/invitation_log_entry.rb |
| 18 | + |
| 19 | +# Fabricators |
| 20 | +git checkout d8863478 -- spec/fabricators/invitation_log_fabricator.rb |
| 21 | +git checkout d8863478 -- spec/fabricators/invitation_log_entry_fabricator.rb |
| 22 | + |
| 23 | +# Model specs |
| 24 | +git checkout d8863478 -- spec/models/invitation_log_spec.rb |
| 25 | +git checkout 503fb86f -- spec/models/invitation_log_entry_spec.rb |
| 26 | + |
| 27 | +# Schema |
| 28 | +git checkout c1c02233 -- db/schema.rb |
| 29 | + |
| 30 | +git add -A |
| 31 | +git commit -m "feat(invitations): add invitation_logs migration and models |
| 32 | +
|
| 33 | +- Create invitation_logs and invitation_log_entries tables |
| 34 | +- Add InvitationLog model with enums, associations, expiration callback |
| 35 | +- Add InvitationLogEntry model with status tracking |
| 36 | +- Add fabricators for test data |
| 37 | +- Add model specs |
| 38 | +
|
| 39 | +Co-Authored-By: opencode <noreply@opencode.ai>" |
| 40 | + |
| 41 | +echo "Running model tests..." |
| 42 | +bundle exec rspec spec/models/invitation_log_spec.rb spec/models/invitation_log_entry_spec.rb 2>&1 | tail -5 |
| 43 | +echo "" |
| 44 | + |
| 45 | +echo "=== Commit 2: feat(invitations): add InvitationLogger service ===" |
| 46 | + |
| 47 | +git checkout b4a44ef2 -- app/services/invitation_logger.rb |
| 48 | +git checkout b4a44ef2 -- spec/services/invitation_logger_spec.rb |
| 49 | + |
| 50 | +git add -A |
| 51 | +git commit -m "feat(invitations): add InvitationLogger service |
| 52 | +
|
| 53 | +- Service for logging invitation batch operations |
| 54 | +- Tracks success/failure/skip counts per batch |
| 55 | +- Provides convenience methods for starting/finishing/failing batches |
| 56 | +
|
| 57 | +Co-Authored-By: opencode <noreply@opencode.ai>" |
| 58 | + |
| 59 | +echo "Running service tests..." |
| 60 | +bundle exec rspec spec/services/invitation_logger_spec.rb 2>&1 | tail -5 |
| 61 | +echo "" |
| 62 | + |
| 63 | +echo "=== Commit 3: feat(invitations): integrate logging into InvitationManager ===" |
| 64 | + |
| 65 | +# Concerns with logging integration |
| 66 | +git checkout 7e1d2ab9 -- app/models/concerns/workshop_invitation_manager_concerns.rb |
| 67 | + |
| 68 | +# Controller to pass initiator_id |
| 69 | +git checkout 436fe167 -- app/controllers/admin/workshops_controller.rb |
| 70 | + |
| 71 | +# Workshop model with invitation_logs association + presenter scope fix |
| 72 | +git checkout 383e131b -- app/models/workshop.rb |
| 73 | + |
| 74 | +# Integration spec |
| 75 | +git checkout 7e1d2ab9 -- spec/models/invitation_manager_logging_spec.rb |
| 76 | + |
| 77 | +git add -A |
| 78 | +git commit -m "feat(invitations): integrate logging into InvitationManager |
| 79 | +
|
| 80 | +- Add invitation_logs association to Workshop model |
| 81 | +- Integrate InvitationLogger into workshop email sending |
| 82 | +- Pass current_user.id for audit trail |
| 83 | +- Handle WorkshopPresenter via workshop.model in scope |
| 84 | +
|
| 85 | +Co-Authored-By: opencode <noreply@opencode.ai>" |
| 86 | + |
| 87 | +echo "Running integration tests..." |
| 88 | +bundle exec rspec spec/models/invitation_manager_logging_spec.rb 2>&1 | tail -5 |
| 89 | +echo "" |
| 90 | + |
| 91 | +echo "=== Commit 4: feat(invitations): add admin UI for viewing invitation logs ===" |
| 92 | + |
| 93 | +# Controller (final version with pagy fix) |
| 94 | +git checkout b1915fbb -- app/controllers/admin/workshop_invitation_logs_controller.rb |
| 95 | + |
| 96 | +# Policy (final version with is_admin_or_chapter_organiser?) |
| 97 | +git checkout 503fb86f -- app/policies/invitation_log_policy.rb |
| 98 | + |
| 99 | +# Views (final versions with content_for fix) |
| 100 | +git checkout a0fc1955 -- app/views/admin/workshop_invitation_logs/index.html.haml |
| 101 | +git checkout a0fc1955 -- app/views/admin/workshop_invitation_logs/show.html.haml |
| 102 | + |
| 103 | +# Shared partial from original admin UI commit |
| 104 | +git checkout cbafb93c -- app/views/admin/workshop_invitation_logs/_invitation_log.html.haml |
| 105 | + |
| 106 | +# Workshop show page with logs section |
| 107 | +git checkout cbafb93c -- app/views/admin/workshops/show.html.haml |
| 108 | + |
| 109 | +# Routes (final version with controller: option) |
| 110 | +git checkout e3008275 -- config/routes.rb |
| 111 | + |
| 112 | +# Seeds |
| 113 | +git checkout f7f701be -- db/seeds.rb |
| 114 | + |
| 115 | +# Controller and policy specs |
| 116 | +git checkout 503fb86f -- spec/controllers/admin/workshop_invitation_logs_controller_spec.rb |
| 117 | +git checkout 503fb86f -- spec/policies/invitation_log_policy_spec.rb |
| 118 | + |
| 119 | +git add -A |
| 120 | +git commit -m "feat(invitations): add admin UI for viewing invitation logs |
| 121 | +
|
| 122 | +- Add WorkshopInvitationLogsController with index/show actions |
| 123 | +- Add InvitationLogPolicy for authorization |
| 124 | +- Add views for listing and detail of invitation logs |
| 125 | +- Add route nesting under admin/workshops |
| 126 | +- Add seed data for invitation logs |
| 127 | +- Add controller and policy specs |
| 128 | +
|
| 129 | +Co-Authored-By: opencode <noreply@opencode.ai>" |
| 130 | + |
| 131 | +echo "Running controller and policy tests..." |
| 132 | +bundle exec rspec spec/controllers/admin/workshop_invitation_logs_controller_spec.rb spec/policies/invitation_log_policy_spec.rb 2>&1 | tail -5 |
| 133 | +echo "" |
| 134 | + |
| 135 | +echo "=== Commit 5: feat(invitations): add cleanup job for expired logs ===" |
| 136 | + |
| 137 | +git checkout 284656d6 -- app/jobs/cleanup_expired_invitation_logs_job.rb |
| 138 | +git checkout 284656d6 -- lib/tasks/invitation_logs.rake |
| 139 | +git checkout 284656d6 -- spec/jobs/cleanup_expired_invitation_logs_job_spec.rb |
| 140 | + |
| 141 | +git add -A |
| 142 | +git commit -m "feat(invitations): add cleanup job for expired logs |
| 143 | +
|
| 144 | +- Add CleanupExpiredInvitationLogsJob for 180-day retention |
| 145 | +- Add rake task invitation_logs:cleanup |
| 146 | +- Add job specs |
| 147 | +
|
| 148 | +Co-Authored-By: opencode <noreply@opencode.ai>" |
| 149 | + |
| 150 | +echo "Running cleanup job tests..." |
| 151 | +bundle exec rspec spec/jobs/cleanup_expired_invitation_logs_job_spec.rb 2>&1 | tail -5 |
| 152 | +echo "" |
| 153 | + |
| 154 | +echo "" |
| 155 | +echo "=== Final verification: all tests ===" |
| 156 | +bundle exec rspec \ |
| 157 | + spec/models/invitation_log_spec.rb \ |
| 158 | + spec/models/invitation_log_entry_spec.rb \ |
| 159 | + spec/services/invitation_logger_spec.rb \ |
| 160 | + spec/models/invitation_manager_logging_spec.rb \ |
| 161 | + spec/controllers/admin/workshop_invitation_logs_controller_spec.rb \ |
| 162 | + spec/policies/invitation_log_policy_spec.rb \ |
| 163 | + spec/jobs/cleanup_expired_invitation_logs_job_spec.rb \ |
| 164 | + --format progress 2>&1 | tail -15 |
| 165 | + |
| 166 | +echo "" |
| 167 | +echo "=== Final git log ===" |
| 168 | +git log --oneline -5 |
0 commit comments