Skip to content

Revert all commits after d5d987a#1020

Merged
skyfallwastaken merged 2 commits intomainfrom
revert-to-d5d987a
Mar 1, 2026
Merged

Revert all commits after d5d987a#1020
skyfallwastaken merged 2 commits intomainfrom
revert-to-d5d987a

Conversation

@skyfallwastaken
Copy link
Member

Reverts all 7 commits after d5d987a (Email layout v2 #1015):

Reverts the following commits:
- 2e3cfd6 Revert Mailkick
- de32044 Merge branch 'main'
- efd189a Add safety-hatch for summary emails
- d5c6292 Remove exploding queries (#1018)
- 2b37201 Bump actions/upload-artifact from 6 to 7 (#1007)
- a4c10b4 Expand scopes to all time for summaries/goals (#1017)
- 4dec2f4 Unsubscribe links + slow job monitoring (#1016)
Copilot AI review requested due to automatic review settings March 1, 2026 13:07
@skyfallwastaken skyfallwastaken merged commit c846217 into main Mar 1, 2026
10 of 12 checks passed
@skyfallwastaken skyfallwastaken deleted the revert-to-d5d987a branch March 1, 2026 13:09
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

Reverts the set of changes introduced after d5d987a8f42 (Email layout v2), rolling back Mailkick/Notable integration and related weekly-summary email delivery changes, and restoring the simpler users.weekly_summary_email_enabled preference approach (while leaving weekly summary sending disabled).

Changes:

  • Removes Mailkick + Notable gems, tables, and unsubscribe URL plumbing from mailers/layout.
  • Restores weekly_summary_email_enabled as a users boolean flag and updates settings UI/controller/tests to use it.
  • Disables weekly summary delivery by turning WeeklySummaryEmailJob into a no-op and reverts CI upload-artifact action to v6.

Reviewed changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/system/settings/notifications_settings_test.rb Updates system test to toggle weekly_summary_email_enabled instead of Mailkick subscriptions.
test/mailers/weekly_summary_mailer_test.rb Adjusts mailer setup to align with the boolean preference.
test/jobs/weekly_summary_email_job_test.rb Removes/enables skips for tests related to the reverted job behavior.
test/controllers/settings_notifications_controller_test.rb Updates controller test to assert boolean preference persistence.
db/schema.rb Reverts schema version; removes Mailkick/Notable tables; keeps weekly_summary_email_enabled on users.
db/migrate/20260301112933_remove_weekly_summary_email_enabled_from_users.rb Removes migration that would have dropped the preference column.
db/migrate/20260301112514_seed_mailkick_subscriptions_from_weekly_summary.rb Removes migration that would have seeded Mailkick subscriptions.
db/migrate/20260301112503_create_mailkick_subscriptions.rb Removes Mailkick subscriptions table migration.
db/migrate/20260301111406_create_notable_jobs.rb Removes Notable jobs table migration.
db/migrate/20260301111352_create_notable_requests.rb Removes Notable requests table migration.
config/initializers/mailkick.rb Removes Mailkick configuration initializer.
app/views/layouts/mailer.html.erb Removes unsubscribe footer block.
app/services/programming_goals_progress_service.rb Filters goal progress heartbeats via .coding_only.
app/models/user.rb Removes subscription hooks/shims; adds boolean attribute default.
app/mailers/weekly_summary_mailer.rb Removes unsubscribe URL; filters summary scope with .coding_only.
app/mailers/application_mailer.rb Removes Mailkick URL helper inclusion.
app/jobs/weekly_summary_user_email_job.rb Removes the per-user weekly summary delivery job.
app/jobs/weekly_summary_email_job.rb Converts weekly summary job into an intentional no-op (with commented-out old logic).
app/javascript/pages/Users/Settings/Notifications.svelte Updates notifications UI state handling for weekly_summary_email_enabled.
app/controllers/settings/notifications_controller.rb Switches update action to standard strong-params update with validation errors.
app/controllers/settings/base_controller.rb Uses @user.weekly_summary_email_enabled directly for props.
app/controllers/settings/access_controller.rb Removes Sentry capture in rescue.
app/controllers/my/heartbeat_imports_controller.rb Removes Sentry capture in rescue.
app/controllers/api/v1/stats_controller.rb Removes Sentry capture in rescue.
app/controllers/api/v1/external_slack_controller.rb Removes Sentry capture in rescue.
app/controllers/api/hackatime/v1/hackatime_controller.rb Removes Sentry capture in rescues.
Gemfile.lock Removes Mailkick/Notable and related dependencies.
Gemfile Removes Mailkick/Notable gems.
Dockerfile.dev Removes Skylight dev-warning steps; leaves a trailing space on CMD line.
.tokeignore Stops ignoring config/languages.yml.
.github/workflows/ci.yml Reverts actions/upload-artifact from v7 back to v6.

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

Comment on lines +6 to +7
# Context: https://hackclub.slack.com/archives/D083UR1DR7V/p1772321709715969
# Keep this no-op until we explicitly decide to turn the campaign back on.
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The job comment includes an internal Slack URL. Since this repo is public-facing, avoid embedding private/internal links in source; replace with a public issue/PR link or a short rationale in the comment so future maintainers have accessible context.

Suggested change
# Context: https://hackclub.slack.com/archives/D083UR1DR7V/p1772321709715969
# Keep this no-op until we explicitly decide to turn the campaign back on.
# This job is intentionally kept as a no-op until we explicitly decide to turn
# the weekly summary email campaign back on.

Copilot uses AI. Check for mistakes.
Comment on lines 4 to +11
def perform(reference_time = Time.current)
return unless Flipper.enabled?(:weekly_summary_emails)
# Weekly summary delivery is intentionally disabled for now.
# Context: https://hackclub.slack.com/archives/D083UR1DR7V/p1772321709715969
# Keep this no-op until we explicitly decide to turn the campaign back on.
reference_time

now_utc = reference_time.utc
cutoff = now_utc - 3.weeks
# now_utc = reference_time.utc
# return unless send_window?(now_utc)
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

perform is currently a no-op, but it keeps a large block of commented-out delivery logic. This makes the job harder to read/maintain and increases the chance someone partially uncomments code later. Prefer either removing the commented-out block (and leaving an explicit return/no-op) or guarding the real implementation behind a clear feature flag/setting and keeping the implementation live.

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +36
def send_window?(time)
time.friday? && time.hour == 17 && time.min == 30
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

send_window? is now unused because perform is a no-op. Either remove it to avoid dead code, or re-enable the send-window guard as part of the (uncommented) implementation so this method is exercised.

Copilot uses AI. Check for mistakes.
<% if @unsubscribe_url.present? %>
<p class="my-1">Don't want to get these anymore? <%= link_to "Unsubscribe", @unsubscribe_url, style: "color: #9ca3af; text-decoration: underline;" %></p>
<% end %>
<p class="my-1">15 Falls Road, Shelburne, VT 05482, United States</p>
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The mailer footer no longer includes any opt-out/unsubscribe link. If these emails are non-transactional (like weekly summaries), recipients should still have a clear way to opt out (e.g., link to notification settings) even without Mailkick, to avoid compliance/user-experience issues when email sending is re-enabled.

Suggested change
<p class="my-1">15 Falls Road, Shelburne, VT 05482, United States</p>
<p class="my-1">15 Falls Road, Shelburne, VT 05482, United States</p>
<p class="my-1">
To stop receiving these emails or update your preferences, please visit your
<a href="/settings/notifications">notification settings</a>.
</p>

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +25
let weeklySummaryEmailEnabled = $state(true);

$effect(() => {
weeklySummaryEmailEnabled = user.weekly_summary_email_enabled;
});
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

weeklySummaryEmailEnabled is initialized to true and only later synced from user.weekly_summary_email_enabled in an effect. For users who have this disabled, the checkbox can render as enabled briefly (and could be submitted before the effect runs). Initialize state from the user prop (and keep the effect only if you expect user to change) to avoid a transient incorrect UI state.

Copilot uses AI. Check for mistakes.

# Start the main process
CMD ["rails", "server", "-b", "0.0.0.0"]
CMD ["rails", "server", "-b", "0.0.0.0"]
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

Trailing whitespace at the end of this CMD line can cause avoidable lint/formatting diffs. Remove the extra space so future changes don't churn this line.

Suggested change
CMD ["rails", "server", "-b", "0.0.0.0"]
CMD ["rails", "server", "-b", "0.0.0.0"]

Copilot uses AI. Check for mistakes.
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 1, 2026

Greptile Summary

This PR reverts 7 commits that introduced mailkick (email subscription management), notable (performance monitoring), and related changes to weekly summary emails. The revert restores the simpler weekly_summary_email_enabled boolean column on users and fixes critical bugs where .coding_only filters were removed from heartbeat queries in programming_goals_progress_service.rb and weekly_summary_mailer.rb.

Key changes:

  • Removes mailkick and notable gem dependencies
  • Deletes migration files for mailkick_subscriptions, notable_jobs, notable_requests tables
  • Restores users.weekly_summary_email_enabled column (previously migrated to mailkick)
  • Adds back .coding_only filter to heartbeat queries (fixing "exploding queries" issue mentioned in commit message)
  • Simplifies notifications controller to use standard Rails params instead of mailkick methods
  • Removes unsubscribe links from email templates
  • Reverts GitHub Actions upload-artifact from v7 to v6

Important deployment considerations:

  • If mailkick tables exist in production, they won't be automatically dropped (deleted migration files, no down migrations)
  • User subscription preferences stored in mailkick need to be migrated back to the weekly_summary_email_enabled column
  • The .coding_only filter restoration is critical - without it, queries may include non-coding heartbeats

Confidence Score: 3/5

  • Safe to merge with careful deployment planning - revert fixes critical query bugs but requires manual data migration
  • The revert itself is clean and fixes important bugs (.coding_only filters), but the migration strategy is concerning. Deleting migration files without down migrations means production databases will have orphaned tables. User preferences stored in mailkick subscriptions could be lost unless explicitly migrated. Score is 3/5 due to deployment risks and manual migration requirements.
  • db/schema.rb requires careful attention for deployment - need manual migration script to drop mailkick/notable tables and restore user subscription preferences

Important Files Changed

Filename Overview
db/schema.rb Reverts schema version from 2026_03_01_125356 to 2026_02_23_212054, removes notable and mailkick tables
app/models/user.rb Removes mailkick integration, restores direct weekly_summary_email_enabled attribute, removes compatibility shim
app/jobs/weekly_summary_email_job.rb Reverts to simpler commented-out implementation, removes mailkick-based eligibility checking and per-user job spawning logic
app/controllers/settings/notifications_controller.rb Simplifies update action to use standard params instead of mailkick subscribe/unsubscribe methods
app/mailers/weekly_summary_mailer.rb Removes @unsubscribe_url (mailkick), adds back .coding_only filter to heartbeat queries
app/services/programming_goals_progress_service.rb Restores .coding_only filter on heartbeats query - critical fix for query correctness

Last reviewed commit: af6c412

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

31 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[8.1].define(version: 2026_03_01_125356) do
ActiveRecord::Schema[8.1].define(version: 2026_02_23_212054) do
Copy link
Contributor

Choose a reason for hiding this comment

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

reverting migrations without down migrations - if these tables exist in production (mailkick_subscriptions, notable_jobs, notable_requests), they won't be automatically dropped when deploying this revert

Prompt To Fix With AI
This is a comment left during a code review.
Path: db/schema.rb
Line: 13

Comment:
reverting migrations without down migrations - if these tables exist in production (`mailkick_subscriptions`, `notable_jobs`, `notable_requests`), they won't be automatically dropped when deploying this revert

How can I resolve this? If you propose a fix, please make it concise.

t.string "username"
t.boolean "uses_slack_status", default: false, null: false
t.boolean "weekly_summary_email_enabled", default: false, null: false
t.boolean "weekly_summary_email_enabled", default: true, null: false
Copy link
Contributor

Choose a reason for hiding this comment

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

restored weekly_summary_email_enabled column - verify existing user subscription preferences from mailkick are migrated back to this column before deployment

Prompt To Fix With AI
This is a comment left during a code review.
Path: db/schema.rb
Line: 650

Comment:
restored `weekly_summary_email_enabled` column - verify existing user subscription preferences from mailkick are migrated back to this column before deployment

How can I resolve this? If you propose a fix, please make it concise.

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.

2 participants